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
5f242d08
Commit
5f242d08
authored
Aug 15, 2006
by
gkodinov/kgeorge@rakia.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B21159-5.0-opt
parents
04d86b3f
c606c63f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
mysql-test/r/compare.result
mysql-test/r/compare.result
+7
-0
mysql-test/t/compare.test
mysql-test/t/compare.test
+9
-0
sql/sql_select.cc
sql/sql_select.cc
+16
-1
No files found.
mysql-test/r/compare.result
View file @
5f242d08
...
...
@@ -42,3 +42,10 @@ CHAR(31) = '' '' = CHAR(31)
SELECT CHAR(30) = '', '' = CHAR(30);
CHAR(30) = '' '' = CHAR(30)
0 0
create table t1 (a tinyint(1),b binary(1));
insert into t1 values (0x01,0x01);
select * from t1 where a=b;
a b
select * from t1 where a=b and b=0x01;
a b
drop table if exists t1;
mysql-test/t/compare.test
View file @
5f242d08
...
...
@@ -37,3 +37,12 @@ SELECT CHAR(31) = '', '' = CHAR(31);
SELECT
CHAR
(
30
)
=
''
,
''
=
CHAR
(
30
);
# End of 4.1 tests
#
#Bug #21159: Optimizer: wrong result after AND with different data types
#
create
table
t1
(
a
tinyint
(
1
),
b
binary
(
1
));
insert
into
t1
values
(
0x01
,
0x01
);
select
*
from
t1
where
a
=
b
;
select
*
from
t1
where
a
=
b
and
b
=
0x01
;
drop
table
if
exists
t1
;
sql/sql_select.cc
View file @
5f242d08
...
...
@@ -6499,8 +6499,23 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal)
field_item
=
(
Item_field
*
)
right_item
;
const_item
=
left_item
;
}
/*
Disable const propagation for Item_hex_string.
This must be done because Item_hex_string->val_int() is not
the same as (Item_hex_string->val_str() in BINARY column)->val_int().
We cannot simply disable the replacement in a particular context (
e.g. <bin_col> = <int_col> AND <bin_col> = <hex_string>) since
Items don't know the context they are in and there are functions like
IF (<hex_string>, 'yes', 'no').
Note that this will disable some valid cases as well
(e.g. : <bin_col> = <hex_string> AND <bin_col2> = <bin_col>) but
there's no way to distinguish the valid cases without having the
Item's parent say something like : Item->set_context(Item::STRING_RESULT)
and have all the Items that contain other Items do that consistently.
*/
if
(
const_item
&&
field_item
->
result_type
()
==
const_item
->
result_type
())
field_item
->
result_type
()
==
const_item
->
result_type
()
&&
const_item
->
type
()
!=
Item
::
VARBIN_ITEM
)
{
bool
copyfl
;
...
...
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