1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

func_like.result, func_like.test:

adding test case.
item_cmpfunc.cc:
  Bug#12611
  ESCAPE + LIKE do not work when the escape char is a multibyte one
  Additional fix for 8bit character sets:
  escape character must be converted into
  operation character set.


sql/item_cmpfunc.cc:
  Bug#12611
  ESCAPE + LIKE do not work when the escape char is a multibyte one
  Additional fix for 8bit character sets:
  escape character must be converted into
  operation character set.
mysql-test/t/func_like.test:
  adding test case.
mysql-test/r/func_like.result:
  adding test case.
This commit is contained in:
unknown
2005-09-06 16:16:10 +05:00
parent e254105bec
commit 965afd45a1
3 changed files with 42 additions and 1 deletions

View File

@ -158,3 +158,10 @@ DROP TABLE t1;
select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin;
_cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin
1
set names koi8r;
select 'andre%' like 'andre<72>%' escape '<27>';
'andre%' like 'andre<72>%' escape '<27>'
1
select _cp1251'andre%' like convert('andre<72>%' using cp1251) escape '<27>';
_cp1251'andre%' like convert('andre<72>%' using cp1251) escape '<27>'
1

View File

@ -96,4 +96,21 @@ DROP TABLE t1;
#
select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin;
#
# Check 8bit escape character
#
set names koi8r;
select 'andre%' like 'andre<72>%' escape '<27>';
# Check 8bit escape character with charset conversion:
# For "a LIKE b ESCAPE c" expressions,
# escape character is converted into the operation character set,
# which is result of aggregation of character sets of "a" and "b".
# "c" itself doesn't take part in aggregation, because its collation
# doesn't matter, escape character is always compared binary.
# In the example below, escape character is converted from koi8r into cp1251:
#
select _cp1251'andre%' like convert('andre<72>%' using cp1251) escape '<27>';
#
# End of 4.1 tests