Commit d2fe2a71 authored by Joerg Bruehe's avatar Joerg Bruehe

Merge main 5.1 into 5.1-build

165 changesets with 23 conflicts:
Text conflict in mysql-test/r/lock_multi.result
Text conflict in mysql-test/t/lock_multi.test
Text conflict in mysql-test/t/mysqldump.test
Text conflict in sql/item_strfunc.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/parse_file.cc
Text conflict in sql/slave.cc
Text conflict in sql/sp.cc
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_acl.cc
Text conflict in sql/sql_base.cc
Text conflict in sql/sql_class.cc
Text conflict in sql/sql_crypt.cc
Text conflict in sql/sql_db.cc
Text conflict in sql/sql_lex.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_view.cc
Text conflict in storage/innobase/handler/ha_innodb.cc
Text conflict in storage/myisam/mi_packrec.c
Text conflict in tests/mysql_client_test.c

Updates to Innobase, taken from main 5.1:
bzr: ERROR: Some change isn't sane:
File mysql-test/r/innodb-semi-consistent.result is owned by Innobase and should not be updated.
File mysql-test/t/innodb-semi-consistent.test is owned by Innobase and should not be updated.
File storage/innobase/handler/ha_innodb.cc is owned by Innobase and should not be updated.
File storage/innobase/ibuf/ibuf0ibuf.c is owned by Innobase and should not be updated.
File storage/innobase/include/row0mysql.h is owned by Innobase and should not be updated.
File storage/innobase/include/srv0srv.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.ic is owned by Innobase and should not be updated.
File storage/innobase/lock/lock0lock.c is owned by Innobase and should not be updated.
File storage/innobase/page/page0cur.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0mysql.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0sel.c is owned by Innobase and should not be updated.
File storage/innobase/srv/srv0srv.c is owned by Innobase and should not be updated.
File storage/innobase/trx/trx0trx.c is owned by Innobase and should not be updated.
(Set env var 'ALLOW_UPDATE_INNOBASE_OWNED' to override.)
parents 1b4cfc36 c715ff41
This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.
MySQL is brought to you by the MySQL team at Sun Microsystems, Inc.
License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.
GPLv2 Disclaimer
For the avoidance of doubt, except that if any license choice
other than GPL or LGPL is available it will apply instead, Sun
elects to use only the General Public License version 2 (GPLv2)
at this time for any software where a choice of GPL license versions
is made available with the language indicating that GPLv2 or any
later version may be used, or where a choice of which version of
the GPL is applied is otherwise unspecified.
For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
......
......@@ -248,7 +248,7 @@ typedef struct {
static COMMANDS commands[] = {
{ "?", '?', com_help, 1, "Synonym for `help'." },
{ "clear", 'c', com_clear, 0, "Clear command."},
{ "clear", 'c', com_clear, 0, "Clear the current input statement."},
{ "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." },
{ "delimiter", 'd', com_delimiter, 1,
......
......@@ -61,7 +61,7 @@ static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#endif
/* Solaris's term.h does horrid things. */
/* Don't use Solaris's term.h. */
#if (defined(HAVE_TERM_H) && !defined(__SunOS))
#include <term.h>
#endif
......
......@@ -27,6 +27,10 @@ extern "C" {
struct st_thr_lock;
extern ulong locks_immediate,locks_waited ;
/*
Important: if a new lock type is added, a matching lock description
must be added to sql_test.cc's lock_descriptions array.
*/
enum thr_lock_type { TL_IGNORE=-1,
TL_UNLOCK, /* UNLOCK ANY LOCK */
/*
......
......@@ -7,125 +7,126 @@
# (Guilhem) have seen the test manage to provoke lock wait timeout
# error but not deadlock error; that is ok as code deals with the two
# errors in exactly the same way.
# We don't 'show status like 'slave_retried_transactions'' because this
# is not repeatable (depends on sleeps).
-- source include/master-slave.inc
--source include/master-slave.inc
# 0) Prepare tables and data
--echo *** Prepare tables and data ***
connection master;
eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
# requiring 'unique' for the timeout part of the test
eval CREATE TABLE t3 (a INT UNIQUE) ENGINE=$engine_type;
eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
show variables like 'slave_transaction_retries';
eval CREATE TABLE t2 (a INT) ENGINE=$engine_type;
eval CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
sync_slave_with_master;
show create table t1;
show create table t2;
show variables like 'slave_transaction_retries';
stop slave;
# 1) Test deadlock
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
SHOW CREATE TABLE t3;
SHOW VARIABLES LIKE 'slave_transaction_retries';
--source include/stop_slave.inc
connection master;
begin;
# Let's keep BEGIN and the locked statement in two different relay logs.
insert into t2 values (0); # t2,t1 actors of deadlock in repl-ed ta
#insert into t3 select * from t2 for update;
let $1=10;
disable_query_log;
while ($1)
{
eval insert into t3 values( $1 );
dec $1;
}
enable_query_log;
insert into t1 values(1);
commit;
BEGIN;
INSERT INTO t1 VALUES (1);
# We make a long transaction here
INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
INSERT INTO t3 VALUES (3);
COMMIT;
save_master_pos;
# Save BEGIN event into variable
let $master_pos_begin= query_get_value(SHOW BINLOG EVENTS, Pos, 5);
--echo
connection slave;
begin;
# Let's make our transaction large so that it's repl-ed msta that's victim
let $1=100;
disable_query_log;
while ($1)
{
eval insert into t4 values( $1 );
dec $1;
}
enable_query_log;
select * from t1 for update; # t1,t2 on local slave's
start slave;
# bad option, todo: replicate a non-transactional t_sync with the transaction
# and use wait_until_rows_count macro below
--real_sleep 3 # hope that slave is blocked now
#let $count=11;
#let $table=t_sync;
#--include wait_until_rows_count.inc
# 1) Test deadlock
# Block slave SQL thread, wait retries of transaction, unlock slave before lock timeout
--echo *** Test deadlock ***
select * from t2 for update /* dl */; # provoke deadlock, repl-ed should be victim
commit;
connection slave;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
# Save variable 'Slave_retried_transactions' before deadlock
let $slave_retried_transactions= query_get_value(SHOW GLOBAL STATUS LIKE 'Slave_retried_transactions', Value, 1);
START SLAVE;
# Wait until SQL thread blocked: variable 'Slave_retried_transactions' will incremented
let $status_var= Slave_retried_transactions;
let $status_var_value= $slave_retried_transactions;
let $status_type= GLOBAL;
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
SELECT COUNT(*) FROM t2;
COMMIT;
sync_with_master;
select * from t1; # check that repl-ed succeeded finally
select * from t2 /* must be 1 */;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
--vertical_results
show slave status;
--horizontal_results
# Check the data
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
--echo
# 2) Test lock wait timeout
# Block slave and wait lock timeout error
--echo *** Test lock wait timeout ***
stop slave;
delete from t3;
change master to master_log_pos=548; # the BEGIN log event
begin;
select * from t2 for update; # hold lock
start slave;
--real_sleep 10 # repl-ed should have blocked, and be retrying
select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit;
connection slave;
--source include/stop_slave.inc
DELETE FROM t2;
# Set slave position to the BEGIN log event
--replace_result $master_pos_begin MASTER_POS_BEGIN
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN;
# Hold lock
SELECT * FROM t1 FOR UPDATE;
# Wait until slave stopped with error 'Lock wait timeout exceeded'
START SLAVE;
let $slave_sql_errno= 1205;
--source include/wait_for_slave_sql_error.inc
SELECT COUNT(*) FROM t2;
COMMIT;
--source include/start_slave.inc
sync_with_master;
select * from t1; # check that repl-ed succeeded finally
select * from t2;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
--vertical_results
show slave status;
--horizontal_results
# Check data from tables
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
--echo
# Now we repeat 2), but with BEGIN in the same relay log as
# COMMIT (to see if seeking into hot log is ok).
set @my_max_relay_log_size= @@global.max_relay_log_size;
set global max_relay_log_size=0;
# 3) Test lock wait timeout and purged relay log
# Set max_relay_log_size=0, block slave and wait lock timeout error.
# Restart slave and check that no erros appear
--echo *** Test lock wait timeout and purged relay logs ***
# This is really copy-paste of 2) of above
stop slave;
delete from t3;
change master to master_log_pos=548;
begin;
select * from t2 for update;
start slave;
--real_sleep 10
select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit;
connection slave;
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
--source include/stop_slave.inc
DELETE FROM t2;
# Set slave position to the BEGIN log event
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN;
# Hold lock
SELECT * FROM t1 FOR UPDATE;
# Wait until slave stopped with error 'Lock wait timeout exceeded'
START SLAVE;
let $slave_sql_errno= 1205;
--source include/wait_for_slave_sql_error.inc
SELECT COUNT(*) FROM t2;
COMMIT;
--source include/start_slave.inc
sync_with_master;
select * from t1;
select * from t2;
--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
--vertical_results
show slave status;
--horizontal_results
# Check data from tables
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
--echo
# Clean up
--echo *** Clean up ***
connection master;
drop table t1,t2,t3,t4;
DROP TABLE t1,t2,t3;
sync_slave_with_master;
set global max_relay_log_size= @my_max_relay_log_size;
SET global max_relay_log_size= @my_max_relay_log_size;
--echo End of 5.1 tests
# ==== Purpose ====
#
# Diff the output of a statement on master and slave
#
# ==== Usage =====
#
# let $diff_statement= SELECT * FROM t1 WHERE a < 100;
# source include/diff_master_slave.inc;
--echo source include/diff_master_slave.inc;
disable_query_log;
disable_result_log;
exec $MYSQL test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_master.out;
sync_slave_with_master;
exec $MYSQL_SLAVE test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_slave.out;
diff_files $MYSQLTEST_VARDIR/tmp/diff_master.out $MYSQLTEST_VARDIR/tmp/diff_slave.out;
enable_result_log;
enable_query_log;
......@@ -720,3 +720,11 @@ connection con1;
drop table t1;
disconnect con1;
connection default;
#
# Bug#44151 using handler commands on information_schema tables crashes server
#
USE information_schema;
--error ER_WRONG_USAGE
HANDLER COLUMNS OPEN;
USE test;
# ==== Purpose ====
#
# Kill a query in the master connection, and then try to reap the
# result of the killed query.
#
# ==== Usage ====
#
# The following variables should be set before sourcing this file.
#
# $debug_lock: name of the debug user lock, if set, will release/lock
# the specified debug lock accordingly, and before
# sourcing this, connection 'master' should get the user
# lock and run a query in another thread, which will
# block before creating statement event.
#
# $connection_name: name of the connection that is waiting for the
# lock, this can not be 'master'
#
# $connection_id: id of the connection that is waiting for the lock
#
# Example:
# let $debug_lock=;
# connection master1;
# let $connection_name= master1;
# let $connection_id= `SELECT CONNECTION_ID()`;
# send CREATE TABLE t1;
# source kill_query.inc;
#
# let $debug_lock= "debug_lock.before_query_log_event";
# connection master;
# eval SELECT GET_LOCK($debug_lock, 10);
# connection master1;
# let $connection_name= master1;
# let $connection_id= `SELECT CONNECTION_ID()`;
# send CREATE TABLE t1;
# source kill_query.inc;
--echo source include/kill_query.inc;
disable_query_log;
disable_result_log;
connection master;
# kill the query that is waiting
eval kill query $connection_id;
if (`SELECT '$debug_lock' != ''`)
{
# release the lock to allow binlog continue
eval SELECT RELEASE_LOCK($debug_lock);
}
# reap the result of the waiting query
connection $connection_name;
error 0, 1317, 1307, 1306, 1334, 1305;
reap;
connection master;
if (`SELECT '$debug_lock' != ''`)
{
# get lock again to make the next query wait
eval SELECT GET_LOCK($debug_lock, 10);
}
connection $connection_name;
enable_query_log;
enable_result_log;
# ==== Purpose ====
#
# Kill a query, sync master with slave, and diff the output of a
# statement on master and slave to check if statement is correctly
# replicated.
#
# ==== Usage ====
#
# connection <CONNECTION>;
# let $connection_name=<CONNECTION>
# let $connection_id=`SELECT CONNECTION_ID()`;
# let $diff_statement=<SQL COMMAND>;
# send <SQL COMMAND>;
# source include/kill_query_and_diff_master_slave.inc;
#
# Note: <CONNECTION> must not be 'master'.
#
# See also kill_query.inc and diff_master_slave.inc for more
# information
source include/kill_query.inc;
# Release the debug lock if used, so that the statements in
# diff_master_slave.inc will not be blocked.
connection master;
disable_query_log;
disable_result_log;
if (`SELECT '$debug_lock' != ''`)
{
eval SELECT RELEASE_LOCK($debug_lock);
}
enable_result_log;
enable_query_log;
source include/diff_master_slave.inc;
# Acquire the debug lock again if used
connection master;
disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
enable_query_log;
connection $connection_name;
# ==== Purpose ====
#
# Waits until a variable from SHOW STATUS has returned a specified
# value, or until a timeout is reached.
#
# ==== Usage ====
#
# let $status_var= Threads_connected;
# let $status_var_value= 1;
# --source include/wait_for_status_var.inc
#
# Parameters:
#
# $status_var, $status_var_value
# This macro will wait until the variable of SHOW STATUS
# named $status_var gets the value $status_var_value. See
# the example above.
#
# $status_type= GLOBAL|SESSION
# To specify the type (attribute) of status variable and
# run either SHOW GLOBAL STATUS or SHOW SESSION STATUS.
#
# $status_var_comparsion
# By default, this file waits until $status_var becomes equal to
# $status_var_value. If you want to wait until $status_var
# becomes *unequal* to $status_var_value, set this parameter to the
# string '!=', like this:
# let $status_var_comparsion= !=;
#
# $status_timeout
# The default timeout is 1 minute. You can change the timeout by
# setting $status_timeout. The unit is tenths of seconds.
#
if (`SELECT STRCMP('$status_type', '') * STRCMP(UPPER('$status_type'), 'SESSION') * STRCMP(UPPER('$status_type'), 'GLOBAL')`)
{
--echo **** ERROR: Unknown type of variable status_type: allowed values are: SESSION or GLOBAL ****
exit;
}
let $_status_timeout_counter= $status_timeout;
if (!$_status_timeout_counter)
{
let $_status_timeout_counter= 600;
}
let $_status_var_comparsion= $status_var_comparsion;
if (`SELECT '$_status_var_comparsion' = ''`)
{
let $_status_var_comparsion= =;
}
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value')`)
{
if (!$_status_timeout_counter)
{
--echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparison $status_var_value ****
--echo Note: the following output may have changed since the failure was detected
--echo **** Showing STATUS, PROCESSLIST ****
eval SHOW $status_type STATUS LIKE '$status_var';
SHOW PROCESSLIST;
exit;
}
dec $_status_timeout_counter;
sleep 0.1;
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
}
......@@ -1600,14 +1600,22 @@ sub mysql_fix_arguments () {
}
sub client_arguments ($) {
sub client_arguments ($;$) {
my $client_name= shift;
my $group_suffix= shift;
my $client_exe= mtr_exe_exists("$path_client_bindir/$client_name");
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
if (defined($group_suffix)) {
mtr_add_arg($args, "--defaults-group-suffix=%s", $group_suffix);
client_debug_arg($args, "$client_name-$group_suffix");
}
else
{
client_debug_arg($args, $client_name);
}
return mtr_args2str($client_exe, @$args);
}
......@@ -1858,6 +1866,7 @@ sub environment_setup {
$ENV{'MYSQL_SHOW'}= client_arguments("mysqlshow");
$ENV{'MYSQL_BINLOG'}= client_arguments("mysqlbinlog");
$ENV{'MYSQL'}= client_arguments("mysql");
$ENV{'MYSQL_SLAVE'}= client_arguments("mysql", ".2");
$ENV{'MYSQL_UPGRADE'}= client_arguments("mysql_upgrade");
$ENV{'MYSQLADMIN'}= native_path($exe_mysqladmin);
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
......
......@@ -2,7 +2,8 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER);
SELECT COUNT(*) FROM t1;
COUNT(*)
4181000
4201000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
# Begin cleanup
SET session myisam_sort_buffer_size = @orig_myisam_sort_buffer_size;
DROP TABLE t1;
set @@read_buffer_size=default;
......@@ -535,3 +535,11 @@ CREATE TABLE t1(a TEXT);
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
ERROR HY000: Incorrect arguments to AGAINST
DROP TABLE t1;
CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
SELECT * FROM t1 WHERE MATCH(a) AGAINST('+awrd bwrd* +cwrd*' IN BOOLEAN MODE);
a
awrd bwrd cwrd
awrd bwrd cwrd
awrd bwrd cwrd
DROP TABLE t1;
select des_encrypt('hello');
des_encrypt('hello')
€Ö2nV“Ø}
#
# Bug #11643: des_encrypt() causes server to die
#
CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
UPDATE t1 SET des=DES_ENCRYPT('1234');
SELECT LENGTH(des) FROM t1;
LENGTH(des)
9
9
9
9
SELECT DES_DECRYPT(des) FROM t1;
DES_DECRYPT(des)
1234
1234
1234
1234
SELECT
LENGTH(DES_ENCRYPT('1234')),
LENGTH(DES_ENCRYPT('12345')),
LENGTH(DES_ENCRYPT('123456')),
LENGTH(DES_ENCRYPT('1234567'));
LENGTH(DES_ENCRYPT('1234')) LENGTH(DES_ENCRYPT('12345')) LENGTH(DES_ENCRYPT('123456')) LENGTH(DES_ENCRYPT('1234567'))
9 9 9 9
SELECT
DES_DECRYPT(DES_ENCRYPT('1234')),
DES_DECRYPT(DES_ENCRYPT('12345')),
DES_DECRYPT(DES_ENCRYPT('123456')),
DES_DECRYPT(DES_ENCRYPT('1234567'));
DES_DECRYPT(DES_ENCRYPT('1234')) DES_DECRYPT(DES_ENCRYPT('12345')) DES_DECRYPT(DES_ENCRYPT('123456')) DES_DECRYPT(DES_ENCRYPT('1234567'))
1234 12345 123456 1234567
DROP TABLE t1;
End of 5.0 tests
......@@ -183,3 +183,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select des_decrypt(des_encrypt('hello',4),'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt('hello','hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
drop table if exists t1;
create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
engine=myisam default charset=latin1;
insert into t1 values (null,'contraction\'s');
insert into t1 values (-15818,'requirement\'s');
select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
drop table t1;
......@@ -103,3 +103,46 @@ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
8
End of 5.0 tests
drop table if exists t1;
create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
engine=myisam default charset=latin1;
insert into t1 values (''),(null),(null),(''),(''),('');
select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
a
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
0
NULL
NULL
0
0
0
drop table t1;
......@@ -2526,3 +2526,17 @@ h i
31.12.2008 AAAAAA, aaaaaa
DROP TABLE t1;
End of 5.0 tests
drop table if exists t1;
create table t1(f1 tinyint default null)engine=myisam;
insert into t1 values (-1),(null);
explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
2 DERIVED t1 ALL NULL NULL NULL NULL 2
explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
2 DERIVED t1 ALL NULL NULL NULL NULL 2
drop table t1;
This diff is collapsed.
......@@ -47,26 +47,26 @@ INSERT INTO gis_point VALUES
INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line;
INSERT into gis_geometry SELECT * FROM gis_polygon;
......
......@@ -739,3 +739,7 @@ handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
USE information_schema;
HANDLER COLUMNS OPEN;
ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
USE test;
......@@ -737,3 +737,7 @@ handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
USE information_schema;
HANDLER COLUMNS OPEN;
ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
USE test;
......@@ -38,3 +38,10 @@ a
11
7
drop table t1;
create table t1 (a int, b int) engine=myisam;
create table t2 (c int, d int, key (c)) engine=innodb;
insert into t1 values (1,1);
insert into t2 values (1,2);
set session transaction isolation level read committed;
delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);
drop table t1, t2;
......@@ -1736,36 +1736,36 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
drop table t1;
show status like "Innodb_buffer_pool_pages_total";
Variable_name Value
Innodb_buffer_pool_pages_total 512
show status like "Innodb_page_size";
Variable_name Value
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
Variable_name Value
Innodb_rows_deleted 71
show status like "Innodb_rows_inserted";
Variable_name Value
Innodb_rows_inserted 1084
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 885
show status like "Innodb_row_lock_waits";
Variable_name Value
Innodb_row_lock_waits 0
show status like "Innodb_row_lock_current_waits";
Variable_name Value
Innodb_row_lock_current_waits 0
show status like "Innodb_row_lock_time";
Variable_name Value
Innodb_row_lock_time 0
show status like "Innodb_row_lock_time_max";
Variable_name Value
Innodb_row_lock_time_max 0
show status like "Innodb_row_lock_time_avg";
Variable_name Value
Innodb_row_lock_time_avg 0
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
512
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
variable_value - @innodb_rows_deleted_orig
71
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
variable_value - @innodb_rows_inserted_orig
1084
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
variable_value - @innodb_rows_updated_orig
885
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
variable_value - @innodb_row_lock_waits_orig
0
SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
variable_value - @innodb_row_lock_current_waits_orig
0
SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
variable_value - @innodb_row_lock_time_orig
0
SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
variable_value - @innodb_row_lock_time_max_orig
0
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value - @innodb_row_lock_time_avg_orig
0
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
......
......@@ -633,4 +633,9 @@ SELECT * FROM t2;
c1
15449237462
DROP TABLE t1, t2;
CREATE TABLE t1(f1 FLOAT);
INSERT INTO t1 VALUES (1.23);
CREATE TABLE t2(f1 CHAR(1));
INSERT INTO t2 SELECT f1 FROM t1;
DROP TABLE t1, t2;
End of 5.0 tests.
......@@ -96,6 +96,61 @@ alter table t1 auto_increment=0;
alter table t1 auto_increment=0;
unlock tables;
drop table t1;
create table t1 (a int);
create table t2 like t1;
# con1
lock tables t1 write;
# con2
flush tables with read lock;
# con5
# global read lock is taken
# con3
select * from t2 for update;
# waiting for release of read lock
# con4
# would hang and later cause a deadlock
flush tables t2;
# clean up
unlock tables;
unlock tables;
a
drop table t1,t2;
#
# Lightweight version:
# Ensure that the wait for a GRL is done before opening tables.
#
create table t1 (a int);
create table t2 like t1;
#
# UPDATE
#
# default
flush tables with read lock;
# con1
update t2 set a = 1;
# default
# statement is waiting for release of read lock
# con2
flush table t2;
# default
unlock tables;
# con1
#
# LOCK TABLES .. WRITE
#
# default
flush tables with read lock;
# con1
lock tables t2 write;
# default
# statement is waiting for release of read lock
# con2
flush table t2;
# default
unlock tables;
# con1
unlock tables;
drop table t1,t2;
End of 5.0 tests
create table t1 (i int);
lock table t1 read;
......
......@@ -2115,4 +2115,16 @@ insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
CREATE TABLE t1 (
col1 INT(10)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE VIEW v1 as SELECT * FROM t1;
CREATE TABLE m1 (
col1 INT(10)
)ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(v1);
#Select should detect that the child table is a view and fail.
SELECT * FROM m1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP VIEW v1;
DROP TABLE m1, t1;
End of 5.1 tests
......@@ -2226,4 +2226,30 @@ Key Start Len Index Type
1 2 30 multip. varchar
2 33 30 multip. char NULL
DROP TABLE t1;
CREATE TABLE t1 (
c INT,
d bit(1),
e INT,
f VARCHAR(1),
g BIT(1),
h BIT(1),
KEY (h, d, e, g)
);
INSERT INTO t1 VALUES
( 3, 1, 1, 'a', 0, 0 ),
( 3, 1, 5, 'a', 0, 0 ),
( 10, 1, 2, 'a', 0, 1 ),
( 10, 1, 3, 'a', 0, 1 ),
( 10, 1, 4, 'a', 0, 1 );
SELECT f FROM t1 WHERE d = 1 AND e = 2 AND g = 0 AND h = 1;
f
a
SELECT h+0, d + 0, e, g + 0 FROM t1;
h+0 d + 0 e g + 0
0 1 1 0
0 1 5 0
1 1 2 0
1 1 3 0
1 1 4 0
DROP TABLE t1;
End of 5.1 tests
#
# BUG#41330 - Myisam table open count set to zero before index blocks are written.
#
# Don't test this under valgrind, memory leaks will occur
# Binary must be compiled with debug for crash to occur
SET GLOBAL delay_key_write=ALL;
CREATE TABLE t1(a INT,
b INT,
PRIMARY KEY(a , b),
KEY(b)) ENGINE=MyISAM DELAY_KEY_WRITE = 1;
INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6);
# Setup the mysqld to crash at certain point
SET SESSION debug="d,crash_before_flush_keys";
# Write file to make mysql-test-run.pl expect crash
# Run the crashing query
FLUSH TABLE t1;
ERROR HY000: Lost connection to MySQL server during query
# Run MYISAMCHK tool to check the table t1 and repair
myisamchk: MyISAM file MYSQLD_DATADIR/test/t1
myisamchk: warning: 1 client is using or hasn't closed the table properly
myisamchk: error: Size of indexfile is: 1024 Should be: 3072
MYISAMCHK: Unknown error 126
myisamchk: error: Can't read indexpage from filepos: 1024
MyISAM-table 'MYSQLD_DATADIR/test/t1' is corrupted
Fix it using switch "-r" or "-o"
# Write file to make mysql-test-run.pl start the server
# Turn on reconnect
# Call script that will poll the server waiting for
# it to be back online again
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`,`b`),
KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1
SELECT * FROM t1 FORCE INDEX (PRIMARY);
a b
1 2
2 3
3 4
4 5
5 6
DROP TABLE t1;
#
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
#
CREATE TABLE `t1` (
`id` BIGINT(20) ,
`id1` BIGINT(20) AUTO_INCREMENT,
KEY(id1), KEY(id)
) ENGINE=MyISAM;
CREATE TABLE `t2` (
`id` BIGINT(20) ,
`id1` BIGINT(20) AUTO_INCREMENT,
KEY (id1), KEY(id)
) ENGINE=MyISAM;
INSERT INTO t2 (id) VALUES (123);
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
# Switch to insert Connection
SET SESSION debug='+d,wait_in_enable_indexes';
# Send insert data
INSERT INTO t1(id) SELECT id FROM t2;
# Switch to default Connection
# Wait for insert data to reach the debug point
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
INTO @thread_id;
KILL QUERY @thread_id;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1,t2;
......@@ -65,3 +65,25 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
1024
DROP TABLE t1;
#
# Bug #43973 - backup_myisam.test fails on 6.0-bugteam
#
CREATE DATABASE mysql_db1;
CREATE TABLE mysql_db1.t1 (c1 VARCHAR(5), c2 int);
CREATE INDEX i1 ON mysql_db1.t1 (c1, c2);
INSERT INTO mysql_db1.t1 VALUES ('A',1);
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
FLUSH TABLE mysql_db1.t1;
# Compress the table using MYISAMPACK tool
# Run MYISAMCHK tool on the compressed table
SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5;
COUNT(*)
128
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
......@@ -9,7 +9,17 @@ SET timestamp=1000000000;
#
# We need big packets.
#
# Capture initial value to reset at the end of the test
# Now adjust max_allowed_packet
SET @@global.max_allowed_packet= 1024*1024*1024;
max_allowed_packet is a global variable.
In order for the preceding change in max_allowed_packets' value
to be seen and used, we must start a new connection.
The change does not take effect with the current one.
For simplicity, we just disconnect / reconnect connection default here.
Disconnecting default connection...
Reconnecting default connection...
default connection established, continuing with the test
#
# Delete all existing binary logs.
#
......@@ -21,40 +31,56 @@ CREATE TABLE t1 (
c1 LONGTEXT
) ENGINE=MyISAM DEFAULT CHARSET latin1;
#
# Show how much rows are affected by each statement.
# Show how many rows are affected by each statement.
#
#
# Insert a big row.
# Insert some big rows.
#
256MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
affected rows: 1
32MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
affected rows: 1
4MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
affected rows: 1
512KB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
affected rows: 1
#
# Show what we have in the table.
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
LENGTH(c1) 268435456
LENGTH(c1) 33554432
affected rows: 1
LENGTH(c1) 4194304
LENGTH(c1) 524288
affected rows: 4
#
# Grow the row by updating.
# Grow the rows by updating.
#
UPDATE t1 SET c1 = CONCAT(c1, c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
affected rows: 4
info: Rows matched: 4 Changed: 4 Warnings: 0
#
# Show what we have in the table.
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
LENGTH(c1) 536870912
LENGTH(c1) 1048576
LENGTH(c1) 67108864
affected rows: 1
LENGTH(c1) 8388608
affected rows: 4
#
# Delete the row.
# Delete the rows.
#
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
affected rows: 1
affected rows: 4
#
# Hide how much rows are affected by each statement.
# Hide how many rows are affected by each statement.
#
#
# Flush all log buffers to the log file.
......@@ -70,5 +96,7 @@ FLUSH LOGS;
#
# Cleanup.
#
# reset variable value to pass testcase checks
SET @@global.max_allowed_packet = 1048576;
DROP TABLE t1;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
......@@ -3815,7 +3815,6 @@ DROP TABLE t1,t2;
-- Dump completed on DATE
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
#
# Bug #42635: mysqldump includes views that were excluded using
# the --ignore-table option
......
select 1;
1
1
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
slave_skip_errors OFF
......@@ -615,3 +615,6 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
a1 a4
DROP TABLE t1, t2, t3;
#
# End of 5.1 tests
#
#
# Bug#39559: dump of stored procedures / functions with C-style
# comment can't be read back
#
+----------+--------+
| expected | result |
+----------+--------+
| 2 | 2 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 1 | 1 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 3 | 3 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 2 | 2 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 7 | 7 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 8 | 8 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 7 | 7 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 4 | 4 |
+----------+--------+
+----------+--------+
| expected | result |
+----------+--------+
| 4 | 4 |
+----------+--------+
......@@ -53,7 +53,14 @@ CREATE TABLE t1 (a INT)
of multi-line
comment */
PARTITIONS 5 */;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/' at line 6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
......
......@@ -126,7 +126,7 @@ id
# Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix it!
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
# REPAIR old table USE_FRM should fail
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
......
......@@ -4373,6 +4373,19 @@ f3 f4 count
1 abc 1
1 def 2
drop table t1, t2, t3;
CREATE TABLE t1 (a INT KEY, b INT);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2
EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2
DROP TABLE t1;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
......
......@@ -6994,6 +6994,21 @@ select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
p
drop procedure p;
CREATE DEFINER = 'root'@'localhost' PROCEDURE p1()
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
SHOW TABLE STATUS like 't1';
END;//
CREATE TABLE t1 (f1 INT);
CALL p1();
CALL p1();
CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
......@@ -57,6 +57,18 @@ s1
1
drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
#
# Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
#
# copy table created using mysql4.0 into the data dir
# check the table created using mysql 4.0
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
# query the table created using mysql 4.0
SELECT * FROM t1;
c1 c2 c3
DROP TABLE t1;
truncate t1;
drop table t1;
drop database if exists `tabc`;
......@@ -84,3 +96,23 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin2
drop database `a-b-c`;
drop database `tabc`;
use `#mysql50#a-b-c`;
create table t1(f1 char(10));
show databases like '%a-b-c%';
Database (%a-b-c%)
#mysql50#a-b-c
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
show databases like '%a-b-c%';
Database (%a-b-c%)
a-b-c
show create view `a-b-c`.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`) utf8 utf8_general_ci
Warnings:
Note 1600 Creation context of view `a-b-c`.`v1' is invalid
select * from `a-b-c`.v1;
f1
Warnings:
Note 1600 Creation context of view `a-b-c`.`v1' is invalid
drop database `a-b-c`;
use test;
......@@ -38,7 +38,7 @@ length(a) length(b)
255 3
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix it!
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
......
......@@ -11,7 +11,7 @@ Variable_name Value
slave_load_tmpdir SLAVE_LOAD_TMPDIR
show variables like 'slave_skip_errors';
Variable_name Value
slave_skip_errors 3,100,137,643,1752
slave_skip_errors 0,3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
......@@ -98,12 +98,12 @@ ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
#
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
slave_skip_errors 3,100,137,643,1752
slave_skip_errors 0,3,100,137,643,1752
SELECT @@session.slave_skip_errors;
ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
SELECT @@global.slave_skip_errors;
@@global.slave_skip_errors
3,100,137,643,1752
0,3,100,137,643,1752
SET @@session.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
SET @@global.slave_skip_errors= 7;
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -11,7 +11,7 @@ prepare s from "insert into t1 select 100 limit ?";
set @a=100;
execute s using @a;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (a int)
......
......@@ -46,6 +46,7 @@
# BUG#34732: mysqlbinlog does not print default values for auto_increment variables
# BUG#34768: nondeterministic INSERT using LIMIT logged in stmt mode if binlog_format=mixed
# BUG#41980, SBL, INSERT .. SELECT .. LIMIT = ERROR, even when @@SQL_LOG_BIN is 0
# BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
#
# ==== Related test cases ====
#
......@@ -369,4 +370,22 @@ DROP FUNCTION func7;
DROP TRIGGER trig;
DROP TABLE t1, t2, t3, trigger_table;
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
#
# For BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
#
SET @save_sql_mode = @@SESSION.SQL_MODE;
SET @@SESSION.SQL_MODE = STRICT_ALL_TABLES;
CREATE TABLE t1(i INT PRIMARY KEY);
CREATE TABLE t2(i INT PRIMARY KEY);
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
INSERT INTO t1 VALUES(@@global.sync_binlog);
UPDATE t1 SET i = 999 LIMIT 1;
DELETE FROM t1 LIMIT 1;
DROP TABLE t1, t2;
SET @@SESSION.SQL_MODE = @save_sql_mode;
--echo "End of tests"
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
begin;
insert into t1i values (5);
begin;
insert into t1i values (4);
insert into t2m values (1);
update t1i set n = 5 where n = 4;
commit;
zero
0
*** kill sql thread ***
rollback;
*** sql thread is *not* running: No ***
*** the prove: the killed slave has not finished the current transaction ***
three
3
one
1
zero
0
delete from t2m;
start slave sql_thread;
delete from t1i;
delete from t2m;
begin;
insert into t1i values (5);
begin;
insert into t1i values (4);
update t1i set n = 5 where n = 4;
commit;
zero
0
stop slave sql_thread;
rollback;
*** sql thread is *not* running: No ***
*** the prove: the stopped slave has rolled back the current transaction ***
zero
0
zero
0
one
1
start slave sql_thread;
drop table t1i, t2m;
#
# Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY
# Bug#319 if while a non-transactional slave is replicating a transaction possible problem
#
# Verifying the fact that STOP SLAVE in the middle of a group execution waits
# for the end of the group before the slave sql thread will stop.
# The patch refines STOP SLAVE to not interrupt a transaction or other type of
# the replication events group (the part I).
# Killing the sql thread continues to provide a "hard" stop (the part II).
#
# Non-deterministic tests
#
source include/master-slave.inc;
source include/have_innodb.inc;
#
# Part II, killed sql slave leaves instantly
#
# A. multi-statement transaction as the replication group
connection master;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
sync_slave_with_master;
connection master;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
sync_slave_with_master;
#
# todo: first challenge is to find out the SQL thread id
# the following is not fully reliable
#
let $id=`SELECT id from information_schema.processlist where user like 'system user' and state like '%Has read all relay log%' or user like 'system user' and state like '%Reading event from the relay log%'`;
connection slave;
begin;
insert into t1i values (5);
connection master;
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
begin;
insert into t1i values (4);
insert into t2m values (1); # non-ta update
update t1i set n = 5 where n = 4; # to block at. can't be played with killed
commit;
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave;
# slave sql thread must be locked out by the conn `slave' explicit lock
let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--disable_query_log
eval select $pos0_master - $pos0_slave as zero;
--enable_query_log
connection slave1;
let $count= 1;
let $table= t2m;
source include/wait_until_rows_count.inc;
#
# todo: may fail as said above
#
--echo *** kill sql thread ***
--disable_query_log
eval kill connection $id;
--enable_query_log
connection slave;
rollback; # release the sql thread
connection slave1;
source include/wait_for_slave_sql_to_stop.inc;
let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
--echo *** sql thread is *not* running: $sql_status ***
let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
connection slave;
--echo *** the prove: the killed slave has not finished the current transaction ***
--disable_query_log
select count(*) as three from t1i;
eval select $pos1_master > $pos1_slave as one;
eval select $pos1_slave - $pos0_slave as zero;
--enable_query_log
delete from t2m; # remove the row to be able to replay
start slave sql_thread;
#
# Part I: B The homogenous transaction remains interuptable in between
#
connection master;
delete from t1i;
delete from t2m;
sync_slave_with_master;
begin;
insert into t1i values (5);
connection master;
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
begin;
insert into t1i values (4);
update t1i set n = 5 where n = 4; # to block at. not to be played
commit;
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave1;
# slave sql can't advance as must be locked by the conn `slave' trans
let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--disable_query_log
eval select $pos0_master - $pos0_slave as zero;
--enable_query_log
#
# the replicated trans is blocked by the slave's local.
# However, it's not easy to catch the exact moment when it happens.
# The test issues sleep which makes the test either non-deterministic or
# wasting too much time.
#
--sleep 3
send stop slave sql_thread;
connection slave;
rollback; # release the sql thread
connection slave1;
reap;
source include/wait_for_slave_sql_to_stop.inc;
let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
--echo *** sql thread is *not* running: $sql_status ***
let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--echo *** the prove: the stopped slave has rolled back the current transaction ***
--disable_query_log
select count(*) as zero from t1i;
eval select $pos0_master - $pos0_slave as zero;
eval select $pos1_master > $pos0_slave as one;
--enable_query_log
start slave sql_thread;
# clean-up
connection master;
drop table t1i, t2m;
sync_slave_with_master;
......@@ -86,6 +86,15 @@ let $check_std_csets= 1;
let $check_ucs2_csets= 1;
let $check_utf8_csets= 1;
# Bug#32784: Timeout in test "innodb_charset": InnoDB much slower
# than other handlers
# NOTE: We turn autocommit off to improve the performance of the innodb variant
# of this test. Per Innobase's recommendation.
--disable_query_log
SET autocommit=0;
--enable_query_log
#
# Check all charsets/collation combinations
#
......
# Check for IBM i 6.1 or later
--disable_query_log
system uname -rv > $MYSQLTEST_VARDIR/tmp/version;
--disable_warnings
drop table if exists uname_vr;
--enable_warnings
create temporary table uname_vr (r int, v int);
--disable_warnings
eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/version" into table uname_vr fields terminated by ' ';
--enable_warnings
let $ok = `select count(*) from uname_vr where v > 5`;
drop table uname_vr;
remove_file $MYSQLTEST_VARDIR/tmp/version;
--enable_query_log
if (!$ok)
{
skip "Need IBM i 6.1 or later";
}
if (!`SELECT count(*) FROM information_schema.engines WHERE
(support = 'YES' OR support = 'DEFAULT') AND
engine = 'ibmdb2i'`)
{
skip Need ibmdb2i engine;
}
create schema `A12345_@$#`;
create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
show create table `A12345_@$#`.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=IBMDB2I DEFAULT CHARSET=latin1
select * from `A12345_@$#`.t1;
i
drop table `A12345_@$#`.t1;
drop schema `A12345_@$#`;
create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
drop table t1;
create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
drop table t1;
source suite/ibmdb2i/include/have_ibmdb2i.inc;
source include/have_case_sensitive_file_system.inc;
create schema `A12345_@$#`;
create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
show create table `A12345_@$#`.t1;
select * from `A12345_@$#`.t1;
drop table `A12345_@$#`.t1;
drop schema `A12345_@$#`;
source suite/ibmdb2i/include/have_ibmdb2i.inc;
source suite/ibmdb2i/include/have_i61.inc;
create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
drop table t1;
create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
drop table t1;
......@@ -83,4 +83,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
reset master;
call mtr.add_suppression("Failed during slave.*thread initialization");
call mtr.add_suppression("Failed during slave thread initialization");
stop slave;
reset slave;
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
......@@ -23,8 +23,8 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Last_Errno #
Last_Error Failed during slave thread initialization
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
......@@ -41,6 +41,6 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Last_SQL_Errno #
Last_SQL_Error Failed during slave thread initialization
SET GLOBAL debug="";
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
......@@ -4,51 +4,57 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
*** Prepare tables and data ***
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t3 (a INT UNIQUE) ENGINE=innodb;
CREATE TABLE t4 (a INT) ENGINE=innodb;
show variables like 'slave_transaction_retries';
Variable_name Value
slave_transaction_retries 10
show create table t1;
CREATE TABLE t2 (a INT) ENGINE=innodb;
CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t2;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) NOT NULL,
KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show variables like 'slave_transaction_retries';
SHOW VARIABLES LIKE 'slave_transaction_retries';
Variable_name Value
slave_transaction_retries 2
stop slave;
begin;
insert into t2 values (0);
insert into t1 values(1);
commit;
begin;
select * from t1 for update;
include/stop_slave.inc
BEGIN;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
INSERT INTO t3 VALUES (3);
COMMIT;
*** Test deadlock ***
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
start slave;
select * from t2 for update /* dl */;
a
commit;
select * from t1;
START SLAVE;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
COMMIT;
SELECT * FROM t1;
a
1
select * from t2 /* must be 1 */;
SELECT * FROM t3;
a
0
show slave status;
3
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
......@@ -83,38 +89,41 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
stop slave;
delete from t3;
change master to master_log_pos=548;
begin;
select * from t2 for update;
*** Test lock wait timeout ***
include/stop_slave.inc
DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
START SLAVE;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit;
select * from t1;
COMMIT;
include/start_slave.inc
SELECT * FROM t1;
a
1
1
select * from t2;
SELECT * FROM t3;
a
0
0
show slave status;
3
3
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
......@@ -138,47 +147,50 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
set @my_max_relay_log_size= @@global.max_relay_log_size;
set global max_relay_log_size=0;
stop slave;
delete from t3;
change master to master_log_pos=548;
begin;
select * from t2 for update;
*** Test lock wait timeout and purged relay logs ***
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
include/stop_slave.inc
DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=440;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
1
START SLAVE;
SELECT COUNT(*) FROM t2;
COUNT(*)
0
0
start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit;
select * from t1;
COMMIT;
include/start_slave.inc
SELECT * FROM t1;
a
1
1
1
select * from t2;
SELECT * FROM t3;
a
0
0
0
show slave status;
3
3
3
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
......@@ -206,6 +218,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
drop table t1,t2,t3,t4;
set global max_relay_log_size= @my_max_relay_log_size;
*** Clean up ***
DROP TABLE t1,t2,t3;
SET global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests
......@@ -141,9 +141,9 @@ select * from ti1 order by b /* must be (2),(3) */;
b
2
3
*** slave must stop
*** slave must stop (Trying to delete a referenced foreing key)
Last_SQL_Error
0
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
b
1
......@@ -159,7 +159,7 @@ set global slave_exec_mode='STRICT';
*** conspire future problem
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop
*** slave must stop (Trying to insert an invalid foreign key)
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
......@@ -179,7 +179,7 @@ a b
*** conspiring query
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop
*** slave must stop (Trying to insert a dupliacte key)
Last_SQL_Error
1062
set foreign_key_checks= 0;
......@@ -195,32 +195,32 @@ INSERT INTO t2 VALUES (-1),(-2),(-3);
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop
*** slave must stop (Key was not found)
Last_SQL_Error
0
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop
*** slave must stop (Key was not found)
Last_SQL_Error
0
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
reset slave;
SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
Reporting the following error: Failed during slave thread initialization
SET GLOBAL debug= "";
stop slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
Reporting the following error: Slave SQL thread aborted. Can't execute init_slave query
SET GLOBAL init_slave= "";
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
DROP DATABASE IF EXISTS d4;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e2;
DROP EVENT IF EXISTS e3;
DROP EVENT IF EXISTS e4;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f3;
DROP FUNCTION IF EXISTS f4;
DROP SERVER IF EXISTS s1;
DROP SERVER IF EXISTS s2;
DROP SERVER IF EXISTS s3;
DROP SERVER IF EXISTS s4;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
DROP TRIGGER IF EXISTS tr1;
DROP TRIGGER IF EXISTS tr2;
DROP TRIGGER IF EXISTS tr3;
DROP TRIGGER IF EXISTS tr4;
CREATE DATABASE d1;
CREATE EVENT e1
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (1);
CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
RETURN 1;
CREATE PROCEDURE p1 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t1;
END;
//
CREATE SERVER s1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'user1', HOST '192.168.1.106', DATABASE 'test');
CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int);
CREATE TRIGGER tr1 BEFORE INSERT ON t1
FOR EACH ROW BEGIN
DELETE FROM t4 WHERE a=NEW.a;
END;
//
CREATE INDEX i1 ON t1 (a);
CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
[on master]
[on master1]
CREATE DATABASE d2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP DATABASE d1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP DATABASE d2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP EVENT e1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP EVENT IF EXISTS e2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
ALTER FUNCTION f1 SQL SECURITY INVOKER;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP FUNCTION f1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
END;
//
source include/kill_query.inc;
source include/diff_master_slave.inc;
ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP PROCEDURE p1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE TABLE t2 (b int);
source include/kill_query.inc;
source include/diff_master_slave.inc;
ALTER TABLE t1 ADD (d int);
source include/kill_query.inc;
source include/diff_master_slave.inc;
RENAME TABLE t3 TO t4;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE INDEX i2 on t1 (a);
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP INDEX i1 on t1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE TRIGGER tr2 BEFORE INSERT ON t4
FOR EACH ROW BEGIN
DELETE FROM t1 WHERE a=NEW.a;
END;
//
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP TRIGGER tr1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP TRIGGER IF EXISTS tr2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP VIEW v1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP VIEW IF EXISTS v2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP TABLE t1;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP TABLE IF EXISTS t2;
source include/kill_query.inc;
source include/diff_master_slave.inc;
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
DROP DATABASE IF EXISTS d4;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e2;
DROP EVENT IF EXISTS e3;
DROP EVENT IF EXISTS e4;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f3;
DROP FUNCTION IF EXISTS f4;
DROP SERVER IF EXISTS s1;
DROP SERVER IF EXISTS s2;
DROP SERVER IF EXISTS s3;
DROP SERVER IF EXISTS s4;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
......@@ -74,19 +74,16 @@ Last_SQL_Error
drop table t1;
create table t1(a int primary key);
insert into t1 values (1),(2);
delete from t1 where @@server_id=1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
SET SQL_LOG_BIN=0;
delete from t1;
SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
insert into t1 values (1), (2), (3);
[on slave]
select * from t1;
a
1
2
7
8
9
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
......@@ -128,3 +125,66 @@ Last_SQL_Errno 0
Last_SQL_Error
==== Clean Up ====
drop table t1;
==== Using Innodb ====
SET SQL_LOG_BIN=0;
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(1, 1);
INSERT INTO t1 VALUES(2, 1);
INSERT INTO t1 VALUES(3, 1);
INSERT INTO t1 VALUES(4, 1);
SET SQL_LOG_BIN=0;
DELETE FROM t1 WHERE id = 4;
SET SQL_LOG_BIN=1;
UPDATE t1 SET id= id + 3, data = 2;
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Using MyIsam ====
SET SQL_LOG_BIN=0;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL,
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL,
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
INSERT INTO t2 VALUES(3, 1);
INSERT INTO t2 VALUES(5, 1);
SET SQL_LOG_BIN=0;
DELETE FROM t2 WHERE id = 5;
SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Clean Up ====
DROP TABLE t1;
DROP TABLE t2;
......@@ -10,3 +10,31 @@ start slave;
stop slave io_thread;
start slave io_thread;
drop table t1;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
begin;
insert into t1i values (5);
begin;
insert into t1i values (4);
insert into t2m values (1);
insert into t1i values (5);
commit;
zero
0
stop slave;
rollback;
*** sql thread is *not* running: No ***
*** the prove: the stopped slave has finished the current transaction ***
five
5
zero
0
one
1
include/start_slave.inc
drop table t1i, t2m;
......@@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
INSERT INTO test.t1 VALUES(1,'test');
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
......@@ -18,7 +18,7 @@ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
end|
CALL test.p1();
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column
1 abase
......
......@@ -182,19 +182,19 @@ CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
affected rows: 0
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Note 1592 Statement is not safe to log in statement format.
affected rows: 1
SELECT * FROM t1 ORDER BY sum;
sum price
......
......@@ -10,5 +10,4 @@
#
##############################################################################
rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
rpl_cross_version : BUG#42311 2009-03-27 joro rpl_cross_version fails on macosx
rm -f $MYSQLTEST_VARDIR/slave-data/master.info
......@@ -34,6 +34,7 @@ source include/setup_fake_relay_log.inc;
--echo ==== Test ====
START SLAVE SQL_THREAD;
let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
source include/wait_for_slave_sql_error.inc;
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error
......
......@@ -15,7 +15,7 @@ reset master;
connection slave;
# Add suppression for expected warnings in slaves error log
call mtr.add_suppression("Failed during slave.*thread initialization");
call mtr.add_suppression("Failed during slave thread initialization");
--disable_warnings
stop slave;
......@@ -38,7 +38,7 @@ connection slave;
source include/wait_for_slave_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 #
query_vertical show slave status;
#
......
--loose-debug=d,simulate_slave_delay_at_terminate_bug38694
# Testing replication threads stopping concurrency issue
# at the server shutdown
# Related bugs: bug#38694, bug#29968, bug#25306
# The test checks if a delay at the termination phase of slave threads
# DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
# could cause any issue.
source include/master-slave.inc;
# End of tests
......@@ -208,7 +208,7 @@ select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced
--echo *** slave must stop
--echo *** slave must stop (Trying to delete a referenced foreing key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -242,7 +242,7 @@ delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
--echo *** slave must stop
--echo *** slave must stop (Trying to insert an invalid foreign key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -281,7 +281,7 @@ insert into ti1 set b=1;
connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop
--echo *** slave must stop (Trying to insert a dupliacte key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -316,7 +316,7 @@ DELETE FROM t2 WHERE a = -2;
connection master;
DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -334,7 +334,7 @@ set global slave_exec_mode='STRICT';
connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -356,7 +356,7 @@ UPDATE t2 SET a = 1 WHERE a = -1;
connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......@@ -376,7 +376,7 @@ set global slave_exec_mode='STRICT';
connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
......
######################################################################
# Some errors that cause the slave SQL thread to stop are not shown in
# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
# is only in the server's error log.
#
# Two failures and their respective reporting are verified:
#
# 1 - Failures during slave thread initialization
# 2 - Failures while processing queries passed through the init_slave
# option.
#
# In order to check the first type of failure, we inject a fault in the
# SQL/IO Threads through SET GLOBAL debug.
#
# To check the second type, we set @@global.init_slave to an invalid
# command thus preventing the initialization of the SQL Thread.
#
# Obs:
# 1 - Note that testing failures while initializing the relay log position
# is hard as the same function is called before the code reaches the point
# that we want to test.
#
# 2 - This test does not target failures that are reported while applying
# events such as duplicate keys, errors while reading the relay-log.bin*,
# etc. Such errors are already checked on other tests.
######################################################################
######################################################################
# Configuring the Environment
######################################################################
source include/have_debug.inc;
source include/master-slave.inc;
source include/have_log_bin.inc;
connection slave;
--disable_warnings
stop slave;
--enable_warnings
reset slave;
######################################################################
# Injecting faults in the threads' initialization
######################################################################
connection slave;
# Set debug flags on slave to force errors to occur
SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
source include/wait_for_slave_to_stop.inc;
let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
echo Reporting the following error: $error;
SET GLOBAL debug= "";
######################################################################
# Injecting faults in the init_slave option
######################################################################
connection slave;
--disable_warnings
stop slave;
--enable_warnings
source include/wait_for_slave_to_stop.inc;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
source include/wait_for_slave_sql_to_stop.inc;
let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
echo Reporting the following error: $error;
######################################################################
# Clean up
######################################################################
SET GLOBAL init_slave= "";
--debug=d,debug_lock_before_query_log_event
# ==== Purpose ====
#
# This test check if DDL statements are correctly binlogged when the
# thread is killed
#
# ==== Method ====
#
# Start a DDL query and kill it, check if the error code of the binlog
# event is correct.
#
# DDL statements tested:
# CREATE/ALTER/RENAME/DROP DATABASE
# CREATE/ALTER/DROP EVENT
# CREATE/ALTER/DROP FUNCTION
# CREATE/ALTER/DROP PROCEDURE
# CREATE/ALTER/DROP SERVER
# CREATE/ALTER/RENAME/DROP TABLE
# CREATE/DROP TRIGGER
# CREATE/ALTER/DROP VIEW
#
# ==== Bugs =====
#
# BUG#37145
#
# ==== TODO ====
#
# There are some part of the test are temporarily disabled because of
# the following bugs, please enable then once they get fixed:
# - BUG#44041
# - BUG#43353
# - BUG#25705
# - BUG#44171
source include/have_debug.inc;
source include/master-slave.inc;
# Use the DBUG_SYNC_POINT to make sure the thread running the DDL is
# waiting before creating the query log event
let $debug_lock= "debug_lock.before_query_log_event";
######## INITIALIZATION ########
disable_warnings;
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
DROP DATABASE IF EXISTS d4;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e2;
DROP EVENT IF EXISTS e3;
DROP EVENT IF EXISTS e4;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f3;
DROP FUNCTION IF EXISTS f4;
DROP SERVER IF EXISTS s1;
DROP SERVER IF EXISTS s2;
DROP SERVER IF EXISTS s3;
DROP SERVER IF EXISTS s4;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
DROP TRIGGER IF EXISTS tr1;
DROP TRIGGER IF EXISTS tr2;
DROP TRIGGER IF EXISTS tr3;
DROP TRIGGER IF EXISTS tr4;
enable_warnings;
CREATE DATABASE d1;
CREATE EVENT e1
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (1);
CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
RETURN 1;
DELIMITER //;
CREATE PROCEDURE p1 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t1;
END;
//
DELIMITER ;//
CREATE SERVER s1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'user1', HOST '192.168.1.106', DATABASE 'test');
CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int);
DELIMITER //;
CREATE TRIGGER tr1 BEFORE INSERT ON t1
FOR EACH ROW BEGIN
DELETE FROM t4 WHERE a=NEW.a;
END;
//
DELIMITER ;//
CREATE INDEX i1 ON t1 (a);
CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
sync_slave_with_master;
connection master1;
let $connection_name= master1;
let $connection_id= `SELECT CONNECTION_ID()`;
connection master;
echo [on master];
# This will block the execution of a statement at the DBUG_SYNC_POINT
# with given lock name
if (`SELECT '$debug_lock' != ''`)
{
disable_query_log;
disable_result_log;
eval SELECT IS_FREE_LOCK($debug_lock);
eval SELECT GET_LOCK($debug_lock, 10);
eval SELECT IS_FREE_LOCK($debug_lock);
enable_query_log;
enable_result_log;
}
######## START TEST ########
connection master1;
echo [on master1];
disable_warnings;
######## DATABASE ########
let $diff_statement= SHOW DATABASES LIKE 'd%';
send CREATE DATABASE d2;
source include/kill_query_and_diff_master_slave.inc;
# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the
# collation of other database on slave
#send ALTER DATABASE d1
# DEFAULT CHARACTER SET = 'utf8';
#source include/kill_query_and_diff_master_slave.inc;
send DROP DATABASE d1;
source include/kill_query_and_diff_master_slave.inc;
send DROP DATABASE d2;
source include/kill_query_and_diff_master_slave.inc;
######## EVENT ########
let $diff_statement= SELECT event_name, event_body, execute_at
FROM information_schema.events where event_name like 'e%';
send CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query_and_diff_master_slave.inc;
# Temporarily disabled because of BUG#44171, killing ALTER EVENT can
# crash the server
#send ALTER EVENT e1
# ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
#source include/kill_query_and_diff_master_slave.inc;
send DROP EVENT e1;
source include/kill_query_and_diff_master_slave.inc;
send DROP EVENT IF EXISTS e2;
source include/kill_query_and_diff_master_slave.inc;
######## FUNCTION ########
let $diff_statement= SHOW FUNCTION STATUS LIKE 'f%';
send CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
source include/kill_query_and_diff_master_slave.inc;
send ALTER FUNCTION f1 SQL SECURITY INVOKER;
source include/kill_query_and_diff_master_slave.inc;
# function f1 probably does not exist because the ALTER query was
# killed
send DROP FUNCTION f1;
source include/kill_query_and_diff_master_slave.inc;
# function f2 probably does not exist because the CREATE query was
# killed
#
# Temporarily disabled. Because of BUG#43353, KILL the query may
# result in function not found, and for 5.1, DROP statements will be
# logged if the function is not found on master, so the following DROP
# FUNCTION statement may be interrupted and not drop the function on
# master, but still get logged and executed on slave and cause
# inconsistence. Also disable the following DROP PROCEDURE IF EXITS
# below.
#send DROP FUNCTION IF EXISTS f2;
#source include/kill_query_and_diff_master_slave.inc;
######## PROCEDURE ########
let $diff_statement= SHOW PROCEDURE STATUS LIKE 'p%';
DELIMITER //;
send CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
END;
//
DELIMITER ;//
source include/kill_query_and_diff_master_slave.inc;
send ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
source include/kill_query_and_diff_master_slave.inc;
send DROP PROCEDURE p1;
source include/kill_query_and_diff_master_slave.inc;
# Temporarily disabled, see comment above for DROP FUNCTION IF EXISTS
#send DROP PROCEDURE IF EXISTS p2;
#source include/kill_query_and_diff_master_slave.inc;
######## TABLE ########
let $diff_statement= SHOW TABLES LIKE 't%';
send CREATE TABLE t2 (b int);
source include/kill_query_and_diff_master_slave.inc;
send ALTER TABLE t1 ADD (d int);
source include/kill_query_and_diff_master_slave.inc;
send RENAME TABLE t3 TO t4;
source include/kill_query_and_diff_master_slave.inc;
######## INDEX ########
let $diff_statement= SHOW INDEX FROM t1;
send CREATE INDEX i2 on t1 (a);
source include/kill_query_and_diff_master_slave.inc;
send DROP INDEX i1 on t1;
source include/kill_query_and_diff_master_slave.inc;
######## SERVER ########
# Tempoarily disabled, see bug#25705
# let $diff_statement= SELECT * FROM mysql.server WHERE name like 's%';
# send CREATE SERVER s2
# FOREIGN DATA WRAPPER mysql
# OPTIONS (USER 'user2', HOST '192.168.1.108', DATABASE 'test');
# source include/kill_query_and_diff_master_slave.inc;
# send ALTER SERVER s1
# OPTIONS (DATABASE 'test1');
# source include/kill_query_and_diff_master_slave.inc;
# send DROP SERVER s1;
# source include/kill_query_and_diff_master_slave.inc;
# send DROP SERVER IF EXIST s1;
# source include/kill_query_and_diff_master_slave.inc;
######## TRIGGER ########
let $diff_statement= SHOW TRIGGERS LIKE 'v%';
DELIMITER //;
send CREATE TRIGGER tr2 BEFORE INSERT ON t4
FOR EACH ROW BEGIN
DELETE FROM t1 WHERE a=NEW.a;
END;
//
DELIMITER ;//
source include/kill_query_and_diff_master_slave.inc;
send DROP TRIGGER tr1;
source include/kill_query_and_diff_master_slave.inc;
send DROP TRIGGER IF EXISTS tr2;
source include/kill_query_and_diff_master_slave.inc;
######## VIEW ########
let $diff_statement= SHOW TABLES LIKE 'v%';
send CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query_and_diff_master_slave.inc;
send DROP VIEW v1;
source include/kill_query_and_diff_master_slave.inc;
send DROP VIEW IF EXISTS v2;
source include/kill_query_and_diff_master_slave.inc;
######## DROP TABLE ########
let $diff_statement= SHOW TABLES LIKE 't%';
send DROP TABLE t1;
source include/kill_query_and_diff_master_slave.inc;
send DROP TABLE IF EXISTS t2;
source include/kill_query_and_diff_master_slave.inc;
######## CLEAN UP ########
connection master;
# The DROP statements above are killed during the process, so they
# does not make sure the objects are dropped.
disable_warnings;
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
DROP DATABASE IF EXISTS d4;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e2;
DROP EVENT IF EXISTS e3;
DROP EVENT IF EXISTS e4;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f3;
DROP FUNCTION IF EXISTS f4;
DROP SERVER IF EXISTS s1;
DROP SERVER IF EXISTS s2;
DROP SERVER IF EXISTS s3;
DROP SERVER IF EXISTS s4;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
enable_warnings;
......@@ -244,7 +244,7 @@ connection master;
# We should be gold by the time, so I will get rid of our file.
--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql
--remove_file $MYSQLTEST_VARDIR/tmp/remote.sql
################### End Bug 17654 ######################
# What is the point of this test? It seems entirely pointless. It
......@@ -349,9 +349,9 @@ FLUSH LOGS;
--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql
--remove_file $MYSQLTEST_VARDIR/tmp/remote.sql
--exec rm $MYSQLTEST_VARDIR/tmp/local.sql
--remove_file $MYSQLTEST_VARDIR/tmp/local.sql
DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
sync_slave_with_master;
......
......@@ -8,18 +8,23 @@
# ==== Method ====
#
# We run the slave with --slave-skip-errors=1062 (the code for
# duplicate key). On slave, we insert value 1 in a table, and then,
# on master, we insert value 1 in the table. The error should be
# ignored on slave.
# duplicate key). Then we have two set of tests. In the first
# set, we insert value 1 in a table on the slave, and then, on
# master, we insert value 1 in the table. In the second set, we
# insert several values on the master, disable the binlog and
# delete one of the values and re-enable the binlog. Right after,
# we perform an update on the set of values in order to generate
# a duplicate key on the slave. The errors should be ignored on
# the slave.
#
# ==== Related bugs ====
#
# BUG#28839: Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
# bug in this test: BUG#30594: rpl.rpl_skip_error is nondeterministic
# bug in this test: BUG#30594: rpl.rpl_skip_error is nondeterministic:
# BUG#39393: slave-skip-errors does not work when using ROW based replication
source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
source include/have_innodb.inc;
--echo ==== Test Without sql_mode=strict_trans_tables ====
......@@ -64,9 +69,11 @@ sync_slave_with_master;
connection master;
create table t1(a int primary key);
insert into t1 values (1),(2);
delete from t1 where @@server_id=1;
SET SQL_LOG_BIN=0;
delete from t1;
SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
insert into t1 values (1), (2), (3);
--echo [on slave]
sync_slave_with_master;
......@@ -80,3 +87,83 @@ connection master;
drop table t1;
sync_slave_with_master;
# End of 5.0 tests
#
# BUG#39393: slave-skip-errors does not work when using ROW based replication
#
--echo ==== Using Innodb ====
connection master;
SET SQL_LOG_BIN=0;
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
SET SQL_LOG_BIN=1;
connection slave;
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
connection master;
INSERT INTO t1 VALUES(1, 1);
INSERT INTO t1 VALUES(2, 1);
INSERT INTO t1 VALUES(3, 1);
INSERT INTO t1 VALUES(4, 1);
SET SQL_LOG_BIN=0;
DELETE FROM t1 WHERE id = 4;
SET SQL_LOG_BIN=1;
UPDATE t1 SET id= id + 3, data = 2;
sync_slave_with_master;
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
echo $error;
--echo **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR.
--echo ==== Using MyIsam ====
connection master;
SET SQL_LOG_BIN=0;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
SET SQL_LOG_BIN=1;
connection slave;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
connection master;
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
INSERT INTO t2 VALUES(3, 1);
INSERT INTO t2 VALUES(5, 1);
SET SQL_LOG_BIN=0;
DELETE FROM t2 WHERE id = 5;
SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;
sync_slave_with_master;
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
echo $error;
--echo **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR.
--echo ==== Clean Up ====
connection master;
DROP TABLE t1;
DROP TABLE t2;
sync_slave_with_master;
source include/master-slave.inc;
source include/have_innodb.inc;
#
# Bug#6148 ()
......@@ -35,4 +36,88 @@ save_master_pos;
connection slave;
sync_with_master;
# End of 4.1 tests
#
# Bug#38205 Row-based Replication (RBR) causes inconsistencies...
# Bug#319 if while a non-transactional slave is replicating a transaction...
#
# Verifying that STOP SLAVE does not interrupt excution of a group
# execution of events if the group can not roll back.
# Killing the sql thread continues to provide a "hard" stop (the
# part II, moved to the bugs suite as it's hard to make it
# deterministic with KILL).
#
#
# Part I. The being stopped sql thread finishes first the current group of
# events if the group contains an event on a non-transaction table.
connection master;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
sync_slave_with_master;
connection slave;
begin;
insert into t1i values (5);
connection master;
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
begin;
insert into t1i values (4);
insert into t2m values (1); # non-ta update to process
insert into t1i values (5); # to block at. to be played with stopped
commit;
connection slave;
# slave sql thread must be locked out by the conn `slave' explicit lock
let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--disable_query_log
eval select $pos0_master - $pos0_slave as zero;
--enable_query_log
connection slave1;
let $count= 1;
let $table= t2m;
source include/wait_until_rows_count.inc;
send stop slave;
connection slave;
rollback; # release the sql thread
connection slave1;
reap;
source include/wait_for_slave_to_stop.inc;
let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
--echo *** sql thread is *not* running: $sql_status ***
connection master;
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave;
let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--echo *** the prove: the stopped slave has finished the current transaction ***
--disable_query_log
select count(*) as five from t1i;
eval select $pos1_master - $pos1_slave as zero;
eval select $pos1_slave > $pos0_slave as one;
--enable_query_log
source include/start_slave.inc;
# clean-up
connection master;
drop table t1i, t2m;
sync_slave_with_master;
# End of tests
......@@ -44,7 +44,7 @@ SET @@global.binlog_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
SET @@global.binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
Warning 1292 Truncated incorrect binlog_cache_size value: '-1024'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
......
......@@ -66,6 +66,8 @@ SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
42949672950
SET @@global.bulk_insert_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-1024'
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
......@@ -80,6 +82,8 @@ SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
42949672950
SET @@session.bulk_insert_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2'
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
......
......@@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_limit;
1
SET @@global.delayed_insert_limit = -1024;
Warnings:
Warning 1292 Truncated incorrect delayed_insert_limit value: '0'
Warning 1292 Truncated incorrect delayed_insert_limit value: '-1024'
SELECT @@global.delayed_insert_limit;
@@global.delayed_insert_limit
1
......
......@@ -35,7 +35,7 @@ SELECT @@global.delayed_queue_size;
1
SET @@global.delayed_queue_size = -1024;
Warnings:
Warning 1292 Truncated incorrect delayed_queue_size value: '0'
Warning 1292 Truncated incorrect delayed_queue_size value: '-1024'
SELECT @@global.delayed_queue_size;
@@global.delayed_queue_size
1
......
......@@ -71,7 +71,7 @@ SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
1
SET @@global.join_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
1
......@@ -103,7 +103,7 @@ SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
1
SET @@session.join_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
Warning 1292 Truncated incorrect join_buffer_size value: '-2'
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
1
......
......@@ -17,8 +17,6 @@ SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
@@global.key_buffer_size BETWEEN 8 AND 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
@@global.key_buffer_size BETWEEN 8 AND 36
1
......
......@@ -74,6 +74,8 @@ SELECT @@global.log_warnings;
@@global.log_warnings
100000000000
SET @@global.log_warnings = -1024;
Warnings:
Warning 1292 Truncated incorrect log_warnings value: '-1024'
SELECT @@global.log_warnings;
@@global.log_warnings
0
......@@ -92,6 +94,8 @@ SELECT @@session.log_warnings;
@@session.log_warnings
100000000000
SET @@session.log_warnings = -2;
Warnings:
Warning 1292 Truncated incorrect log_warnings value: '-2'
SELECT @@session.log_warnings;
@@session.log_warnings
0
......
SET @start_value = @@global.max_binlog_cache_size;
SELECT @start_value;
@start_value
18446744073709551615
18446744073709547520
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_cache_size = 5000;
SET @@global.max_binlog_cache_size = DEFAULT;
......@@ -39,7 +39,7 @@ SELECT @@global.max_binlog_cache_size;
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_cache_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '0'
Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
......@@ -54,7 +54,7 @@ SELECT @@global.max_binlog_cache_size;
99999997952
SET @@global.max_binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '0'
Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1024'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
......
......@@ -39,7 +39,7 @@ SELECT @@global.max_connect_errors;
'#--------------------FN_DYNVARS_073_04-------------------------#'
SET @@global.max_connect_errors = -1;
Warnings:
Warning 1292 Truncated incorrect max_connect_errors value: '0'
Warning 1292 Truncated incorrect max_connect_errors value: '-1'
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
1
......@@ -54,7 +54,7 @@ SELECT @@global.max_connect_errors;
100000000000
SET @@global.max_connect_errors = -1024;
Warnings:
Warning 1292 Truncated incorrect max_connect_errors value: '0'
Warning 1292 Truncated incorrect max_connect_errors value: '-1024'
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
1
......
......@@ -73,13 +73,13 @@ SELECT @@session.max_heap_table_size;
'#------------------FN_DYNVARS_077_05-----------------------#'
SET @@global.max_heap_table_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '0'
Warning 1292 Truncated incorrect max_heap_table_size value: '-1'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16384
SET @@global.max_heap_table_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '0'
Warning 1292 Truncated incorrect max_heap_table_size value: '-1024'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16384
......@@ -111,7 +111,7 @@ SELECT @@global.max_heap_table_size;
4294967296
SET @@session.max_heap_table_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '0'
Warning 1292 Truncated incorrect max_heap_table_size value: '-1'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
16384
......
......@@ -77,7 +77,7 @@ SELECT @@global.max_seeks_for_key;
1
SET @@global.max_seeks_for_key = -1024;
Warnings:
Warning 1292 Truncated incorrect max_seeks_for_key value: '0'
Warning 1292 Truncated incorrect max_seeks_for_key value: '-1024'
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
1
......@@ -103,7 +103,7 @@ SELECT @@session.max_seeks_for_key;
1
SET @@session.max_seeks_for_key = -2;
Warnings:
Warning 1292 Truncated incorrect max_seeks_for_key value: '0'
Warning 1292 Truncated incorrect max_seeks_for_key value: '-2'
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
1
......
......@@ -71,7 +71,7 @@ SELECT @@session.max_tmp_tables;
'#------------------FN_DYNVARS_086_05-----------------------#'
SET @@global.max_tmp_tables = -1024;
Warnings:
Warning 1292 Truncated incorrect max_tmp_tables value: '0'
Warning 1292 Truncated incorrect max_tmp_tables value: '-1024'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
......@@ -81,7 +81,7 @@ SELECT @@global.max_tmp_tables;
4294967296
SET @@global.max_tmp_tables = -1;
Warnings:
Warning 1292 Truncated incorrect max_tmp_tables value: '0'
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
1
......@@ -105,7 +105,7 @@ SELECT @@session.max_tmp_tables;
4294967296
SET @@session.max_tmp_tables = -1;
Warnings:
Warning 1292 Truncated incorrect max_tmp_tables value: '0'
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
......@@ -115,7 +115,7 @@ SELECT @@session.max_tmp_tables;
429496729500
SET @@session.max_tmp_tables = -001;
Warnings:
Warning 1292 Truncated incorrect max_tmp_tables value: '0'
Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
......
......@@ -37,7 +37,7 @@ SELECT @@global.max_write_lock_count;
'#------------------FN_DYNVARS_088_04-----------------------#'
SET @@global.max_write_lock_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_write_lock_count value: '0'
Warning 1292 Truncated incorrect max_write_lock_count value: '-1024'
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
1
......@@ -47,7 +47,7 @@ SELECT @@global.max_write_lock_count;
4294967296
SET @@global.max_write_lock_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_write_lock_count value: '0'
Warning 1292 Truncated incorrect max_write_lock_count value: '-1'
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
1
......
......@@ -82,6 +82,8 @@ SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
429496726
SET @@global.min_examined_row_limit = -1024;
Warnings:
Warning 1292 Truncated incorrect min_examined_row_limit value: '-1024'
SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
0
......@@ -104,6 +106,8 @@ SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
4294967296
SET @@session.min_examined_row_limit = -1;
Warnings:
Warning 1292 Truncated incorrect min_examined_row_limit value: '-1'
SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
0
......
......@@ -81,7 +81,7 @@ SELECT @@global.multi_range_count;
4294967296
SET @@global.multi_range_count = -1024;
Warnings:
Warning 1292 Truncated incorrect multi_range_count value: '0'
Warning 1292 Truncated incorrect multi_range_count value: '-1024'
SELECT @@global.multi_range_count;
@@global.multi_range_count
1
......@@ -111,7 +111,7 @@ SELECT @@session.multi_range_count;
4294967296
SET @@session.multi_range_count = -1;
Warnings:
Warning 1292 Truncated incorrect multi_range_count value: '0'
Warning 1292 Truncated incorrect multi_range_count value: '-1'
SELECT @@session.multi_range_count;
@@session.multi_range_count
1
......
SET @start_global_value = @@global.myisam_max_sort_file_size;
SELECT @start_global_value;
@start_global_value
9223372036854775807
9223372036853727232
'#--------------------FN_DYNVARS_094_01-------------------------#'
SET @@global.myisam_max_sort_file_size = 500000;
SET @@global.myisam_max_sort_file_size = DEFAULT;
......@@ -48,14 +48,20 @@ SET @@local.myisam_max_sort_file_size = 4;
ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
'#------------------FN_DYNVARS_094_05-----------------------#'
SET @@global.myisam_max_sort_file_size = -1;
Warnings:
Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '-1'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = -2147483648;
Warnings:
Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '-2147483648'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = -2147483649;
Warnings:
Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '-2147483649'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment