1151 do not try to trim on numeric types

@javisantana can you please review?
basically it's reversing the order of quote_nullable and trim in db queries