mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts: Text conflict in client/mysqlbinlog.cc Text conflict in mysql-test/Makefile.am Text conflict in mysql-test/collections/default.daily Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test Text conflict in mysys/charset.c Text conflict in sql/field.cc Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_func.cc Text conflict in sql/log.cc Text conflict in sql/log_event.cc Text conflict in sql/log_event_old.cc Text conflict in sql/mysqld.cc Text conflict in sql/rpl_utility.cc Text conflict in sql/rpl_utility.h Text conflict in sql/set_var.cc Text conflict in sql/share/Makefile.am Text conflict in sql/sql_delete.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_table.cc Text conflict in storage/example/ha_example.h Text conflict in storage/federated/ha_federated.cc Text conflict in storage/myisammrg/ha_myisammrg.cc Text conflict in storage/myisammrg/myrg_open.c
This commit is contained in:
14
mysql-test/include/check_ipv6.inc
Normal file
14
mysql-test/include/check_ipv6.inc
Normal file
@@ -0,0 +1,14 @@
|
||||
# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
|
||||
--disable_query_log
|
||||
--disable_abort_on_error
|
||||
connect (checkcon123456789,::1,root,,test);
|
||||
if($mysql_errno)
|
||||
{
|
||||
skip wrong IP;
|
||||
}
|
||||
connection default;
|
||||
disconnect checkcon123456789;
|
||||
--enable_abort_on_error
|
||||
--enable_query_log
|
||||
# end check
|
||||
|
@@ -547,9 +547,9 @@ call p_verify_status_increment(0, 0, 0, 0);
|
||||
--echo # the binary log.
|
||||
--echo #
|
||||
select f1();
|
||||
call p_verify_status_increment(0, 0, 1, 0);
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
commit;
|
||||
call p_verify_status_increment(0, 0, 1, 0);
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
|
||||
--echo # 17. Read-only statement, a function changes non-trans-table.
|
||||
--echo #
|
||||
@@ -557,15 +557,19 @@ call p_verify_status_increment(0, 0, 1, 0);
|
||||
--echo # non-transactional changes saved in the transaction cache to
|
||||
--echo # the binary log.
|
||||
--echo #
|
||||
--disable_warnings
|
||||
select f1() from t1;
|
||||
call p_verify_status_increment(1, 0, 2, 0);
|
||||
--enable_warnings
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
commit;
|
||||
call p_verify_status_increment(1, 0, 2, 0);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
|
||||
--echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows.
|
||||
--echo #
|
||||
select count(*) from t2;
|
||||
--disable_warnings
|
||||
update t1 set a=2 where a=f1()+10;
|
||||
--enable_warnings
|
||||
select count(*) from t2;
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
commit;
|
||||
@@ -579,7 +583,7 @@ call p_verify_status_increment(2, 0, 2, 0);
|
||||
drop table t2;
|
||||
set sql_mode=no_engine_substitution;
|
||||
create temporary table t2 (a int);
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
call p_verify_status_increment(1, 0, 0, 0);
|
||||
set sql_mode=default;
|
||||
--echo # 19. A function changes temp-trans-table.
|
||||
--echo #
|
||||
@@ -636,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0);
|
||||
--echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
|
||||
--echo #
|
||||
drop temporary table t2;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
call p_verify_status_increment(1, 0, 0, 0);
|
||||
commit;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
call p_verify_status_increment(1, 0, 0, 0);
|
||||
|
||||
--echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit
|
||||
--echo #
|
||||
@@ -719,21 +723,21 @@ call p_verify_status_increment(4, 4, 4, 4);
|
||||
--echo # Sic: no table is created.
|
||||
create table if not exists t2 (a int) select 6 union select 7;
|
||||
--echo # Sic: first commits the statement, and then the transaction.
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
call p_verify_status_increment(2, 0, 4, 4);
|
||||
create table t3 select a from t2;
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
call p_verify_status_increment(2, 0, 4, 4);
|
||||
alter table t3 add column (b int);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
alter table t3 rename t4;
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
rename table t4 to t3;
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
truncate table t3;
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
create view v1 as select * from t2;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
check table t1;
|
||||
call p_verify_status_increment(3, 0, 3, 0);
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
--echo # Sic: after this bug is fixed, CHECK leaves no pending transaction
|
||||
commit;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
|
11
mysql-test/include/ctype_datetime.inc
Normal file
11
mysql-test/include/ctype_datetime.inc
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Bug#32390 Character sets: casting utf32 to/from date doesn't work
|
||||
#
|
||||
CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0;
|
||||
SET timestamp=1216359724;
|
||||
INSERT INTO t1 VALUES (current_date);
|
||||
INSERT INTO t1 VALUES (current_time);
|
||||
INSERT INTO t1 VALUES (current_timestamp);
|
||||
SELECT s1, hex(s1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET timestamp=0;
|
50
mysql-test/include/ctype_like.inc
Normal file
50
mysql-test/include/ctype_like.inc
Normal file
@@ -0,0 +1,50 @@
|
||||
select @@collation_connection;
|
||||
|
||||
#
|
||||
# Create a table with a nullable varchar(10) column
|
||||
# using currect character_set_connection.
|
||||
create table t1 as select repeat(' ',10) as a union select null;
|
||||
alter table t1 add key(a);
|
||||
show create table t1;
|
||||
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
|
||||
explain select * from t1 where a like 'abc%';
|
||||
explain select * from t1 where a like concat('abc','%');
|
||||
select * from t1 where a like "abc%";
|
||||
select * from t1 where a like concat("abc","%");
|
||||
select * from t1 where a like "ABC%";
|
||||
select * from t1 where a like "test%";
|
||||
select * from t1 where a like "te_t";
|
||||
select * from t1 where a like "%a%";
|
||||
select * from t1 where a like "%abcd%";
|
||||
select * from t1 where a like "%abc\d%";
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #2619 ucs2 LIKE comparison fails in some cases
|
||||
#
|
||||
|
||||
select 'AA' like 'AA';
|
||||
select 'AA' like 'A%A';
|
||||
select 'AA' like 'A%%A';
|
||||
select 'AA' like 'AA%';
|
||||
select 'AA' like '%AA%';
|
||||
select 'AA' like '%A';
|
||||
select 'AA' like '%AA';
|
||||
select 'AA' like 'A%A%';
|
||||
select 'AA' like '_%_%';
|
||||
select 'AA' like '%A%A';
|
||||
select 'AAA'like 'A%A%A';
|
||||
|
||||
select 'AZ' like 'AZ';
|
||||
select 'AZ' like 'A%Z';
|
||||
select 'AZ' like 'A%%Z';
|
||||
select 'AZ' like 'AZ%';
|
||||
select 'AZ' like '%AZ%';
|
||||
select 'AZ' like '%Z';
|
||||
select 'AZ' like '%AZ';
|
||||
select 'AZ' like 'A%Z%';
|
||||
select 'AZ' like '_%_%';
|
||||
select 'AZ' like '%A%Z';
|
||||
select 'AZ' like 'A_';
|
||||
select 'AZ' like '_Z';
|
||||
select 'AMZ'like 'A%M%Z';
|
1606
mysql-test/include/ctype_numconv.inc
Normal file
1606
mysql-test/include/ctype_numconv.inc
Normal file
File diff suppressed because it is too large
Load Diff
44
mysql-test/include/ctype_utf8_table.inc
Normal file
44
mysql-test/include/ctype_utf8_table.inc
Normal file
@@ -0,0 +1,44 @@
|
||||
CREATE TABLE t1 (a CHAR(1)) CHARACTER SET utf8;
|
||||
INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
|
||||
INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
|
||||
#
|
||||
# Populate tables head and tail with values '00'-'FF'
|
||||
#
|
||||
CREATE TEMPORARY TABLE head AS SELECT concat(b1.a, b2.a) AS head FROM t1 b1, t1 b2;
|
||||
CREATE TEMPORARY TABLE tail AS SELECT concat(b1.a, b2.a) AS tail FROM t1 b1, t1 b2;
|
||||
CREATE TEMPORARY TABLE middle AS SELECT concat(b1.a, b2.a) AS middle FROM t1 b1, t1 b2;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a varchar(1)) CHARACTER SET utf8;
|
||||
|
||||
#
|
||||
# Populate single byte characters
|
||||
#
|
||||
|
||||
INSERT INTO t1 SELECT UNHEX(head)
|
||||
FROM head WHERE (head BETWEEN '00' AND '7F') ORDER BY head;
|
||||
|
||||
#
|
||||
# Populate 2-byte byte characters: U+80..U+7FF: [C2-DF][80-BF]
|
||||
#
|
||||
INSERT INTO t1
|
||||
SELECT UNHEX(CONCAT(head,tail))
|
||||
FROM head, tail
|
||||
WHERE (head BETWEEN 'C2' AND 'DF') AND (tail BETWEEN '80' AND 'BF')
|
||||
ORDER BY head, tail;
|
||||
|
||||
|
||||
#
|
||||
# Populate 3-byte characters: U+800..U+FFFF: [E0-EF][80-BF][80-BF]
|
||||
# excluding overlong [E0][80-9F][80-BF]
|
||||
#
|
||||
INSERT INTO t1
|
||||
SELECT UNHEX(CONCAT(head, middle, tail))
|
||||
FROM head, middle, tail
|
||||
WHERE (head BETWEEN 'E0' AND 'EF')
|
||||
AND (middle BETWEEN '80' AND 'BF')
|
||||
AND (tail BETWEEN '80' AND 'BF')
|
||||
AND NOT (head='E0' AND middle BETWEEN '80' AND '9F')
|
||||
ORDER BY head, middle, tail;
|
||||
|
||||
SELECT count(*) FROM t1;
|
1858
mysql-test/include/ctype_utf8mb4.inc
Normal file
1858
mysql-test/include/ctype_utf8mb4.inc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -36,19 +36,19 @@ SHOW PROCEDURE STATUS LIKE 'p4'|
|
||||
--echo
|
||||
--echo
|
||||
|
||||
--replace_column 16 CREATED 17 ALTERED
|
||||
--replace_column 23 CREATED 24 ALTERED
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
|
||||
--echo
|
||||
--replace_column 16 CREATED 17 ALTERED
|
||||
--replace_column 23 CREATED 24 ALTERED
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
|
||||
--echo
|
||||
--replace_column 16 CREATED 17 ALTERED
|
||||
--replace_column 23 CREATED 24 ALTERED
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
|
||||
--echo
|
||||
--replace_column 16 CREATED 17 ALTERED
|
||||
--replace_column 23 CREATED 24 ALTERED
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
|
||||
# - Initialize the used variables (actual values don't matter);
|
||||
|
@@ -1,3 +1,18 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Use default setting for mysqld processes
|
||||
!include default_mysqld.cnf
|
||||
!include default_client.cnf
|
||||
@@ -9,18 +24,12 @@
|
||||
|
||||
log-bin= master-bin
|
||||
|
||||
# Run tests with the performance schema instrumentation
|
||||
loose-enable-performance-schema
|
||||
|
||||
[mysqlbinlog]
|
||||
disable-force-if-open
|
||||
|
||||
# mysql_fix_privilege_tables.sh does not read from [client] so it
|
||||
# need its own section
|
||||
[mysql_fix_privilege_tables]
|
||||
socket= @client.socket
|
||||
port= @client.port
|
||||
user= @client.user
|
||||
password= @client.password
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
MASTER_MYSOCK= @mysqld.1.socket
|
||||
|
@@ -1,8 +1,23 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Default values that applies to all MySQL Servers
|
||||
[mysqld]
|
||||
open-files-limit= 1024
|
||||
local-infile
|
||||
default-character-set= latin1
|
||||
character-set-server= latin1
|
||||
|
||||
# Increase default connect_timeout to avoid intermittent
|
||||
# disconnects when test servers are put under load see BUG#28359
|
||||
@@ -26,3 +41,7 @@ slave-net-timeout=120
|
||||
|
||||
log-bin=mysqld-bin
|
||||
|
||||
# Run tests with the performance schema instrumentation
|
||||
loose-enable-performance-schema
|
||||
|
||||
binlog-direct-non-transactional-updates
|
||||
|
@@ -60,6 +60,7 @@ disable_query_log;
|
||||
--error 0,1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
|
||||
|
||||
|
||||
let $_diff_table=$diff_table_2;
|
||||
let $_diff_i=2;
|
||||
while ($_diff_i) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
#
|
||||
# Whether server supports dynamic loading.
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip The test requires dynamic loading
|
||||
}
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
|
@@ -1,13 +1,21 @@
|
||||
#
|
||||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
--source include/have_dynamic_loading.inc
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip Example plugin requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable EXAMPLE_PLUGIN is set
|
||||
#
|
||||
--require r/have_example_plugin.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin';
|
||||
if (`SELECT LENGTH('$EXAMPLE_PLUGIN') = 0`) {
|
||||
--skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr)
|
||||
}
|
||||
|
||||
#
|
||||
# Check if --plugin-dir was setup for exampledb
|
||||
#
|
||||
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) {
|
||||
--skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use)
|
||||
}
|
||||
enable_query_log;
|
||||
|
14
mysql-test/include/have_ipv4_mapped.inc
Normal file
14
mysql-test/include/have_ipv4_mapped.inc
Normal file
@@ -0,0 +1,14 @@
|
||||
# Check if ipv4 mapped to ipv6 is available.
|
||||
--disable_query_log
|
||||
--disable_abort_on_error
|
||||
connect (checkcon123456789,::FFFF:127.0.0.1,root,,test);
|
||||
if($mysql_errno)
|
||||
{
|
||||
skip wrong IP;
|
||||
}
|
||||
connection default;
|
||||
disconnect checkcon123456789;
|
||||
--enable_abort_on_error
|
||||
--enable_query_log
|
||||
# end check
|
||||
|
20
mysql-test/include/have_perfschema.inc
Normal file
20
mysql-test/include/have_perfschema.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2010 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
if (!`SELECT count(*) FROM information_schema.engines WHERE
|
||||
(support = 'YES' OR support = 'DEFAULT') AND
|
||||
engine = 'PERFORMANCE_SCHEMA'`){
|
||||
skip Need performance schema compiled in;
|
||||
}
|
@@ -1,10 +1,9 @@
|
||||
#
|
||||
# Check if dynamic loading is supported
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip Requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable SEMISYNC_MASTER_PLUGIN is set
|
||||
|
@@ -1,13 +1,20 @@
|
||||
#
|
||||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
--source include/have_dynamic_loading.inc
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip simple parser requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable SIMPLE_PARSER is set
|
||||
#
|
||||
--require r/have_simple_parser.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
|
||||
enable_query_log;
|
||||
if (`SELECT LENGTH('$SIMPLE_PARSER') = 0`) {
|
||||
--skip simple parser requires the environment variable \$SIMPLE_PARSER to be set (normally done by mtr)
|
||||
}
|
||||
|
||||
#
|
||||
# Check if --plugin-dir was setup for simple parser
|
||||
#
|
||||
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) {
|
||||
--skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
|
||||
}
|
||||
|
10
mysql-test/include/have_thread_concurrency.inc
Normal file
10
mysql-test/include/have_thread_concurrency.inc
Normal file
@@ -0,0 +1,10 @@
|
||||
disable_query_log;
|
||||
disable_result_log;
|
||||
set @have_thread_concurrency=0;
|
||||
select @have_thread_concurrency:=1 from information_schema.global_variables where variable_name='thread_concurrency';
|
||||
if (`select @have_thread_concurrency = 0`)
|
||||
{
|
||||
skip Need @@thread_concurrency;
|
||||
}
|
||||
enable_result_log;
|
||||
enable_query_log;
|
@@ -1,13 +1,20 @@
|
||||
#
|
||||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
--source include/have_dynamic_loading.inc
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip UDF requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable UDF_EXAMPLE_LIB is set
|
||||
#
|
||||
--require r/have_udf_example.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib';
|
||||
enable_query_log;
|
||||
if (`SELECT LENGTH('$UDF_EXAMPLE_LIB') = 0`) {
|
||||
--skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr)
|
||||
}
|
||||
|
||||
#
|
||||
# Check if --plugin-dir was setup for udf
|
||||
#
|
||||
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) {
|
||||
--skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
|
||||
}
|
||||
|
4
mysql-test/include/have_utf16.inc
Normal file
4
mysql-test/include/have_utf16.inc
Normal file
@@ -0,0 +1,4 @@
|
||||
-- require r/have_utf16.require
|
||||
disable_query_log;
|
||||
show collation like 'utf16_general_ci';
|
||||
enable_query_log;
|
4
mysql-test/include/have_utf32.inc
Normal file
4
mysql-test/include/have_utf32.inc
Normal file
@@ -0,0 +1,4 @@
|
||||
-- require r/have_utf32.require
|
||||
disable_query_log;
|
||||
show collation like 'utf32_general_ci';
|
||||
enable_query_log;
|
7
mysql-test/include/have_utf8mb4.inc
Normal file
7
mysql-test/include/have_utf8mb4.inc
Normal file
@@ -0,0 +1,7 @@
|
||||
--require r/have_utf8mb4.require
|
||||
|
||||
--disable_query_log
|
||||
|
||||
SHOW COLLATION LIKE 'utf8mb4_general_ci';
|
||||
|
||||
--enable_query_log
|
5
mysql-test/include/implicit_commit_helper.inc
Normal file
5
mysql-test/include/implicit_commit_helper.inc
Normal file
@@ -0,0 +1,5 @@
|
||||
INSERT INTO db1.trans (a) VALUES (1);
|
||||
--disable_result_log
|
||||
eval $statement;
|
||||
--enable_result_log
|
||||
CALL db1.test_if_commit();
|
@@ -303,7 +303,7 @@ drop table t4;
|
||||
create table t4 (a int);
|
||||
insert into t4 values (1),(4),(3);
|
||||
set @save_join_buffer_size=@@join_buffer_size;
|
||||
set join_buffer_size= 4000;
|
||||
set join_buffer_size= 4096;
|
||||
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
|
||||
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
where (A.key1 < 500000 or A.key2 < 3)
|
||||
|
25
mysql-test/include/ipv6.inc
Normal file
25
mysql-test/include/ipv6.inc
Normal file
@@ -0,0 +1,25 @@
|
||||
eval CREATE USER testuser@'$IPv6' identified by '1234';
|
||||
eval GRANT ALL ON test.* TO testuser@'$IPv6';
|
||||
eval SHOW GRANTS FOR testuser@'$IPv6';
|
||||
# deliver NULL instead of a valid number, see bug#34037
|
||||
eval SET @nip= inet_aton('$IPv6');
|
||||
SELECT @nip;
|
||||
SELECT inet_ntoa(@nip);
|
||||
# delivers a wrong value, see bug#34037
|
||||
--replace_result ::1 localhost
|
||||
SELECT USER();
|
||||
--replace_result ::1 localhost
|
||||
SELECT current_user();
|
||||
--disable_result_log
|
||||
SHOW PROCESSLIST;
|
||||
--enable_result_log
|
||||
connect (con1, $IPv6, root, , test, $MASTER_MYPORT);
|
||||
connection default;
|
||||
disconnect con1;
|
||||
eval REVOKE ALL ON test.* FROM testuser@'$IPv6';
|
||||
eval RENAME USER testuser@'$IPv6' to testuser1@'$IPv6';
|
||||
eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
|
||||
--replace_result ::1 localhost
|
||||
SELECT USER();
|
||||
eval DROP USER testuser1@'$IPv6';
|
||||
|
7
mysql-test/include/ipv6_clients.inc
Normal file
7
mysql-test/include/ipv6_clients.inc
Normal file
@@ -0,0 +1,7 @@
|
||||
--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -h $IPv6 -P $MASTER_MYPORT -u root ping
|
||||
--disable_result_log
|
||||
--exec $MYSQL_CHECK -h $IPv6 -P $MASTER_MYPORT -u root test
|
||||
--exec $MYSQL_DUMP -h $IPv6 -P $MASTER_MYPORT -u root test
|
||||
--exec $MYSQL_SHOW -h $IPv6 -P $MASTER_MYPORT -u root
|
||||
--exec $MYSQL --host=$IPv6 --port=$MASTER_MYPORT --user=root test -e "SELECT current_user();SELECT user();"
|
||||
--enable_result_log
|
@@ -6,12 +6,29 @@
|
||||
# Since we expect STOP SLAVE to produce a warning as the slave is
|
||||
# stopped (the server was started with skip-slave-start), we disable
|
||||
# warnings when doing STOP SLAVE.
|
||||
#
|
||||
# $no_change_master If true, no change master will be done nor any reset slave.
|
||||
# This is to avoid touching the relay-log.info file allowing
|
||||
# the test to create one itself.
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
|
||||
connection slave;
|
||||
|
||||
#we expect STOP SLAVE to produce a warning as the slave is stopped
|
||||
#(the server was started with skip-slave-start)
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
--disable_query_log
|
||||
if (!$no_change_master) {
|
||||
eval CHANGE MASTER TO MASTER_USER='root',
|
||||
MASTER_CONNECT_RETRY=1,
|
||||
MASTER_HOST='127.0.0.1',
|
||||
MASTER_PORT=$MASTER_MYPORT;
|
||||
}
|
||||
--enable_query_log
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
@@ -20,17 +37,39 @@ use test;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
--disable_query_log
|
||||
reset slave;
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
reset slave;
|
||||
|
||||
--disable_warnings
|
||||
# the first RESET SLAVE may produce a warning about non-existent
|
||||
# 'ndb_apply_status' table, because this table is created
|
||||
# asynchronously at the server startup and may not exist yet
|
||||
# if RESET SLAVE comes too soon after the server startup
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
# Clean up old test tables
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
|
||||
--disable_query_log
|
||||
#eval CHANGE MASTER TO MASTER_USER='root',
|
||||
# MASTER_CONNECT_RETRY=1,
|
||||
# MASTER_HOST='127.0.0.1',
|
||||
# MASTER_PORT=$MASTER_MYPORT;
|
||||
reset master;
|
||||
--enable_query_log
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
||||
if (!$skip_slave_start) {
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
# Replication tests need binlog
|
||||
#
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
source include/have_log_bin.inc;
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
@@ -8,7 +10,10 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
-- source include/master-slave-reset.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
if (!$skip_slave_start) {
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
}
|
||||
|
||||
# Set the default connection to 'master'
|
||||
connection master;
|
||||
|
@@ -899,6 +899,8 @@ CREATE PROCEDURE p1 ()
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 50;
|
||||
DECLARE cnt INT;
|
||||
# Continue even in the presence of ER_LOCK_DEADLOCK.
|
||||
DECLARE CONTINUE HANDLER FOR 1213 BEGIN END;
|
||||
START TRANSACTION;
|
||||
ALTER TABLE t1 ENGINE=InnoDB;
|
||||
COMMIT;
|
||||
@@ -1392,6 +1394,7 @@ SELECT * FROM t1;
|
||||
connection con2;
|
||||
--reap
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
|
||||
--echo # Switch to connection con1
|
||||
connection con1;
|
||||
|
@@ -1994,6 +1994,7 @@ commit;
|
||||
connection b;
|
||||
set autocommit = 0;
|
||||
update t1 set b = 5 where a = 2;
|
||||
commit;
|
||||
connection a;
|
||||
delimiter |;
|
||||
create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
|
||||
@@ -2056,6 +2057,7 @@ update t2 set b = b + 5 where a = 1;
|
||||
update t3 set b = b + 5 where a = 1;
|
||||
update t4 set b = b + 5 where a = 1;
|
||||
insert into t5(a) values(20);
|
||||
commit;
|
||||
connection b;
|
||||
set autocommit = 0;
|
||||
insert into t1(a) values(7);
|
||||
|
@@ -193,6 +193,8 @@ INSERT INTO global_suppressions VALUES
|
||||
("==[0-9]*== For more details"),
|
||||
/* This comes with innodb plugin tests */
|
||||
("==[0-9]*== Warning: set address range perms: large range"),
|
||||
/* valgrind-3.5.0 dumps this */
|
||||
("==[0-9]*== Command: "),
|
||||
|
||||
/* valgrind warnings: invalid file descriptor -1 in syscall
|
||||
write()/read(). Bug #50414 */
|
||||
@@ -207,6 +209,13 @@ INSERT INTO global_suppressions VALUES
|
||||
("Slave I/O: Get master clock failed with error:.*"),
|
||||
("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
|
||||
("Slave I/O: Get master TIME_ZONE failed with error:.*"),
|
||||
/*
|
||||
BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB
|
||||
table cause warnings in errlog
|
||||
Note: This is a temporary suppression until Bug#42147 can be
|
||||
fixed properly. See bug page for more information.
|
||||
*/
|
||||
("Found lock of type 6 that is write and read locked"),
|
||||
|
||||
("THE_LAST_SUPPRESSION")||
|
||||
|
||||
|
45
mysql-test/include/mysqld--help.inc
Normal file
45
mysql-test/include/mysqld--help.inc
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# mysqld --help
|
||||
#
|
||||
--source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# force lower-case-table-names=1 (linux/macosx have different defaults)
|
||||
# force symbolic-links=0 (valgrind build has a different default)
|
||||
#
|
||||
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
|
||||
|
||||
perl;
|
||||
@skipvars=qw/basedir open-files-limit general-log-file log plugin-dir
|
||||
log-slow-queries pid-file slow-query-log-file
|
||||
datadir slave-load-tmpdir tmpdir/;
|
||||
@plugins=qw/innodb ndb archive blackhole federated partition ndbcluster safemalloc debug temp-pool ssl des-key-file
|
||||
thread-concurrency super-large-pages mutex-deadlock-detector null-audit/;
|
||||
@env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR /;
|
||||
$re1=join('|', @skipvars, @plugins);
|
||||
$re2=join('|', @plugins);
|
||||
$skip=0;
|
||||
open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
|
||||
while (<F>) {
|
||||
next if 1../The following groups are read/;
|
||||
# formatting, skip line consisting entirely of dashes and blanks
|
||||
next if /^[\- ]+$/;
|
||||
next if /Value \(after reading options\)/; # skip table header
|
||||
next if /^($re1) /;
|
||||
next if /^($re2)-/;
|
||||
$skip=0 if /^ -/;
|
||||
$skip=1 if / --($re2)\b/;
|
||||
y!\\!/!;
|
||||
s/[ ]+/ /; # squeeze spaces to remove table formatting
|
||||
# fixes for 32-bit
|
||||
s/\b4294967295\b/18446744073709551615/;
|
||||
s/\b2146435072\b/9223372036853727232/;
|
||||
s/\b196608\b/262144/;
|
||||
foreach $var (@env) { s/$ENV{$var}/$var/ }
|
||||
next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again
|
||||
next if $skip;
|
||||
print;
|
||||
}
|
||||
close F;
|
||||
EOF
|
||||
|
@@ -1,4 +1,4 @@
|
||||
--require r/not_ndb_default.require
|
||||
disable_query_log;
|
||||
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
enable_query_log;
|
||||
|
13
mysql-test/include/not_var_link.inc
Normal file
13
mysql-test/include/not_var_link.inc
Normal file
@@ -0,0 +1,13 @@
|
||||
perl;
|
||||
open (ISLINK, ">" . $ENV{'MYSQL_TMP_DIR'} . "/mtr_var_link");
|
||||
my $mvr= -l $ENV{'MYSQLTEST_VARDIR'} ? 1 : 0;
|
||||
print ISLINK "let \$mtr_var_link= $mvr;\n";
|
||||
close ISLINK;
|
||||
EOF
|
||||
|
||||
--source $MYSQL_TMP_DIR/mtr_var_link
|
||||
--remove_file $MYSQL_TMP_DIR/mtr_var_link
|
||||
|
||||
if ($mtr_var_link) {
|
||||
--skip Test does not work with var being softlink
|
||||
}
|
@@ -114,7 +114,7 @@ connection default;
|
||||
# This should be 'YES'.
|
||||
SHOW VARIABLES LIKE 'have_query_cache';
|
||||
|
||||
SET GLOBAL query_cache_size = 200000;
|
||||
SET GLOBAL query_cache_size = 204800;
|
||||
flush status;
|
||||
SET @@autocommit=1;
|
||||
eval SET SESSION STORAGE_ENGINE = $engine_type;
|
||||
|
@@ -27,7 +27,7 @@ connect (con1,localhost,root,,test,$MASTER_MYPORT,);
|
||||
connection default;
|
||||
|
||||
set @initial_query_cache_size = @@global.query_cache_size;
|
||||
set @@global.query_cache_size=100000;
|
||||
set @@global.query_cache_size=102400;
|
||||
flush status;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
@@ -178,7 +178,7 @@ show status like 'Qcache_hits';
|
||||
# then QC is re-enabled for more EXECUTE.
|
||||
--echo ---- switch to connection default ----
|
||||
connection default;
|
||||
set global query_cache_size=100000;
|
||||
set global query_cache_size=102400;
|
||||
# Expect to see additional Qcache_hits.
|
||||
# The fact that the QC was temporary disabled should have no affect
|
||||
# except that the first execute will not hit results from the
|
||||
@@ -235,7 +235,7 @@ prepare stmt3 from "select * from t1 where c1=10";
|
||||
--echo ---- switch to connection default ----
|
||||
connection default;
|
||||
# then QC is enabled at EXECUTE
|
||||
set global query_cache_size=100000;
|
||||
set global query_cache_size=102400;
|
||||
show status like 'Qcache_hits';
|
||||
execute stmt1;
|
||||
show status like 'Qcache_hits';
|
||||
@@ -260,7 +260,7 @@ connection default;
|
||||
set global query_cache_size=0;
|
||||
prepare stmt1 from "select * from t1 where c1=?";
|
||||
# then QC is enabled at EXECUTE
|
||||
set global query_cache_size=100000;
|
||||
set global query_cache_size=102400;
|
||||
show status like 'Qcache_hits';
|
||||
set @a=1;
|
||||
execute stmt1 using @a;
|
||||
@@ -509,7 +509,7 @@ execute stmt;
|
||||
set @@global.query_cache_size=0;
|
||||
alter table t1 add column b int;
|
||||
execute stmt;
|
||||
set @@global.query_cache_size=100000;
|
||||
set @@global.query_cache_size=102400;
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
--echo #
|
||||
|
24
mysql-test/include/rpl_ip_mix.inc
Normal file
24
mysql-test/include/rpl_ip_mix.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
24
mysql-test/include/rpl_ip_mix2.inc
Normal file
24
mysql-test/include/rpl_ip_mix2.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
22
mysql-test/include/rpl_ipv6.inc
Normal file
22
mysql-test/include/rpl_ipv6.inc
Normal file
@@ -0,0 +1,22 @@
|
||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
@@ -55,11 +55,13 @@ connection master;
|
||||
--echo "Running on the master"
|
||||
--enable_info
|
||||
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
|
||||
--disable_warnings
|
||||
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
|
||||
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
|
||||
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
|
||||
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
|
||||
SELECT * FROM t1 ORDER BY sum;
|
||||
--enable_warnings
|
||||
--disable_info
|
||||
|
||||
sync_slave_with_master;
|
||||
|
@@ -3,6 +3,6 @@
|
||||
|
||||
# masked out log positions
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT $DEFAULT_MASTER_PORT 3306
|
||||
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
|
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
@@ -0,0 +1,41 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Several test primitives from mysql-test/extra/rpl_tests
|
||||
# shared for test cases for MyISAM, InnoDB, NDB and other
|
||||
# engines. But for NDB all events will be added by NDB
|
||||
# injector and now there are no way to detect the state of
|
||||
# NDB injector therefore this primitive waits 5 sec
|
||||
# if engine type is NDB.
|
||||
# In future that should be fixed by waiting of proper
|
||||
# state of NDB injector.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# let $engine_type= NDB;
|
||||
# --source include/wait_for_ndb_to_binlog.inc
|
||||
#
|
||||
# ==== Parameters =====
|
||||
#
|
||||
# $engine_type
|
||||
# Type of engine. If type is NDB then it waits $wait_time sec
|
||||
#
|
||||
# $wait_time
|
||||
# Test will wait $wait_time seconds
|
||||
|
||||
let $_wait_time= 5;
|
||||
|
||||
if (!$wait_time) {
|
||||
let $_wait_time= $wait_time;
|
||||
}
|
||||
|
||||
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
|
||||
while (!$_wait_time) {
|
||||
let $_wait_time_internal= 10;
|
||||
while (!$_wait_time_internal) {
|
||||
sleep 0.1;
|
||||
dec $_wait_time_internal;
|
||||
}
|
||||
dec $_wait_time;
|
||||
}
|
||||
}
|
||||
|
@@ -2,13 +2,16 @@
|
||||
#
|
||||
# SUMMARY
|
||||
#
|
||||
# Waits until the show statement ($show_statement) has at least within one of
|
||||
# the rows of the result set for the field ($field) a value which fulfils
|
||||
# Waits until the show statement ($show_statement) has one or all of the
|
||||
# rows of the result set for the field ($field) a value which fulfils
|
||||
# a condition ($condition), or the operation times out.
|
||||
#
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# All rows of the result must fulfil the condition if $all_rows_fulfil is 1
|
||||
# else at least one of the result must fulfil the condition.
|
||||
# let $wait_for_all= 1;
|
||||
# let $show_statement= SHOW PROCESSLIST;
|
||||
# let $field= State;
|
||||
# let $condition= = 'Updating';
|
||||
@@ -46,27 +49,56 @@ inc $max_run_time;
|
||||
|
||||
let $found= 0;
|
||||
let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
|
||||
if (`SELECT '$wait_for_all' != '1'`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' $condition`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
# We are behind the last row of the result set.
|
||||
let $process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' $condition`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
# We are behind the last row of the result set.
|
||||
let $process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (`SELECT '$wait_for_all' = '1'`)
|
||||
{
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT $found = 0 AND NOT '$field_value' $condition`)
|
||||
{
|
||||
let process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found)
|
||||
{
|
||||
echo # Timeout in include/wait_show_condition.inc for $wait_condition;
|
||||
|
Reference in New Issue
Block a user