summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-09-03 23:28:49 +0400
committerunknown <konstantin@mysql.com>2004-09-03 23:28:49 +0400
commit14c4d0d72ee38960182cfd013d1f5f3fc9a73393 (patch)
tree80293b4b3ae9f9f5423d4877aa048b372cbf1e48 /mysql-test
parent6a5f9b4139ef78c599f5cb6ad8213d036180747c (diff)
downloadmariadb-git-14c4d0d72ee38960182cfd013d1f5f3fc9a73393.tar.gz
A fix for bug#4368 '"like" fails in PreparedStatement, crashes
server': the bug occurs when arguments of LIKE function are in differentcharacter sets. If these character sets are compatible, we create an item-converter. In prepared mode, this item needs to be created in memory of current prepared statement. mysql-test/r/ps.result: Test for Bug#4368 added. mysql-test/t/ps.test: A test case for bug#4368 '"like" fails in PreparedStatement, crashes server'.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result11
-rw-r--r--mysql-test/t/ps.test17
2 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index e161904cd6f..321b8894796 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -259,3 +259,14 @@ execute `ü`;
1234
1234
set names default;
+create table t1 (a varchar(10)) charset=utf8;
+insert into t1 (a) values ('yahoo');
+set character_set_connection=latin1;
+prepare stmt from 'select a from t1 where a like ?';
+set @var='google';
+execute stmt using @var;
+a
+execute stmt using @var;
+a
+deallocate prepare stmt;
+drop table t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index e54bf8076e0..cbc76e02b42 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -261,3 +261,20 @@ execute `ü`;
set names default;
+#
+# BUG#4368 "select * from t1 where a like ?" crashes server if a is in utf8
+# and ? is in latin1
+# Check that Item converting latin1 to utf8 (for LIKE function) is created
+# in memory of prepared statement.
+#
+
+create table t1 (a varchar(10)) charset=utf8;
+insert into t1 (a) values ('yahoo');
+set character_set_connection=latin1;
+prepare stmt from 'select a from t1 where a like ?';
+set @var='google';
+execute stmt using @var;
+execute stmt using @var;
+deallocate prepare stmt;
+drop table t1;
+