Skip to content

Commit c021a92

Browse files
committed
Removed TODO.
Tested whether we needed to account for \ escapes in backtick literals in mysql REPL: > CREATE DATABASE scratch; > USE SCRATCH; > CREATE TABLE `a``b` (id INT); > SELECT * FROM `a``b`; Empty set (0.01 sec) > SELECT * FROM `a\`b`; ERROR 1064 (42000): You have an error in your SQL syntax; ... and by examination of https://dev.mysql.com/doc/refman/5.7/en/string-literals.html re other escaping conventions.
1 parent 8c09ab6 commit c021a92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SqlString.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ var CHARS_ESCAPE_MAP = {
1414
'\'' : '\\\'',
1515
'\\' : '\\\\'
1616
};
17-
var ONE_ID_PATTERN = '`(?:[^`]|``)+`'; // TODO(mikesamuel): Should allow ``?
17+
// \ does not escape backquotes inside ID literals.
18+
var ONE_ID_PATTERN = '`(?:[^`]|``)+`';
1819
// One or more Identifiers separated by dots.
1920
var QUALIFIED_ID_REGEXP = new RegExp(
2021
'^' + ONE_ID_PATTERN + '(?:[.]' + ONE_ID_PATTERN + ')*$');

0 commit comments

Comments
 (0)