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
8d75510e
Commit
8d75510e
authored
Nov 05, 2008
by
Evgeny Potemkin
Browse files
Options
Browse Files
Download
Plain Diff
Merged fix for the bug#37870.
parents
50baafeb
3c49cb07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
11 deletions
+33
-11
BUILD/SETUP.sh
BUILD/SETUP.sh
+2
-2
mysql-test/r/explain.result
mysql-test/r/explain.result
+14
-2
mysql-test/t/explain.test
mysql-test/t/explain.test
+8
-2
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+9
-5
No files found.
BUILD/SETUP.sh
View file @
8d75510e
...
...
@@ -80,7 +80,7 @@ path=`dirname $0`
.
"
$path
/check-cpu"
export
AM_MAKEFLAGS
AM_MAKEFLAGS
=
"-j
4
"
AM_MAKEFLAGS
=
"-j
6
"
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
...
...
@@ -105,7 +105,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings
=
"
$cxx_warnings
-Wreorder"
cxx_warnings
=
"
$cxx_warnings
-Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags
=
"-O1 -Wuninitialized"
debug_extra_cflags
=
"-O
0 -g3 -gdwarf-2"
#
1 -Wuninitialized"
else
warnings
=
"-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings
=
"
$warnings
"
...
...
mysql-test/r/explain.result
View file @
8d75510e
...
...
@@ -158,15 +158,27 @@ DROP TABLE t1,t2;
#
# Bug#37870: Usage of uninitialized value caused failed assertion.
#
create table t1 (dt datetime not null);
create table t1 (dt datetime not null
, t time not null
);
create table t2 (dt datetime not null);
insert into t1 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1');
insert into t1 values ('2001-01-01 1:1:1', '1:1:1'),
('2001-01-01 1:1:1', '1:1:1');
insert into t2 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1');
flush tables;
EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
dt
flush tables;
EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
dt
2001-01-01 01:01:01
2001-01-01 01:01:01
drop tables t1, t2;
mysql-test/t/explain.test
View file @
8d75510e
...
...
@@ -126,13 +126,19 @@ DROP TABLE t1,t2;
--
echo
#
--
echo
# Bug#37870: Usage of uninitialized value caused failed assertion.
--
echo
#
create
table
t1
(
dt
datetime
not
null
);
create
table
t1
(
dt
datetime
not
null
,
t
time
not
null
);
create
table
t2
(
dt
datetime
not
null
);
insert
into
t1
values
(
'2001-01-01 1:1:1'
),
(
'2001-01-01 1:1:1'
);
insert
into
t1
values
(
'2001-01-01 1:1:1'
,
'1:1:1'
),
(
'2001-01-01 1:1:1'
,
'1:1:1'
);
insert
into
t2
values
(
'2001-01-01 1:1:1'
),
(
'2001-01-01 1:1:1'
);
flush
tables
;
EXPLAIN
SELECT
OUTR
.
dt
FROM
t1
AS
OUTR
WHERE
OUTR
.
dt
IN
(
SELECT
INNR
.
dt
FROM
t2
AS
INNR
WHERE
OUTR
.
dt
IS
NULL
);
flush
tables
;
SELECT
OUTR
.
dt
FROM
t1
AS
OUTR
WHERE
OUTR
.
dt
IN
(
SELECT
INNR
.
dt
FROM
t2
AS
INNR
WHERE
OUTR
.
dt
IS
NULL
);
flush
tables
;
EXPLAIN
SELECT
OUTR
.
dt
FROM
t1
AS
OUTR
WHERE
OUTR
.
dt
IN
(
SELECT
INNR
.
dt
FROM
t2
AS
INNR
WHERE
OUTR
.
t
<
'2005-11-13 7:41:31'
);
flush
tables
;
SELECT
OUTR
.
dt
FROM
t1
AS
OUTR
WHERE
OUTR
.
dt
IN
(
SELECT
INNR
.
dt
FROM
t2
AS
INNR
WHERE
OUTR
.
t
<
'2005-11-13 7:41:31'
);
drop
tables
t1
,
t2
;
# End of 5.0 tests.
sql/item_cmpfunc.cc
View file @
8d75510e
...
...
@@ -413,11 +413,15 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd
->
count_cuted_fields
=
CHECK_FIELD_IGNORE
;
/*
Store the value of the field/constant if it references an outer field because
the call to save_in_field below overrides that value.
Don't save value of the field for EXPLAIN since it's not initialized.
Store the value of the field/constant if it references an outer field
because the call to save_in_field below overrides that value.
Don't save field value if no data has been read yet.
Outer constant values are always saved.
*/
if
(
field_item
->
depended_from
&&
(
!
thd
->
lex
->
describe
||
field_item
->
const_item
()))
bool
save_field_value
=
(
field_item
->
depended_from
&&
(
field_item
->
const_item
()
||
!
(
field
->
table
->
status
&
STATUS_NO_RECORD
)));
if
(
save_field_value
)
orig_field_val
=
field
->
val_int
();
if
(
!
(
*
item
)
->
is_null
()
&&
!
(
*
item
)
->
save_in_field
(
field
,
1
))
{
...
...
@@ -428,7 +432,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
result
=
1
;
// Item was replaced
}
/* Restore the original field value. */
if
(
field_item
->
depended_from
&&
(
!
thd
->
lex
->
describe
||
field_item
->
const_item
())
)
if
(
save_field_value
)
{
result
=
field
->
store
(
orig_field_val
,
TRUE
);
/* orig_field_val must be a valid value that can be restored back. */
...
...
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