1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

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.
This commit is contained in:
konstantin@mysql.com
2004-09-03 23:28:49 +04:00
parent c3cb5980c2
commit bdec2c603b
3 changed files with 41 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;