mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Merge mysql.com:/home/jimw/my/mysql-5.0-6368
into mysql.com:/home/jimw/my/mysql-5.0-clean sql/sql_lex.cc: Auto merged
This commit is contained in:
commit
7814366660
3 changed files with 26 additions and 1 deletions
|
@ -386,4 +386,18 @@ p mask example
|
||||||
20 \\\\% \\\\%
|
20 \\\\% \\\\%
|
||||||
20 \\\\% \\\\_
|
20 \\\\% \\\\_
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
|
||||||
|
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
|
||||||
|
a\\b a\\\"b a'\\b a'\\\"b
|
||||||
|
a\\b a\\\"b a'\\b a'\\\"b
|
||||||
|
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
|
||||||
|
a\\b a\\\'b a"\\b a"\\\'b
|
||||||
|
a\\b a\\\'b a"\\b a"\\\'b
|
||||||
|
SET @@SQL_MODE='';
|
||||||
|
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
|
||||||
|
a\b a\"b a'\b a'\"b
|
||||||
|
a\b a\"b a'\b a'\"b
|
||||||
|
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
|
||||||
|
a\b a\'b a"\b a"\'b
|
||||||
|
a\b a\'b a"\b a"\'b
|
||||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||||
|
|
|
@ -174,4 +174,14 @@ order by masks.p, example;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Bug #6368: Make sure backslashes mixed with doubled quotes are handled
|
||||||
|
# correctly in NO_BACKSLASH_ESCAPES mode
|
||||||
|
SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
|
||||||
|
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
|
||||||
|
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
|
||||||
|
|
||||||
|
SET @@SQL_MODE='';
|
||||||
|
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
|
||||||
|
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
|
||||||
|
|
||||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||||
|
|
|
@ -337,7 +337,8 @@ static char *get_text(LEX *lex)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (*str == '\\' && str+1 != end)
|
if (!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
|
||||||
|
*str == '\\' && str+1 != end)
|
||||||
{
|
{
|
||||||
switch(*++str) {
|
switch(*++str) {
|
||||||
case 'n':
|
case 'n':
|
||||||
|
|
Loading…
Add table
Reference in a new issue