summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorJonathan Perkin <jperkin@sun.com>2008-07-17 17:39:33 +0200
committermysqldev <mysqldev@production.mysql.com>2008-07-17 17:39:33 +0200
commit2ade957b074c1773deae28fff8608b552fdce10b (patch)
tree22442c37177cc8b40dc8cb3cacde6e61b83508a2 /mysql-test/t
parentf81792945a215a842894a0bc131c7ee7661f3442 (diff)
parent3bcbaf6cbf18dc04ee2495cc6cd2bf8aa399ebb5 (diff)
downloadmariadb-git-2ade957b074c1773deae28fff8608b552fdce10b.tar.gz
Merge from mysql-5.0.66-release
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/parser.test59
-rw-r--r--mysql-test/t/varbinary.test28
2 files changed, 87 insertions, 0 deletions
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)
+#=============================================================================
+
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;
+