mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.4 into 10.5
FIXME: Part of the MDEV-20699 test is disabled due to nonderterministic result.
This commit is contained in:
@ -224,10 +224,10 @@ SELECT 4;
|
|||||||
END IF ;
|
END IF ;
|
||||||
END"where name = "P1";
|
END"where name = "P1";
|
||||||
show create procedure P1;
|
show create procedure P1;
|
||||||
ERROR HY000: Failed to load routine test.P1 (internal code -6). For more details, run SHOW WARNINGS
|
ERROR 42000: Undeclared variable: foo
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
Error 1327 Undeclared variable: foo
|
Error 1327 Undeclared variable: foo
|
||||||
Error 1457 Failed to load routine test.P1 (internal code -6). For more details, run SHOW WARNINGS
|
Error 1305 PROCEDURE P1 does not exist
|
||||||
drop procedure P1;
|
drop procedure P1;
|
||||||
# End of 10.4 tests
|
# End of 10.4 tests
|
||||||
|
@ -275,7 +275,7 @@ SELECT 4;
|
|||||||
END IF ;
|
END IF ;
|
||||||
END"where name = "P1";
|
END"where name = "P1";
|
||||||
|
|
||||||
--error ER_SP_PROC_TABLE_CORRUPT
|
--error ER_SP_UNDECLARED_VAR
|
||||||
show create procedure P1;
|
show create procedure P1;
|
||||||
show warnings;
|
show warnings;
|
||||||
|
|
||||||
|
@ -221,6 +221,8 @@ end|
|
|||||||
# called below.
|
# called below.
|
||||||
#
|
#
|
||||||
connection con1;
|
connection con1;
|
||||||
|
set @save_dbug=@@debug_dbug;
|
||||||
|
set debug_dbug="+d,cache_sp_in_show_create";
|
||||||
# Cache all functions used in the tests below so statements
|
# Cache all functions used in the tests below so statements
|
||||||
# calling them won't need to open and lock mysql.proc table
|
# calling them won't need to open and lock mysql.proc table
|
||||||
# and we can assume that each statement locks its tables
|
# and we can assume that each statement locks its tables
|
||||||
@ -245,6 +247,7 @@ show create function f14;
|
|||||||
show create function f15;
|
show create function f15;
|
||||||
show create function f16;
|
show create function f16;
|
||||||
show create function f17;
|
show create function f17;
|
||||||
|
set debug_dbug=@save_dbug;
|
||||||
connection default;
|
connection default;
|
||||||
#
|
#
|
||||||
# 1. Statements that read tables and do not use subqueries.
|
# 1. Statements that read tables and do not use subqueries.
|
||||||
|
@ -232,6 +232,8 @@ let $con_aux2= con2;
|
|||||||
let $table= t1;
|
let $table= t1;
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
set @save_dbug=@@debug_dbug;
|
||||||
|
set debug_dbug="+d,cache_sp_in_show_create";
|
||||||
--echo # Cache all functions used in the tests below so statements
|
--echo # Cache all functions used in the tests below so statements
|
||||||
--echo # calling them won't need to open and lock mysql.proc table
|
--echo # calling them won't need to open and lock mysql.proc table
|
||||||
--echo # and we can assume that each statement locks its tables
|
--echo # and we can assume that each statement locks its tables
|
||||||
@ -257,6 +259,7 @@ show create function f14;
|
|||||||
show create function f15;
|
show create function f15;
|
||||||
show create function f16;
|
show create function f16;
|
||||||
show create function f17;
|
show create function f17;
|
||||||
|
set debug_dbug=@save_dbug;
|
||||||
--enable_result_log
|
--enable_result_log
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ RETURN 0;
|
|||||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
SHOW CREATE FUNCTION TESTF_bug11763507;
|
SHOW CREATE FUNCTION TESTF_bug11763507;
|
||||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||||
testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507`() RETURNS int(11)
|
TESTF_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `TESTF_bug11763507`() RETURNS int(11)
|
||||||
BEGIN
|
BEGIN
|
||||||
RETURN 0;
|
RETURN 0;
|
||||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
@ -198,7 +198,7 @@ SELECT "PROCEDURE testp_bug11763507";
|
|||||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
SHOW CREATE PROCEDURE TESTP_bug11763507;
|
SHOW CREATE PROCEDURE TESTP_bug11763507;
|
||||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||||
testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug11763507`()
|
TESTP_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `TESTP_bug11763507`()
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT "PROCEDURE testp_bug11763507";
|
SELECT "PROCEDURE testp_bug11763507";
|
||||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
|
@ -703,9 +703,6 @@ connection default;
|
|||||||
#
|
#
|
||||||
# SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
|
# SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
|
||||||
#
|
#
|
||||||
# We are just covering the existing behaviour with tests. The
|
|
||||||
# results are not necessarily correct."
|
|
||||||
#
|
|
||||||
CREATE PROCEDURE p1()
|
CREATE PROCEDURE p1()
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT get_lock("test", 10);
|
SELECT get_lock("test", 10);
|
||||||
@ -736,10 +733,7 @@ get_lock("test", 10)
|
|||||||
1
|
1
|
||||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||||
p1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
p1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
||||||
BEGIN
|
BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
SELECT get_lock("test", 10);
|
|
||||||
SHOW CREATE PROCEDURE p1;
|
|
||||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
|
||||||
connection con3;
|
connection con3;
|
||||||
disconnect con3;
|
disconnect con3;
|
||||||
connection con2;
|
connection con2;
|
||||||
|
@ -807,9 +807,6 @@ connection default;
|
|||||||
--echo #
|
--echo #
|
||||||
--echo # SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
|
--echo # SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
|
||||||
--echo #
|
--echo #
|
||||||
--echo # We are just covering the existing behaviour with tests. The
|
|
||||||
--echo # results are not necessarily correct."
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
delimiter |;
|
delimiter |;
|
||||||
CREATE PROCEDURE p1()
|
CREATE PROCEDURE p1()
|
||||||
|
@ -8872,6 +8872,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||||||
BEGIN
|
BEGIN
|
||||||
RETURN '';
|
RETURN '';
|
||||||
END' at line 2
|
END' at line 2
|
||||||
|
SELECT VARIABLE_VALUE into @global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
CREATE PROCEDURE sp0() SELECT 1;
|
||||||
|
SHOW CREATE PROCEDURE sp0;
|
||||||
|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||||
|
sp0 STRICT_ALL_TABLES CREATE DEFINER=`root`@`localhost` PROCEDURE `sp0`()
|
||||||
|
SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
|
DROP PROCEDURE sp0;
|
||||||
|
SELECT VARIABLE_VALUE into @global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
CREATE PROCEDURE sp1() SELECT 1;
|
||||||
|
SHOW CREATE PROCEDURE sp1;
|
||||||
|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||||
|
sp1 STRICT_ALL_TABLES CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||||
|
SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
|
SELECT VARIABLE_VALUE-@local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
VARIABLE_VALUE-@local_mem_used
|
||||||
|
0
|
||||||
|
DROP PROCEDURE sp1;
|
||||||
# End of 10.3 tests
|
# End of 10.3 tests
|
||||||
#
|
#
|
||||||
# Start of 10.4 tests
|
# Start of 10.4 tests
|
||||||
|
@ -10418,6 +10418,24 @@ END;
|
|||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
|
|
||||||
|
# MDEV-20699 do not cache SP in SHOW CREATE
|
||||||
|
# Warmup round, this might allocate some memory for session variable
|
||||||
|
# and the output
|
||||||
|
SELECT VARIABLE_VALUE into @global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
CREATE PROCEDURE sp0() SELECT 1;
|
||||||
|
SHOW CREATE PROCEDURE sp0;
|
||||||
|
DROP PROCEDURE sp0;
|
||||||
|
|
||||||
|
#Check that CREATE/SHOW does not use memory in caches.
|
||||||
|
SELECT VARIABLE_VALUE into @global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
CREATE PROCEDURE sp1() SELECT 1;
|
||||||
|
SHOW CREATE PROCEDURE sp1;
|
||||||
|
SELECT VARIABLE_VALUE-@local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
# 10.5 FIXME: This occasionally shows 56 or 64 bytes of difference!
|
||||||
|
#SELECT VARIABLE_VALUE-@global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
|
||||||
|
DROP PROCEDURE sp1;
|
||||||
--echo # End of 10.3 tests
|
--echo # End of 10.3 tests
|
||||||
|
|
||||||
|
|
||||||
|
@ -6792,6 +6792,49 @@ sum(z)
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
#
|
#
|
||||||
|
# MDEV-24454: Crash at change_item_tree
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(f0 INT);
|
||||||
|
CREATE VIEW v1 AS
|
||||||
|
SELECT
|
||||||
|
f0 AS f1
|
||||||
|
FROM t1;
|
||||||
|
CREATE VIEW v2 AS
|
||||||
|
SELECT
|
||||||
|
(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ')
|
||||||
|
FROM v1 n) AS f2,
|
||||||
|
GROUP_CONCAT('' SEPARATOR ', ') AS f3
|
||||||
|
FROM v1;
|
||||||
|
CREATE VIEW v3 AS
|
||||||
|
SELECT 1 as f4 FROM v2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
SELECT * FROM v3;
|
||||||
|
CALL p1();
|
||||||
|
f4
|
||||||
|
1
|
||||||
|
CALL p1();
|
||||||
|
f4
|
||||||
|
1
|
||||||
|
drop procedure p1;
|
||||||
|
drop view v1,v2,v3;
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-25631: Crash in st_select_lex::mark_as_dependent with
|
||||||
|
# VIEW, aggregate and subquery
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (i1 int);
|
||||||
|
insert into t1 values (1),(2),(3);
|
||||||
|
CREATE VIEW v1 AS
|
||||||
|
SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b)));
|
||||||
|
SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
|
||||||
|
ERROR 21000: Subquery returns more than 1 row
|
||||||
|
delete from t1 where i1 > 1;
|
||||||
|
SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
# End of 10.2 tests
|
# End of 10.2 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -6500,6 +6500,55 @@ SELECT sum(z) FROM v1;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-24454: Crash at change_item_tree
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1(f0 INT);
|
||||||
|
|
||||||
|
CREATE VIEW v1 AS
|
||||||
|
SELECT
|
||||||
|
f0 AS f1
|
||||||
|
FROM t1;
|
||||||
|
|
||||||
|
CREATE VIEW v2 AS
|
||||||
|
SELECT
|
||||||
|
(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ')
|
||||||
|
FROM v1 n) AS f2,
|
||||||
|
GROUP_CONCAT('' SEPARATOR ', ') AS f3
|
||||||
|
FROM v1;
|
||||||
|
|
||||||
|
CREATE VIEW v3 AS
|
||||||
|
SELECT 1 as f4 FROM v2;
|
||||||
|
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
SELECT * FROM v3;
|
||||||
|
|
||||||
|
CALL p1();
|
||||||
|
CALL p1();
|
||||||
|
|
||||||
|
drop procedure p1;
|
||||||
|
drop view v1,v2,v3;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-25631: Crash in st_select_lex::mark_as_dependent with
|
||||||
|
--echo # VIEW, aggregate and subquery
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (i1 int);
|
||||||
|
insert into t1 values (1),(2),(3); #not important
|
||||||
|
CREATE VIEW v1 AS
|
||||||
|
SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b)));
|
||||||
|
|
||||||
|
--error ER_SUBQUERY_NO_1_ROW
|
||||||
|
SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
|
||||||
|
delete from t1 where i1 > 1;
|
||||||
|
SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.2 tests
|
--echo # End of 10.2 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -727,6 +727,10 @@ END
|
|||||||
character_set_client latin1
|
character_set_client latin1
|
||||||
collation_connection latin1_swedish_ci
|
collation_connection latin1_swedish_ci
|
||||||
Database Collation latin1_swedish_ci
|
Database Collation latin1_swedish_ci
|
||||||
|
Warnings:
|
||||||
|
Level Note
|
||||||
|
Code 1585
|
||||||
|
Message This function 'concat' has the same name as a native function
|
||||||
SHOW CREATE PACKAGE BODY test2;
|
SHOW CREATE PACKAGE BODY test2;
|
||||||
Package body test2
|
Package body test2
|
||||||
sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
|
sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT
|
||||||
@ -747,6 +751,10 @@ END
|
|||||||
character_set_client latin1
|
character_set_client latin1
|
||||||
collation_connection latin1_swedish_ci
|
collation_connection latin1_swedish_ci
|
||||||
Database Collation latin1_swedish_ci
|
Database Collation latin1_swedish_ci
|
||||||
|
Warnings:
|
||||||
|
Level Note
|
||||||
|
Code 1585
|
||||||
|
Message This function 'concat' has the same name as a native function
|
||||||
DROP PACKAGE BODY test2;
|
DROP PACKAGE BODY test2;
|
||||||
SELECT test2.f1();
|
SELECT test2.f1();
|
||||||
ERROR 42000: FUNCTION test.test2.f1 does not exist
|
ERROR 42000: FUNCTION test.test2.f1 does not exist
|
||||||
|
@ -35,7 +35,6 @@ galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
|
|||||||
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
|
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
|
||||||
galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case
|
galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case
|
||||||
galera_trigger : MDEV-24048 galera.galera_trigger MTR fails: Result content mismatch
|
galera_trigger : MDEV-24048 galera.galera_trigger MTR fails: Result content mismatch
|
||||||
galera_var_ignore_apply_errors : MDEV-20451: Lock wait timeout exceeded in galera_var_ignore_apply_errors
|
|
||||||
galera_var_node_address : MDEV-20485 Galera test failure
|
galera_var_node_address : MDEV-20485 Galera test failure
|
||||||
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
|
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
|
||||||
galera_var_reject_queries : assertion in inline_mysql_socket_send
|
galera_var_reject_queries : assertion in inline_mysql_socket_send
|
||||||
|
@ -36,31 +36,3 @@ COUNT(f1) = 1000
|
|||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE ten;
|
DROP TABLE ten;
|
||||||
connection node_1;
|
|
||||||
SET @value=REPEAT (1,5001);
|
|
||||||
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
|
|
||||||
INSERT IGNORE INTO t VALUES(@value);
|
|
||||||
Warnings:
|
|
||||||
Warning 1265 Data truncated for column 'a' at row 1
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
connection node_2;
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
connection node_1;
|
|
||||||
DROP TABLE t;
|
|
||||||
CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
|
|
||||||
INSERT IGNORE INTO t VALUES(@value);
|
|
||||||
Warnings:
|
|
||||||
Warning 1265 Data truncated for column 'a' at row 1
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
connection node_2;
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
connection node_1;
|
|
||||||
DROP TABLE t;
|
|
||||||
|
@ -424,3 +424,5 @@ connection node_4;
|
|||||||
connection node_1;
|
connection node_1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
|
disconnect node_3;
|
||||||
|
disconnect node_4;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
--source include/big_test.inc
|
|
||||||
--source include/galera_cluster.inc
|
--source include/galera_cluster.inc
|
||||||
--source include/have_innodb.inc
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# InnoDB FULLTEXT indexes
|
# InnoDB FULLTEXT indexes
|
||||||
@ -63,24 +61,25 @@ DROP TABLE ten;
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Case 2: UTF-8
|
# Case 2: UTF-8
|
||||||
|
# TODO: MDEV-24978
|
||||||
#
|
#
|
||||||
--connection node_1
|
#--connection node_1
|
||||||
SET @value=REPEAT (1,5001);
|
#SET @value=REPEAT (1,5001);
|
||||||
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
|
#CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
|
||||||
INSERT IGNORE INTO t VALUES(@value);
|
#INSERT IGNORE INTO t VALUES(@value);
|
||||||
SELECT COUNT(*) FROM t;
|
#SELECT COUNT(*) FROM t;
|
||||||
|
#
|
||||||
--connection node_2
|
#--connection node_2
|
||||||
SELECT COUNT(*) FROM t;
|
#SELECT COUNT(*) FROM t;
|
||||||
|
#
|
||||||
--connection node_1
|
#--connection node_1
|
||||||
DROP TABLE t;
|
#DROP TABLE t;
|
||||||
CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
|
#CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
|
||||||
INSERT IGNORE INTO t VALUES(@value);
|
#INSERT IGNORE INTO t VALUES(@value);
|
||||||
SELECT COUNT(*) FROM t;
|
#SELECT COUNT(*) FROM t;
|
||||||
|
#
|
||||||
--connection node_2
|
#--connection node_2
|
||||||
SELECT COUNT(*) FROM t;
|
#SELECT COUNT(*) FROM t;
|
||||||
|
#
|
||||||
--connection node_1
|
#--connection node_1
|
||||||
DROP TABLE t;
|
#DROP TABLE t;
|
||||||
|
@ -3,16 +3,20 @@
|
|||||||
[mysqld.1]
|
[mysqld.1]
|
||||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1'
|
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1'
|
||||||
wsrep_slave_threads=10
|
wsrep_slave_threads=10
|
||||||
|
wsrep_debug=1
|
||||||
|
|
||||||
[mysqld.2]
|
[mysqld.2]
|
||||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1'
|
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1'
|
||||||
wsrep_slave_threads=10
|
wsrep_slave_threads=10
|
||||||
|
wsrep_debug=1
|
||||||
|
|
||||||
[mysqld.3]
|
[mysqld.3]
|
||||||
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2'
|
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2'
|
||||||
wsrep_slave_threads=10
|
wsrep_slave_threads=10
|
||||||
|
wsrep_debug=1
|
||||||
|
|
||||||
[mysqld.4]
|
[mysqld.4]
|
||||||
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3'
|
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3'
|
||||||
wsrep_slave_threads=10
|
wsrep_slave_threads=10
|
||||||
|
wsrep_debug=1
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ call mtr.add_suppression("WSREP: ALTER TABLE isolation failure");
|
|||||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||||
|
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||||
@ -449,3 +451,7 @@ reap;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
--disconnect node_3
|
||||||
|
--disconnect node_4
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
!include ../galera_2nodes.cnf
|
||||||
|
|
||||||
|
[mysqld.1]
|
||||||
|
wsrep_debug=1
|
||||||
|
|
||||||
|
[mysqld.2]
|
||||||
|
wsrep_debug=1
|
@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
--source include/galera_cluster.inc
|
--source include/galera_cluster.inc
|
||||||
--source include/have_innodb.inc
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -73,11 +72,15 @@ SET GLOBAL wsrep_on = ON;
|
|||||||
DELETE FROM t1 WHERE f1 = 1;
|
DELETE FROM t1 WHERE f1 = 1;
|
||||||
|
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM t1;
|
SELECT COUNT(*) as expect_0 FROM t1;
|
||||||
--connection node_2
|
--connection node_2
|
||||||
--source include/galera_wait_ready.inc
|
--source include/galera_wait_ready.inc
|
||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM t1;
|
SELECT COUNT(*) as expect_0 FROM t1;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -97,11 +100,15 @@ DELETE FROM t1 WHERE f1 = 2;
|
|||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_1 FROM t1;
|
SELECT COUNT(*) as expect_1 FROM t1;
|
||||||
--connection node_2
|
--connection node_2
|
||||||
--source include/galera_wait_ready.inc
|
--source include/galera_wait_ready.inc
|
||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_1 FROM t1;
|
SELECT COUNT(*) as expect_1 FROM t1;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -132,6 +139,8 @@ SELECT COUNT(*) as expect_0 FROM t1;
|
|||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM t1;
|
SELECT COUNT(*) as expect_0 FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
@ -171,6 +180,8 @@ SELECT COUNT(*) as expect_0 FROM t1;
|
|||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM t1;
|
SELECT COUNT(*) as expect_0 FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
@ -205,6 +216,8 @@ SELECT COUNT(*) as expect_0 FROM t1;
|
|||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM t1;
|
SELECT COUNT(*) as expect_0 FROM t1;
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
@ -239,6 +252,10 @@ SELECT COUNT(*) as expect_0 FROM child;
|
|||||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM parent;
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 0 FROM child;
|
||||||
|
--source include/wait_condition.inc
|
||||||
SELECT COUNT(*) as expect_0 FROM parent;
|
SELECT COUNT(*) as expect_0 FROM parent;
|
||||||
SELECT COUNT(*) as expect_0 FROM child;
|
SELECT COUNT(*) as expect_0 FROM child;
|
||||||
DROP TABLE child, parent;
|
DROP TABLE child, parent;
|
||||||
|
@ -1,123 +1,118 @@
|
|||||||
SET GLOBAL innodb_defragment_stats_accuracy = 20;
|
SET GLOBAL innodb_defragment_stats_accuracy = 20;
|
||||||
DELETE FROM mysql.innodb_index_stats;
|
DELETE FROM mysql.innodb_index_stats;
|
||||||
# Create table.
|
# Create table.
|
||||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
|
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
|
||||||
INSERT INTO t1 SELECT seq, REPEAT('A', 256) FROM seq_1_to_1024;
|
KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
|
||||||
|
INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
|
||||||
|
FROM seq_1_to_1024;
|
||||||
# Not enough page splits to trigger persistent stats write yet.
|
# Not enough page splits to trigger persistent stats write yet.
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT * FROM mysql.innodb_index_stats;
|
||||||
count(stat_value) = 0
|
database_name table_name index_name last_update stat_name stat_value sample_size stat_description
|
||||||
1
|
INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
FROM seq_1025_to_1433;
|
||||||
count(stat_value) = 0
|
|
||||||
1
|
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
count(stat_value) = 0
|
|
||||||
1
|
|
||||||
INSERT INTO t1 SELECT seq, REPEAT('A', 256) FROM seq_1025_to_2048;
|
|
||||||
# Persistent stats recorded.
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
|
||||||
count(stat_value) > 0
|
|
||||||
1
|
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
|
||||||
count(stat_value) = 0
|
|
||||||
1
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
count(stat_value) > 0
|
|
||||||
1
|
|
||||||
# Delete some rows.
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
delete from t1 where a between 100 * 20 and 100 * 20 + 30;
|
INSERT INTO t1 SELECT 100*20+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 19 and 100 * 19 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 18 and 100 * 18 + 30;
|
INSERT INTO t1 SELECT 100*19+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 17 and 100 * 17 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 16 and 100 * 16 + 30;
|
INSERT INTO t1 SELECT 100*18+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 15 and 100 * 15 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 14 and 100 * 14 + 30;
|
INSERT INTO t1 SELECT 100*17+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 13 and 100 * 13 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 12 and 100 * 12 + 30;
|
INSERT INTO t1 SELECT 100*16+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 11 and 100 * 11 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 10 and 100 * 10 + 30;
|
INSERT INTO t1 SELECT 100*15+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 9 and 100 * 9 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 8 and 100 * 8 + 30;
|
INSERT INTO t1 SELECT 100*14+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 7 and 100 * 7 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 6 and 100 * 6 + 30;
|
INSERT INTO t1 SELECT 100*13+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 5 and 100 * 5 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 4 and 100 * 4 + 30;
|
INSERT INTO t1 SELECT 100*12+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 3 and 100 * 3 + 30;
|
FROM seq_70_to_99;
|
||||||
delete from t1 where a between 100 * 2 and 100 * 2 + 30;
|
INSERT INTO t1 SELECT 100*11+seq, REPEAT('A', 256)
|
||||||
delete from t1 where a between 100 * 1 and 100 * 1 + 30;
|
FROM seq_70_to_99;
|
||||||
COMMIT;
|
INSERT INTO t1 SELECT 100*10+seq, REPEAT('A', 256)
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
FROM seq_70_to_99;
|
||||||
count(stat_value) > 0
|
INSERT INTO t1 SELECT 100*9+seq, REPEAT('A', 256)
|
||||||
1
|
FROM seq_70_to_99;
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
INSERT INTO t1 SELECT 100*8+seq, REPEAT('A', 256)
|
||||||
count(stat_value) = 0
|
FROM seq_70_to_99;
|
||||||
1
|
INSERT INTO t1 SELECT 100*7+seq, REPEAT('A', 256)
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
FROM seq_70_to_99;
|
||||||
count(stat_value) > 0
|
INSERT INTO t1 SELECT 100*6+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
INSERT INTO t1 SELECT 100*5+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
INSERT INTO t1 SELECT 100*4+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
INSERT INTO t1 SELECT 100*3+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
INSERT INTO t1 SELECT 100*2+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
INSERT INTO t1 SELECT 100*1+seq, REPEAT('A', 256)
|
||||||
|
FROM seq_70_to_99;
|
||||||
|
ROLLBACK;
|
||||||
|
SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
|
||||||
|
have background defragmentation
|
||||||
1
|
1
|
||||||
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
|
table_name index_name stat_name
|
||||||
|
t1 PRIMARY n_leaf_pages_defrag
|
||||||
|
t1 PRIMARY n_leaf_pages_reserved
|
||||||
|
t1 PRIMARY n_page_split
|
||||||
|
t1 SECOND n_leaf_pages_defrag
|
||||||
|
t1 SECOND n_leaf_pages_reserved
|
||||||
|
t1 SECOND n_page_split
|
||||||
optimize table t1;
|
optimize table t1;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 optimize status OK
|
test.t1 optimize status OK
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
count(stat_value) > 0
|
table_name index_name stat_name
|
||||||
1
|
t1 PRIMARY n_leaf_pages_defrag
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
t1 PRIMARY n_leaf_pages_reserved
|
||||||
count(stat_value) > 0
|
t1 PRIMARY n_page_split
|
||||||
1
|
t1 PRIMARY n_pages_freed
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
t1 SECOND n_leaf_pages_defrag
|
||||||
count(stat_value) > 0
|
t1 SECOND n_leaf_pages_reserved
|
||||||
1
|
t1 SECOND n_page_split
|
||||||
|
t1 SECOND n_pages_freed
|
||||||
set global innodb_defragment_stats_accuracy = 40;
|
set global innodb_defragment_stats_accuracy = 40;
|
||||||
INSERT INTO t1 (b) SELECT b from t1;
|
INSERT INTO t1 (b) SELECT b from t1;
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
count(stat_value) > 0
|
table_name index_name stat_name
|
||||||
1
|
t1 PRIMARY n_leaf_pages_defrag
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
t1 PRIMARY n_leaf_pages_reserved
|
||||||
count(stat_value) > 0
|
t1 PRIMARY n_page_split
|
||||||
1
|
t1 PRIMARY n_pages_freed
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
t1 SECOND n_leaf_pages_defrag
|
||||||
count(stat_value) > 0
|
t1 SECOND n_leaf_pages_reserved
|
||||||
1
|
t1 SECOND n_page_split
|
||||||
|
t1 SECOND n_pages_freed
|
||||||
INSERT INTO t1 (b) SELECT b from t1;
|
INSERT INTO t1 (b) SELECT b from t1;
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
|
||||||
count(stat_value) > 0
|
stat_name
|
||||||
1
|
n_leaf_pages_defrag
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
n_leaf_pages_defrag
|
||||||
count(stat_value) > 0
|
n_leaf_pages_reserved
|
||||||
1
|
n_leaf_pages_reserved
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
n_page_split
|
||||||
count(stat_value) > 0
|
n_page_split
|
||||||
1
|
n_pages_freed
|
||||||
|
n_pages_freed
|
||||||
# Table rename should cause stats rename.
|
# Table rename should cause stats rename.
|
||||||
rename table t1 to t2;
|
rename table t1 to t2;
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
count(stat_value) = 0
|
table_name index_name stat_name
|
||||||
1
|
t2 PRIMARY n_leaf_pages_defrag
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
t2 PRIMARY n_leaf_pages_reserved
|
||||||
count(stat_value) = 0
|
t2 PRIMARY n_page_split
|
||||||
1
|
t2 PRIMARY n_pages_freed
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
t2 SECOND n_leaf_pages_defrag
|
||||||
count(stat_value) = 0
|
t2 SECOND n_leaf_pages_reserved
|
||||||
1
|
t2 SECOND n_page_split
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
|
t2 SECOND n_pages_freed
|
||||||
count(stat_value) > 0
|
|
||||||
1
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
|
|
||||||
count(stat_value) > 0
|
|
||||||
1
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
count(stat_value) > 0
|
|
||||||
1
|
|
||||||
# Drop index should cause stats drop, but will not.
|
# Drop index should cause stats drop, but will not.
|
||||||
drop index SECOND on t2;
|
drop index SECOND on t2;
|
||||||
SELECT stat_name, stat_value>0 FROM mysql.innodb_index_stats
|
|
||||||
WHERE table_name like '%t2%' AND index_name='SECOND';
|
|
||||||
stat_name stat_value>0
|
|
||||||
n_leaf_pages_defrag 1
|
|
||||||
n_leaf_pages_reserved 1
|
|
||||||
n_page_split 1
|
|
||||||
n_pages_freed 1
|
|
||||||
#
|
#
|
||||||
# MDEV-26636: Statistics must not be written for temporary tables
|
# MDEV-26636: Statistics must not be written for temporary tables
|
||||||
#
|
#
|
||||||
@ -126,20 +121,18 @@ CREATE TEMPORARY TABLE t (a INT PRIMARY KEY, c CHAR(255) NOT NULL)
|
|||||||
ENGINE=InnoDB;
|
ENGINE=InnoDB;
|
||||||
INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
|
INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
|
||||||
# restart
|
# restart
|
||||||
SELECT * FROM mysql.innodb_index_stats where table_name like '%t1%';
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
database_name table_name index_name last_update stat_name stat_value sample_size stat_description
|
table_name index_name stat_name
|
||||||
SELECT table_name, index_name, stat_name, stat_value>0
|
t2 PRIMARY n_leaf_pages_defrag
|
||||||
FROM mysql.innodb_index_stats;
|
t2 PRIMARY n_leaf_pages_reserved
|
||||||
table_name index_name stat_name stat_value>0
|
t2 PRIMARY n_page_split
|
||||||
t2 PRIMARY n_leaf_pages_defrag 1
|
t2 PRIMARY n_pages_freed
|
||||||
t2 PRIMARY n_leaf_pages_reserved 1
|
t2 SECOND n_leaf_pages_defrag
|
||||||
t2 PRIMARY n_page_split 1
|
t2 SECOND n_leaf_pages_reserved
|
||||||
t2 PRIMARY n_pages_freed 1
|
t2 SECOND n_page_split
|
||||||
t2 SECOND n_leaf_pages_defrag 1
|
t2 SECOND n_pages_freed
|
||||||
t2 SECOND n_leaf_pages_reserved 1
|
|
||||||
t2 SECOND n_page_split 1
|
|
||||||
t2 SECOND n_pages_freed 1
|
|
||||||
# Clean up
|
# Clean up
|
||||||
|
ALTER TABLE t2 STATS_PERSISTENT=1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
SELECT * FROM mysql.innodb_index_stats;
|
SELECT * FROM mysql.innodb_index_stats;
|
||||||
database_name table_name index_name last_update stat_name stat_value sample_size stat_description
|
database_name table_name index_name last_update stat_name stat_value sample_size stat_description
|
||||||
|
@ -8,77 +8,65 @@ SET GLOBAL innodb_defragment_stats_accuracy = 20;
|
|||||||
DELETE FROM mysql.innodb_index_stats;
|
DELETE FROM mysql.innodb_index_stats;
|
||||||
|
|
||||||
--echo # Create table.
|
--echo # Create table.
|
||||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
|
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
|
||||||
|
KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
|
||||||
|
|
||||||
INSERT INTO t1 SELECT seq, REPEAT('A', 256) FROM seq_1_to_1024;
|
INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
|
||||||
|
FROM seq_1_to_1024;
|
||||||
|
|
||||||
--echo # Not enough page splits to trigger persistent stats write yet.
|
--echo # Not enough page splits to trigger persistent stats write yet.
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT * FROM mysql.innodb_index_stats;
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
INSERT INTO t1 SELECT seq, REPEAT('A', 256) FROM seq_1025_to_2048;
|
INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
|
||||||
|
FROM seq_1025_to_1433;
|
||||||
|
|
||||||
--echo # Persistent stats recorded.
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
--echo # Delete some rows.
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
let $num_delete = 20;
|
let $num_delete = 20;
|
||||||
while ($num_delete)
|
while ($num_delete)
|
||||||
{
|
{
|
||||||
let $j = 100 * $num_delete;
|
eval INSERT INTO t1 SELECT 100*$num_delete+seq, REPEAT('A', 256)
|
||||||
eval delete from t1 where a between $j and $j + 30;
|
FROM seq_70_to_99;
|
||||||
dec $num_delete;
|
dec $num_delete;
|
||||||
}
|
}
|
||||||
COMMIT;
|
ROLLBACK;
|
||||||
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
# Wait for defrag_pool to be processed.
|
||||||
|
|
||||||
|
let $wait_timeout=30;
|
||||||
|
let $wait_condition = SELECT COUNT(*)>0 FROM mysql.innodb_index_stats;
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
|
|
||||||
optimize table t1;
|
optimize table t1;
|
||||||
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
--sorted_result
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
set global innodb_defragment_stats_accuracy = 40;
|
set global innodb_defragment_stats_accuracy = 40;
|
||||||
|
|
||||||
INSERT INTO t1 (b) SELECT b from t1;
|
INSERT INTO t1 (b) SELECT b from t1;
|
||||||
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
--sorted_result
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO t1 (b) SELECT b from t1;
|
INSERT INTO t1 (b) SELECT b from t1;
|
||||||
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
--sorted_result
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
|
|
||||||
--echo # Table rename should cause stats rename.
|
--echo # Table rename should cause stats rename.
|
||||||
rename table t1 to t2;
|
rename table t1 to t2;
|
||||||
|
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
|
--sorted_result
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
|
|
||||||
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
|
|
||||||
|
|
||||||
--echo # Drop index should cause stats drop, but will not.
|
--echo # Drop index should cause stats drop, but will not.
|
||||||
drop index SECOND on t2;
|
drop index SECOND on t2;
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT stat_name, stat_value>0 FROM mysql.innodb_index_stats
|
|
||||||
WHERE table_name like '%t2%' AND index_name='SECOND';
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-26636: Statistics must not be written for temporary tables
|
--echo # MDEV-26636: Statistics must not be written for temporary tables
|
||||||
--echo #
|
--echo #
|
||||||
@ -89,13 +77,13 @@ INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
|
|||||||
|
|
||||||
--source include/restart_mysqld.inc
|
--source include/restart_mysqld.inc
|
||||||
|
|
||||||
SELECT * FROM mysql.innodb_index_stats where table_name like '%t1%';
|
|
||||||
|
|
||||||
--sorted_result
|
--sorted_result
|
||||||
SELECT table_name, index_name, stat_name, stat_value>0
|
SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
|
||||||
FROM mysql.innodb_index_stats;
|
|
||||||
|
|
||||||
--echo # Clean up
|
--echo # Clean up
|
||||||
|
# Starting with 10.6, DROP TABLE will not touch persistent statistics
|
||||||
|
# (not defragmentation statistics either) if the table has none!
|
||||||
|
ALTER TABLE t2 STATS_PERSISTENT=1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
|
|
||||||
SELECT * FROM mysql.innodb_index_stats;
|
SELECT * FROM mysql.innodb_index_stats;
|
||||||
|
@ -54,7 +54,7 @@ let $trx_after= `select substr('$trx_after',9)`;
|
|||||||
|
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
if ($trx_before != $trx_after)
|
if ($trx_before > $trx_after)
|
||||||
{
|
{
|
||||||
echo Transaction sequence mismatch: $trx_before != $trx_after;
|
echo Transaction sequence mismatch: $trx_before > $trx_after;
|
||||||
}
|
}
|
||||||
|
@ -24,3 +24,19 @@ VARIABLE_VALUE>0 VARIABLE_NAME
|
|||||||
1 Collation used utf8mb4_bin
|
1 Collation used utf8mb4_bin
|
||||||
1 Collation used utf8_bin
|
1 Collation used utf8_bin
|
||||||
1 Collation used utf8_general_ci
|
1 Collation used utf8_general_ci
|
||||||
|
prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME";
|
||||||
|
execute stmt;
|
||||||
|
VARIABLE_VALUE>0 VARIABLE_NAME
|
||||||
|
1 Collation used binary
|
||||||
|
1 Collation used latin1_swedish_ci
|
||||||
|
1 Collation used utf8mb4_bin
|
||||||
|
1 Collation used utf8_bin
|
||||||
|
1 Collation used utf8_general_ci
|
||||||
|
execute stmt;
|
||||||
|
VARIABLE_VALUE>0 VARIABLE_NAME
|
||||||
|
1 Collation used binary
|
||||||
|
1 Collation used latin1_swedish_ci
|
||||||
|
1 Collation used utf8mb4_bin
|
||||||
|
1 Collation used utf8_bin
|
||||||
|
1 Collation used utf8_general_ci
|
||||||
|
deallocate prepare stmt;
|
||||||
|
@ -42,3 +42,10 @@ if (`SELECT VERSION() LIKE '%embedded%'`)
|
|||||||
SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK
|
SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK
|
||||||
WHERE VARIABLE_NAME LIKE 'Collation used %'
|
WHERE VARIABLE_NAME LIKE 'Collation used %'
|
||||||
ORDER BY VARIABLE_NAME;
|
ORDER BY VARIABLE_NAME;
|
||||||
|
|
||||||
|
prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME";
|
||||||
|
|
||||||
|
execute stmt;
|
||||||
|
execute stmt;
|
||||||
|
|
||||||
|
deallocate prepare stmt;
|
||||||
|
@ -92,17 +92,19 @@ static COND * const OOM= (COND*)1;
|
|||||||
static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
|
static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
|
||||||
{
|
{
|
||||||
Item_cond_or *res= NULL;
|
Item_cond_or *res= NULL;
|
||||||
Name_resolution_context nrc;
|
/* A reference to this context will be stored in Item_field */
|
||||||
|
Name_resolution_context *nrc= new (thd->mem_root) Name_resolution_context;
|
||||||
LEX_CSTRING &db= tables->db;
|
LEX_CSTRING &db= tables->db;
|
||||||
LEX_CSTRING &table= tables->alias;
|
LEX_CSTRING &table= tables->alias;
|
||||||
LEX_CSTRING &field= tables->table->field[0]->field_name;
|
LEX_CSTRING &field= tables->table->field[0]->field_name;
|
||||||
CHARSET_INFO *cs= &my_charset_latin1;
|
CHARSET_INFO *cs= &my_charset_latin1;
|
||||||
|
|
||||||
if (!filter->str)
|
if (!filter->str || !nrc)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
nrc.init();
|
nrc->init();
|
||||||
nrc.resolve_in_table_list_only(tables);
|
nrc->resolve_in_table_list_only(tables);
|
||||||
|
nrc->select_lex= tables->select_lex;
|
||||||
|
|
||||||
res= new (thd->mem_root) Item_cond_or(thd);
|
res= new (thd->mem_root) Item_cond_or(thd);
|
||||||
if (!res)
|
if (!res)
|
||||||
@ -110,7 +112,7 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
|
|||||||
|
|
||||||
for (; filter->str; filter++)
|
for (; filter->str; filter++)
|
||||||
{
|
{
|
||||||
Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table,
|
Item_field *fld= new (thd->mem_root) Item_field(thd, nrc, db, table,
|
||||||
field);
|
field);
|
||||||
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
|
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
|
||||||
(uint) filter->length, cs);
|
(uint) filter->length, cs);
|
||||||
|
104
sql/item.cc
104
sql/item.cc
@ -70,11 +70,12 @@ bool cmp_items(Item *a, Item *b)
|
|||||||
/**
|
/**
|
||||||
Set max_sum_func_level if it is needed
|
Set max_sum_func_level if it is needed
|
||||||
*/
|
*/
|
||||||
inline void set_max_sum_func_level(THD *thd, SELECT_LEX *select)
|
inline void set_max_sum_func_level(SELECT_LEX *select)
|
||||||
{
|
{
|
||||||
if (thd->lex->in_sum_func &&
|
LEX *lex_s= select->parent_lex;
|
||||||
thd->lex->in_sum_func->nest_level >= select->nest_level)
|
if (lex_s->in_sum_func &&
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_sum_func_level,
|
lex_s->in_sum_func->nest_level >= select->nest_level)
|
||||||
|
set_if_bigger(lex_s->in_sum_func->max_sum_func_level,
|
||||||
select->nest_level - 1);
|
select->nest_level - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,6 +644,7 @@ Item_ident::Item_ident(THD *thd, Name_resolution_context *context_arg,
|
|||||||
cached_table(0), depended_from(0), can_be_depended(TRUE)
|
cached_table(0), depended_from(0), can_be_depended(TRUE)
|
||||||
{
|
{
|
||||||
name= field_name_arg;
|
name= field_name_arg;
|
||||||
|
DBUG_ASSERT(!context || context->select_lex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -659,6 +661,7 @@ Item_ident::Item_ident(THD *thd, TABLE_LIST *view_arg,
|
|||||||
cached_table(NULL), depended_from(NULL), can_be_depended(TRUE)
|
cached_table(NULL), depended_from(NULL), can_be_depended(TRUE)
|
||||||
{
|
{
|
||||||
name= field_name_arg;
|
name= field_name_arg;
|
||||||
|
DBUG_ASSERT(!context || context->select_lex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -680,7 +683,9 @@ Item_ident::Item_ident(THD *thd, Item_ident *item)
|
|||||||
cached_table(item->cached_table),
|
cached_table(item->cached_table),
|
||||||
depended_from(item->depended_from),
|
depended_from(item->depended_from),
|
||||||
can_be_depended(item->can_be_depended)
|
can_be_depended(item->can_be_depended)
|
||||||
{}
|
{
|
||||||
|
DBUG_ASSERT(!context || context->select_lex);
|
||||||
|
}
|
||||||
|
|
||||||
void Item_ident::cleanup()
|
void Item_ident::cleanup()
|
||||||
{
|
{
|
||||||
@ -5498,7 +5503,14 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
*/
|
*/
|
||||||
Name_resolution_context *last_checked_context= context;
|
Name_resolution_context *last_checked_context= context;
|
||||||
Item **ref= (Item **) not_found_item;
|
Item **ref= (Item **) not_found_item;
|
||||||
SELECT_LEX *current_sel= thd->lex->current_select;
|
/*
|
||||||
|
There are cases when name resolution context is absent (when we are not
|
||||||
|
doing name resolution), but here the name resolution context should
|
||||||
|
be present because we are doing name resolution
|
||||||
|
*/
|
||||||
|
DBUG_ASSERT(context);
|
||||||
|
SELECT_LEX *current_sel= context->select_lex;
|
||||||
|
LEX *lex_s= context->select_lex->parent_lex;
|
||||||
Name_resolution_context *outer_context= 0;
|
Name_resolution_context *outer_context= 0;
|
||||||
SELECT_LEX *select= 0;
|
SELECT_LEX *select= 0;
|
||||||
/* Currently derived tables cannot be correlated */
|
/* Currently derived tables cannot be correlated */
|
||||||
@ -5600,18 +5612,18 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
return -1;
|
return -1;
|
||||||
thd->change_item_tree(reference, rf);
|
thd->change_item_tree(reference, rf);
|
||||||
select->inner_refs_list.push_back(rf, thd->mem_root);
|
select->inner_refs_list.push_back(rf, thd->mem_root);
|
||||||
rf->in_sum_func= thd->lex->in_sum_func;
|
rf->in_sum_func= lex_s->in_sum_func;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
A reference is resolved to a nest level that's outer or the same as
|
A reference is resolved to a nest level that's outer or the same as
|
||||||
the nest level of the enclosing set function : adjust the value of
|
the nest level of the enclosing set function : adjust the value of
|
||||||
max_arg_level for the function if it's needed.
|
max_arg_level for the function if it's needed.
|
||||||
*/
|
*/
|
||||||
if (thd->lex->in_sum_func &&
|
if (lex_s->in_sum_func &&
|
||||||
thd->lex->in_sum_func->nest_level >= select->nest_level)
|
lex_s->in_sum_func->nest_level >= select->nest_level)
|
||||||
{
|
{
|
||||||
Item::Type ref_type= (*reference)->type();
|
Item::Type ref_type= (*reference)->type();
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
|
set_if_bigger(lex_s->in_sum_func->max_arg_level,
|
||||||
select->nest_level);
|
select->nest_level);
|
||||||
set_field(*from_field);
|
set_field(*from_field);
|
||||||
fixed= 1;
|
fixed= 1;
|
||||||
@ -5632,10 +5644,10 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
|
((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
|
||||||
(Item_ident*) (*reference) :
|
(Item_ident*) (*reference) :
|
||||||
0), false);
|
0), false);
|
||||||
if (thd->lex->in_sum_func &&
|
if (lex_s->in_sum_func &&
|
||||||
thd->lex->in_sum_func->nest_level >= select->nest_level)
|
lex_s->in_sum_func->nest_level >= select->nest_level)
|
||||||
{
|
{
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
|
set_if_bigger(lex_s->in_sum_func->max_arg_level,
|
||||||
select->nest_level);
|
select->nest_level);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -5727,7 +5739,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
{
|
{
|
||||||
outer_context->select_lex->inner_refs_list.push_back((Item_outer_ref*)rf,
|
outer_context->select_lex->inner_refs_list.push_back((Item_outer_ref*)rf,
|
||||||
thd->mem_root);
|
thd->mem_root);
|
||||||
((Item_outer_ref*)rf)->in_sum_func= thd->lex->in_sum_func;
|
((Item_outer_ref*)rf)->in_sum_func= lex_s->in_sum_func;
|
||||||
}
|
}
|
||||||
thd->change_item_tree(reference, rf);
|
thd->change_item_tree(reference, rf);
|
||||||
/*
|
/*
|
||||||
@ -5742,7 +5754,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
We can not "move" aggregate function in the place where
|
We can not "move" aggregate function in the place where
|
||||||
its arguments are not defined.
|
its arguments are not defined.
|
||||||
*/
|
*/
|
||||||
set_max_sum_func_level(thd, select);
|
set_max_sum_func_level(select);
|
||||||
mark_as_dependent(thd, last_checked_context->select_lex,
|
mark_as_dependent(thd, last_checked_context->select_lex,
|
||||||
context->select_lex, rf,
|
context->select_lex, rf,
|
||||||
rf, false);
|
rf, false);
|
||||||
@ -5755,7 +5767,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
|
|||||||
We can not "move" aggregate function in the place where
|
We can not "move" aggregate function in the place where
|
||||||
its arguments are not defined.
|
its arguments are not defined.
|
||||||
*/
|
*/
|
||||||
set_max_sum_func_level(thd, select);
|
set_max_sum_func_level(select);
|
||||||
mark_as_dependent(thd, last_checked_context->select_lex,
|
mark_as_dependent(thd, last_checked_context->select_lex,
|
||||||
context->select_lex,
|
context->select_lex,
|
||||||
this, (Item_ident*)*reference, false);
|
this, (Item_ident*)*reference, false);
|
||||||
@ -5834,7 +5846,20 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
|
|||||||
DBUG_ASSERT(fixed == 0);
|
DBUG_ASSERT(fixed == 0);
|
||||||
Field *from_field= (Field *)not_found_field;
|
Field *from_field= (Field *)not_found_field;
|
||||||
bool outer_fixed= false;
|
bool outer_fixed= false;
|
||||||
SELECT_LEX *select= thd->lex->current_select;
|
SELECT_LEX *select;
|
||||||
|
LEX *lex_s;
|
||||||
|
if (context)
|
||||||
|
{
|
||||||
|
select= context->select_lex;
|
||||||
|
lex_s= context->select_lex->parent_lex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No real name resolution, used somewhere in SP
|
||||||
|
DBUG_ASSERT(field);
|
||||||
|
select= NULL;
|
||||||
|
lex_s= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (select && select->in_tvc)
|
if (select && select->in_tvc)
|
||||||
{
|
{
|
||||||
@ -5902,7 +5927,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
|
|||||||
We can not "move" aggregate function in the place where
|
We can not "move" aggregate function in the place where
|
||||||
its arguments are not defined.
|
its arguments are not defined.
|
||||||
*/
|
*/
|
||||||
set_max_sum_func_level(thd, select);
|
set_max_sum_func_level(select);
|
||||||
set_field(new_field);
|
set_field(new_field);
|
||||||
depended_from= (*((Item_field**)res))->depended_from;
|
depended_from= (*((Item_field**)res))->depended_from;
|
||||||
return 0;
|
return 0;
|
||||||
@ -5931,7 +5956,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
|
|||||||
We can not "move" aggregate function in the place where
|
We can not "move" aggregate function in the place where
|
||||||
its arguments are not defined.
|
its arguments are not defined.
|
||||||
*/
|
*/
|
||||||
set_max_sum_func_level(thd, select);
|
set_max_sum_func_level(select);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5968,10 +5993,11 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
|
|||||||
goto mark_non_agg_field;
|
goto mark_non_agg_field;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thd->lex->in_sum_func &&
|
if (lex_s &&
|
||||||
thd->lex->in_sum_func->nest_level ==
|
lex_s->in_sum_func &&
|
||||||
|
lex_s->in_sum_func->nest_level ==
|
||||||
select->nest_level)
|
select->nest_level)
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
|
set_if_bigger(lex_s->in_sum_func->max_arg_level,
|
||||||
select->nest_level);
|
select->nest_level);
|
||||||
/*
|
/*
|
||||||
if it is not expression from merged VIEW we will set this field.
|
if it is not expression from merged VIEW we will set this field.
|
||||||
@ -6037,8 +6063,9 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
|
|||||||
if (field->vcol_info)
|
if (field->vcol_info)
|
||||||
fix_session_vcol_expr_for_read(thd, field, field->vcol_info);
|
fix_session_vcol_expr_for_read(thd, field, field->vcol_info);
|
||||||
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
|
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
|
||||||
!outer_fixed && !thd->lex->in_sum_func &&
|
!outer_fixed &&
|
||||||
select &&
|
select &&
|
||||||
|
!lex_s->in_sum_func &&
|
||||||
select->cur_pos_in_select_list != UNDEF_POS &&
|
select->cur_pos_in_select_list != UNDEF_POS &&
|
||||||
select->join)
|
select->join)
|
||||||
{
|
{
|
||||||
@ -6073,13 +6100,13 @@ mark_non_agg_field:
|
|||||||
*/
|
*/
|
||||||
select_lex= context->select_lex;
|
select_lex= context->select_lex;
|
||||||
}
|
}
|
||||||
if (!thd->lex->in_sum_func)
|
if (!lex_s || !lex_s->in_sum_func)
|
||||||
select_lex->set_non_agg_field_used(true);
|
select_lex->set_non_agg_field_used(true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (outer_fixed)
|
if (outer_fixed)
|
||||||
thd->lex->in_sum_func->outer_fields.push_back(this, thd->mem_root);
|
lex_s->in_sum_func->outer_fields.push_back(this, thd->mem_root);
|
||||||
else if (thd->lex->in_sum_func->nest_level !=
|
else if (lex_s->in_sum_func->nest_level !=
|
||||||
select->nest_level)
|
select->nest_level)
|
||||||
select_lex->set_non_agg_field_used(true);
|
select_lex->set_non_agg_field_used(true);
|
||||||
}
|
}
|
||||||
@ -7539,6 +7566,12 @@ Item *get_field_item_for_having(THD *thd, Item *item, st_select_lex *sel)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item *Item_ident::derived_field_transformer_for_having(THD *thd, uchar *arg)
|
||||||
|
{
|
||||||
|
st_select_lex *sel= (st_select_lex *)arg;
|
||||||
|
context= &sel->context;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
|
Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
|
||||||
{
|
{
|
||||||
@ -7558,12 +7591,13 @@ Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
|
|||||||
Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd,
|
Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd,
|
||||||
uchar *arg)
|
uchar *arg)
|
||||||
{
|
{
|
||||||
|
st_select_lex *sel= (st_select_lex *)arg;
|
||||||
|
context= &sel->context;
|
||||||
if ((*ref)->marker & SUBSTITUTION_FL)
|
if ((*ref)->marker & SUBSTITUTION_FL)
|
||||||
{
|
{
|
||||||
this->marker|= SUBSTITUTION_FL;
|
this->marker|= SUBSTITUTION_FL;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
st_select_lex *sel= (st_select_lex *)arg;
|
|
||||||
table_map tab_map= sel->master_unit()->derived->table->map;
|
table_map tab_map= sel->master_unit()->derived->table->map;
|
||||||
if ((item_equal && !(item_equal->used_tables() & tab_map)) ||
|
if ((item_equal && !(item_equal->used_tables() & tab_map)) ||
|
||||||
!item_equal)
|
!item_equal)
|
||||||
@ -7826,7 +7860,9 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
{
|
{
|
||||||
enum_parsing_place place= NO_MATTER;
|
enum_parsing_place place= NO_MATTER;
|
||||||
DBUG_ASSERT(fixed == 0);
|
DBUG_ASSERT(fixed == 0);
|
||||||
SELECT_LEX *current_sel= thd->lex->current_select;
|
|
||||||
|
SELECT_LEX *current_sel= context->select_lex;
|
||||||
|
LEX *lex_s= context->select_lex->parent_lex;
|
||||||
|
|
||||||
if (set_properties_only)
|
if (set_properties_only)
|
||||||
{
|
{
|
||||||
@ -7987,10 +8023,10 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
the nest level of the enclosing set function : adjust the value of
|
the nest level of the enclosing set function : adjust the value of
|
||||||
max_arg_level for the function if it's needed.
|
max_arg_level for the function if it's needed.
|
||||||
*/
|
*/
|
||||||
if (thd->lex->in_sum_func &&
|
if (lex_s->in_sum_func &&
|
||||||
thd->lex->in_sum_func->nest_level >=
|
lex_s->in_sum_func->nest_level >=
|
||||||
last_checked_context->select_lex->nest_level)
|
last_checked_context->select_lex->nest_level)
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
|
set_if_bigger(lex_s->in_sum_func->max_arg_level,
|
||||||
last_checked_context->select_lex->nest_level);
|
last_checked_context->select_lex->nest_level);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -8010,10 +8046,10 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
the nest level of the enclosing set function : adjust the value of
|
the nest level of the enclosing set function : adjust the value of
|
||||||
max_arg_level for the function if it's needed.
|
max_arg_level for the function if it's needed.
|
||||||
*/
|
*/
|
||||||
if (thd->lex->in_sum_func &&
|
if (lex_s->in_sum_func &&
|
||||||
thd->lex->in_sum_func->nest_level >=
|
lex_s->in_sum_func->nest_level >=
|
||||||
last_checked_context->select_lex->nest_level)
|
last_checked_context->select_lex->nest_level)
|
||||||
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
|
set_if_bigger(lex_s->in_sum_func->max_arg_level,
|
||||||
last_checked_context->select_lex->nest_level);
|
last_checked_context->select_lex->nest_level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3363,6 +3363,7 @@ public:
|
|||||||
Collect outer references
|
Collect outer references
|
||||||
*/
|
*/
|
||||||
bool collect_outer_ref_processor(void *arg) override;
|
bool collect_outer_ref_processor(void *arg) override;
|
||||||
|
Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override;
|
||||||
friend bool insert_fields(THD *thd, Name_resolution_context *context,
|
friend bool insert_fields(THD *thd, Name_resolution_context *context,
|
||||||
const char *db_name,
|
const char *db_name,
|
||||||
const char *table_name, List_iterator<Item> *it,
|
const char *table_name, List_iterator<Item> *it,
|
||||||
|
@ -5264,8 +5264,9 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
|
|||||||
tmp_table_ref->init_one_table(&empty_clex_str, &table_name, NULL, TL_READ);
|
tmp_table_ref->init_one_table(&empty_clex_str, &table_name, NULL, TL_READ);
|
||||||
tmp_table_ref->table= tmp_table;
|
tmp_table_ref->table= tmp_table;
|
||||||
|
|
||||||
context= new Name_resolution_context;
|
context= new (thd->mem_root) Name_resolution_context;
|
||||||
context->init();
|
context->init();
|
||||||
|
context->select_lex= item_in->unit->first_select();
|
||||||
context->first_name_resolution_table=
|
context->first_name_resolution_table=
|
||||||
context->last_name_resolution_table= tmp_table_ref;
|
context->last_name_resolution_table= tmp_table_ref;
|
||||||
semi_join_conds_context= context;
|
semi_join_conds_context= context;
|
||||||
|
@ -73,6 +73,7 @@ size_t Item_sum::ram_limitation(THD *thd)
|
|||||||
bool Item_sum::init_sum_func_check(THD *thd)
|
bool Item_sum::init_sum_func_check(THD *thd)
|
||||||
{
|
{
|
||||||
SELECT_LEX *curr_sel= thd->lex->current_select;
|
SELECT_LEX *curr_sel= thd->lex->current_select;
|
||||||
|
LEX *lex_s= (curr_sel ? curr_sel->parent_lex : thd->lex);
|
||||||
if (curr_sel && curr_sel->name_visibility_map.is_clear_all())
|
if (curr_sel && curr_sel->name_visibility_map.is_clear_all())
|
||||||
{
|
{
|
||||||
for (SELECT_LEX *sl= curr_sel; sl; sl= sl->context.outer_select())
|
for (SELECT_LEX *sl= curr_sel; sl; sl= sl->context.outer_select())
|
||||||
@ -88,9 +89,9 @@ bool Item_sum::init_sum_func_check(THD *thd)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
/* Set a reference to the nesting set function if there is any */
|
/* Set a reference to the nesting set function if there is any */
|
||||||
in_sum_func= thd->lex->in_sum_func;
|
in_sum_func= lex_s->in_sum_func;
|
||||||
/* Save a pointer to object to be used in items for nested set functions */
|
/* Save a pointer to object to be used in items for nested set functions */
|
||||||
thd->lex->in_sum_func= this;
|
lex_s->in_sum_func= this;
|
||||||
nest_level= thd->lex->current_select->nest_level;
|
nest_level= thd->lex->current_select->nest_level;
|
||||||
ref_by= 0;
|
ref_by= 0;
|
||||||
aggr_level= -1;
|
aggr_level= -1;
|
||||||
@ -157,6 +158,7 @@ bool Item_sum::init_sum_func_check(THD *thd)
|
|||||||
bool Item_sum::check_sum_func(THD *thd, Item **ref)
|
bool Item_sum::check_sum_func(THD *thd, Item **ref)
|
||||||
{
|
{
|
||||||
SELECT_LEX *curr_sel= thd->lex->current_select;
|
SELECT_LEX *curr_sel= thd->lex->current_select;
|
||||||
|
LEX *lex_s= curr_sel->parent_lex;
|
||||||
nesting_map allow_sum_func(thd->lex->allow_sum_func);
|
nesting_map allow_sum_func(thd->lex->allow_sum_func);
|
||||||
allow_sum_func.intersect(curr_sel->name_visibility_map);
|
allow_sum_func.intersect(curr_sel->name_visibility_map);
|
||||||
bool invalid= FALSE;
|
bool invalid= FALSE;
|
||||||
@ -319,7 +321,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
|
|||||||
if (sum_func() == SP_AGGREGATE_FUNC)
|
if (sum_func() == SP_AGGREGATE_FUNC)
|
||||||
aggr_sel->set_custom_agg_func_used(true);
|
aggr_sel->set_custom_agg_func_used(true);
|
||||||
update_used_tables();
|
update_used_tables();
|
||||||
thd->lex->in_sum_func= in_sum_func;
|
lex_s->in_sum_func= in_sum_func;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ void stop_mysqld_service()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Remeber initial state of the service, we will restore it on
|
Remember initial state of the service, we will restore it on
|
||||||
exit.
|
exit.
|
||||||
*/
|
*/
|
||||||
if(initial_service_state == UINT_MAX)
|
if(initial_service_state == UINT_MAX)
|
||||||
@ -490,8 +490,10 @@ int main(int argc, char **argv)
|
|||||||
CopyFile(service_properties.inifile, my_ini_bck, FALSE);
|
CopyFile(service_properties.inifile, my_ini_bck, FALSE);
|
||||||
upgrade_config_file(service_properties.inifile);
|
upgrade_config_file(service_properties.inifile);
|
||||||
|
|
||||||
log("Phase %d/%d: Ensuring innodb slow shutdown%s", ++phase, max_phases,
|
bool do_start_stop_server = old_mysqld_exe_exists && initial_service_state != SERVICE_RUNNING;
|
||||||
old_mysqld_exe_exists?",this can take some time":"(skipped)");
|
|
||||||
|
log("Phase %d/%d: Start and stop server in the old version, to avoid crash recovery %s", ++phase, max_phases,
|
||||||
|
do_start_stop_server?",this can take some time":"(skipped)");
|
||||||
|
|
||||||
char socket_param[FN_REFLEN];
|
char socket_param[FN_REFLEN];
|
||||||
sprintf_s(socket_param, "--socket=mysql_upgrade_service_%u",
|
sprintf_s(socket_param, "--socket=mysql_upgrade_service_%u",
|
||||||
@ -499,11 +501,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
DWORD start_duration_ms = 0;
|
DWORD start_duration_ms = 0;
|
||||||
|
|
||||||
if (old_mysqld_exe_exists)
|
if (do_start_stop_server)
|
||||||
{
|
{
|
||||||
/* Start/stop server with --loose-innodb-fast-shutdown=0 */
|
/* Start/stop server with --loose-innodb-fast-shutdown=1 */
|
||||||
mysqld_process = (HANDLE)run_tool(P_NOWAIT, service_properties.mysqld_exe,
|
mysqld_process = (HANDLE)run_tool(P_NOWAIT, service_properties.mysqld_exe,
|
||||||
defaults_file_param, "--loose-innodb-fast-shutdown=0", "--skip-networking",
|
defaults_file_param, "--loose-innodb-fast-shutdown=1", "--skip-networking",
|
||||||
"--enable-named-pipe", socket_param, "--skip-slave-start", NULL);
|
"--enable-named-pipe", socket_param, "--skip-slave-start", NULL);
|
||||||
|
|
||||||
if (mysqld_process == INVALID_HANDLE_VALUE)
|
if (mysqld_process == INVALID_HANDLE_VALUE)
|
||||||
|
22
sql/sp.cc
22
sql/sp.cc
@ -1931,8 +1931,6 @@ bool
|
|||||||
Sp_handler::sp_show_create_routine(THD *thd,
|
Sp_handler::sp_show_create_routine(THD *thd,
|
||||||
const Database_qualified_name *name) const
|
const Database_qualified_name *name) const
|
||||||
{
|
{
|
||||||
sp_head *sp;
|
|
||||||
|
|
||||||
DBUG_ENTER("sp_show_create_routine");
|
DBUG_ENTER("sp_show_create_routine");
|
||||||
DBUG_PRINT("enter", ("type: %s name: %.*s",
|
DBUG_PRINT("enter", ("type: %s name: %.*s",
|
||||||
type_str(),
|
type_str(),
|
||||||
@ -1945,20 +1943,28 @@ Sp_handler::sp_show_create_routine(THD *thd,
|
|||||||
It is "safe" to do as long as it doesn't affect the results
|
It is "safe" to do as long as it doesn't affect the results
|
||||||
of the binary log or the query cache, which currently it does not.
|
of the binary log or the query cache, which currently it does not.
|
||||||
*/
|
*/
|
||||||
if (sp_cache_routine(thd, name, false, &sp))
|
sp_head *sp= 0;
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
|
|
||||||
if (sp == NULL || sp->show_create_routine(thd, this))
|
DBUG_EXECUTE_IF("cache_sp_in_show_create",
|
||||||
|
/* Some tests need just need a way to cache SP without other side-effects.*/
|
||||||
|
sp_cache_routine(thd, name, false, &sp);
|
||||||
|
sp->show_create_routine(thd, this);
|
||||||
|
DBUG_RETURN(false);
|
||||||
|
);
|
||||||
|
|
||||||
|
bool free_sp= db_find_routine(thd, name, &sp) == SP_OK;
|
||||||
|
bool ret= !sp || sp->show_create_routine(thd, this);
|
||||||
|
if (ret)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
If we have insufficient privileges, pretend the routine
|
If we have insufficient privileges, pretend the routine
|
||||||
does not exist.
|
does not exist.
|
||||||
*/
|
*/
|
||||||
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), type_str(), name->m_name.str);
|
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), type_str(), name->m_name.str);
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
}
|
}
|
||||||
|
if (free_sp)
|
||||||
DBUG_RETURN(FALSE);
|
sp_head::destroy(sp);
|
||||||
|
DBUG_RETURN(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6828,6 +6828,7 @@ set_new_item_local_context(THD *thd, Item_ident *item, TABLE_LIST *table_ref)
|
|||||||
if (!(context= new (thd->mem_root) Name_resolution_context))
|
if (!(context= new (thd->mem_root) Name_resolution_context))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
context->init();
|
context->init();
|
||||||
|
context->select_lex= table_ref->select_lex;
|
||||||
context->first_name_resolution_table=
|
context->first_name_resolution_table=
|
||||||
context->last_name_resolution_table= table_ref;
|
context->last_name_resolution_table= table_ref;
|
||||||
item->context= context;
|
item->context= context;
|
||||||
|
@ -3040,6 +3040,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
|
|||||||
}
|
}
|
||||||
for (; sl; sl= sl->next_select_in_list())
|
for (; sl; sl= sl->next_select_in_list())
|
||||||
{
|
{
|
||||||
|
sl->parent_lex->in_sum_func= NULL;
|
||||||
if (sl->changed_elements & TOUCHED_SEL_COND)
|
if (sl->changed_elements & TOUCHED_SEL_COND)
|
||||||
{
|
{
|
||||||
/* remove option which was put by mysql_explain_union() */
|
/* remove option which was put by mysql_explain_union() */
|
||||||
@ -3174,7 +3175,6 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
|
|||||||
lex->result->set_thd(thd);
|
lex->result->set_thd(thd);
|
||||||
}
|
}
|
||||||
lex->allow_sum_func.clear_all();
|
lex->allow_sum_func.clear_all();
|
||||||
lex->in_sum_func= NULL;
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user