You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No need to escape double quotes when wrapped in single quotes #40
var sql = 'INSERT INTO tbl (str) VALUES (?)';
conn.execute(sql, ['logLevel:"ERROR"'], cb);
In the above case when the query parameter value includes double quotes, node-cubrid escapes them, so the final value that gets inserted is logLevel:""ERROR"" where each double quote is escaped with another double quote. On read the value of str column will be logLevel:""ERROR"" which is not what the user expects.
When placing parameters into the placeholders we should check if the delimiter is the same as the quote. The default delimiter is a single quote which means that when a string is wrapped in single quotes, no need to escape the double quotes in the string.
The opposite is true, too, i.e. when a string that includes a single quote but wrapped in double quote, single quotes should not be escaped.
Activity
Enh #40: No need to escape double quotes when wrapped in single quotes.
Merge pull request #41 from CUBRID/40.fix-escape