mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge from 5.5-merge
This commit is contained in:
@ -720,7 +720,8 @@ CREATE TABLE t2 (a int, b int, primary key (a));
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(100,100);
|
||||
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
SELECT * from t2;
|
||||
a b
|
||||
100 100
|
||||
@ -738,7 +739,8 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(100,100);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
SELECT * from t2;
|
||||
a b
|
||||
100 100
|
||||
@ -746,7 +748,8 @@ COMMIT;
|
||||
BEGIN;
|
||||
INSERT INTO t2 values(101,101);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
SELECT * from t2;
|
||||
a b
|
||||
100 100
|
||||
@ -889,13 +892,13 @@ EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type range
|
||||
type index
|
||||
possible_keys bkey
|
||||
key bkey
|
||||
key_len 5
|
||||
key PRIMARY
|
||||
key_len 4
|
||||
ref NULL
|
||||
rows 16
|
||||
Extra Using where; Using index; Using filesort
|
||||
rows 32
|
||||
Extra Using where
|
||||
SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
|
||||
a b
|
||||
1 2
|
||||
@ -934,12 +937,12 @@ EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type range
|
||||
type index
|
||||
possible_keys bkey
|
||||
key bkey
|
||||
key_len 5
|
||||
ref NULL
|
||||
rows 16
|
||||
rows 32
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
|
||||
a b
|
||||
@ -989,7 +992,7 @@ possible_keys bkey
|
||||
key bkey
|
||||
key_len 5
|
||||
ref const
|
||||
rows 8
|
||||
rows 16
|
||||
Extra Using where; Using index; Using filesort
|
||||
SELECT * FROM t2 WHERE b=1 ORDER BY a;
|
||||
a b c
|
||||
@ -1018,7 +1021,7 @@ possible_keys bkey
|
||||
key bkey
|
||||
key_len 10
|
||||
ref const,const
|
||||
rows 8
|
||||
rows 16
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
|
||||
a b c
|
||||
@ -1047,7 +1050,7 @@ possible_keys bkey
|
||||
key bkey
|
||||
key_len 10
|
||||
ref const,const
|
||||
rows 8
|
||||
rows 16
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
|
||||
a b c
|
||||
@ -1076,7 +1079,7 @@ possible_keys bkey
|
||||
key bkey
|
||||
key_len 10
|
||||
ref const,const
|
||||
rows 8
|
||||
rows 16
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
|
||||
a b c
|
||||
@ -1213,7 +1216,7 @@ possible_keys b
|
||||
key b
|
||||
key_len 5
|
||||
ref const
|
||||
rows 1
|
||||
rows 2
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
|
||||
a b
|
||||
@ -1228,7 +1231,7 @@ possible_keys b
|
||||
key b
|
||||
key_len 5
|
||||
ref const
|
||||
rows 1
|
||||
rows 2
|
||||
Extra Using where; Using index
|
||||
SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
|
||||
a b
|
||||
@ -1372,7 +1375,7 @@ INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
|
||||
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
|
||||
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index t1_b PRIMARY 4 NULL 8 Using where
|
||||
1 SIMPLE t1 range t1_b t1_b 5 NULL 8 Using where
|
||||
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
|
||||
a b c
|
||||
8 1 1
|
||||
@ -1735,7 +1738,7 @@ SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index c3,c2 c2 10 NULL 5
|
||||
2 DERIVED t1 ALL c3,c2 c3 5 5 Using filesort
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 REAL, c2 REAL, c3 REAL, KEY (c3), KEY (c2, c3))
|
||||
ENGINE=InnoDB;
|
||||
@ -1749,7 +1752,7 @@ SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index c3,c2 c2 18 NULL 5
|
||||
2 DERIVED t1 ALL c3,c2 c3 9 5 Using filesort
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 DECIMAL(12,2), c2 DECIMAL(12,2), c3 DECIMAL(12,2),
|
||||
KEY (c3), KEY (c2, c3))
|
||||
@ -1764,7 +1767,7 @@ SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index c3,c2 c2 14 NULL 5
|
||||
2 DERIVED t1 ALL c3,c2 c3 7 5 Using filesort
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
#
|
||||
@ -1871,7 +1874,7 @@ possible_keys b
|
||||
key b
|
||||
key_len 5
|
||||
ref NULL
|
||||
rows 3
|
||||
rows 5
|
||||
Extra Using where; Using index
|
||||
EXPLAIN SELECT c FROM bar WHERE c>2;;
|
||||
id 1
|
||||
@ -2536,7 +2539,7 @@ f1 f2 f3 f4
|
||||
EXPLAIN SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
|
||||
ORDER BY f1 DESC LIMIT 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range f2,f4 f4 1 NULL 11 Using where
|
||||
1 SIMPLE t1 range f2,f4 f4 1 NULL 22 Using where
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#54117 crash in thr_multi_unlock, temporary table
|
||||
@ -2547,6 +2550,64 @@ ALTER TABLE t1 COMMENT 'test';
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#55656: mysqldump can be slower after bug #39653 fix
|
||||
#
|
||||
CREATE TABLE t1 (a INT , b INT, c INT, d INT,
|
||||
KEY (b), PRIMARY KEY (a,b)) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 4
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index
|
||||
DROP INDEX b ON t1;
|
||||
CREATE INDEX b ON t1(a,b);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 8
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index
|
||||
DROP INDEX b ON t1;
|
||||
CREATE INDEX b ON t1(a,b,c);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 13
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index
|
||||
DROP INDEX b ON t1;
|
||||
CREATE INDEX b ON t1(a,b,c,d);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key PRIMARY
|
||||
key_len 8
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index
|
||||
DROP TABLE t1;
|
||||
#
|
||||
#
|
||||
# Bug#55826: create table .. select crashes with when KILL_BAD_DATA
|
||||
# is returned
|
||||
#
|
||||
|
Reference in New Issue
Block a user