-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
245 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
# | ||
# MDEV-14429 sql_safe_updates in my.cnf not work | ||
# | ||
select @@sql_safe_updates; | ||
@@sql_safe_updates | ||
1 | ||
# | ||
# MDEV-18304 sql_safe_updates does not work with OR clauses | ||
# | ||
create table t1 (a int, b int, primary key (a), key (b)); | ||
update t1 set b=2 where a=1 or b=2; | ||
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column | ||
explain update t1 set b=2 where a=1 or b=2; | ||
id select_type table type possible_keys key key_len ref rows Extra | ||
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where | ||
delete from t1 where a=1 or b=2; | ||
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column | ||
explain delete from t1 where a=1 or b=2; | ||
id select_type table type possible_keys key key_len ref rows Extra | ||
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where | ||
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); | ||
update t1 set b=2 where a=1 or b=2; | ||
delete from t1 where a=1 or b=2; | ||
drop table t1; | ||
# | ||
# End of 10.3 tests | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
# | ||
# MDEV-14429 sql_safe_updates in my.cnf not work | ||
# | ||
--echo # | ||
--echo # MDEV-14429 sql_safe_updates in my.cnf not work | ||
--echo # | ||
select @@sql_safe_updates; | ||
|
||
--echo # | ||
--echo # MDEV-18304 sql_safe_updates does not work with OR clauses | ||
--echo # | ||
create table t1 (a int, b int, primary key (a), key (b)); | ||
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE | ||
update t1 set b=2 where a=1 or b=2; | ||
explain update t1 set b=2 where a=1 or b=2; | ||
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE | ||
delete from t1 where a=1 or b=2; | ||
explain delete from t1 where a=1 or b=2; | ||
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); | ||
update t1 set b=2 where a=1 or b=2; | ||
delete from t1 where a=1 or b=2; | ||
drop table t1; | ||
|
||
--echo # | ||
--echo # End of 10.3 tests | ||
--echo # |
17 changes: 17 additions & 0 deletions
17
mysql-test/suite/binlog/r/binlog_xa_recover_using_new_server_id.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
========= Set server_id to 99 and prepare test table. | ||
SET GLOBAL server_id= 99; | ||
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; | ||
========= Crash the server. | ||
SET SESSION debug_dbug="+d,crash_commit_after_log"; | ||
INSERT INTO t1 VALUES (1, NULL); | ||
Got one of the listed errors | ||
========= Restart the server with default config file in which server_id= 1. | ||
========= Check that recover succeeds and server is up. | ||
connection default; | ||
========= Check that all transactions are recovered. | ||
SELECT a FROM t1 ORDER BY a; | ||
a | ||
1 | ||
========= Cleanup. | ||
connection default; | ||
DROP TABLE t1; |
44 changes: 44 additions & 0 deletions
44
mysql-test/suite/binlog/t/binlog_xa_recover_using_new_server_id.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This test verifies attempt to xa recover using a new server id that | ||
# different from the transaction's original server_id. | ||
# | ||
|
||
--source include/have_innodb.inc | ||
--source include/have_debug.inc | ||
--source include/have_binlog_format_row.inc | ||
# Valgrind does not work well with test that crashes the server | ||
--source include/not_valgrind.inc | ||
|
||
|
||
--echo ========= Set server_id to 99 and prepare test table. | ||
SET GLOBAL server_id= 99; | ||
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; | ||
|
||
|
||
--echo ========= Crash the server. | ||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
wait-binlog_xa_recover_using_new_server_id.test | ||
EOF | ||
SET SESSION debug_dbug="+d,crash_commit_after_log"; | ||
--error 2006,2013 | ||
INSERT INTO t1 VALUES (1, NULL); | ||
|
||
|
||
--echo ========= Restart the server with default config file in which server_id= 1. | ||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
restart-binlog_xa_recover_using_new_server_id.test | ||
EOF | ||
|
||
|
||
--echo ========= Check that recover succeeds and server is up. | ||
connection default; | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
|
||
|
||
--echo ========= Check that all transactions are recovered. | ||
SELECT a FROM t1 ORDER BY a; | ||
|
||
|
||
--echo ========= Cleanup. | ||
connection default; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.