1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

merge with 5.5

This commit is contained in:
Sergei Golubchik
2012-11-03 12:28:51 +01:00
210 changed files with 5894 additions and 1460 deletions

View File

@ -97,7 +97,6 @@ INSERT INTO global_suppressions VALUES
("Failed to open log"),
("Failed to open the existing master info file"),
("Forcing shutdown of [0-9]* plugins"),
("Forcing close of thread"),
/*
Due to timing issues, it might be that this warning

View File

@ -1687,6 +1687,7 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b AND t.c = t1.a;
b c a
8 c c
EXPLAIN EXTENDED
SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
@ -1701,6 +1702,7 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b <> 0 AND t.c = t1.a;
b c a
8 c c
INSERT INTO t3 VALUES (100), (200);
EXPLAIN EXTENDED
SELECT t.b, t.c, t1.a
@ -1716,7 +1718,7 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b AND t.c = t1.a;
b c a
NULL NULL c
8 c c
EXPLAIN EXTENDED
SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
@ -1731,7 +1733,7 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b <> 0 AND t.c = t1.a;
b c a
NULL NULL c
8 c c
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1,t2,t3;
#

View File

@ -2867,3 +2867,16 @@ SET @@global.max_allowed_packet:= @tmp_max;
#
# End of 5.5 tests
#
SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
SET @@global.max_allowed_packet=1024*1024*1024;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SELECT CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000)));
CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000)))
NULL
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
SET @@global.max_allowed_packet:= @tmp_max;

View File

@ -16,6 +16,7 @@ INDEX_STATISTICS
INNODB_BUFFER_POOL_PAGES
INNODB_BUFFER_POOL_PAGES_BLOB
INNODB_BUFFER_POOL_PAGES_INDEX
INNODB_CHANGED_PAGES
INNODB_CMP
INNODB_CMPMEM
INNODB_CMPMEM_RESET
@ -88,6 +89,7 @@ INDEX_STATISTICS TABLE_SCHEMA
INNODB_BUFFER_POOL_PAGES page_type
INNODB_BUFFER_POOL_PAGES_BLOB space_id
INNODB_BUFFER_POOL_PAGES_INDEX index_id
INNODB_CHANGED_PAGES space_id
INNODB_CMP page_size
INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
@ -160,6 +162,7 @@ INDEX_STATISTICS TABLE_SCHEMA
INNODB_BUFFER_POOL_PAGES page_type
INNODB_BUFFER_POOL_PAGES_BLOB space_id
INNODB_BUFFER_POOL_PAGES_INDEX index_id
INNODB_CHANGED_PAGES space_id
INNODB_CMP page_size
INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
@ -238,6 +241,7 @@ INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 1
INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 1
INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 1
INNODB_CHANGED_PAGES information_schema.INNODB_CHANGED_PAGES 1
INNODB_CMP information_schema.INNODB_CMP 1
INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
@ -299,6 +303,7 @@ Database: information_schema
| INNODB_BUFFER_POOL_PAGES |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| INNODB_CHANGED_PAGES |
| INNODB_CMP |
| INNODB_CMPMEM |
| INNODB_CMPMEM_RESET |
@ -361,6 +366,7 @@ Database: INFORMATION_SCHEMA
| INNODB_BUFFER_POOL_PAGES |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| INNODB_CHANGED_PAGES |
| INNODB_CMP |
| INNODB_CMPMEM |
| INNODB_CMPMEM_RESET |
@ -411,5 +417,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 57
information_schema 58
mysql 23

View File

@ -5589,4 +5589,52 @@ set join_buffer_size=default;
set join_cache_level=default;
set optimizer_switch=@tmp_optimizer_switch;
DROP TABLE t1,t2,t3;
#
# Bug #1058071: LEFT JOIN using blobs
# (mdev-564) when join buffer size is small
#
CREATE TABLE t1 (
col269 decimal(31,10) unsigned DEFAULT NULL,
col280 multipoint DEFAULT NULL,
col281 tinyint(1) DEFAULT NULL,
col282 time NOT NULL,
col284 datetime DEFAULT NULL,
col286 date DEFAULT NULL,
col287 datetime DEFAULT NULL,
col288 decimal(30,29) DEFAULT NULL,
col291 time DEFAULT NULL,
col292 time DEFAULT NULL
) ENGINE=Aria;
INSERT INTO t1 VALUES
(0.0,PointFromText('POINT(9 0)'),0,'11:24:05','2013-04-14 21:30:28',NULL,'2011-12-20 06:00:34',9.9,'13:04:39',NULL),
(0.0,NULL,127,'05:43:12','2012-09-05 06:15:27','2027-01-01','2011-10-29 10:48:29',0.0,'06:24:05','11:33:37'),
(0.0,NULL,127,'12:54:41','2013-01-12 11:32:58','2011-11-03','2013-01-03 02:00:34',00,'11:54:15','20:19:15'),
(0.0,PointFromText('POINT(9 0)'),0,'19:48:07','2012-07-16 15:45:25','2012-03-25','2013-09-07 17:21:52',0.5,'17:36:54','21:24:19'),
(0.0,PointFromText('POINT(9 0)'),0,'03:43:48','2012-09-28 00:00:00','2012-06-26','2011-11-16 05:01:09',00,'01:25:42','19:30:06'),
(0.0,LineStringFromText('LINESTRING(0 0,9 9,0 0,9 0,0 0)'),127,'11:33:21','2012-03-31 10:29:22','2012-10-10','2012-04-21 19:21:06',NULL,'05:13:22','09:48:34'),
(NULL,PointFromText('POINT(9 0)'),127,'00:00:00','0000-00-00','2012-04-04 21:26:12','2013-03-04',0.0,'12:54:30',NULL),
(NULL,PointFromText('POINT(9 0)'),1,'00:00:00','2013-05-01 22:37:49','2013-06-26','2012-09-22 17:31:03',0.0,'08:09:57','11:15:36');
Warnings:
Note 1265 Data truncated for column 'col286' at row 7
CREATE TABLE t2 (b int) ENGINE=Aria;
INSERT INTO t2 VALUES (NULL);
CREATE TABLE t3 (c int) ENGINE=Aria;
INSERT INTO t3 VALUES (NULL);
set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch = 'outer_join_with_cache=on,join_cache_incremental=on';
set join_buffer_size=128;
EXPLAIN
SELECT 1 AS c FROM t1 NATURAL LEFT JOIN t2 LEFT OUTER JOIN t3 ON 1
GROUP BY elt(t1.col282,1,t1.col280);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
SELECT 1 AS c FROM t1 NATURAL LEFT JOIN t2 LEFT OUTER JOIN t3 ON 1
GROUP BY elt(t1.col282,1,t1.col280);
c
1
set join_buffer_size=default;
set optimizer_switch=@tmp_optimizer_switch;
DROP table t1,t2,t3;
set @@optimizer_switch=@save_optimizer_switch;

View File

@ -318,7 +318,7 @@ LIMIT ROWS EXAMINED 9;
c1
bb
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 10 rows, which exceeds LIMIT ROWS EXAMINED (9). The query result may be incomplete.
Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (9). The query result may be incomplete.
Same as above, without subquery cache
set @@optimizer_switch='subquery_cache=off';
select * from t1
@ -347,7 +347,7 @@ LIMIT ROWS EXAMINED 5;
c1
bb
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete.
Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete.
Subqueries with materialization
set @@optimizer_switch='semijoin=off,in_to_exists=off,materialization=on,subquery_cache=on';
explain

View File

@ -199,7 +199,7 @@ SELECT @@general_log, @@log;
1 1
SET GLOBAL log = 0;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log OFF
@ -230,7 +230,7 @@ SELECT @@slow_query_log, @@log_slow_queries;
0 0
SET GLOBAL log_slow_queries = 0;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SHOW VARIABLES LIKE 'slow_query_log';
Variable_name Value
slow_query_log OFF
@ -283,16 +283,16 @@ SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
deprecated:
SET GLOBAL log = 0;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
SET GLOBAL log_slow_queries = 0;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SET GLOBAL log = DEFAULT;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
SET GLOBAL log_slow_queries = DEFAULT;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
not deprecated:
SELECT @@global.general_log_file INTO @my_glf;
SELECT @@global.slow_query_log_file INTO @my_sqlf;

View File

@ -204,6 +204,10 @@ The following options may be given as the first argument:
-?, --help Display this help and exit.
--ignore-builtin-innodb
Disable initialization of builtin InnoDB plugin
--ignore-db-dirs=name
Specifies a directory to add to the ignore list when
collecting database names from the datadir. Put a blank
argument to reset the list accumulated so far.
--init-connect=name Command(s) that are executed for each new connection
(unless the user has SUPER privilege)
--init-file=name Read SQL commands from this file at startup
@ -979,6 +983,7 @@ general-log FALSE
group-concat-max-len 1024
help TRUE
ignore-builtin-innodb FALSE
ignore-db-dirs
init-connect
init-file (No default value)
init-rpl-role MASTER

View File

@ -44,9 +44,9 @@ ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
SSL error: Unable to get private key from ''
mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get private key
SSL error: Unable to get certificate from ''

View File

@ -1,4 +1,5 @@
drop table if exists t1,t2;
set @@sort_buffer_size=32804;
CREATE TABLE `t1` (
`id` int(11) NOT NULL default '0',
`id2` int(11) NOT NULL default '0',

View File

@ -777,3 +777,14 @@ execute stmt1 ;
prepare stmt1 from ' select * from t5 ' ;
execute stmt1 ;
drop table t1, t5, t9;
#
# testcase for bug#11765413 - Crash with dependent subquery and
# prepared statement
create table t1 (c1 int);
insert into t1 values (1);
prepare stmt1 from "select 1 from t1 where 1=(select 1 from t1 having c1)";
execute stmt1;
1
1
drop prepare stmt1;
drop table t1;

View File

@ -4887,7 +4887,7 @@ CREATE TABLE t5 (f1 int) ;
INSERT INTO t5 VALUES (20),(5);
CREATE TABLE t6(f1 int);
INSERT INTO t6 VALUES (9),(7);
SET SESSION join_buffer_size = 2048;
SET SESSION join_buffer_size = 2176;
EXPLAIN
SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
id select_type table type possible_keys key key_len ref rows Extra
@ -4901,50 +4901,50 @@ SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
f1 f1 f1 f1 f2 f1 f1
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
SET SESSION join_buffer_size = DEFAULT;

View File

@ -4898,7 +4898,7 @@ CREATE TABLE t5 (f1 int) ;
INSERT INTO t5 VALUES (20),(5);
CREATE TABLE t6(f1 int);
INSERT INTO t6 VALUES (9),(7);
SET SESSION join_buffer_size = 2048;
SET SESSION join_buffer_size = 2176;
EXPLAIN
SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
id select_type table type possible_keys key key_len ref rows Extra
@ -4913,48 +4913,48 @@ f1 f1 f1 f1 f2 f1 f1
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7

View File

@ -4887,7 +4887,7 @@ CREATE TABLE t5 (f1 int) ;
INSERT INTO t5 VALUES (20),(5);
CREATE TABLE t6(f1 int);
INSERT INTO t6 VALUES (9),(7);
SET SESSION join_buffer_size = 2048;
SET SESSION join_buffer_size = 2176;
EXPLAIN
SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
id select_type table type possible_keys key key_len ref rows Extra
@ -4901,50 +4901,50 @@ SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
f1 f1 f1 f1 f2 f1 f1
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 9
3 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 20 9
18 9 NULL NULL NULL 20 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 20 7
3 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 20 7
18 9 NULL NULL NULL 20 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 9
3 9 NULL NULL NULL 5 9
7 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 9
18 9 NULL NULL NULL 5 7
3 9 NULL NULL NULL 5 7
7 9 NULL NULL NULL 5 7
18 9 NULL NULL NULL 5 7
SET SESSION join_buffer_size = DEFAULT;

View File

@ -6638,6 +6638,23 @@ a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# MDEV-521 single value subselect transformation problem
#
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
DROP TABLE t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
@ -6847,6 +6864,27 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
a
drop table t1, t2, t3;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));

View File

@ -179,4 +179,23 @@ pk a b
SET optimizer_switch=@tmp_optimizer_switch;
DROP VIEW v1;
DROP TABLE t1,t2,t3;
#
# MDEV-567: Wrong result from a query with correlated subquery if ICP is allowed
#
CREATE TABLE t1 (a int, b int, INDEX idx(a));
INSERT INTO t1 VALUES (9,0), (7,1), (1,9), (7,3), (2,1);
CREATE TABLE t2 (a int, b int, INDEX idx(a));
INSERT INTO t2 VALUES (2,1), (6,4), (7,6), (9,4);
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (1,0), (1,1), (1,3);
SELECT * FROM t3
WHERE a = (SELECT COUNT(DISTINCT t2.b) FROM t1, t2
WHERE t1.a = t2.a AND t2.a BETWEEN 7 AND 9
AND t3.b = t1.b
GROUP BY t1.b);
a b
1 0
1 1
1 3
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect2_test_tmp;

View File

@ -126,7 +126,7 @@ Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 50
Handler_read_rnd_next 41
select 'No key lookups, seq reads: 29= 5 reads from t2 + 4 * 6 reads from t1.' Z;
Z
No key lookups, seq reads: 29= 5 reads from t2 + 4 * 6 reads from t1.

View File

@ -136,7 +136,7 @@ Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 50
Handler_read_rnd_next 41
select 'No key lookups, seq reads: 29= 5 reads from t2 + 4 * 6 reads from t1.' Z;
Z
No key lookups, seq reads: 29= 5 reads from t2 + 4 * 6 reads from t1.

View File

@ -430,7 +430,7 @@ set @old_optimizer_switch = @@session.optimizer_switch,
SET SESSION OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off,mrr=on';
SET SESSION engine_condition_pushdown = 1;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT `time_nokey` G1 FROM t1 WHERE ( `varchar_nokey` , `varchar_key` ) IN (
SELECT `varchar_nokey` , `varchar_nokey` ) AND `varchar_key` >= 'c' HAVING G1 ORDER
BY `pk` ;
@ -438,7 +438,7 @@ G1
set @@session.optimizer_switch = @old_optimizer_switch,
@@session.engine_condition_pushdown = @old_engine_condition_pushdown;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
DROP TABLE t1;
#
# During work with BUG#45863 I had problems with a query that was
@ -625,7 +625,7 @@ SELECT @old_icp:=@@engine_condition_pushdown;
#
SET SESSION engine_condition_pushdown = 'ON';
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT pk
FROM t2
@ -640,7 +640,7 @@ pk
# Restore old value for Index condition pushdown
SET SESSION engine_condition_pushdown=@old_icp;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
DROP TABLE t1,t2;
#
# End of 5.3 tests.
@ -1351,7 +1351,7 @@ ON SUBQUERY2_t3.f2)
GROUP BY t1.f4 ORDER BY t1.f1 LIMIT 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 PRIMARY t1 index NULL f4 5 NULL 11 Using where
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where
2 DEPENDENT SUBQUERY SUBQUERY2_t1 system NULL NULL NULL NULL 1
2 DEPENDENT SUBQUERY SUBQUERY2_t2 index NULL f4 5 NULL 11 Using index
2 DEPENDENT SUBQUERY SUBQUERY2_t3 ALL NULL NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join)

View File

@ -6637,6 +6637,23 @@ a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# MDEV-521 single value subselect transformation problem
#
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
DROP TABLE t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
@ -6845,6 +6862,26 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
a
drop table t1, t2, t3;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));

View File

@ -6633,6 +6633,23 @@ a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# MDEV-521 single value subselect transformation problem
#
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
DROP TABLE t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
@ -6842,6 +6859,27 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
a
drop table t1, t2, t3;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));

View File

@ -6644,6 +6644,23 @@ a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# MDEV-521 single value subselect transformation problem
#
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
DROP TABLE t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
@ -6853,6 +6870,27 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
a
drop table t1, t2, t3;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));

View File

@ -6633,6 +6633,23 @@ a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# MDEV-521 single value subselect transformation problem
#
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
f1
u1
u2
DROP TABLE t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
@ -6842,6 +6859,27 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index
2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
a
drop table t1, t2, t3;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));

View File

@ -538,7 +538,7 @@ Warning 1292 Truncated incorrect read_buffer_size value: '100'
set read_rnd_buffer_size=100;
set global rpl_recovery_rank=100;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@ -1064,7 +1064,7 @@ set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
set global rpl_recovery_rank =@my_rpl_recovery_rank;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global default_storage_engine =@my_storage_engine;

View File

@ -4530,6 +4530,55 @@ WHERE t4.a >= v1.a);
a a
DROP VIEW v1;
DROP TABLE t1,t2,t3,t4;
#
# LP bug #823237: dependent subquery with LEFT JOIN
# referencing view in WHERE
# (duplicate of LP bug #823189)
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 ( b int, d int, e int);
INSERT INTO t2 VALUES (7,8,0);
CREATE TABLE t3 ( c int);
INSERT INTO t3 VALUES (0);
CREATE TABLE t4 (a int, b int, c int);
INSERT INTO t4 VALUES (93,1,0), (95,NULL,0);
CREATE VIEW v4 AS SELECT * FROM t4;
EXPLAIN EXTENDED
SELECT * FROM t3 , t4
WHERE t4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > t4.b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Note 1276 Field or reference 'test.t4.b' of SELECT #2 was resolved in SELECT #1
Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where (`test`.`t4`.`c` <= <expr_cache><`test`.`t4`.`b`>((select 0 from dual where (7 > `test`.`t4`.`b`))))
SELECT * FROM t3 , t4
WHERE t4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > t4.b);
c a b c
0 93 1 0
EXPLAIN EXTENDED
SELECT * FROM t3, v4
WHERE v4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > v4.b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Note 1276 Field or reference 'v4.b' of SELECT #2 was resolved in SELECT #1
Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where (`test`.`t4`.`c` <= <expr_cache><`test`.`t4`.`b`>((select 0 from dual where (7 > `test`.`t4`.`b`))))
SELECT * FROM t3, v4
WHERE v4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > v4.b);
c a b c
0 93 1 0
DROP VIEW v4;
DROP TABLE t1,t2,t3,t4;
drop table if exists t_9801;
drop view if exists v_9801;
create table t_9801 (s1 int);
@ -4730,6 +4779,49 @@ id id bbb iddqd val1
30631 NULL NULL NULL NULL
drop view v2;
drop table t1,t2;
#
# MDEV-589 (LP BUG#1007647) :
# Assertion `vcol_table == 0 || vcol_table == table' failed in
# fill_record(THD*, List<Item>&, List<Item>&, bool)
#
CREATE TABLE t1 (f1 INT, f2 INT);
CREATE TABLE t2 (f1 INT, f2 INT);
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.f1, a2.f2 FROM t1 AS a1, t1 AS a2;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1;
CREATE ALGORITHM=MERGE VIEW v3 AS SELECT a1.f1, a2.f2 FROM t1 AS a1, t2 AS a2;
CREATE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM v3;
INSERT INTO v3 (f1, f2) VALUES (1, 2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v3'
INSERT INTO v1 (f1, f2) VALUES (1, 2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
INSERT INTO v4 (f1, f2) VALUES (1, 2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v4'
INSERT INTO v2 (f1, f2) VALUES (1, 2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v2'
drop view v4,v3,v2,v1;
drop table t1,t2;
#
# MDEV-3799 fix of above bugfix (MDEV-589)
# Wrong result (NULLs instead of real values) with RIGHT JOIN
# in a FROM subquery and derived_merge=on
#
CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4),(6);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (7),(8);
SELECT * FROM (
SELECT * FROM t1 RIGHT JOIN t2 ON f1 = f2
) AS alias;
f1 f2
NULL 7
NULL 8
SELECT * FROM (
SELECT * FROM t2 LEFT JOIN t1 ON f1 = f2
) AS alias;
f2 f1
7 NULL
8 NULL
drop tables t1,t2;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------

View File

@ -95,6 +95,7 @@ PURGE BINARY LOGS TO "master-bin.000006";
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-binlog_xa_recover.test
EOF
--error 0,2006,2013
SET DEBUG_SYNC= "now SIGNAL con4_cont";
connection con4;
--error 2006,2013

View File

@ -1,5 +1,5 @@
source include/have_archive.inc;
source federated.inc;
source suite/federated/include/federated.inc;
connection slave;
@ -54,5 +54,5 @@ connection slave;
DROP TABLE federated.archive_table;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -1,4 +1,4 @@
source federated.inc;
source suite/federated/include/federated.inc;
connection slave;
--disable_warnings
@ -37,5 +37,5 @@ connection slave;
DROP TABLE federated.bug_13118_table;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -4,7 +4,7 @@ if (!$MYSQL_BUG25714)
skip Need bug25714 test program;
}
source federated.inc;
source suite/federated/include/federated.inc;
connection master;
# Disable concurrent inserts to avoid test failures when reading
@ -59,4 +59,4 @@ SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -1,4 +1,4 @@
source federated.inc;
source include/federated.inc;
--echo #
--echo # Bug #32426: FEDERATED query returns corrupt results for ORDER BY
@ -21,4 +21,4 @@ DROP TABLE federated.t1;
connection default;
source federated_cleanup.inc;
source include/federated_cleanup.inc;

View File

@ -9,7 +9,7 @@
--echo # to complete while still indicating a problem. This fix applies to any non-fatal system
--echo # error that occurs during a query against I_S.TABLES.de
--source federated.inc
--source suite/federated/include/federated.inc
--disable_warnings
# Federated database exists
@ -74,4 +74,4 @@ DROP TABLE t1;
--echo # Cleanup
--echo #
--source federated_cleanup.inc
--source suite/federated/include/federated_cleanup.inc

View File

@ -1,4 +1,4 @@
source federated.inc;
source include/federated.inc;
--echo #
--echo # Bug #585688: maridb crashes in federatedx code
@ -49,5 +49,5 @@ DROP TABLE federated.t1;
connection default;
source federated_cleanup.inc;
source include/federated_cleanup.inc;

View File

@ -1,6 +1,6 @@
--source include/have_debug.inc
--source include/long_test.inc
--source federated.inc
--source include/federated.inc
--echo #
--echo # Bug#47525: MySQL crashed (Federated)
@ -37,4 +37,4 @@ DROP TABLE t1;
connection default;
--echo # Federated cleanup
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -4,7 +4,7 @@
# See Bug #40645 Test main.federated_innodb does not always clean up after itself
source include/have_innodb.inc;
source federated.inc;
source suite/federated/include/federated.inc;
#
# Bug#25513 Federated transaction failures
@ -36,4 +36,4 @@ connection slave;
drop table federated.t1;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -4,7 +4,7 @@
source have_federatedx.inc;
source include/have_partition.inc;
source include/have_innodb.inc;
source federated.inc;
source include/federated.inc;
disable_warnings;
drop table if exists t1;
@ -50,4 +50,4 @@ drop table federated.t1_2;
--echo End of 5.1 tests
source federated_cleanup.inc;
source include/federated_cleanup.inc;

View File

@ -4,7 +4,7 @@
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/big_test.inc
-- source federated.inc
-- source include/federated.inc
connection slave;
create database first_db;
@ -343,4 +343,4 @@ drop table t1;
drop server if exists s;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -1,6 +1,6 @@
source have_federatedx.inc;
source include/have_innodb.inc;
source federated.inc;
source suite/federated/include/federated.inc;
connection slave;
DROP TABLE IF EXISTS federated.t1;
@ -36,4 +36,4 @@ INSERT INTO federated.t1 (id, name) VALUES (6, 'fig');
SELECT * FROM federated.t1;
DELETE FROM federated.t1;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -4,7 +4,7 @@
#
--source federated.inc
--source include/federated.inc
--source have_federatedx.inc
connection default;
@ -1999,4 +1999,4 @@ connection slave;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
source federated_cleanup.inc;
source suite/federated/include/federated_cleanup.inc;

View File

@ -0,0 +1,130 @@
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB;
INSERT INTO infoschema_buffer_test VALUES(9);
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and PAGE_TYPE="index";
TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
test/infoschema_buffer_test GEN_CLUST_INDEX 1 29 FILE_PAGE INDEX
INSERT INTO infoschema_buffer_test VALUES(19);
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and PAGE_TYPE="index";
TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
test/infoschema_buffer_test GEN_CLUST_INDEX 2 58 FILE_PAGE INDEX
CREATE INDEX idx ON infoschema_buffer_test(col1);
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index";
TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
test/infoschema_buffer_test idx 2 32 FILE_PAGE INDEX
DROP TABLE infoschema_buffer_test;
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test";
TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id))
ENGINE=INNODB;
CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id),
FOREIGN KEY (parent_id)
REFERENCES infoschema_parent(id)
ON DELETE CASCADE)
ENGINE=INNODB;
SELECT count(*)
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_child" and PAGE_STATE="file_page"
and PAGE_TYPE="index";
count(*)
2
DROP TABLE infoschema_child;
DROP TABLE infoschema_parent;
show create table information_schema.innodb_buffer_page;
Table Create Table
INNODB_BUFFER_PAGE CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE` (
`POOL_ID` bigint(21) unsigned NOT NULL DEFAULT '0',
`BLOCK_ID` bigint(21) unsigned NOT NULL DEFAULT '0',
`SPACE` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGE_NUMBER` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGE_TYPE` varchar(64) DEFAULT NULL,
`FLUSH_TYPE` bigint(21) unsigned NOT NULL DEFAULT '0',
`FIX_COUNT` bigint(21) unsigned NOT NULL DEFAULT '0',
`IS_HASHED` varchar(3) DEFAULT NULL,
`NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
`OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
`ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT '0',
`TABLE_NAME` varchar(1024) DEFAULT NULL,
`INDEX_NAME` varchar(1024) DEFAULT NULL,
`NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT '0',
`DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
`COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGE_STATE` varchar(64) DEFAULT NULL,
`IO_FIX` varchar(64) DEFAULT NULL,
`IS_OLD` varchar(3) DEFAULT NULL,
`FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
show create table information_schema.innodb_buffer_page_lru;
Table Create Table
INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` (
`POOL_ID` bigint(21) unsigned NOT NULL DEFAULT '0',
`LRU_POSITION` bigint(21) unsigned NOT NULL DEFAULT '0',
`SPACE` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGE_NUMBER` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGE_TYPE` varchar(64) DEFAULT NULL,
`FLUSH_TYPE` bigint(21) unsigned NOT NULL DEFAULT '0',
`FIX_COUNT` bigint(21) unsigned NOT NULL DEFAULT '0',
`IS_HASHED` varchar(3) DEFAULT NULL,
`NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
`OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
`ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT '0',
`TABLE_NAME` varchar(1024) DEFAULT NULL,
`INDEX_NAME` varchar(1024) DEFAULT NULL,
`NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT '0',
`DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
`COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
`COMPRESSED` varchar(3) DEFAULT NULL,
`IO_FIX` varchar(64) DEFAULT NULL,
`IS_OLD` varchar(3) DEFAULT NULL,
`FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
show create table information_schema.innodb_buffer_pool_stats;
Table Create Table
INNODB_BUFFER_POOL_STATS CREATE TEMPORARY TABLE `INNODB_BUFFER_POOL_STATS` (
`POOL_ID` bigint(21) unsigned NOT NULL DEFAULT '0',
`POOL_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
`FREE_BUFFERS` bigint(21) unsigned NOT NULL DEFAULT '0',
`DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
`OLD_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
`MODIFIED_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
`PENDING_DECOMPRESS` bigint(21) unsigned NOT NULL DEFAULT '0',
`PENDING_READS` bigint(21) unsigned NOT NULL DEFAULT '0',
`PENDING_FLUSH_LRU` bigint(21) unsigned NOT NULL DEFAULT '0',
`PENDING_FLUSH_LIST` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGES_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGES_NOT_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGES_MADE_YOUNG_RATE` double NOT NULL DEFAULT '0',
`PAGES_MADE_NOT_YOUNG_RATE` double NOT NULL DEFAULT '0',
`NUMBER_PAGES_READ` bigint(21) unsigned NOT NULL DEFAULT '0',
`NUMBER_PAGES_CREATED` bigint(21) unsigned NOT NULL DEFAULT '0',
`NUMBER_PAGES_WRITTEN` bigint(21) unsigned NOT NULL DEFAULT '0',
`PAGES_READ_RATE` double NOT NULL DEFAULT '0',
`PAGES_CREATE_RATE` double NOT NULL DEFAULT '0',
`PAGES_WRITTEN_RATE` double NOT NULL DEFAULT '0',
`NUMBER_PAGES_GET` bigint(21) unsigned NOT NULL DEFAULT '0',
`HIT_RATE` bigint(21) unsigned NOT NULL DEFAULT '0',
`YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT '0',
`NOT_YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT '0',
`NUMBER_PAGES_READ_AHEAD` bigint(21) unsigned NOT NULL DEFAULT '0',
`NUMBER_READ_AHEAD_EVICTED` bigint(21) unsigned NOT NULL DEFAULT '0',
`READ_AHEAD_RATE` double NOT NULL DEFAULT '0',
`READ_AHEAD_EVICTED_RATE` double NOT NULL DEFAULT '0',
`LRU_IO_TOTAL` bigint(21) unsigned NOT NULL DEFAULT '0',
`LRU_IO_CURRENT` bigint(21) unsigned NOT NULL DEFAULT '0',
`UNCOMPRESS_TOTAL` bigint(21) unsigned NOT NULL DEFAULT '0',
`UNCOMPRESS_CURRENT` bigint(21) unsigned NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8

View File

@ -1,11 +1,6 @@
--source include/have_innodb.inc
--source include/have_debug.inc
if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.0.17-13.01 or earlier
}
create table t1 (
rowid int,
f1 int,

View File

@ -0,0 +1,3 @@
--loose-innodb-buffer-pool-stats
--loose-innodb-buffer-page
--loose-innodb-buffer-page-lru

View File

@ -0,0 +1,81 @@
# Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS
# and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
-- source include/have_innodb.inc
if (`select plugin_auth_version <= "1.1.8-29.0" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.1.8-29.0 or earlier
}
-- disable_result_log
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
# How many buffer pools we have
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
# This gives the over all buffer pool size
SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
-- enable_result_log
# Create a table and check its page info behave correctly in the pool
CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB;
INSERT INTO infoschema_buffer_test VALUES(9);
# We should be able to see this table in the buffer pool if we check
# right away
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and PAGE_TYPE="index";
# The NUMBER_RECORDS and DATA_SIZE should check with each insertion
INSERT INTO infoschema_buffer_test VALUES(19);
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and PAGE_TYPE="index";
CREATE INDEX idx ON infoschema_buffer_test(col1);
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test"
and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index";
# Check the buffer after dropping the table
DROP TABLE infoschema_buffer_test;
SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_buffer_test";
# Do one more test
#--replace_regex /'*[0-9]*'/'NUM'/
CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id))
ENGINE=INNODB;
CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id),
FOREIGN KEY (parent_id)
REFERENCES infoschema_parent(id)
ON DELETE CASCADE)
ENGINE=INNODB;
SELECT count(*)
FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
WHERE TABLE_NAME like "%infoschema_child" and PAGE_STATE="file_page"
and PAGE_TYPE="index";
DROP TABLE infoschema_child;
DROP TABLE infoschema_parent;
show create table information_schema.innodb_buffer_page;
show create table information_schema.innodb_buffer_page_lru;
show create table information_schema.innodb_buffer_pool_stats;

View File

@ -4,7 +4,7 @@ create user pam_test;
grant proxy on pam_test to test_pam;
#
# athentication is successful, challenge/pin are ok
# note that current_user() differts from user()
# note that current_user() differs from user()
#
Challenge input first.
Enter: not very secret challenge

View File

@ -26,7 +26,7 @@ EOF
--echo #
--echo # athentication is successful, challenge/pin are ok
--echo # note that current_user() differts from user()
--echo # note that current_user() differs from user()
--echo #
--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_good.txt

View File

@ -16,4 +16,6 @@ reset master;
stop slave;
reset slave;
drop table if exists t;
reset master;
End of the tests
include/rpl_end.inc

View File

@ -65,12 +65,11 @@ reset master;
--connection slave
stop slave;
reset slave;
# The table t may have been created on the slave from binlog. It does not exist
# on the master.
# "May", as it depends on whether the SQL thread had time do do the CREATE
# TABLE before we stopped.
--disable_warnings
# Table was created from binlog, it may not be created if SQL thread is running
# slowly and IO thread reaches incident before SQL thread applies it.
drop table if exists t;
--enable_warnings
reset master;
--echo End of the tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View File

@ -1,6 +1,6 @@
set session debug="L";
Warnings:
Warning 1287 The syntax '@@debug' is deprecated and will be removed in MariaDB 10.1. Please use '@@debug_dbug' instead
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
select @@global.debug="1";
@@global.debug="1"
0

View File

@ -13,26 +13,26 @@ index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_inters
'#--------------------FN_DYNVARS_028_01------------------------#'
SET @@session.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SET @@session.engine_condition_pushdown = DEFAULT;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET @@global.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SET @@global.engine_condition_pushdown = DEFAULT;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
1
'#---------------------FN_DYNVARS_028_02-------------------------#'
SET engine_condition_pushdown = 1;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@engine_condition_pushdown;
@@engine_condition_pushdown
1
@ -44,38 +44,38 @@ SELECT global.engine_condition_pushdown;
ERROR 42S02: Unknown table 'global' in field list
SET session engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET global engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
0
'#--------------------FN_DYNVARS_028_03------------------------#'
SET @@session.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET @@session.engine_condition_pushdown = 1;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
1
SET @@global.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
0
SET @@global.engine_condition_pushdown = 1;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
1
@ -115,16 +115,16 @@ ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '
'#-------------------FN_DYNVARS_028_05----------------------------#'
SET @@global.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SET @@session.engine_condition_pushdown = 1;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown AS res_is_0;
res_is_0
0
SET @@global.engine_condition_pushdown = 0;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown AS res_is_1;
res_is_1
1
@ -159,50 +159,50 @@ ON
'#---------------------FN_DYNVARS_028_08-------------------------#'
SET @@session.engine_condition_pushdown = OFF;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET @@session.engine_condition_pushdown = ON;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
1
SET @@global.engine_condition_pushdown = OFF;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
0
SET @@global.engine_condition_pushdown = ON;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
1
'#---------------------FN_DYNVARS_028_09----------------------#'
SET @@session.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
1
SET @@session.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET @@global.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
1
SET @@global.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
0
@ -215,7 +215,7 @@ select @@session.engine_condition_pushdown,
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
set @@session.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@ -223,7 +223,7 @@ select @@session.engine_condition_pushdown,
1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
set @@session.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@ -231,7 +231,7 @@ select @@session.engine_condition_pushdown,
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
set @@global.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@ -239,7 +239,7 @@ select @@session.engine_condition_pushdown,
0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
set @@global.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@ -271,13 +271,13 @@ select @@session.engine_condition_pushdown,
0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
SET @@session.engine_condition_pushdown = @session_start_value;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@session.engine_condition_pushdown;
@@session.engine_condition_pushdown
0
SET @@global.engine_condition_pushdown = @global_start_value;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MariaDB 10.1. Please use '@@optimizer_switch' instead
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
SELECT @@global.engine_condition_pushdown;
@@global.engine_condition_pushdown
0

View File

@ -0,0 +1,49 @@
select @@ignore_db_dirs;
@@ignore_db_dirs
e,lost+found,.mysqlgui,ignored_db
# Check that SHOW DATABASES ignores all directories from
# @@ignore_db_dirs and all directories with names starting
# with '.'
SHOW DATABASES;
Database
information_schema
#mysql50#.otherdir
mtr
mysql
performance_schema
test
USE ignored_db;
ERROR 42000: Incorrect database name 'ignored_db'
SELECT * FROM ignored_db.t1;
ERROR 42000: Incorrect database name 'ignored_db'
CALL ignored_db.p1();
ERROR 42000: Incorrect database name 'ignored_db'
SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='ignored_db';
COUNT(*)
1
CREATE DATABASE ignored_db;
ERROR 42000: Incorrect database name 'ignored_db'
CREATE DATABASE `lost+found`;
USE `lost+found`;
CREATE TABLE t1(id INT);
INSERT INTO t1 VALUES (1), (2);
SELECT * FROM `lost+found`.t1;
id
1
2
SHOW DATABASES;
Database
information_schema
#mysql50#.otherdir
lost+found
mtr
mysql
performance_schema
test
DROP DATABASE `lost+found`;
SET @@global.ignore_db_dirs = 'aha';
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable
SET @@local.ignore_db_dirs = 'aha';
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable
SET @@ignore_db_dirs = 'aha';
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable

View File

@ -0,0 +1,24 @@
SELECT @@global.innodb_persistent_stats_root_page;
@@global.innodb_persistent_stats_root_page
0
SELECT COUNT(@@global.innodb_persistent_stats_root_page);
COUNT(@@global.innodb_persistent_stats_root_page)
1
SET @@global.innodb_persistent_stats_root_page=100;
ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a read only variable
SELECT @@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
@@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
1
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
COUNT(*)
1
SELECT @@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page;
@@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page
1
SELECT COUNT(@@local.innodb_persistent_stats_root_page);
ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a GLOBAL variable
SELECT COUNT(@@session.innodb_persistent_stats_root_page);
ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a GLOBAL variable

View File

@ -0,0 +1,21 @@
SELECT COUNT(@@GLOBAL.innodb_track_changed_pages);
COUNT(@@GLOBAL.innodb_track_changed_pages)
1
SET @@GLOBAL.innodb_track_changed_pages=1;
ERROR HY000: Variable 'innodb_track_changed_pages' is a read only variable
SELECT @@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_track_changed_pages';
@@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'OFF'
SELECT @@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages;
@@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages
1
SELECT COUNT(@@SESSION.innodb_track_changed_pages);
ERROR HY000: Variable 'innodb_track_changed_pages' is a GLOBAL variable
SELECT COUNT(@@LOCAL.innodb_track_changed_pages);
ERROR HY000: Variable 'innodb_track_changed_pages' is a GLOBAL variable
SELECT innodb_track_changed_pages = @@SESSION.innodb_track_changed_pages;
ERROR 42S22: Unknown column 'innodb_track_changed_pages' in 'field list'

View File

@ -8,10 +8,10 @@ INIT_VALUE
1
SET @@global.log = ON;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
SET global log = 0;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
'#--------------------FN_DYNVARS_062_02-------------------------#'
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@ -20,4 +20,4 @@ VARIABLE_VALUE
OFF
SET @@global.log= @start_log;
Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MariaDB 10.1. Please use '@@general_log' instead
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead

View File

@ -5,20 +5,20 @@ SELECT @start_value;
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.log_slow_queries = DEFAULT;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries = 0;
@@global.log_slow_queries = 0
1
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.log_slow_queries = ON;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
1
SET @@global.log_slow_queries = OFF;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
0
@ -61,7 +61,7 @@ IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
'#---------------------FN_DYNVARS_004_06----------------------#'
SET @@global.log_slow_queries = 0;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
0
@ -72,7 +72,7 @@ IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
1
SET @@global.log_slow_queries = 1;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
1
@ -84,7 +84,7 @@ IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
'#---------------------FN_DYNVARS_004_07----------------------#'
SET @@global.log_slow_queries = TRUE;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
1
@ -95,7 +95,7 @@ IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
1
SET @@global.log_slow_queries = FALSE;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
0
@ -107,7 +107,7 @@ IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
'#---------------------FN_DYNVARS_004_08----------------------#'
SET @@global.log_slow_queries = ON;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@log_slow_queries = @@global.log_slow_queries;
@@log_slow_queries = @@global.log_slow_queries
1
@ -126,7 +126,7 @@ SELECT log_slow_queries = @@session.log_slow_queries;
ERROR 42S22: Unknown column 'log_slow_queries' in 'field list'
SET @@global.log_slow_queries = @start_value;
Warnings:
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MariaDB 10.1. Please use '@@slow_query_log' instead
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
SELECT @@global.log_slow_queries;
@@global.log_slow_queries
1

View File

@ -9,101 +9,101 @@ SELECT @start_session_value;
'#--------------------FN_DYNVARS_090_01-------------------------#'
SET @@global.multi_range_count = 100;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SET @@global.multi_range_count = DEFAULT;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
256
SET @@session.multi_range_count = 200;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SET @@session.multi_range_count = DEFAULT;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
256
'#--------------------FN_DYNVARS_090_02-------------------------#'
SET @@global.multi_range_count = DEFAULT;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count = 256;
@@global.multi_range_count = 256
1
SET @@session.multi_range_count = DEFAULT;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count = 256;
@@session.multi_range_count = 256
1
'#--------------------FN_DYNVARS_090_03-------------------------#'
SET @@global.multi_range_count = 1;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
1
SET @@global.multi_range_count = 60020;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
60020
SET @@global.multi_range_count = 65535;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
65535
SET @@global.multi_range_count = 4294967295;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
4294967295
SET @@global.multi_range_count = 4294967294;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
4294967294
'#--------------------FN_DYNVARS_090_04-------------------------#'
SET @@session.multi_range_count = 1;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
1
SET @@session.multi_range_count = 50050;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
50050
SET @@session.multi_range_count = 65535;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
65535
SET @@session.multi_range_count = 4294967295;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
4294967295
SET @@session.multi_range_count = 4294967294;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
4294967294
'#------------------FN_DYNVARS_090_05-----------------------#'
SET @@global.multi_range_count = 0;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
Warning 1292 Truncated incorrect multi_range_count value: '0'
SELECT @@global.multi_range_count;
@@global.multi_range_count
@ -114,7 +114,7 @@ SELECT @@global.multi_range_count;
4294967295
SET @@global.multi_range_count = -1024;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
Warning 1292 Truncated incorrect multi_range_count value: '-1024'
SELECT @@global.multi_range_count;
@@global.multi_range_count
@ -135,7 +135,7 @@ SELECT @@global.multi_range_count;
4294967295
SET @@session.multi_range_count = 0;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
Warning 1292 Truncated incorrect multi_range_count value: '0'
SELECT @@session.multi_range_count;
@@session.multi_range_count
@ -146,7 +146,7 @@ SELECT @@session.multi_range_count;
4294967295
SET @@session.multi_range_count = -1;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
Warning 1292 Truncated incorrect multi_range_count value: '-1'
SELECT @@session.multi_range_count;
@@session.multi_range_count
@ -178,13 +178,13 @@ WHERE VARIABLE_NAME='multi_range_count';
'#------------------FN_DYNVARS_090_08-----------------------#'
SET @@global.multi_range_count = TRUE;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
1
SET @@global.multi_range_count = FALSE;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
Warning 1292 Truncated incorrect multi_range_count value: '0'
SELECT @@global.multi_range_count;
@@global.multi_range_count
@ -192,14 +192,14 @@ SELECT @@global.multi_range_count;
'#---------------------FN_DYNVARS_090_09----------------------#'
SET @@global.multi_range_count = 10;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@multi_range_count = @@global.multi_range_count;
@@multi_range_count = @@global.multi_range_count
0
'#---------------------FN_DYNVARS_090_10----------------------#'
SET @@multi_range_count = 100;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@multi_range_count = @@local.multi_range_count;
@@multi_range_count = @@local.multi_range_count
1
@ -209,7 +209,7 @@ SELECT @@local.multi_range_count = @@session.multi_range_count;
'#---------------------FN_DYNVARS_090_11----------------------#'
SET multi_range_count = 1;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@multi_range_count;
@@multi_range_count
1
@ -221,13 +221,13 @@ SELECT multi_range_count = @@session.multi_range_count;
ERROR 42S22: Unknown column 'multi_range_count' in 'field list'
SET @@global.multi_range_count = @start_global_value;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@global.multi_range_count;
@@global.multi_range_count
256
SET @@session.multi_range_count = @start_session_value;
Warnings:
Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MariaDB 10.1. Please use '@@mrr_buffer_size' instead
Warning 1287 '@@multi_range_count' is deprecated and will be removed in a future release. Please use '@@mrr_buffer_size' instead
SELECT @@session.multi_range_count;
@@session.multi_range_count
256

View File

@ -5,29 +5,29 @@ SELECT @start_global_value;
'#--------------------FN_DYNVARS_142_01-------------------------#'
SET @@global.rpl_recovery_rank = 500000;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SET @@global.rpl_recovery_rank = DEFAULT;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#--------------------FN_DYNVARS_142_02-------------------------#'
SET @@global.rpl_recovery_rank = 0;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = 1024;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1024
SET @@global.rpl_recovery_rank = 123456789;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
123456789
@ -53,21 +53,21 @@ ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_142_04-----------------------#'
SET @@global.rpl_recovery_rank = -1;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-1'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483648;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483648'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483649;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483649'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
@ -81,7 +81,7 @@ ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
'#------------------FN_DYNVARS_142_05-----------------------#'
SET @@global.rpl_recovery_rank = 3000;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='rpl_recovery_rank';
@ -96,20 +96,20 @@ count(VARIABLE_VALUE)
'#------------------FN_DYNVARS_142_07-----------------------#'
SET @@global.rpl_recovery_rank = TRUE;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1
SET @@global.rpl_recovery_rank = FALSE;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@global.rpl_recovery_rank = 512;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
@@rpl_recovery_rank = @@global.rpl_recovery_rank
1
@ -123,10 +123,10 @@ SELECT @@rpl_recovery_rank;
512
SET global rpl_recovery_rank = 64;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SET @@global.rpl_recovery_rank = @start_global_value;
Warnings:
Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MariaDB 10.1.
Warning 1287 '@@rpl_recovery_rank' is deprecated and will be removed in a future release.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0

View File

@ -5,7 +5,7 @@ SET @session_max_join_size = @@SESSION.max_join_size;
SET @global_max_join_size = @@GLOBAL.max_join_size;
SET SQL_MAX_JOIN_SIZE=9;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20));
CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20));
INSERT INTO t1 VALUES('aa','bb');

View File

@ -22,10 +22,10 @@ VARIABLE_NAME VARIABLE_VALUE
SQL_MAX_JOIN_SIZE 18446744073709551615
set global sql_max_join_size=10;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
set session sql_max_join_size=20;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
select @@global.sql_max_join_size;
@@global.sql_max_join_size
10
@ -55,20 +55,20 @@ select @@sql_big_selects;
0
set sql_max_join_size=cast(-1 as unsigned int);
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
Note 1105 Cast to unsigned converted negative integer to it's positive complement
select @@sql_big_selects;
@@sql_big_selects
1
set sql_max_join_size=100;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
select @@sql_big_selects;
@@sql_big_selects
0
SET @@global.sql_max_join_size = @start_global_value;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
SELECT @@global.sql_max_join_size;
@@global.sql_max_join_size
18446744073709551615

View File

@ -17,7 +17,7 @@ INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_161_01-------------------------#'
SET SESSION sql_max_join_size=9;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
@ -33,7 +33,7 @@ aa4 bb aa4 bb
This should work
SET SESSION sql_max_join_size=DEFAULT;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
DELETE FROM t2 WHERE a = 'aa4';
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
a b a b
@ -45,7 +45,7 @@ This should work
'#----------------------------FN_DYNVARS_136_05-------------------------#'
SET GLOBAL sql_max_join_size = 4;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
** Connecting con_int1 using root **
** Connection con_int1 **
SELECT @@SESSION.sql_max_join_size;
@ -54,7 +54,7 @@ SELECT @@SESSION.sql_max_join_size;
4 Expected
SET SESSION sql_max_join_size = 2;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
** Connecting con_int2 using root **
** Connection con_int2 **
SELECT @@SESSION.sql_max_join_size;
@ -63,7 +63,7 @@ SELECT @@SESSION.sql_max_join_size;
4 Expected
SET SESSION sql_max_join_size = 10;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
** Connection con_int2 **
SELECT @@SESSION.sql_max_join_size;
@@SESSION.sql_max_join_size
@ -82,10 +82,10 @@ SELECT @@GLOBAL.sql_max_join_size;
Disconnecting Connections con_int1, con_int2
SET @@SESSION.sql_max_join_size = @session_max_join_size;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
SET @@GLOBAL.sql_max_join_size = @global_max_join_size ;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MariaDB 10.1. Please use '@@max_join_size' instead
Warning 1287 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
SET @@SESSION.sql_big_selects = @session_sql_big_selects;
DROP TABLE t1;
DROP TABLE t2;

View File

@ -0,0 +1,11 @@
--ignore-db-dir=a
--ignore-db-dir=b
--ignore-db-dir=c
--ignore-db-dir=
--ignore-db-dir=d
--ignore-db-dir x
--ignore-db-dir=
--ignore-db-dir=e
--ignore-db-dir=lost+found
--ignore-db-dir=.mysqlgui
--ignore-db-dir=ignored_db

View File

@ -0,0 +1,38 @@
select @@ignore_db_dirs;
let $MYSQLD_DATADIR= `select @@datadir`;
mkdir $MYSQLD_DATADIR/.mysqlgui;
mkdir $MYSQLD_DATADIR/.otherdir;
mkdir $MYSQLD_DATADIR/lost+found;
mkdir $MYSQLD_DATADIR/ignored_db;
--echo # Check that SHOW DATABASES ignores all directories from
--echo # @@ignore_db_dirs and all directories with names starting
--echo # with '.'
SHOW DATABASES;
--error ER_WRONG_DB_NAME
USE ignored_db;
--error ER_WRONG_DB_NAME
SELECT * FROM ignored_db.t1;
--error ER_WRONG_DB_NAME
CALL ignored_db.p1();
SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='ignored_db';
--error ER_WRONG_DB_NAME
CREATE DATABASE ignored_db;
CREATE DATABASE `lost+found`;
USE `lost+found`;
CREATE TABLE t1(id INT);
INSERT INTO t1 VALUES (1), (2);
SELECT * FROM `lost+found`.t1;
SHOW DATABASES;
DROP DATABASE `lost+found`;
rmdir $MYSQLD_DATADIR/.mysqlgui;
rmdir $MYSQLD_DATADIR/.otherdir;
rmdir $MYSQLD_DATADIR/lost+found;
rmdir $MYSQLD_DATADIR/ignored_db;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.ignore_db_dirs = 'aha';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@local.ignore_db_dirs = 'aha';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@ignore_db_dirs = 'aha';

View File

@ -0,0 +1,26 @@
--source include/have_debug.inc
--source include/have_xtradb.inc
SELECT @@global.innodb_persistent_stats_root_page;
SELECT COUNT(@@global.innodb_persistent_stats_root_page);
# Read-only variable
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.innodb_persistent_stats_root_page=100;
# Check if INFORMATION_SCHEMA agrees with the var
SELECT @@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
# Check if accessing the var without GLOBAL points to the same
SELECT @@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_persistent_stats_root_page);
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@session.innodb_persistent_stats_root_page);

View File

@ -0,0 +1,21 @@
# Tests for innodb_track_changed_pages variable
--source include/have_xtradb.inc
SELECT COUNT(@@GLOBAL.innodb_track_changed_pages);
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_track_changed_pages=1;
SELECT @@GLOBAL.innodb_track_changed_pages = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_track_changed_pages';
SELECT @@innodb_track_changed_pages = @@GLOBAL.innodb_track_changed_pages;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_track_changed_pages);
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@LOCAL.innodb_track_changed_pages);
--error ER_BAD_FIELD_ERROR
SELECT innodb_track_changed_pages = @@SESSION.innodb_track_changed_pages;

View File

@ -1506,3 +1506,14 @@ SET @@global.max_allowed_packet:= @tmp_max;
--echo #
--echo # End of 5.5 tests
--echo #
#
# Bug#11765562 58545:
# EXPORT_SET() CAN BE USED TO MAKE ENTIRE SERVER COMPLETELY UNRESPONSIVE
#
SELECT @tmp_max:= @@global.max_allowed_packet;
SET @@global.max_allowed_packet=1024*1024*1024;
SELECT @@global.max_allowed_packet;
SELECT CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000)));
SET @@global.max_allowed_packet:= @tmp_max;

View File

@ -3587,5 +3587,54 @@ set optimizer_switch=@tmp_optimizer_switch;
DROP TABLE t1,t2,t3;
--echo #
--echo # Bug #1058071: LEFT JOIN using blobs
--echo # (mdev-564) when join buffer size is small
--echo #
CREATE TABLE t1 (
col269 decimal(31,10) unsigned DEFAULT NULL,
col280 multipoint DEFAULT NULL,
col281 tinyint(1) DEFAULT NULL,
col282 time NOT NULL,
col284 datetime DEFAULT NULL,
col286 date DEFAULT NULL,
col287 datetime DEFAULT NULL,
col288 decimal(30,29) DEFAULT NULL,
col291 time DEFAULT NULL,
col292 time DEFAULT NULL
) ENGINE=Aria;
INSERT INTO t1 VALUES
(0.0,PointFromText('POINT(9 0)'),0,'11:24:05','2013-04-14 21:30:28',NULL,'2011-12-20 06:00:34',9.9,'13:04:39',NULL),
(0.0,NULL,127,'05:43:12','2012-09-05 06:15:27','2027-01-01','2011-10-29 10:48:29',0.0,'06:24:05','11:33:37'),
(0.0,NULL,127,'12:54:41','2013-01-12 11:32:58','2011-11-03','2013-01-03 02:00:34',00,'11:54:15','20:19:15'),
(0.0,PointFromText('POINT(9 0)'),0,'19:48:07','2012-07-16 15:45:25','2012-03-25','2013-09-07 17:21:52',0.5,'17:36:54','21:24:19'),
(0.0,PointFromText('POINT(9 0)'),0,'03:43:48','2012-09-28 00:00:00','2012-06-26','2011-11-16 05:01:09',00,'01:25:42','19:30:06'),
(0.0,LineStringFromText('LINESTRING(0 0,9 9,0 0,9 0,0 0)'),127,'11:33:21','2012-03-31 10:29:22','2012-10-10','2012-04-21 19:21:06',NULL,'05:13:22','09:48:34'),
(NULL,PointFromText('POINT(9 0)'),127,'00:00:00','0000-00-00','2012-04-04 21:26:12','2013-03-04',0.0,'12:54:30',NULL),
(NULL,PointFromText('POINT(9 0)'),1,'00:00:00','2013-05-01 22:37:49','2013-06-26','2012-09-22 17:31:03',0.0,'08:09:57','11:15:36');
CREATE TABLE t2 (b int) ENGINE=Aria;
INSERT INTO t2 VALUES (NULL);
CREATE TABLE t3 (c int) ENGINE=Aria;
INSERT INTO t3 VALUES (NULL);
set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch = 'outer_join_with_cache=on,join_cache_incremental=on';
set join_buffer_size=128;
EXPLAIN
SELECT 1 AS c FROM t1 NATURAL LEFT JOIN t2 LEFT OUTER JOIN t3 ON 1
GROUP BY elt(t1.col282,1,t1.col280);
SELECT 1 AS c FROM t1 NATURAL LEFT JOIN t2 LEFT OUTER JOIN t3 ON 1
GROUP BY elt(t1.col282,1,t1.col280);
set join_buffer_size=default;
set optimizer_switch=@tmp_optimizer_switch;
DROP table t1,t2,t3;
# this must be the last command in the file
set @@optimizer_switch=@save_optimizer_switch;

View File

@ -1,7 +1,5 @@
# Can't run test of external client with embedded server
-- source include/not_embedded.inc
# Test lists tables in Information_schema, and InnoDB adds some
-- source include/have_innodb.inc
# Don't test when thread_pool active
--source include/not_threadpool.inc
@ -31,3 +29,14 @@ select "---- -v -v -t ------" as "";
DROP TABLE t1, t2;
--echo End of 5.0 tests
# because of lp:1066512 this test shows xtradb I_S plugins, even when
# xtradb is supposed to be disabled
#
# Bug #19147: mysqlshow INFORMATION_SCHEMA does not work
#
# --exec $MYSQL_SHOW information_schema
# --exec $MYSQL_SHOW INFORMATION_SCHEMA
# --exec $MYSQL_SHOW inf_rmation_schema

View File

@ -74,25 +74,31 @@ drop table t1;
#
--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql
# Handle that openssl gives different error messages from YaSSL.
--replace_regex /error:0000000[15]:lib\(0\):func\(0\):(reason\(1\)|DH lib)/ASN: bad other signature confirmation/
#--replace_regex /error:00000001:lib\(0\):func\(0\):reason\(1\)/ASN: bad other signature confirmation/
--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
#
# Test that we can't open connection to server if we are using
# a blank ca
#
--replace_regex /error:0000000[15]:lib\(0\):func\(0\):(reason\(1\)|DH lib)/ASN: bad other signature confirmation/
#--replace_regex /error:00000001:lib\(0\):func\(0\):reason\(1\)/ASN: bad other signature confirmation/
--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
#
# Test that we can't open connection to server if we are using
# a nonexistent ca file
#
--replace_regex /error:0000000[15]:lib\(0\):func\(0\):(reason\(1\)|DH lib)/ASN: bad other signature confirmation/
#--replace_regex /error:00000001:lib\(0\):func\(0\):reason\(1\)/ASN: bad other signature confirmation/
--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
#
# Test that we can't open connection to server if we are using

View File

@ -1 +0,0 @@
--sort_buffer=32804

View File

@ -7,6 +7,8 @@
drop table if exists t1,t2;
--enable_warnings
set @@sort_buffer_size=32804;
CREATE TABLE `t1` (
`id` int(11) NOT NULL default '0',
`id2` int(11) NOT NULL default '0',

View File

@ -827,6 +827,16 @@ execute stmt1 ;
drop table t1, t5, t9;
--echo #
--echo # testcase for bug#11765413 - Crash with dependent subquery and
--echo # prepared statement
create table t1 (c1 int);
insert into t1 values (1);
prepare stmt1 from "select 1 from t1 where 1=(select 1 from t1 having c1)";
execute stmt1;
drop prepare stmt1;
drop table t1;
##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES #####
#
# 0. You don't have the time to

View File

@ -4174,7 +4174,7 @@ INSERT INTO t5 VALUES (20),(5);
CREATE TABLE t6(f1 int);
INSERT INTO t6 VALUES (9),(7);
SET SESSION join_buffer_size = 2048;
SET SESSION join_buffer_size = 2176;
EXPLAIN
SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;

View File

@ -5596,6 +5596,22 @@ set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
--echo #
--echo # MDEV-521 single value subselect transformation problem
--echo #
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2');
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
# Cleanup
DROP TABLE t1;
--echo # return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
--echo #
--echo # lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
--echo # precomputed and thus not part of optimization
@ -5756,6 +5772,29 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
DROP TABLE t1,t2;
--echo #
--echo # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
--echo #
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (8),(0);
CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'j'),(6,'v');
CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('b'),('c');
EXPLAIN
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
SELECT * FROM t1
WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10;
drop table t1, t2, t3;
--echo #
--echo # MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
--echo #

View File

@ -203,5 +203,24 @@ SET optimizer_switch=@tmp_optimizer_switch;
DROP VIEW v1;
DROP TABLE t1,t2,t3;
--echo #
--echo # MDEV-567: Wrong result from a query with correlated subquery if ICP is allowed
--echo #
CREATE TABLE t1 (a int, b int, INDEX idx(a));
INSERT INTO t1 VALUES (9,0), (7,1), (1,9), (7,3), (2,1);
CREATE TABLE t2 (a int, b int, INDEX idx(a));
INSERT INTO t2 VALUES (2,1), (6,4), (7,6), (9,4);
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (1,0), (1,1), (1,3);
SELECT * FROM t3
WHERE a = (SELECT COUNT(DISTINCT t2.b) FROM t1, t2
WHERE t1.a = t2.a AND t2.a BETWEEN 7 AND 9
AND t3.b = t1.b
GROUP BY t1.b);
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect2_test_tmp;

View File

@ -4381,6 +4381,46 @@ SELECT * FROM v1, t2
DROP VIEW v1;
DROP TABLE t1,t2,t3,t4;
--echo #
--echo # LP bug #823237: dependent subquery with LEFT JOIN
--echo # referencing view in WHERE
--echo # (duplicate of LP bug #823189)
--echo #
CREATE TABLE t1 (a int);
CREATE TABLE t2 ( b int, d int, e int);
INSERT INTO t2 VALUES (7,8,0);
CREATE TABLE t3 ( c int);
INSERT INTO t3 VALUES (0);
CREATE TABLE t4 (a int, b int, c int);
INSERT INTO t4 VALUES (93,1,0), (95,NULL,0);
CREATE VIEW v4 AS SELECT * FROM t4;
EXPLAIN EXTENDED
SELECT * FROM t3 , t4
WHERE t4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > t4.b);
SELECT * FROM t3 , t4
WHERE t4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > t4.b);
EXPLAIN EXTENDED
SELECT * FROM t3, v4
WHERE v4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > v4.b);
SELECT * FROM t3, v4
WHERE v4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d )
WHERE t2.b > v4.b);
DROP VIEW v4;
DROP TABLE t1,t2,t3,t4;
#
# Bug#9801 (Views: imperfect error message)
#
@ -4661,6 +4701,52 @@ create algorithm=MERGE view v2 as select 2 as id, id is null as bbb, id as iddqd
select t1.*, v2.* from t1 left join v2 on t1.id = v2.id;
drop view v2;
drop table t1,t2;
--echo #
--echo # MDEV-589 (LP BUG#1007647) :
--echo # Assertion `vcol_table == 0 || vcol_table == table' failed in
--echo # fill_record(THD*, List<Item>&, List<Item>&, bool)
--echo #
CREATE TABLE t1 (f1 INT, f2 INT);
CREATE TABLE t2 (f1 INT, f2 INT);
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.f1, a2.f2 FROM t1 AS a1, t1 AS a2;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1;
CREATE ALGORITHM=MERGE VIEW v3 AS SELECT a1.f1, a2.f2 FROM t1 AS a1, t2 AS a2;
CREATE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM v3;
--error ER_VIEW_MULTIUPDATE
INSERT INTO v3 (f1, f2) VALUES (1, 2);
--error ER_VIEW_MULTIUPDATE
INSERT INTO v1 (f1, f2) VALUES (1, 2);
--error ER_VIEW_MULTIUPDATE
INSERT INTO v4 (f1, f2) VALUES (1, 2);
--error ER_VIEW_MULTIUPDATE
INSERT INTO v2 (f1, f2) VALUES (1, 2);
drop view v4,v3,v2,v1;
drop table t1,t2;
--echo #
--echo # MDEV-3799 fix of above bugfix (MDEV-589)
--echo # Wrong result (NULLs instead of real values) with RIGHT JOIN
--echo # in a FROM subquery and derived_merge=on
--echo #
CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4),(6);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (7),(8);
SELECT * FROM (
SELECT * FROM t1 RIGHT JOIN t2 ON f1 = f2
) AS alias;
SELECT * FROM (
SELECT * FROM t2 LEFT JOIN t1 ON f1 = f2
) AS alias;
drop tables t1,t2;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.3 tests.
--echo # -----------------------------------------------------------------