kylefarris / node-querybuilder

Node QueryBuilder Adapter for Node.js (tags: nodejs, node, mysql, active record, activerecord, querybuilder, query builder)
49 stars 19 forks source link

like() Numeric bug #60

Open selfclose opened 4 years ago

selfclose commented 4 years ago

Im using v2.1.1

When using .like() and .or_like() on numeric, Quote got removed '%123%' became %123% and error of execution

ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%123% ORfirst_nameLIKE %123% ORlast_nameLIKE %123% ORDER BYidDESC LI' at line

kylefarris commented 4 years ago

Interesting... I'd be happy to merge in a PR if you can patch the bug. I'm swamped with a million other things at the moment, unfortunately.

parthutank commented 2 years ago

Remove else if condition in _qb_escape function.

File Path - node_modules\node-querybuilder\drivers\mysql\query_builder.js