x-ream / sqli

orm sql query builder, API: QB, QB.X, QrB
http://sqli.xream.io
Apache License 2.0
1.9k stars 813 forks source link

in把能拼接"" #48

Open CoocaChina opened 2 years ago

CoocaChina commented 2 years ago

"error": "StatementCallback; bad SQL grammar [SELECT * FROM Equipment WHERE ( barCode IN ( 'lb1649400074854' ) OR RFID IN ( ) OR nfc IN ( ) OR recorderCode IN ( ) )]; nested exception is java.sql.SQLSyntaxErrorException: 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 ') OR nfc IN ( ) OR recorderCode IN ( ) )' at line 1",

hongchenjie commented 2 years ago

您好,您的邮件已经收到,感谢您的努力,辛苦了

sim-wangyan commented 2 years ago

最终还是没支持拼接 IN (''), 和标准SQL有区别。 用sqli API的时候,主要是为了业务层自动过滤掉null, "", " "等。如果加上了, 就违背了API的初始目标。解决方案是增加了IN 过滤 [""] 里面的""。