sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.06k stars 499 forks source link

Escape problem on insert (MySQL) #677

Open 0x25CBFC4F opened 1 year ago

0x25CBFC4F commented 1 year ago

Version: 2.3.7 (also tested on 2.4.0) When inserting escaped JSON string SqlKata generates incorrect SQL:

INSERT INTO `Table` (`field`)
VALUES ('{"Name":"\u111B"}')
ON DUPLICATE KEY UPDATE someField=null;

Which results in adding a new row with the name of u111B which is incorrect.

Expected behavior: I expected SqlKata to escape input string, so \u111B so that becomes \\u111B.