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
2ba654fd
Commit
2ba654fd
authored
Jun 10, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coercibility tests for
- equal predicate - LIKE predicate - strcmp() function
parent
3d08cfec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
mysql-test/r/func_test.result
mysql-test/r/func_test.result
+57
-0
mysql-test/t/func_test.test
mysql-test/t/func_test.test
+35
-0
No files found.
mysql-test/r/func_test.result
View file @
2ba654fd
...
@@ -52,6 +52,63 @@ select 10 % 7, 10 mod 7, 10 div 3;
...
@@ -52,6 +52,63 @@ select 10 % 7, 10 mod 7, 10 div 3;
select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
18446744073709551615 18446744073709551615 9223372036854775807
18446744073709551615 18446744073709551615 9223372036854775807
select _koi8r'a' = _koi8r'A';
_koi8r'a' = _koi8r'A'
1
select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci
1
select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin;
_koi8r'a' = _koi8r'A' COLLATE koi8r_bin
0
select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A';
_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'
1
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A';
_koi8r'a' COLLATE koi8r_bin = _koi8r'A'
0
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci;
ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '='
select _koi8r'a' = _latin1'A';
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
select strcmp(_koi8r'a', _koi8r'A');
strcmp(_koi8r'a', _koi8r'A')
0
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci);
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci)
0
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin);
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin)
1
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A');
strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A')
0
select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A');
strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A')
1
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin);
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp'
select strcmp(_koi8r'a', _latin1'A');
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp'
select _koi8r'a' LIKE _koi8r'A';
_koi8r'a' LIKE _koi8r'A'
1
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci;
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci
1
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin;
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin
0
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A';
_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'
1
select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'
0
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
select _koi8r'a' LIKE _latin1'A';
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
0 1
...
...
mysql-test/t/func_test.test
View file @
2ba654fd
...
@@ -20,6 +20,41 @@ select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
...
@@ -20,6 +20,41 @@ select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
select
10
%
7
,
10
mod
7
,
10
div
3
;
select
10
%
7
,
10
mod
7
,
10
div
3
;
select
(
1
<<
64
)
-
1
,
((
1
<<
64
)
-
1
)
DIV
1
,
((
1
<<
64
)
-
1
)
DIV
2
;
select
(
1
<<
64
)
-
1
,
((
1
<<
64
)
-
1
)
DIV
1
,
((
1
<<
64
)
-
1
)
DIV
2
;
#
# Coercibility
#
select
_koi8r
'a'
=
_koi8r
'A'
;
select
_koi8r
'a'
=
_koi8r
'A'
COLLATE
koi8r_general_ci
;
select
_koi8r
'a'
=
_koi8r
'A'
COLLATE
koi8r_bin
;
select
_koi8r
'a'
COLLATE
koi8r_general_ci
=
_koi8r
'A'
;
select
_koi8r
'a'
COLLATE
koi8r_bin
=
_koi8r
'A'
;
--
error
1265
select
_koi8r
'a'
COLLATE
koi8r_bin
=
_koi8r
'A'
COLLATE
koi8r_general_ci
;
--
error
1265
select
_koi8r
'a'
=
_latin1
'A'
;
select
strcmp
(
_koi8r
'a'
,
_koi8r
'A'
);
select
strcmp
(
_koi8r
'a'
,
_koi8r
'A'
COLLATE
koi8r_general_ci
);
select
strcmp
(
_koi8r
'a'
,
_koi8r
'A'
COLLATE
koi8r_bin
);
select
strcmp
(
_koi8r
'a'
COLLATE
koi8r_general_ci
,
_koi8r
'A'
);
select
strcmp
(
_koi8r
'a'
COLLATE
koi8r_bin
,
_koi8r
'A'
);
--
error
1265
select
strcmp
(
_koi8r
'a'
COLLATE
koi8r_general_ci
,
_koi8r
'A'
COLLATE
koi8r_bin
);
--
error
1265
select
strcmp
(
_koi8r
'a'
,
_latin1
'A'
);
select
_koi8r
'a'
LIKE
_koi8r
'A'
;
select
_koi8r
'a'
LIKE
_koi8r
'A'
COLLATE
koi8r_general_ci
;
select
_koi8r
'a'
LIKE
_koi8r
'A'
COLLATE
koi8r_bin
;
select
_koi8r
'a'
COLLATE
koi8r_general_ci
LIKE
_koi8r
'A'
;
select
_koi8r
'a'
COLLATE
koi8r_bin
LIKE
_koi8r
'A'
;
--
error
1265
select
_koi8r
'a'
COLLATE
koi8r_general_ci
LIKE
_koi8r
'A'
COLLATE
koi8r_bin
;
--
error
1265
select
_koi8r
'a'
LIKE
_latin1
'A'
;
#
#
# Wrong usage of functions
# Wrong usage of functions
#
#
...
...
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