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
9ad24486
Commit
9ad24486
authored
Aug 23, 2004
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@build.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1
parents
c644595d
b1847f47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
mysql-test/r/binary.result
mysql-test/r/binary.result
+18
-0
mysql-test/t/binary.test
mysql-test/t/binary.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-2
No files found.
mysql-test/r/binary.result
View file @
9ad24486
...
@@ -116,3 +116,21 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
...
@@ -116,3 +116,21 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
collation(a) collation(b) collation(binary 'ccc')
latin1_bin binary latin1_bin
latin1_bin binary latin1_bin
drop table t1;
drop table t1;
create table t1( firstname char(20), lastname char(20));
insert into t1 values ("john","doe"),("John","Doe");
select * from t1 where firstname='john' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and binary 'john' = firstname;
firstname lastname
john doe
select * from t1 where firstname='john' and firstname = binary 'john';
firstname lastname
john doe
select * from t1 where firstname='John' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and firstname like binary 'John';
firstname lastname
John Doe
drop table t1;
mysql-test/t/binary.test
View file @
9ad24486
...
@@ -67,3 +67,16 @@ select * from t1 where lower(b)='bbb';
...
@@ -67,3 +67,16 @@ select * from t1 where lower(b)='bbb';
select
charset
(
a
),
charset
(
b
),
charset
(
binary
'ccc'
)
from
t1
limit
1
;
select
charset
(
a
),
charset
(
b
),
charset
(
binary
'ccc'
)
from
t1
limit
1
;
select
collation
(
a
),
collation
(
b
),
collation
(
binary
'ccc'
)
from
t1
limit
1
;
select
collation
(
a
),
collation
(
b
),
collation
(
binary
'ccc'
)
from
t1
limit
1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug5134: WHERE x = 'bar' AND x LIKE BINARY 'bar' returns wrong results
#
create
table
t1
(
firstname
char
(
20
),
lastname
char
(
20
));
insert
into
t1
values
(
"john"
,
"doe"
),(
"John"
,
"Doe"
);
select
*
from
t1
where
firstname
=
'john'
and
firstname
like
binary
'john'
;
select
*
from
t1
where
firstname
=
'john'
and
binary
'john'
=
firstname
;
select
*
from
t1
where
firstname
=
'john'
and
firstname
=
binary
'john'
;
select
*
from
t1
where
firstname
=
'John'
and
firstname
like
binary
'john'
;
select
*
from
t1
where
firstname
=
'john'
and
firstname
like
binary
'John'
;
drop
table
t1
;
sql/sql_select.cc
View file @
9ad24486
...
@@ -4186,7 +4186,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
...
@@ -4186,7 +4186,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
Item
*
right_item
=
func
->
arguments
()[
1
];
Item
*
right_item
=
func
->
arguments
()[
1
];
Item_func
::
Functype
functype
=
func
->
functype
();
Item_func
::
Functype
functype
=
func
->
functype
();
if
(
right_item
->
eq
(
field
,
0
)
&&
left_item
!=
value
)
if
(
right_item
->
eq
(
field
,
0
)
&&
left_item
!=
value
&&
(
left_item
->
result_type
()
!=
STRING_RESULT
||
value
->
result_type
()
!=
STRING_RESULT
||
left_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
{
Item
*
tmp
=
value
->
new_item
();
Item
*
tmp
=
value
->
new_item
();
if
(
tmp
)
if
(
tmp
)
...
@@ -4204,7 +4207,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
...
@@ -4204,7 +4207,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
func
->
set_cmp_func
();
func
->
set_cmp_func
();
}
}
}
}
else
if
(
left_item
->
eq
(
field
,
0
)
&&
right_item
!=
value
)
else
if
(
left_item
->
eq
(
field
,
0
)
&&
right_item
!=
value
&&
(
right_item
->
result_type
()
!=
STRING_RESULT
||
value
->
result_type
()
!=
STRING_RESULT
||
right_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
{
Item
*
tmp
=
value
->
new_item
();
Item
*
tmp
=
value
->
new_item
();
if
(
tmp
)
if
(
tmp
)
...
...
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