mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql.com:/home/bar/mysql-work/mysql-5.0.b31081 mysql-test/t/ctype_uca.test: Auto merged
This commit is contained in:
42
mysql-test/include/ctype_regex.inc
Normal file
42
mysql-test/include/ctype_regex.inc
Normal file
@ -0,0 +1,42 @@
|
||||
#
|
||||
# To test a desired collation, set session.collation_connection to
|
||||
# this collation before including this file
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Create a table with two varchar(64) null-able column,
|
||||
# using current values of
|
||||
# @@character_set_connection and @@collation_connection.
|
||||
#
|
||||
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
delete from t1;
|
||||
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
|
||||
drop table t1;
|
@ -2754,4 +2754,49 @@ a
|
||||
c
|
||||
ch
|
||||
drop table t1;
|
||||
set collation_connection=ucs2_unicode_ci;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) character set ucs2 collate ucs2_unicode_ci default NULL,
|
||||
`s2` varchar(64) character set ucs2 collate ucs2_unicode_ci default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
End for 5.0 tests
|
||||
|
@ -922,4 +922,49 @@ ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_gen
|
||||
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
|
||||
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
|
||||
drop table t1;
|
||||
set collation_connection=ucs2_general_ci;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) character set ucs2 default NULL,
|
||||
`s2` varchar(64) character set ucs2 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
set names latin1;
|
||||
End of 5.0 tests
|
||||
|
@ -267,6 +267,51 @@ b
|
||||
select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set collation_connection=utf8_general_ci;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) character set utf8 default NULL,
|
||||
`s2` varchar(64) character set utf8 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
set names utf8;
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
|
@ -1,5 +1,17 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (s1 char(64),s2 char(64));
|
||||
set names latin1;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) default NULL,
|
||||
`s2` varchar(64) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
|
@ -538,4 +538,8 @@ alter table t1 convert to character set ucs2 collate ucs2_czech_ci;
|
||||
select * from t1 where a like 'c%';
|
||||
drop table t1;
|
||||
|
||||
set collation_connection=ucs2_unicode_ci;
|
||||
--source include/ctype_regex.inc
|
||||
set names utf8;
|
||||
|
||||
-- echo End for 5.0 tests
|
||||
|
@ -651,4 +651,8 @@ select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
|
||||
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
|
||||
drop table t1;
|
||||
|
||||
set collation_connection=ucs2_general_ci;
|
||||
--source include/ctype_regex.inc
|
||||
set names latin1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -185,6 +185,13 @@ select * from t1 where a = 'b' and a = 'b';
|
||||
select * from t1 where a = 'b' and a != 'b';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Testing regexp
|
||||
#
|
||||
set collation_connection=utf8_general_ci;
|
||||
--source include/ctype_regex.inc
|
||||
set names utf8;
|
||||
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
|
@ -6,28 +6,9 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (s1 char(64),s2 char(64));
|
||||
set names latin1;
|
||||
--source include/ctype_regex.inc
|
||||
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# This test a bug in regexp on Alpha
|
||||
|
Reference in New Issue
Block a user