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
5d5f3a1e
Commit
5d5f3a1e
authored
Aug 21, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.3->5.5
parents
c97ae6b5
99992f6e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
2 deletions
+64
-2
mysql-test/r/null.result
mysql-test/r/null.result
+30
-0
mysql-test/t/null.test
mysql-test/t/null.test
+28
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+4
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-2
No files found.
mysql-test/r/null.result
View file @
5d5f3a1e
...
...
@@ -343,3 +343,33 @@ Field Type Null Key Default Extra
IFNULL(NULL, b) decimal(1,0) YES NULL
DROP TABLE t1, t2;
# End of 5.0 tests
#
# MDEV-4895 Valgrind warnings (Conditional jump or move depends on uninitialised value) in Field_datetime::get_date on GREATEST(..) IS NULL
#
CREATE TABLE t1 (dt DATETIME NOT NULL);
INSERT INTO t1 VALUES (NOW()),(NOW());
EXPLAIN
SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
dt
DROP TABLE t1;
CREATE TABLE t1 (dt INT NOT NULL);
INSERT INTO t1 VALUES (1),(2);
EXPLAIN
SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
dt
DROP TABLE t1;
CREATE TABLE t1 (dt INT NOT NULL);
INSERT INTO t1 VALUES (1),(2);
EXPLAIN
SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
dt
DROP TABLE t1;
mysql-test/t/null.test
View file @
5d5f3a1e
...
...
@@ -255,3 +255,31 @@ DESCRIBE t2;
DROP
TABLE
t1
,
t2
;
--
echo
# End of 5.0 tests
--
echo
#
--
echo
# MDEV-4895 Valgrind warnings (Conditional jump or move depends on uninitialised value) in Field_datetime::get_date on GREATEST(..) IS NULL
--
echo
#
CREATE
TABLE
t1
(
dt
DATETIME
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
NOW
()),(
NOW
());
EXPLAIN
SELECT
*
FROM
t1
WHERE
concat
(
dt
,
'2012-12-21 12:12:12'
)
IS
NULL
;
SELECT
*
FROM
t1
WHERE
concat
(
dt
,
'2012-12-21 12:12:12'
)
IS
NULL
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
dt
INT
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
concat
(
dt
,
'1'
)
IS
NULL
;
SELECT
*
FROM
t1
WHERE
concat
(
dt
,
'1'
)
IS
NULL
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
dt
INT
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
NOT
(
concat
(
dt
,
'1'
)
IS
NOT
NULL
);
SELECT
*
FROM
t1
WHERE
NOT
(
concat
(
dt
,
'1'
)
IS
NOT
NULL
);
DROP
TABLE
t1
;
sql/item_cmpfunc.cc
View file @
5d5f3a1e
...
...
@@ -4748,6 +4748,8 @@ Item *and_expressions(Item *a, Item *b, Item **org_item)
longlong
Item_func_isnull
::
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
const_item
()
&&
!
args
[
0
]
->
maybe_null
)
return
0
;
return
args
[
0
]
->
is_null
()
?
1
:
0
;
}
...
...
@@ -4755,6 +4757,8 @@ longlong Item_is_not_null_test::val_int()
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ENTER
(
"Item_is_not_null_test::val_int"
);
if
(
const_item
()
&&
!
args
[
0
]
->
maybe_null
)
DBUG_RETURN
(
1
);
if
(
args
[
0
]
->
is_null
())
{
DBUG_PRINT
(
"info"
,
(
"null"
));
...
...
sql/sql_select.cc
View file @
5d5f3a1e
...
...
@@ -13748,7 +13748,7 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
Propagate the newly formed multiple equalities to
the all AND/OR levels of cond
*/
bool
is_simplifiable_cond
=
tru
e
;
bool
is_simplifiable_cond
=
fals
e
;
propagate_new_equalities
(
thd
,
cond
,
cond_equalities
,
cond_equal
->
upper_levels
,
&
is_simplifiable_cond
);
...
...
@@ -13759,7 +13759,7 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
*/
if
(
is_simplifiable_cond
)
{
if
(
!
(
cond
=
remove_eq_conds
(
thd
,
cond
,
cond_value
)))
if
(
!
(
cond
=
internal_
remove_eq_conds
(
thd
,
cond
,
cond_value
)))
return
cond
;
}
}
...
...
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