From b83b4697d229c78d85954b219cfed5caf428b20e Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 27 Jun 2008 20:56:41 +0500 Subject: backport from 6.0 Bug#35658 (An empty binary value leads to mysqld crash) Before this fix, the following token b'' caused the parser to crash when reading the binary value from the empty string. The crash was caused by: ptr+= max_length - 1; because max_length is unsigned and was 0, causing an overflow. With this fix, an empty binary literal b'' is parsed as a binary value 0, in Item_bin_string. mysql-test/r/varbinary.result: Bug#35658 (An empty binary value leads to mysqld crash) mysql-test/t/varbinary.test: Bug#35658 (An empty binary value leads to mysqld crash) sql/item.cc: Bug#35658 (An empty binary value leads to mysqld crash) --- mysql-test/r/varbinary.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/varbinary.test | 28 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index a41885a257d..f584c22f98a 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -78,3 +78,34 @@ alter table t1 modify a varchar(255); select length(a) from t1; length(a) 6 +select 0b01000001; +0b01000001 +A +select 0x41; +0x41 +A +select b'01000001'; +b'01000001' +A +select x'41', 0+x'41'; +x'41' 0+x'41' +A 65 +select N'abc', length(N'abc'); +abc length(N'abc') +abc 3 +select N'', length(N''); + length(N'') + 0 +select '', length(''); + length('') + 0 +select b'', 0+b''; +b'' 0+b'' + 0 +select x'', 0+x''; +x'' 0+x'' + 0 +select 0x; +ERROR 42S22: Unknown column '0x' in 'field list' +select 0b; +ERROR 42S22: Unknown column '0b' in 'field list' diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 2f0c1c83e84..427c1a6b84a 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -84,3 +84,31 @@ select length(a) from t1; alter table t1 modify a varchar(255); select length(a) from t1; +# +# Bug#35658 (An empty binary value leads to mysqld crash) +# + +select 0b01000001; + +select 0x41; + +select b'01000001'; + +select x'41', 0+x'41'; + +select N'abc', length(N'abc'); + +select N'', length(N''); + +select '', length(''); + +select b'', 0+b''; + +select x'', 0+x''; + +--error ER_BAD_FIELD_ERROR +select 0x; + +--error ER_BAD_FIELD_ERROR +select 0b; + -- cgit v1.2.1 From 9393ae3dff60d256cd9e5aa73134e0e38168df44 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Tue, 1 Jul 2008 14:44:47 -0400 Subject: Bug#37380 - Test funcs_1.is_columns_myisam_embedded fails on OS X Test was failing due to the addition of a '\x05' character in result sets Latest builds of the server have shown this problem to have disappeared. Removing code within the test that disables the test on Mac OS X. Recommit due to tree error on earlier, approved patch. --- mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test | 5 ----- 1 file changed, 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test b/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test index 0d5f1a72cdb..3d0cca24474 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test +++ b/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test @@ -10,11 +10,6 @@ # 2008-06-06 mleich Create this this variant for the embedded server. # -let $value= query_get_value(SHOW VARIABLES LIKE 'version_compile_os',Value,1); -if (`SELECT '$value' LIKE 'apple-darwin%'`) -{ - skip Bug#37380 Test funcs_1.is_columns_myisam_embedded fails on OS X; -} if (`SELECT VERSION() NOT LIKE '%embedded%'`) { --skip Test requires: embedded server -- cgit v1.2.1 From ac2a037ff9664b48cc90811d33818523ee9fbffc Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Fri, 4 Jul 2008 12:41:27 -0400 Subject: Bug#30563: Is not possible to create rpl_ or innodb test if needed \ to use ANSI_QUOTES Make all have_* tests universally safe by using ANSI quotes. --- mysql-test/include/have_archive.inc | 2 +- mysql-test/include/have_bdb.inc | 2 +- mysql-test/include/have_big5.inc | 2 +- mysql-test/include/have_blackhole.inc | 2 +- mysql-test/include/have_case_sensitive_file_system.inc | 2 +- mysql-test/include/have_compress.inc | 2 +- mysql-test/include/have_cp1250_ch.inc | 2 +- mysql-test/include/have_cp932.inc | 2 +- mysql-test/include/have_crypt.inc | 2 +- mysql-test/include/have_csv.inc | 2 +- mysql-test/include/have_eucjpms.inc | 2 +- mysql-test/include/have_euckr.inc | 2 +- mysql-test/include/have_exampledb.inc | 2 +- mysql-test/include/have_federated_db.inc | 2 +- mysql-test/include/have_gb2312.inc | 2 +- mysql-test/include/have_gbk.inc | 2 +- mysql-test/include/have_geometry.inc | 2 +- mysql-test/include/have_innodb.inc | 2 +- mysql-test/include/have_latin2_ch.inc | 2 +- mysql-test/include/have_log_bin.inc | 2 +- mysql-test/include/have_lowercase0.inc | 2 +- mysql-test/include/have_multi_ndb.inc | 4 ++-- mysql-test/include/have_ndb.inc | 2 +- mysql-test/include/have_query_cache.inc | 2 +- mysql-test/include/have_sjis.inc | 2 +- mysql-test/include/have_ssl.inc | 2 +- mysql-test/include/have_tis620.inc | 2 +- mysql-test/include/have_ucs2.inc | 2 +- mysql-test/include/have_udf.inc | 2 +- mysql-test/include/have_ujis.inc | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc index 262f66076a8..75460316322 100644 --- a/mysql-test/include/have_archive.inc +++ b/mysql-test/include/have_archive.inc @@ -1,4 +1,4 @@ --require r/have_archive.require --disable_query_log -show variables like "have_archive"; +show variables like 'have_archive'; --enable_query_log diff --git a/mysql-test/include/have_bdb.inc b/mysql-test/include/have_bdb.inc index 3f7377e7515..c2f29e0d286 100644 --- a/mysql-test/include/have_bdb.inc +++ b/mysql-test/include/have_bdb.inc @@ -1,4 +1,4 @@ -- require r/have_bdb.require disable_query_log; -show variables like "have_bdb"; +show variables like 'have_bdb'; enable_query_log; diff --git a/mysql-test/include/have_big5.inc b/mysql-test/include/have_big5.inc index 790e8085e1a..dad4a0a8eeb 100644 --- a/mysql-test/include/have_big5.inc +++ b/mysql-test/include/have_big5.inc @@ -1,4 +1,4 @@ -- require r/have_big5.require disable_query_log; -show collation like "big5_chinese_ci"; +show collation like 'big5_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_blackhole.inc b/mysql-test/include/have_blackhole.inc index c2b6ea18830..d13c9fda3f5 100644 --- a/mysql-test/include/have_blackhole.inc +++ b/mysql-test/include/have_blackhole.inc @@ -1,4 +1,4 @@ -- require r/have_blackhole.require disable_query_log; -show variables like "have_blackhole_engine"; +show variables like 'have_blackhole_engine'; enable_query_log; diff --git a/mysql-test/include/have_case_sensitive_file_system.inc b/mysql-test/include/have_case_sensitive_file_system.inc index 730af975497..7bb1bef93fd 100644 --- a/mysql-test/include/have_case_sensitive_file_system.inc +++ b/mysql-test/include/have_case_sensitive_file_system.inc @@ -1,4 +1,4 @@ --require r/case_sensitive_file_system.require --disable_query_log -show variables like "lower_case_file_system"; +show variables like 'lower_case_file_system'; --enable_query_log diff --git a/mysql-test/include/have_compress.inc b/mysql-test/include/have_compress.inc index c042cd7452a..150c7f3448d 100644 --- a/mysql-test/include/have_compress.inc +++ b/mysql-test/include/have_compress.inc @@ -1,4 +1,4 @@ -- require r/have_compress.require disable_query_log; -show variables like "have_compress"; +show variables like 'have_compress'; enable_query_log; diff --git a/mysql-test/include/have_cp1250_ch.inc b/mysql-test/include/have_cp1250_ch.inc index eec5d69fbd6..426fa658597 100644 --- a/mysql-test/include/have_cp1250_ch.inc +++ b/mysql-test/include/have_cp1250_ch.inc @@ -1,4 +1,4 @@ -- require r/have_cp1250_ch.require disable_query_log; -show collation like "cp1250_czech_cs"; +show collation like 'cp1250_czech_cs'; enable_query_log; diff --git a/mysql-test/include/have_cp932.inc b/mysql-test/include/have_cp932.inc index b500dac0bbe..ecad979c02a 100644 --- a/mysql-test/include/have_cp932.inc +++ b/mysql-test/include/have_cp932.inc @@ -1,4 +1,4 @@ -- require r/have_cp932.require disable_query_log; -show collation like "cp932_japanese_ci"; +show collation like 'cp932_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc index fe1f974bffd..cbf0a7ac876 100644 --- a/mysql-test/include/have_crypt.inc +++ b/mysql-test/include/have_crypt.inc @@ -1,4 +1,4 @@ -- require r/have_crypt.require disable_query_log; -show variables like "have_crypt"; +show variables like 'have_crypt'; enable_query_log; diff --git a/mysql-test/include/have_csv.inc b/mysql-test/include/have_csv.inc index d28199831b8..12e69962486 100644 --- a/mysql-test/include/have_csv.inc +++ b/mysql-test/include/have_csv.inc @@ -1,4 +1,4 @@ -- require r/have_csv.require disable_query_log; -show variables like "have_csv"; +show variables like 'have_csv'; enable_query_log; diff --git a/mysql-test/include/have_eucjpms.inc b/mysql-test/include/have_eucjpms.inc index a5e1a5ac547..6d96eefcc31 100644 --- a/mysql-test/include/have_eucjpms.inc +++ b/mysql-test/include/have_eucjpms.inc @@ -1,4 +1,4 @@ -- require r/have_eucjpms.require disable_query_log; -show collation like "eucjpms_japanese_ci"; +show collation like 'eucjpms_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_euckr.inc b/mysql-test/include/have_euckr.inc index af794aafc04..4b4e870cf47 100644 --- a/mysql-test/include/have_euckr.inc +++ b/mysql-test/include/have_euckr.inc @@ -1,4 +1,4 @@ -- require r/have_euckr.require disable_query_log; -show collation like "euckr_korean_ci"; +show collation like 'euckr_korean_ci'; enable_query_log; diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc index 7ddd15c48b3..b8f9a24463e 100644 --- a/mysql-test/include/have_exampledb.inc +++ b/mysql-test/include/have_exampledb.inc @@ -1,4 +1,4 @@ -- require r/have_exampledb.require disable_query_log; -show variables like "have_example_engine"; +show variables like 'have_example_engine'; enable_query_log; diff --git a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc index e4cf1366fda..4745534780d 100644 --- a/mysql-test/include/have_federated_db.inc +++ b/mysql-test/include/have_federated_db.inc @@ -1,4 +1,4 @@ -- require r/have_federated_db.require disable_query_log; -show variables like "have_federated_engine"; +show variables like 'have_federated_engine'; enable_query_log; diff --git a/mysql-test/include/have_gb2312.inc b/mysql-test/include/have_gb2312.inc index 4328bc67639..27591c01b6c 100644 --- a/mysql-test/include/have_gb2312.inc +++ b/mysql-test/include/have_gb2312.inc @@ -1,4 +1,4 @@ -- require r/have_gb2312.require disable_query_log; -show collation like "gb2312_chinese_ci"; +show collation like 'gb2312_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_gbk.inc b/mysql-test/include/have_gbk.inc index 55805da0495..72252d6b00d 100644 --- a/mysql-test/include/have_gbk.inc +++ b/mysql-test/include/have_gbk.inc @@ -1,4 +1,4 @@ -- require r/have_gbk.require disable_query_log; -show collation like "gbk_chinese_ci"; +show collation like 'gbk_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_geometry.inc b/mysql-test/include/have_geometry.inc index f0ec22af172..f1836469017 100644 --- a/mysql-test/include/have_geometry.inc +++ b/mysql-test/include/have_geometry.inc @@ -1,4 +1,4 @@ --require r/have_geometry.require --disable_query_log -show variables like "have_geometry"; +show variables like 'have_geometry'; --enable_query_log diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc index 4f83d378cbc..4142b84813b 100644 --- a/mysql-test/include/have_innodb.inc +++ b/mysql-test/include/have_innodb.inc @@ -1,4 +1,4 @@ -- require r/have_innodb.require disable_query_log; -show variables like "have_innodb"; +show variables like 'have_innodb'; enable_query_log; diff --git a/mysql-test/include/have_latin2_ch.inc b/mysql-test/include/have_latin2_ch.inc index 9d3ee6b341c..215715a6aaf 100644 --- a/mysql-test/include/have_latin2_ch.inc +++ b/mysql-test/include/have_latin2_ch.inc @@ -1,4 +1,4 @@ -- require r/have_latin2_ch.require disable_query_log; -show collation like "latin2_czech_cs"; +show collation like 'latin2_czech_cs'; enable_query_log; diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index 11530dc953e..5bcdb30b3e0 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -1,4 +1,4 @@ -- require r/have_log_bin.require disable_query_log; -show variables like "log_bin"; +show variables like 'log_bin'; enable_query_log; diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc index 8d3ae02f61e..6192acb7b01 100644 --- a/mysql-test/include/have_lowercase0.inc +++ b/mysql-test/include/have_lowercase0.inc @@ -1,4 +1,4 @@ --require r/lowercase0.require --disable_query_log -show variables like "lower_case_%"; +show variables like 'lower_case_%'; --enable_query_log diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc index 45a551274f7..7f922d85ff2 100644 --- a/mysql-test/include/have_multi_ndb.inc +++ b/mysql-test/include/have_multi_ndb.inc @@ -10,7 +10,7 @@ drop table if exists t1, t2; --enable_warnings flush tables; --require r/have_ndb.require -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Check that server2 has NDB support @@ -21,7 +21,7 @@ drop table if exists t1, t2; --enable_warnings flush tables; --require r/have_ndb.require -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Set the default connection to 'server1' diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 721d79392b7..691adc12231 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,7 +1,7 @@ # Check that server is compiled and started with support for NDB -- require r/have_ndb.require disable_query_log; -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Check that NDB is installed and known to be working diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index 39549157849..647f8598ae6 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -3,5 +3,5 @@ # of query cache hits -- disable_ps_protocol disable_query_log; -show variables like "have_query_cache"; +show variables like 'have_query_cache'; enable_query_log; diff --git a/mysql-test/include/have_sjis.inc b/mysql-test/include/have_sjis.inc index 0d580a3a232..ac6531ca868 100644 --- a/mysql-test/include/have_sjis.inc +++ b/mysql-test/include/have_sjis.inc @@ -1,4 +1,4 @@ -- require r/have_sjis.require disable_query_log; -show collation like "sjis_japanese_ci"; +show collation like 'sjis_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_ssl.inc b/mysql-test/include/have_ssl.inc index fab57d630e5..6f2d5587a75 100644 --- a/mysql-test/include/have_ssl.inc +++ b/mysql-test/include/have_ssl.inc @@ -1,4 +1,4 @@ -- require r/have_ssl.require disable_query_log; -show variables like "have_ssl"; +show variables like 'have_ssl'; enable_query_log; diff --git a/mysql-test/include/have_tis620.inc b/mysql-test/include/have_tis620.inc index c1e775681b0..ad5ba9dea69 100644 --- a/mysql-test/include/have_tis620.inc +++ b/mysql-test/include/have_tis620.inc @@ -1,4 +1,4 @@ -- require r/have_tis620.require disable_query_log; -show collation like "tis620_thai_ci"; +show collation like 'tis620_thai_ci'; enable_query_log; diff --git a/mysql-test/include/have_ucs2.inc b/mysql-test/include/have_ucs2.inc index 92ec9b5fb44..324ed52dd02 100644 --- a/mysql-test/include/have_ucs2.inc +++ b/mysql-test/include/have_ucs2.inc @@ -1,4 +1,4 @@ -- require r/have_ucs2.require disable_query_log; -show collation like "ucs2_general_ci"; +show collation like 'ucs2_general_ci'; enable_query_log; diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index 42b9942f74d..154dccf2270 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -4,7 +4,7 @@ # --require r/have_udf.require disable_query_log; -show variables like "have_dynamic_loading"; +show variables like 'have_dynamic_loading'; enable_query_log; # diff --git a/mysql-test/include/have_ujis.inc b/mysql-test/include/have_ujis.inc index ecceb7a8408..e4b2f50cf93 100644 --- a/mysql-test/include/have_ujis.inc +++ b/mysql-test/include/have_ujis.inc @@ -1,4 +1,4 @@ -- require r/have_ujis.require disable_query_log; -show collation like "ujis_japanese_ci"; +show collation like 'ujis_japanese_ci'; enable_query_log; -- cgit v1.2.1 From c7724872d85cebf07df3380757cf7259f9116682 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 7 Jul 2008 10:00:08 -0600 Subject: Bug#26030 (Parsing fails for stored routine w/multi-statement execution enabled) Before this fix, the lexer and parser would treat the ';' character as a different token (either ';' or END_OF_INPUT), based on convoluted logic, which failed in simple cases where a stored procedure is implemented as a single statement, and used in a multi query. With this fix: - the character ';' is always parsed as a ';' token in the lexer, - parsing multi queries is implemented in the parser, in the 'query:' rules, - the value of thd->client_capabilities, which is the capabilities negotiated between the client and the server during bootstrap, is immutable and not arbitrarily modified during parsing (which was the root cause of the bug) --- mysql-test/r/comments.result | 2 +- mysql-test/r/parser.result | 68 ++++++++++++++++++++++++++++++++++++++++++++ mysql-test/r/ps.result | 4 +-- mysql-test/t/parser.test | 59 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 mysql-test/r/parser.result create mode 100644 mysql-test/t/parser.test (limited to 'mysql-test') diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result index 1040c3fc8e9..b9d0028dc7c 100644 --- a/mysql-test/r/comments.result +++ b/mysql-test/r/comments.result @@ -35,7 +35,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;"; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';*' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';"; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!98765' AND b = 'bar'' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*"; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result new file mode 100644 index 00000000000..18391bd2a45 --- /dev/null +++ b/mysql-test/r/parser.result @@ -0,0 +1,68 @@ +DROP PROCEDURE IF EXISTS p26030; +select "non terminated"$$ +non terminated +non terminated +select "terminated";$$ +terminated +terminated +select "non terminated, space" $$ +non terminated, space +non terminated, space +select "terminated, space"; $$ +terminated, space +terminated, space +select "non terminated, comment" /* comment */$$ +non terminated, comment +non terminated, comment +select "terminated, comment"; /* comment */$$ +terminated, comment +terminated, comment +select "stmt 1";select "stmt 2 non terminated"$$ +stmt 1 +stmt 1 +stmt 2 non terminated +stmt 2 non terminated +select "stmt 1";select "stmt 2 terminated";$$ +stmt 1 +stmt 1 +stmt 2 terminated +stmt 2 terminated +select "stmt 1";select "stmt 2 non terminated, space" $$ +stmt 1 +stmt 1 +stmt 2 non terminated, space +stmt 2 non terminated, space +select "stmt 1";select "stmt 2 terminated, space"; $$ +stmt 1 +stmt 1 +stmt 2 terminated, space +stmt 2 terminated, space +select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ +stmt 1 +stmt 1 +stmt 2 non terminated, comment +stmt 2 non terminated, comment +select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ +stmt 1 +stmt 1 +stmt 2 terminated, comment +stmt 2 terminated, comment +select "stmt 1"; select "space, stmt 2"$$ +stmt 1 +stmt 1 +space, stmt 2 +space, stmt 2 +select "stmt 1";/* comment */select "comment, stmt 2"$$ +stmt 1 +stmt 1 +comment, stmt 2 +comment, stmt 2 +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() +$$ +1 +1 +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() +$$ +1 +1 +DROP PROCEDURE p26030; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 9aef58d5702..09deaf2f322 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -85,9 +85,9 @@ NULL NULL NULL prepare stmt6 from 'select 1; select2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1 prepare stmt6 from 'insert into t1 values (5,"five"); select2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1 explain prepare stmt6 from 'insert into t1 values (5,"five"); select2'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1 create table t2 diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test new file mode 100644 index 00000000000..02fe98dc7b2 --- /dev/null +++ b/mysql-test/t/parser.test @@ -0,0 +1,59 @@ +# +# This file contains tests covering the parser +# + +#============================================================================= +# LEXICAL PARSER (lex) +#============================================================================= + +# +# Maintainer: these tests are for the lexical parser, so every character, +# even whitespace or comments, is significant here. +# + +# +# Bug#26030 (Parsing fails for stored routine w/multi-statement execution +# enabled) +# + +--disable_warnings +DROP PROCEDURE IF EXISTS p26030; +--enable_warnings + +delimiter $$; + +select "non terminated"$$ +select "terminated";$$ +select "non terminated, space" $$ +select "terminated, space"; $$ +select "non terminated, comment" /* comment */$$ +select "terminated, comment"; /* comment */$$ + +# Multi queries can not be used in --ps-protocol test mode +--disable_ps_protocol + +select "stmt 1";select "stmt 2 non terminated"$$ +select "stmt 1";select "stmt 2 terminated";$$ +select "stmt 1";select "stmt 2 non terminated, space" $$ +select "stmt 1";select "stmt 2 terminated, space"; $$ +select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ +select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ + +select "stmt 1"; select "space, stmt 2"$$ +select "stmt 1";/* comment */select "comment, stmt 2"$$ + +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() +$$ + +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() +$$ + +--enable_ps_protocol + +delimiter ;$$ +DROP PROCEDURE p26030; + +#============================================================================r +# SYNTACTIC PARSER (bison) +#============================================================================= + -- cgit v1.2.1