diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-06-27 14:00:10 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-06-27 14:00:37 +0200 |
commit | d5cd33450413816f8696125cd66c8393921e6267 (patch) | |
tree | 80c1a9b013e218aaee4ade6c55984a791dfe61ca /mysql-test | |
parent | 39385ff7b253302723a94c896d199a83adb8622f (diff) | |
download | mariadb-git-d5cd33450413816f8696125cd66c8393921e6267.tar.gz |
MDEV-13187 incorrect backslash parsing in clients
cover ANSI_QUOTES and NO_BACKSLASH_ESCAPES in mysqltest
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysql.result | 30 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 5 | ||||
-rw-r--r-- | mysql-test/t/mysql.test | 15 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 8 |
4 files changed, 57 insertions, 1 deletions
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index dad8b3a701c..8a24128daa2 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -557,3 +557,33 @@ a 1 2 drop table `a1\``b1`; +set sql_mode=ansi_quotes; +create table "a1\""b1" (a int); +show tables; +Tables_in_test +a1\"b1 +insert "a1\""b1" values (1),(2); +show create table "a1\""b1"; +Table Create Table +a1\"b1 CREATE TABLE "a1\""b1" ( + "a" int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE "a1\""b1" ( + "a" int(11) DEFAULT NULL +); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO "a1\""b1" VALUES (1),(2); +insert "a1\""b1" values (4),(5); +show create table "a1\""b1"; +Table Create Table +a1\"b1 CREATE TABLE "a1\""b1" ( + "a" int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from "a1\""b1"; +a +1 +2 +drop table "a1\""b1"; +set sql_mode=default; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 0ebef585974..9800aed6368 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -957,4 +957,9 @@ con1 con2 con2 -closed_connection- +set sql_mode=no_backslash_escapes; +select "foo\""bar"; +foo\"bar +foo\"bar +set sql_mode=default; End of tests diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 20205924e15..dd964c46420 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -633,3 +633,18 @@ insert `a1\``b1` values (4),(5); show create table `a1\``b1`; select * from `a1\``b1`; drop table `a1\``b1`; + +# same with ansi_quotes +set sql_mode=ansi_quotes; +create table "a1\""b1" (a int); +show tables; +insert "a1\""b1" values (1),(2); +show create table "a1\""b1"; +--exec $MYSQL_DUMP --compact --compatible=postgres test +--exec $MYSQL_DUMP --compatible=postgres test > $MYSQLTEST_VARDIR/tmp/bug.sql +insert "a1\""b1" values (4),(5); +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug.sql +show create table "a1\""b1"; +select * from "a1\""b1"; +drop table "a1\""b1"; +set sql_mode=default; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 6470ede4f14..afe37926591 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -2942,11 +2942,17 @@ disconnect $x; # Disconnect the selected connection disconnect $y; --echo $CURRENT_CONNECTION +connection default; +# +# MDEV-13187 incorrect backslash parsing in clients +# +set sql_mode=no_backslash_escapes; +select "foo\""bar"; +set sql_mode=default; --echo End of tests -connection default; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc |