summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-06-18 04:16:08 +0400
committerunknown <konstantin@mysql.com>2004-06-18 04:16:08 +0400
commitcbfe9f05174eefc4fe2dcf97c4ca32d2087c32db (patch)
treefd77ab1ae1671618423ee4d87147610ae243d693 /mysql-test
parent25749c968604adc68a00055abb73e6d8ec3d5505 (diff)
downloadmariadb-git-cbfe9f05174eefc4fe2dcf97c4ca32d2087c32db.tar.gz
Fix for bug#4105 "Server crash on attempt to prepare a statement with
character set introducer": add new item type to be returned before from Item_param until it's value is set. This way items like Item_bool_func2 and udf_handler won't treat this item as constant literal when statement is prepared. mysql-test/r/ps.result: Test results fixed (test case for bug #4105) mysql-test/t/ps.test: Followup to bug #4105: a test case. sql/item.cc: Fix for bug#4105 "Server crash on attempt to prepare a statement with character set introducer": add new item type to be returned before from Item_param until it's value is set. sql/item.h: Fix for bug#4105 "Server crash on attempt to prepare a statement with character set introducer": add new item type to be returned before from Item_param until it's value is set.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result6
-rw-r--r--mysql-test/t/ps.test9
2 files changed, 14 insertions, 1 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index fd3a7d54b4d..e03952efe13 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -113,3 +113,9 @@ execute stmt1 using @ivar;
?
1234
drop table t1,t2;
+PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
+set @var='A';
+EXECUTE stmt1 USING @var;
+_utf8 'A' collate utf8_bin = ?
+1
+DEALLOCATE PREPARE stmt1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index d9e0f0852c5..f379fb3eebe 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -116,4 +116,11 @@ prepare stmt1 from @str2;
execute stmt1 using @ivar;
drop table t1,t2;
-
+#
+# Bug #4105: Server crash on attempt to prepare a statement with character
+# set introducer
+#
+PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
+set @var='A';
+EXECUTE stmt1 USING @var;
+DEALLOCATE PREPARE stmt1;