mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
5.3 merge
This commit is contained in:
commit
9a64d0794c
24 changed files with 262 additions and 274 deletions
|
@ -220,6 +220,10 @@ a d
|
|||
3 11120436154190595086
|
||||
drop table t1, t2;
|
||||
End of 5.0 tests
|
||||
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;
|
||||
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;
|
||||
|
@ -227,7 +231,3 @@ 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;
|
||||
|
|
|
@ -146,19 +146,6 @@ count(*) min(7) max(7)
|
|||
0 NULL NULL
|
||||
drop table t1m, t1i, t2m, t2i;
|
||||
#
|
||||
# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
|
||||
#
|
||||
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
|
||||
KEY(b, c, a(765))) ENGINE=INNODB;
|
||||
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
|
||||
SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
MIN(c)
|
||||
0
|
||||
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #57954: BIT_AND function returns incorrect results when
|
||||
# semijoin=on
|
||||
CREATE TABLE c (
|
||||
|
@ -230,4 +217,18 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
|
|||
member_id_to COUNT(*)
|
||||
518491 2
|
||||
DROP TABLE t1;
|
||||
# End of test BUG#12713907
|
||||
#
|
||||
# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
|
||||
#
|
||||
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
|
||||
KEY(b, c, a(765))) ENGINE=INNODB;
|
||||
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
|
||||
SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
MIN(c)
|
||||
0
|
||||
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by
|
||||
DROP TABLE t1;
|
||||
End of 5.5 tests
|
||||
|
|
|
@ -3056,7 +3056,7 @@ DROP TABLE t1;
|
|||
|
||||
End of 5.1 tests.
|
||||
#
|
||||
# LP bug#1001500 Crash on the second execution of the PS for
|
||||
# lp:1001500 Crash on the second execution of the PS for
|
||||
# a query with degenerated conjunctive condition
|
||||
# (see also mysql bug#12582849)
|
||||
#
|
||||
|
@ -3996,108 +3996,4 @@ Handler_read_rnd_deleted 0
|
|||
Handler_read_rnd_next 0
|
||||
deallocate prepare st;
|
||||
drop table t1;
|
||||
#
|
||||
# LP bug#993459 Execution of PS for a query with GROUP BY
|
||||
# returns wrong result (see also mysql bug#13805127)
|
||||
#
|
||||
PREPARE s1 FROM
|
||||
"
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2
|
||||
";
|
||||
|
||||
SET @x = 1;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 3 1
|
||||
2012-03-01 01:99345900:00 2 1
|
||||
2012-03-01 02:00:00 3 1
|
||||
|
||||
EXECUTE s1;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 2 1
|
||||
2012-03-01 01:00:00 3 1
|
||||
2012-03-01 02:00:00 3 1
|
||||
|
||||
SET @x = 2;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 2 1
|
||||
|
||||
EXECUTE s1;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 2 1
|
||||
|
||||
SET @x = 1;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 2 1
|
||||
2012-03-01 01:00:00 3 1
|
||||
2012-03-01 02:00:00 3 1
|
||||
|
||||
EXECUTE s1;
|
||||
c1 c2 count(c3)
|
||||
2012-03-01 01:00:00 2 1
|
||||
2012-03-01 01:00:00 3 1
|
||||
2012-03-01 02:00:00 3 1
|
||||
DEALLOCATE PREPARE s1;
|
||||
# End of 5.3 tests
|
||||
|
|
|
@ -7811,9 +7811,12 @@ DROP FUNCTION f1;
|
|||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
# LP bug#993459 Execution of PS for a query with GROUP BY
|
||||
# lp:993459 Execution of PS for a query with GROUP BY
|
||||
# returns wrong result (see also mysql bug#13805127)
|
||||
#
|
||||
|
||||
# Bug#13805127: Stored program cache produces wrong result in same THD
|
||||
|
||||
CREATE PROCEDURE p1(x INT UNSIGNED)
|
||||
BEGIN
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
|
@ -7850,7 +7853,7 @@ c1 c2 count(c3)
|
|||
2012-03-01 02:00:00 3 1
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# LP bug#1002157 : testing stored function
|
||||
# lp:1002157 : testing stored function
|
||||
# bug#62125 result for null incorrectly yields 1292 warning.
|
||||
#
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
|
|
|
@ -6612,7 +6612,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
min_a a
|
||||
drop table t1;
|
||||
#
|
||||
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# MDEV-367: Different results with and without subquery_cache on
|
||||
# a query with a constant NOT IN condition
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# precomputed and thus not part of optimization
|
||||
#
|
||||
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
|
||||
|
@ -6806,5 +6832,3 @@ Table_schema Table_name Index_name Rows_read
|
|||
test t2 b 1
|
||||
set global userstat=@tmp_mdev410;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
# return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
|
|
|
@ -6611,7 +6611,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
min_a a
|
||||
drop table t1;
|
||||
#
|
||||
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# MDEV-367: Different results with and without subquery_cache on
|
||||
# a query with a constant NOT IN condition
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# precomputed and thus not part of optimization
|
||||
#
|
||||
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
|
||||
|
@ -6804,8 +6830,6 @@ Table_schema Table_name Index_name Rows_read
|
|||
test t2 b 1
|
||||
set global userstat=@tmp_mdev410;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
# return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
set optimizer_switch=default;
|
||||
select @@optimizer_switch like '%materialization=on%';
|
||||
@@optimizer_switch like '%materialization=on%'
|
||||
|
|
|
@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
min_a a
|
||||
drop table t1;
|
||||
#
|
||||
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# MDEV-367: Different results with and without subquery_cache on
|
||||
# a query with a constant NOT IN condition
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# precomputed and thus not part of optimization
|
||||
#
|
||||
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
|
||||
|
@ -6801,6 +6827,4 @@ Table_schema Table_name Index_name Rows_read
|
|||
test t2 b 1
|
||||
set global userstat=@tmp_mdev410;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
# return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
set @optimizer_switch_for_subselect_test=null;
|
||||
|
|
|
@ -6618,7 +6618,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
min_a a
|
||||
drop table t1;
|
||||
#
|
||||
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# MDEV-367: Different results with and without subquery_cache on
|
||||
# a query with a constant NOT IN condition
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# precomputed and thus not part of optimization
|
||||
#
|
||||
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
|
||||
|
@ -6812,8 +6838,6 @@ Table_schema Table_name Index_name Rows_read
|
|||
test t2 b 1
|
||||
set global userstat=@tmp_mdev410;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
# return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
set optimizer_switch=default;
|
||||
select @@optimizer_switch like '%subquery_cache=on%';
|
||||
@@optimizer_switch like '%subquery_cache=on%'
|
||||
|
|
|
@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
min_a a
|
||||
drop table t1;
|
||||
#
|
||||
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# MDEV-367: Different results with and without subquery_cache on
|
||||
# a query with a constant NOT IN condition
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
a
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
|
||||
1 NULL
|
||||
2 NULL
|
||||
3 NULL
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
# precomputed and thus not part of optimization
|
||||
#
|
||||
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
|
||||
|
@ -6801,7 +6827,5 @@ Table_schema Table_name Index_name Rows_read
|
|||
test t2 b 1
|
||||
set global userstat=@tmp_mdev410;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
# return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
set @optimizer_switch_for_subselect_test=null;
|
||||
set @join_cache_level_for_subselect_test=NULL;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
if (`select plugin_auth_version <= "1.1.8-26.0" from information_schema.plugins where plugin_name='innodb'`)
|
||||
if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`)
|
||||
{
|
||||
--skip Not fixed in XtraDB 1.1.8-26.0 or earlier
|
||||
--skip Not fixed in XtraDB 1.0.17-13.01 or earlier
|
||||
}
|
||||
|
||||
create table t1 (
|
||||
|
|
|
@ -174,6 +174,16 @@ drop table t1, t2;
|
|||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# lp: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;
|
||||
|
||||
#
|
||||
# lp:839387 Assertion `(Item_result)i != TIME_RESULT' failed with CASE + datetime
|
||||
#
|
||||
|
@ -183,12 +193,3 @@ 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;
|
||||
|
|
|
@ -84,20 +84,6 @@ select count(*), min(7), max(7) from t2m, t1i;
|
|||
|
||||
drop table t1m, t1i, t2m, t2i;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
|
||||
KEY(b, c, a(765))) ENGINE=INNODB;
|
||||
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
|
||||
|
||||
SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #57954: BIT_AND function returns incorrect results when
|
||||
--echo # semijoin=on
|
||||
|
@ -173,4 +159,19 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of test BUG#12713907
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
|
||||
KEY(b, c, a(765))) ENGINE=INNODB;
|
||||
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
|
||||
|
||||
SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.5 tests
|
||||
|
|
|
@ -3125,7 +3125,7 @@ DROP TABLE t1;
|
|||
--echo End of 5.1 tests.
|
||||
|
||||
--echo #
|
||||
--echo # LP bug#1001500 Crash on the second execution of the PS for
|
||||
--echo # lp:1001500 Crash on the second execution of the PS for
|
||||
--echo # a query with degenerated conjunctive condition
|
||||
--echo # (see also mysql bug#12582849)
|
||||
--echo #
|
||||
|
@ -3572,94 +3572,4 @@ show status like '%Handler_read%';
|
|||
deallocate prepare st;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # LP bug#993459 Execution of PS for a query with GROUP BY
|
||||
--echo # returns wrong result (see also mysql bug#13805127)
|
||||
--echo #
|
||||
|
||||
PREPARE s1 FROM
|
||||
"
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2
|
||||
";
|
||||
|
||||
--echo
|
||||
SET @x = 1;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
--echo
|
||||
EXECUTE s1;
|
||||
|
||||
--echo
|
||||
SET @x = 2;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
--echo
|
||||
EXECUTE s1;
|
||||
|
||||
--echo
|
||||
SET @x = 1;
|
||||
SELECT c1, t2.c2, count(c3)
|
||||
FROM
|
||||
(
|
||||
SELECT 3 as c2 FROM dual WHERE @x = 1
|
||||
UNION
|
||||
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
|
||||
) AS t1,
|
||||
(
|
||||
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
|
||||
UNION
|
||||
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
|
||||
) AS t2
|
||||
WHERE t2.c2 = t1.c2
|
||||
GROUP BY c1, c2;
|
||||
--echo
|
||||
EXECUTE s1;
|
||||
|
||||
DEALLOCATE PREPARE s1;
|
||||
|
||||
--echo # End of 5.3 tests
|
||||
|
|
|
@ -9111,9 +9111,14 @@ DROP FUNCTION f1;
|
|||
--echo # ------------------------------------------------------------------
|
||||
|
||||
--echo #
|
||||
--echo # LP bug#993459 Execution of PS for a query with GROUP BY
|
||||
--echo # lp:993459 Execution of PS for a query with GROUP BY
|
||||
--echo # returns wrong result (see also mysql bug#13805127)
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo # Bug#13805127: Stored program cache produces wrong result in same THD
|
||||
--echo
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE PROCEDURE p1(x INT UNSIGNED)
|
||||
|
@ -9147,7 +9152,7 @@ CALL p1(1);
|
|||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # LP bug#1002157 : testing stored function
|
||||
--echo # lp:1002157 : testing stored function
|
||||
--echo # bug#62125 result for null incorrectly yields 1292 warning.
|
||||
--echo #
|
||||
|
||||
|
|
|
@ -5576,7 +5576,28 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
|
|||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
--echo # MDEV-367: Different results with and without subquery_cache on
|
||||
--echo # a query with a constant NOT IN condition
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
|
||||
set @mdev367_optimizer_switch = @@optimizer_switch;
|
||||
|
||||
set optimizer_switch = 'subquery_cache=on';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
|
||||
set optimizer_switch = 'subquery_cache=off';
|
||||
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
|
||||
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
|
||||
set optimizer_switch=@mdev367_optimizer_switch;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
|
||||
--echo # precomputed and thus not part of optimization
|
||||
--echo #
|
||||
|
||||
|
@ -5721,5 +5742,3 @@ set global userstat=@tmp_mdev410;
|
|||
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
--echo # return optimizer switch changed in the beginning of this test
|
||||
set optimizer_switch=@subselect_tmp;
|
||||
|
|
|
@ -819,7 +819,9 @@ table_map Item_subselect::used_tables() const
|
|||
|
||||
bool Item_subselect::const_item() const
|
||||
{
|
||||
return thd->lex->context_analysis_only ? FALSE : const_item_cache;
|
||||
return (thd->lex->context_analysis_only ?
|
||||
FALSE :
|
||||
forced_const || const_item_cache);
|
||||
}
|
||||
|
||||
Item *Item_subselect::get_tmp_table_item(THD *thd_arg)
|
||||
|
@ -1272,7 +1274,7 @@ bool Item_singlerow_subselect::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
|
|||
else
|
||||
{
|
||||
reset();
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1538,6 +1540,10 @@ double Item_in_subselect::val_real()
|
|||
*/
|
||||
DBUG_ASSERT(0);
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (forced_const)
|
||||
return value;
|
||||
DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) ||
|
||||
! engine->is_executed());
|
||||
null_value= was_null= FALSE;
|
||||
if (exec())
|
||||
{
|
||||
|
@ -1558,6 +1564,10 @@ longlong Item_in_subselect::val_int()
|
|||
*/
|
||||
DBUG_ASSERT(0);
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (forced_const)
|
||||
return value;
|
||||
DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) ||
|
||||
! engine->is_executed());
|
||||
null_value= was_null= FALSE;
|
||||
if (exec())
|
||||
{
|
||||
|
@ -1578,6 +1588,10 @@ String *Item_in_subselect::val_str(String *str)
|
|||
*/
|
||||
DBUG_ASSERT(0);
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (forced_const)
|
||||
goto value_is_ready;
|
||||
DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) ||
|
||||
! engine->is_executed());
|
||||
null_value= was_null= FALSE;
|
||||
if (exec())
|
||||
{
|
||||
|
@ -1589,6 +1603,7 @@ String *Item_in_subselect::val_str(String *str)
|
|||
null_value= TRUE;
|
||||
return 0;
|
||||
}
|
||||
value_is_ready:
|
||||
str->set((ulonglong)value, &my_charset_bin);
|
||||
return str;
|
||||
}
|
||||
|
@ -1599,6 +1614,8 @@ bool Item_in_subselect::val_bool()
|
|||
DBUG_ASSERT(fixed == 1);
|
||||
if (forced_const)
|
||||
return value;
|
||||
DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) ||
|
||||
! engine->is_executed());
|
||||
null_value= was_null= FALSE;
|
||||
if (exec())
|
||||
{
|
||||
|
@ -1617,6 +1634,10 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value)
|
|||
method should not be used
|
||||
*/
|
||||
DBUG_ASSERT(0);
|
||||
if (forced_const)
|
||||
goto value_is_ready;
|
||||
DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) ||
|
||||
! engine->is_executed());
|
||||
null_value= was_null= FALSE;
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (exec())
|
||||
|
@ -1626,6 +1647,7 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value)
|
|||
}
|
||||
if (was_null && !value)
|
||||
null_value= TRUE;
|
||||
value_is_ready:
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, value, 0, decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
@ -3176,6 +3198,8 @@ int subselect_single_select_engine::exec()
|
|||
tab->read_record.read_record= tab->save_read_record;
|
||||
}
|
||||
executed= 1;
|
||||
if (!(uncacheable() & ~UNCACHEABLE_EXPLAIN))
|
||||
item->make_const();
|
||||
thd->where= save_where;
|
||||
thd->lex->current_select= save_select;
|
||||
DBUG_RETURN(join->error || thd->is_fatal_error || thd->is_error());
|
||||
|
|
|
@ -863,7 +863,7 @@ int query_error_code(THD *thd, bool not_killed);
|
|||
uint purge_log_get_error_code(int res);
|
||||
|
||||
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
|
||||
void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
void sql_print_error(const char *format, ...);
|
||||
void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
void sql_print_information(const char *format, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
|
|
|
@ -4295,6 +4295,16 @@ bool event_checksum_test(uchar *buf, ulong event_len, uint8 alg);
|
|||
uint8 get_checksum_alg(const char* buf, ulong len);
|
||||
extern TYPELIB binlog_checksum_typelib;
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
/**
|
||||
The function is called by slave applier in case there are
|
||||
active table filtering rules to force gathering events associated
|
||||
with Query-log-event into an array to execute
|
||||
them once the fate of the Query is determined for execution.
|
||||
*/
|
||||
bool slave_execute_deferred_events(THD *thd);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@} (end of group Replication)
|
||||
*/
|
||||
|
|
|
@ -15,11 +15,10 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "rpl_utility.h"
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
#include "unireg.h" // REQUIRED by later includes
|
||||
#include "rpl_rli.h"
|
||||
#include "log_event.h"
|
||||
|
||||
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
|
||||
#include "rpl_rli.h"
|
||||
#include "sql_select.h"
|
||||
|
||||
/**
|
||||
|
@ -954,7 +953,6 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *
|
|||
target_table->s->table_name.str);
|
||||
DBUG_RETURN(conv_table);
|
||||
}
|
||||
|
||||
#endif /* MYSQL_CLIENT */
|
||||
|
||||
table_def::table_def(unsigned char *types, ulong size,
|
||||
|
@ -1115,7 +1113,6 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
|
|||
return DBUG_EVALUATE_IF("simulate_checksum_test_failure", TRUE, res);
|
||||
}
|
||||
|
||||
|
||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||
|
||||
Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL)
|
||||
|
|
|
@ -4159,7 +4159,6 @@ bool LEX::is_partition_management() const
|
|||
alter_info.flags == ALTER_REORGANIZE_PARTITION));
|
||||
}
|
||||
|
||||
|
||||
#ifdef MYSQL_SERVER
|
||||
uint binlog_unsafe_map[256];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2011, Monty Program Ab
|
||||
Copyright (c) 2008, 2012, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -11904,9 +11904,9 @@ static int compare_fields_by_table_order(Item *field1,
|
|||
bool outer_ref= 0;
|
||||
Item_field *f1= (Item_field *) (field1->real_item());
|
||||
Item_field *f2= (Item_field *) (field2->real_item());
|
||||
if (f1->const_item())
|
||||
if (field1->const_item() || f1->const_item())
|
||||
return 1;
|
||||
if (f2->const_item())
|
||||
if (field2->const_item() || f2->const_item())
|
||||
return -1;
|
||||
if (f2->used_tables() & OUTER_REF_TABLE_BIT)
|
||||
{
|
||||
|
|
|
@ -621,6 +621,8 @@ bool st_select_lex_unit::exec()
|
|||
if (executed && !uncacheable && !describe)
|
||||
DBUG_RETURN(FALSE);
|
||||
executed= 1;
|
||||
if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item)
|
||||
item->make_const();
|
||||
|
||||
saved_error= optimize();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ IF(MSVC_VERSION EQUAL 1400)
|
|||
ELSEIF(MSVC_VERSION EQUAL 1500)
|
||||
SET(WIX35_MSVC_SUFFIX "_2008")
|
||||
SET(WIX36_MSVC_SUFFIX "VS2008")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1600)
|
||||
ELSEIF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
|
||||
SET(WIX35_MSVC_SUFFIX "_2010")
|
||||
SET(WIX36_MSVC_SUFFIX "VS2010")
|
||||
ELSE()
|
||||
|
|
Loading…
Add table
Reference in a new issue