mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.3->5.5 merge
This commit is contained in:
@ -5302,4 +5302,24 @@ INSERT INTO t2 VALUES (3),(4);
|
||||
SELECT * FROM t1, t2 WHERE a=3 AND a=b;
|
||||
a b
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Bug mdev-4250: wrong transformation of WHERE condition with OR
|
||||
#
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, a int);
|
||||
INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0);
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
pk a
|
||||
EXPLAIN EXTENDED
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0))
|
||||
DROP TABLE t1;
|
||||
SELECT * FROM mysql.time_zone
|
||||
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
|
||||
AND Time_zone_id = Time_zone_id
|
||||
OR Time_zone_id <> Time_zone_id )
|
||||
AND Use_leap_seconds <> 'N';
|
||||
Time_zone_id Use_leap_seconds
|
||||
End of 5.3 tests
|
||||
|
@ -5313,6 +5313,26 @@ INSERT INTO t2 VALUES (3),(4);
|
||||
SELECT * FROM t1, t2 WHERE a=3 AND a=b;
|
||||
a b
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Bug mdev-4250: wrong transformation of WHERE condition with OR
|
||||
#
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, a int);
|
||||
INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0);
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
pk a
|
||||
EXPLAIN EXTENDED
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0))
|
||||
DROP TABLE t1;
|
||||
SELECT * FROM mysql.time_zone
|
||||
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
|
||||
AND Time_zone_id = Time_zone_id
|
||||
OR Time_zone_id <> Time_zone_id )
|
||||
AND Use_leap_seconds <> 'N';
|
||||
Time_zone_id Use_leap_seconds
|
||||
End of 5.3 tests
|
||||
set join_cache_level=default;
|
||||
show variables like 'join_cache_level';
|
||||
|
@ -5302,4 +5302,24 @@ INSERT INTO t2 VALUES (3),(4);
|
||||
SELECT * FROM t1, t2 WHERE a=3 AND a=b;
|
||||
a b
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Bug mdev-4250: wrong transformation of WHERE condition with OR
|
||||
#
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, a int);
|
||||
INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0);
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
pk a
|
||||
EXPLAIN EXTENDED
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0))
|
||||
DROP TABLE t1;
|
||||
SELECT * FROM mysql.time_zone
|
||||
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
|
||||
AND Time_zone_id = Time_zone_id
|
||||
OR Time_zone_id <> Time_zone_id )
|
||||
AND Use_leap_seconds <> 'N';
|
||||
Time_zone_id Use_leap_seconds
|
||||
End of 5.3 tests
|
||||
|
@ -1854,3 +1854,18 @@ a
|
||||
a
|
||||
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# MDEV-4241: Assertion failure: scale >= 0 && precision > 0 &&
|
||||
# scale <= precision in decimal_bin_size
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
f1 enum('1','2','3','4','5')
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SELECT AVG(f1) FROM t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def AVG(f1) 246 7 6 Y 32896 4 63
|
||||
AVG(f1)
|
||||
1.5000
|
||||
drop table t1;
|
||||
|
@ -4460,5 +4460,24 @@ INSERT INTO t2 VALUES (3),(4);
|
||||
SELECT * FROM t1, t2 WHERE a=3 AND a=b;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug mdev-4250: wrong transformation of WHERE condition with OR
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, a int);
|
||||
INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0);
|
||||
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
EXPLAIN EXTENDED
|
||||
SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
SELECT * FROM mysql.time_zone
|
||||
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
|
||||
AND Time_zone_id = Time_zone_id
|
||||
OR Time_zone_id <> Time_zone_id )
|
||||
AND Use_leap_seconds <> 'N';
|
||||
|
||||
--echo End of 5.3 tests
|
||||
|
||||
|
@ -221,3 +221,18 @@ SELECT a FROM t1 WHERE a=0;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-4241: Assertion failure: scale >= 0 && precision > 0 &&
|
||||
--echo # scale <= precision in decimal_bin_size
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
f1 enum('1','2','3','4','5')
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
--enable_metadata
|
||||
SELECT AVG(f1) FROM t1;
|
||||
--disable_metadata
|
||||
drop table t1;
|
||||
|
||||
|
Reference in New Issue
Block a user