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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
11f14e00
Commit
11f14e00
authored
Mar 29, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better tests for BINARY
parent
f84f6d5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
0 deletions
+95
-0
mysql-test/r/binary.result
mysql-test/r/binary.result
+31
-0
mysql-test/r/ctype_cp1251.result
mysql-test/r/ctype_cp1251.result
+32
-0
mysql-test/t/binary.test
mysql-test/t/binary.test
+15
-0
mysql-test/t/ctype_cp1251.test
mysql-test/t/ctype_cp1251.test
+17
-0
No files found.
mysql-test/r/binary.result
View file @
11f14e00
...
...
@@ -79,3 +79,34 @@ NULL
select b from t1 having binary b like '';
b
drop table t1;
create table t1 (a char(15) binary, b binary(15));
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
upper(a) upper(b)
AAA bbb
AAA BBB
select lower(a),lower(b) from t1;
lower(a) lower(b)
aaa bbb
aaa BBB
select * from t1 where upper(a)='AAA';
a b
aaa bbb
AAA BBB
select * from t1 where lower(a)='aaa';
a b
aaa bbb
AAA BBB
select * from t1 where upper(b)='BBB';
a b
AAA BBB
select * from t1 where lower(b)='bbb';
a b
aaa bbb
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
charset(a) charset(b) charset(binary 'ccc')
latin1 binary latin1
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
latin1_bin binary latin1_bin
drop table t1;
mysql-test/r/ctype_cp1251.result
View file @
11f14e00
drop table if exists t1;
SET NAMES cp1251;
create table t1 (a varchar(10) not null);
insert into t1 values ("a"),("ab"),("abc");
select * from t1;
...
...
@@ -22,3 +23,34 @@ a
b
c
drop table t1;
create table t1 (a char(15) binary, b binary(15));
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
upper(a) upper(b)
AAA bbb
AAA BBB
select lower(a),lower(b) from t1;
lower(a) lower(b)
aaa bbb
aaa BBB
select * from t1 where upper(a)='AAA';
a b
aaa bbb
AAA BBB
select * from t1 where lower(a)='aaa';
a b
aaa bbb
AAA BBB
select * from t1 where upper(b)='BBB';
a b
AAA BBB
select * from t1 where lower(b)='bbb';
a b
aaa bbb
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
charset(a) charset(b) charset(binary 'ccc')
cp1251 binary cp1251
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
cp1251_bin binary cp1251_bin
drop table t1;
mysql-test/t/binary.test
View file @
11f14e00
...
...
@@ -51,3 +51,18 @@ select b from t1 where binary b like '';
select
b
from
t1
group
by
binary
b
like
''
;
select
b
from
t1
having
binary
b
like
''
;
drop
table
t1
;
#
# Test of binary and upper/lower
#
create
table
t1
(
a
char
(
15
)
binary
,
b
binary
(
15
));
insert
into
t1
values
(
'aaa'
,
'bbb'
),(
'AAA'
,
'BBB'
);
select
upper
(
a
),
upper
(
b
)
from
t1
;
select
lower
(
a
),
lower
(
b
)
from
t1
;
select
*
from
t1
where
upper
(
a
)
=
'AAA'
;
select
*
from
t1
where
lower
(
a
)
=
'aaa'
;
select
*
from
t1
where
upper
(
b
)
=
'BBB'
;
select
*
from
t1
where
lower
(
b
)
=
'bbb'
;
select
charset
(
a
),
charset
(
b
),
charset
(
binary
'ccc'
)
from
t1
limit
1
;
select
collation
(
a
),
collation
(
b
),
collation
(
binary
'ccc'
)
from
t1
limit
1
;
drop
table
t1
;
mysql-test/t/ctype_cp1251.test
View file @
11f14e00
...
...
@@ -4,6 +4,8 @@
drop
table
if
exists
t1
;
--
enable_warnings
SET
NAMES
cp1251
;
#
# Test problem with LEFT() (Bug #514)
#
...
...
@@ -15,3 +17,18 @@ select a, left(a,1) as b from t1;
select
a
,
left
(
a
,
1
)
as
b
from
t1
group
by
a
;
SELECT
DISTINCT
RIGHT
(
a
,
1
)
from
t1
;
drop
table
t1
;
#
# Test of binary and upper/lower
#
create
table
t1
(
a
char
(
15
)
binary
,
b
binary
(
15
));
insert
into
t1
values
(
'aaa'
,
'bbb'
),(
'AAA'
,
'BBB'
);
select
upper
(
a
),
upper
(
b
)
from
t1
;
select
lower
(
a
),
lower
(
b
)
from
t1
;
select
*
from
t1
where
upper
(
a
)
=
'AAA'
;
select
*
from
t1
where
lower
(
a
)
=
'aaa'
;
select
*
from
t1
where
upper
(
b
)
=
'BBB'
;
select
*
from
t1
where
lower
(
b
)
=
'bbb'
;
select
charset
(
a
),
charset
(
b
),
charset
(
binary
'ccc'
)
from
t1
limit
1
;
select
collation
(
a
),
collation
(
b
),
collation
(
binary
'ccc'
)
from
t1
limit
1
;
drop
table
t1
;
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