mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge mysql.com:/usr/home/bar/mysql-4.1
into mysql.com:/usr/home/bar/mysql-5.0 BitKeeper/deleted/.del-ctype-cp932.c: Auto merged BitKeeper/deleted/.del-ctype_cp932.result: Auto merged BitKeeper/deleted/.del-ctype_cp932.test: Auto merged mysql-test/r/ctype_ujis.result: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-gbk.c: Auto merged strings/ctype-simple.c: Auto merged strings/ctype-sjis.c: Auto merged
This commit is contained in:
21
mysql-test/include/ctype_innodb_like.inc
Normal file
21
mysql-test/include/ctype_innodb_like.inc
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Bug#11650: LIKE pattern matching using prefix index
|
||||||
|
# doesn't return correct result
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
#
|
||||||
|
# This query creates a column using
|
||||||
|
# character_set_connection and
|
||||||
|
# collation_connection.
|
||||||
|
#
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
--enable_warnings
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
drop table t1;
|
@@ -67,6 +67,28 @@ big5_chinese_ci 6109
|
|||||||
big5_chinese_ci 61
|
big5_chinese_ci 61
|
||||||
big5_chinese_ci 6120
|
big5_chinese_ci 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
big5_chinese_ci
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
SET collation_connection='big5_bin';
|
SET collation_connection='big5_bin';
|
||||||
create table t1 select repeat('a',4000) a;
|
create table t1 select repeat('a',4000) a;
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -77,6 +99,28 @@ big5_bin 6109
|
|||||||
big5_bin 61
|
big5_bin 61
|
||||||
big5_bin 6120
|
big5_bin 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
big5_bin
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
SET NAMES big5;
|
SET NAMES big5;
|
||||||
CREATE TABLE t1 (a text) character set big5;
|
CREATE TABLE t1 (a text) character set big5;
|
||||||
INSERT INTO t1 VALUES ('<27><>');
|
INSERT INTO t1 VALUES ('<27><>');
|
||||||
|
@@ -81,6 +81,28 @@ sjis_japanese_ci 6109
|
|||||||
sjis_japanese_ci 61
|
sjis_japanese_ci 61
|
||||||
sjis_japanese_ci 6120
|
sjis_japanese_ci 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
sjis_japanese_ci
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
SET collation_connection='sjis_bin';
|
SET collation_connection='sjis_bin';
|
||||||
create table t1 select repeat('a',4000) a;
|
create table t1 select repeat('a',4000) a;
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -91,6 +113,28 @@ sjis_bin 6109
|
|||||||
sjis_bin 61
|
sjis_bin 61
|
||||||
sjis_bin 6120
|
sjis_bin 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
sjis_bin
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
SET NAMES sjis;
|
SET NAMES sjis;
|
||||||
SELECT HEX('<27><><EFBFBD><EFBFBD><EFBFBD>@\<5C>\') FROM DUAL;
|
SELECT HEX('<27><><EFBFBD><EFBFBD><EFBFBD>@\<5C>\') FROM DUAL;
|
||||||
HEX('<27><><EFBFBD><EFBFBD><EFBFBD>@<40>_<EFBFBD>\')
|
HEX('<27><><EFBFBD><EFBFBD><EFBFBD>@<40>_<EFBFBD>\')
|
||||||
|
@@ -2217,6 +2217,28 @@ ujis_japanese_ci 6109
|
|||||||
ujis_japanese_ci 61
|
ujis_japanese_ci 61
|
||||||
ujis_japanese_ci 6120
|
ujis_japanese_ci 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
ujis_japanese_ci
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
SET collation_connection='ujis_bin';
|
SET collation_connection='ujis_bin';
|
||||||
create table t1 select repeat('a',4000) a;
|
create table t1 select repeat('a',4000) a;
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -2227,3 +2249,25 @@ ujis_bin 6109
|
|||||||
ujis_bin 61
|
ujis_bin 61
|
||||||
ujis_bin 6120
|
ujis_bin 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||||
|
alter table t1 add index(c1(5));
|
||||||
|
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||||
|
select collation(c1) from t1 limit 1;
|
||||||
|
collation(c1)
|
||||||
|
ujis_bin
|
||||||
|
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||||
|
c1
|
||||||
|
abcdefg
|
||||||
|
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde100
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde110
|
||||||
|
abcde111
|
||||||
|
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||||
|
c1
|
||||||
|
abcde111
|
||||||
|
drop table t1;
|
||||||
|
@@ -14,8 +14,10 @@ SET @test_collation= 'big5_chinese_ci';
|
|||||||
SET NAMES big5;
|
SET NAMES big5;
|
||||||
SET collation_connection='big5_chinese_ci';
|
SET collation_connection='big5_chinese_ci';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
SET collation_connection='big5_bin';
|
SET collation_connection='big5_bin';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bugs#9357: TEXT columns break string with special word in BIG5 charset.
|
# Bugs#9357: TEXT columns break string with special word in BIG5 charset.
|
||||||
|
@@ -66,8 +66,10 @@ drop table t1;
|
|||||||
|
|
||||||
SET collation_connection='sjis_japanese_ci';
|
SET collation_connection='sjis_japanese_ci';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
SET collation_connection='sjis_bin';
|
SET collation_connection='sjis_bin';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
|
|
||||||
# Check parsing of string literals in SJIS with multibyte characters that
|
# Check parsing of string literals in SJIS with multibyte characters that
|
||||||
# have an embedded \ in them. (Bug #8303)
|
# have an embedded \ in them. (Bug #8303)
|
||||||
|
@@ -1145,5 +1145,7 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
SET collation_connection='ujis_japanese_ci';
|
SET collation_connection='ujis_japanese_ci';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
SET collation_connection='ujis_bin';
|
SET collation_connection='ujis_bin';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
-- source include/ctype_innodb_like.inc
|
||||||
|
@@ -401,9 +401,14 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
uint res_length, char *min_str,char *max_str,
|
uint res_length, char *min_str,char *max_str,
|
||||||
uint *min_length,uint *max_length)
|
uint *min_length,uint *max_length)
|
||||||
{
|
{
|
||||||
const char *end=ptr+ptr_length;
|
const char *end;
|
||||||
char *min_org=min_str;
|
char *min_org=min_str;
|
||||||
char *min_end=min_str+res_length;
|
char *min_end=min_str+res_length;
|
||||||
|
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||||
|
|
||||||
|
if (charlen < ptr_length)
|
||||||
|
ptr_length= charlen;
|
||||||
|
end= ptr + ptr_length;
|
||||||
|
|
||||||
for (; ptr != end && min_str != min_end ; ptr++)
|
for (; ptr != end && min_str != min_end ; ptr++)
|
||||||
{
|
{
|
||||||
|
@@ -2714,9 +2714,14 @@ static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
uint res_length, char *min_str,char *max_str,
|
uint res_length, char *min_str,char *max_str,
|
||||||
uint *min_length,uint *max_length)
|
uint *min_length,uint *max_length)
|
||||||
{
|
{
|
||||||
const char *end=ptr+ptr_length;
|
const char *end;
|
||||||
char *min_org=min_str;
|
char *min_org=min_str;
|
||||||
char *min_end=min_str+res_length;
|
char *min_end=min_str+res_length;
|
||||||
|
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||||
|
|
||||||
|
if (charlen < ptr_length)
|
||||||
|
ptr_length= charlen;
|
||||||
|
end= ptr + ptr_length;
|
||||||
|
|
||||||
for (; ptr != end && min_str != min_end ; ptr++)
|
for (; ptr != end && min_str != min_end ; ptr++)
|
||||||
{
|
{
|
||||||
|
@@ -1034,9 +1034,15 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
|
|||||||
char *min_str,char *max_str,
|
char *min_str,char *max_str,
|
||||||
uint *min_length,uint *max_length)
|
uint *min_length,uint *max_length)
|
||||||
{
|
{
|
||||||
const char *end=ptr+ptr_length;
|
const char *end;
|
||||||
char *min_org=min_str;
|
char *min_org=min_str;
|
||||||
char *min_end=min_str+res_length;
|
char *min_end=min_str+res_length;
|
||||||
|
#ifdef USE_MB
|
||||||
|
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||||
|
if (charlen < ptr_length)
|
||||||
|
ptr_length= charlen;
|
||||||
|
#endif
|
||||||
|
end= ptr + ptr_length;
|
||||||
|
|
||||||
for (; ptr != end && min_str != min_end ; ptr++)
|
for (; ptr != end && min_str != min_end ; ptr++)
|
||||||
{
|
{
|
||||||
|
@@ -330,9 +330,14 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
uint res_length, char *min_str,char *max_str,
|
uint res_length, char *min_str,char *max_str,
|
||||||
uint *min_length,uint *max_length)
|
uint *min_length,uint *max_length)
|
||||||
{
|
{
|
||||||
const char *end=ptr+ptr_length;
|
const char *end;
|
||||||
char *min_org=min_str;
|
char *min_org=min_str;
|
||||||
char *min_end=min_str+res_length;
|
char *min_end=min_str+res_length;
|
||||||
|
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||||
|
|
||||||
|
if (charlen < ptr_length)
|
||||||
|
ptr_length= charlen;
|
||||||
|
end= ptr + ptr_length;
|
||||||
|
|
||||||
while (ptr < end && min_str < min_end) {
|
while (ptr < end && min_str < min_end) {
|
||||||
if (ismbchar_sjis(cs, ptr, end)) {
|
if (ismbchar_sjis(cs, ptr, end)) {
|
||||||
|
Reference in New Issue
Block a user