Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f5b73fe3
Commit
f5b73fe3
authored
Apr 21, 2014
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.3.
parents
1c6d508a
5fc5195f
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
243 additions
and
1 deletion
+243
-1
mysql-test/include/ctype_common.inc
mysql-test/include/ctype_common.inc
+8
-0
mysql-test/r/ctype_big5.result
mysql-test/r/ctype_big5.result
+9
-0
mysql-test/r/ctype_cp1250_ch.result
mysql-test/r/ctype_cp1250_ch.result
+18
-0
mysql-test/r/ctype_euckr.result
mysql-test/r/ctype_euckr.result
+9
-0
mysql-test/r/ctype_gb2312.result
mysql-test/r/ctype_gb2312.result
+9
-0
mysql-test/r/ctype_gbk.result
mysql-test/r/ctype_gbk.result
+9
-0
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_latin1.result
+102
-0
mysql-test/r/ctype_uca.result
mysql-test/r/ctype_uca.result
+9
-0
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+9
-0
mysql-test/r/ctype_utf16_uca.result
mysql-test/r/ctype_utf16_uca.result
+9
-0
mysql-test/r/ctype_utf32_uca.result
mysql-test/r/ctype_utf32_uca.result
+9
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+1
-1
mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
+9
-0
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
+9
-0
mysql-test/t/ctype_latin1.test
mysql-test/t/ctype_latin1.test
+4
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-0
storage/tokudb/mysql-test/tokudb/r/ctype_cp1250_ch.result
storage/tokudb/mysql-test/tokudb/r/ctype_cp1250_ch.result
+18
-0
No files found.
mysql-test/include/ctype_common.inc
View file @
f5b73fe3
...
@@ -64,6 +64,14 @@ select a sounds like a from t1;
...
@@ -64,6 +64,14 @@ select a sounds like a from t1;
select
1
from
t1
order
by
cast
(
a
as
char
(
1
));
select
1
from
t1
order
by
cast
(
a
as
char
(
1
));
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
--
echo
#
SET
character_set_client
=
latin1
;
SET
character_set_connection
=
@
test_character_set
;
SET
collation_connection
=
@
test_collation
;
SELECT
COLLATION
(
'.'
),
SUBSTRING_INDEX
(
'.wwwmysqlcom'
,
'.'
,
-
2
)
AS
c1
;
#
#
# Bug#27580 SPACE() function collation bug?
# Bug#27580 SPACE() function collation bug?
#
#
...
...
mysql-test/r/ctype_big5.result
View file @
f5b73fe3
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
big5_chinese_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_cp1250_ch.result
View file @
f5b73fe3
...
@@ -75,6 +75,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -75,6 +75,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp1250_general_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
@@ -168,6 +177,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -168,6 +177,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp1250_czech_cs .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_euckr.result
View file @
f5b73fe3
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
euckr_korean_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_gb2312.result
View file @
f5b73fe3
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
gb2312_chinese_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_gbk.result
View file @
f5b73fe3
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
gbk_chinese_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_latin1.result
View file @
f5b73fe3
...
@@ -308,6 +308,108 @@ select 'a' regexp 'A' collate latin1_general_cs;
...
@@ -308,6 +308,108 @@ select 'a' regexp 'A' collate latin1_general_cs;
select 'a' regexp 'A' collate latin1_bin;
select 'a' regexp 'A' collate latin1_bin;
'a' regexp 'A' collate latin1_bin
'a' regexp 'A' collate latin1_bin
0
0
SET @test_character_set= 'latin1';
SET @test_collation= 'latin1_swedish_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
SET @safe_character_set_client= @@character_set_client;
SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
USE d1;
CREATE TABLE t1 (c CHAR(10), KEY(c));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
c char(10) latin1_swedish_ci YES MUL NULL
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
want3results
aaa
aaaa
aaaaa
DROP TABLE t1;
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
c1 varchar(15) latin1_swedish_ci YES MUL NULL
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
SELECT c1 as want3results from t1 where c1 like 'l%';
want3results
location
loberge
lotre
SELECT c1 as want3results from t1 where c1 like 'lo%';
want3results
location
loberge
lotre
SELECT c1 as want1result from t1 where c1 like 'loc%';
want1result
location
SELECT c1 as want1result from t1 where c1 like 'loca%';
want1result
location
SELECT c1 as want1result from t1 where c1 like 'locat%';
want1result
location
SELECT c1 as want1result from t1 where c1 like 'locati%';
want1result
location
SELECT c1 as want1result from t1 where c1 like 'locatio%';
want1result
location
SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
select 1 from t1 order by cast(a as char(1));
1
1
1
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
latin1_swedish_ci .wwwmysqlcom
set names utf8;
create table t1 (
name varchar(10),
level smallint unsigned);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`name` varchar(10) DEFAULT NULL,
`level` smallint(5) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('string',1);
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
concat(name,space(level)) concat(name, repeat(' ',level))
string string
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
SET character_set_client= @safe_character_set_client;
SET character_set_results= @safe_character_set_results;
SET collation_connection='latin1_swedish_ci';
SET collation_connection='latin1_swedish_ci';
create table t1 select repeat('a',4000) a;
create table t1 select repeat('a',4000) a;
delete from t1;
delete from t1;
...
...
mysql-test/r/ctype_uca.result
View file @
f5b73fe3
...
@@ -2725,6 +2725,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -2725,6 +2725,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
utf8_swedish_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_ucs.result
View file @
f5b73fe3
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
ucs2_general_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_utf16_uca.result
View file @
f5b73fe3
...
@@ -2241,6 +2241,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -2241,6 +2241,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
utf16_swedish_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/ctype_utf32_uca.result
View file @
f5b73fe3
...
@@ -2241,6 +2241,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -2241,6 +2241,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
utf32_swedish_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/r/func_str.result
View file @
f5b73fe3
...
@@ -119,7 +119,7 @@ substring_index('aaaaaaaaa1','aaa',-3)
...
@@ -119,7 +119,7 @@ substring_index('aaaaaaaaa1','aaa',-3)
aaaaaa1
aaaaaa1
select substring_index('aaaaaaaaa1','aaa',-4);
select substring_index('aaaaaaaaa1','aaa',-4);
substring_index('aaaaaaaaa1','aaa',-4)
substring_index('aaaaaaaaa1','aaa',-4)
aaaaaaaaa1
select substring_index('the king of thethe hill','the',-2);
select substring_index('the king of thethe hill','the',-2);
substring_index('the king of thethe hill','the',-2)
substring_index('the king of thethe hill','the',-2)
the hill
the hill
...
...
mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
View file @
f5b73fe3
...
@@ -74,6 +74,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -74,6 +74,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp932_japanese_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
View file @
f5b73fe3
...
@@ -74,6 +74,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -74,6 +74,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp932_japanese_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
mysql-test/t/ctype_latin1.test
View file @
f5b73fe3
...
@@ -79,6 +79,10 @@ select 'a' regexp 'A' collate latin1_general_cs;
...
@@ -79,6 +79,10 @@ select 'a' regexp 'A' collate latin1_general_cs;
select
'a'
regexp
'A'
collate
latin1_bin
;
select
'a'
regexp
'A'
collate
latin1_bin
;
SET
@
test_character_set
=
'latin1'
;
SET
@
test_collation
=
'latin1_swedish_ci'
;
--
source
include
/
ctype_common
.
inc
SET
collation_connection
=
'latin1_swedish_ci'
;
SET
collation_connection
=
'latin1_swedish_ci'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_like_escape
.
inc
--
source
include
/
ctype_like_escape
.
inc
...
...
sql/item_strfunc.cc
View file @
f5b73fe3
...
@@ -1579,6 +1579,8 @@ String *Item_func_substr_index::val_str(String *str)
...
@@ -1579,6 +1579,8 @@ String *Item_func_substr_index::val_str(String *str)
break
;
break
;
}
}
}
}
if
(
count
)
return
res
;
// Didn't find, return org string
}
}
}
}
/*
/*
...
...
storage/tokudb/mysql-test/tokudb/r/ctype_cp1250_ch.result
View file @
f5b73fe3
...
@@ -76,6 +76,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -76,6 +76,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp1250_general_ci .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
@@ -169,6 +178,15 @@ select 1 from t1 order by cast(a as char(1));
...
@@ -169,6 +178,15 @@ select 1 from t1 order by cast(a as char(1));
1
1
1
1
drop table t1;
drop table t1;
#
# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
#
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
COLLATION('.') c1
cp1250_czech_cs .wwwmysqlcom
set names utf8;
set names utf8;
create table t1 (
create table t1 (
name varchar(10),
name varchar(10),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment