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
e44a800d
Commit
e44a800d
authored
Aug 24, 2012
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.2
parents
ed06ba34
60561ae6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
0 deletions
+45
-0
mysql-test/r/case.result
mysql-test/r/case.result
+4
-0
mysql-test/r/compare.result
mysql-test/r/compare.result
+4
-0
mysql-test/t/case.test
mysql-test/t/case.test
+10
-0
mysql-test/t/compare.test
mysql-test/t/compare.test
+8
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+19
-0
No files found.
mysql-test/r/case.result
View file @
e44a800d
...
...
@@ -225,3 +225,7 @@ case t1.f1 when '00:00:00' then 1 end
1
NULL
drop table t1;
CREATE TABLE t1(a YEAR);
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
1
DROP TABLE t1;
mysql-test/r/compare.result
View file @
e44a800d
...
...
@@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
a
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1(a INT ZEROFILL);
SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
1
DROP TABLE t1;
mysql-test/t/case.test
View file @
e44a800d
...
...
@@ -179,3 +179,13 @@ create table t1 (f1 time);
insert
t1
values
(
'00:00:00'
),(
'00:01:00'
);
select
case
t1
.
f1
when
'00:00:00'
then
1
end
from
t1
;
drop
table
t1
;
#
# LP BUG#1001510
# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN
# ELSE CLAUSE
#
CREATE
TABLE
t1
(
a
YEAR
);
SELECT
1
FROM
t1
WHERE
a
=
1
AND
CASE
1
WHEN
a
THEN
1
ELSE
1
END
;
DROP
TABLE
t1
;
mysql-test/t/compare.test
View file @
e44a800d
...
...
@@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
#
# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL
#
CREATE
TABLE
t1
(
a
INT
ZEROFILL
);
SELECT
1
FROM
t1
WHERE
t1
.
a
IN
(
1
,
t1
.
a
)
AND
t1
.
a
=
2
;
DROP
TABLE
t1
;
sql/item_cmpfunc.cc
View file @
e44a800d
...
...
@@ -3007,6 +3007,15 @@ void Item_func_case::fix_length_and_dec()
return
;
}
}
/*
Set cmp_context of all WHEN arguments. This prevents
Item_field::equal_fields_propagator() from transforming a
zerofill argument into a string constant. Such a change would
require rebuilding cmp_items.
*/
for
(
i
=
0
;
i
<
ncases
;
i
+=
2
)
args
[
i
]
->
cmp_context
=
item_cmp_type
(
left_result_type
,
args
[
i
]
->
result_type
());
}
if
(
else_expr_num
==
-
1
||
args
[
else_expr_num
]
->
maybe_null
)
...
...
@@ -3986,6 +3995,16 @@ void Item_func_in::fix_length_and_dec()
}
}
}
/*
Set cmp_context of all arguments. This prevents
Item_field::equal_fields_propagator() from transforming a zerofill integer
argument into a string constant. Such a change would require rebuilding
cmp_itmes.
*/
for
(
arg
=
args
+
1
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
{
arg
[
0
]
->
cmp_context
=
item_cmp_type
(
left_result_type
,
arg
[
0
]
->
result_type
());
}
max_length
=
1
;
}
...
...
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