-
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
28 changed files
with
474 additions
and
100 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ã"RT @niouzechun: 遘√����繝上ャ繝斐����繧ィ繝ウ繝牙耳縺ェ繧薙□縺代l縺ゥ縲√い繝ウ繝上ャ繝斐����繧ィ繝ウ繝峨d諠ィ蜉����噪縺ェ縺願ゥア繧偵≠縺セ繧顔ゥ肴・オ逧����↓鞫ょ叙縺励↑縺����炊逕ア縺ッ縲∫樟螳溘����莠コ逕溘����蝓コ譛ャ逧����↓縺����∪縺上>縺九↑縺����@荳榊ケウ遲峨□縺礼炊荳榊ース縺�縺苓セ帙> |
58 changes: 58 additions & 0 deletions
58
mysql-test/suite/binlog/r/binlog_dmls_on_tmp_tables_readonly.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,58 @@ | ||
DROP TABLE IF EXISTS t1 ; | ||
# READ_ONLY does nothing to SUPER users | ||
# so we use a non-SUPER one: | ||
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; | ||
connect con1,localhost,test,,test; | ||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
connection con1; | ||
CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB; | ||
# Test INSERTS with autocommit being off and on. | ||
BEGIN; | ||
INSERT INTO t1 VALUES (10); | ||
COMMIT; | ||
INSERT INTO t1 VALUES (20); | ||
# Test UPDATES with autocommit being off and on. | ||
BEGIN; | ||
UPDATE t1 SET a=30 WHERE a=10; | ||
COMMIT; | ||
UPDATE t1 SET a=40 WHERE a=20; | ||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
# Test scenario where global read_only is enabled in the middle of transaction. | ||
# Test INSERT operations on temporary tables, INSERTs should be successful even | ||
# when global read_only is enabled. | ||
connection con1; | ||
BEGIN; | ||
INSERT INTO t1 VALUES(50); | ||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
connection con1; | ||
SELECT @@GLOBAL.READ_ONLY; | ||
@@GLOBAL.READ_ONLY | ||
1 | ||
COMMIT; | ||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
# Test UPDATE operations on temporary tables, UPDATEs should be successful even | ||
# when global read_only is enabled. | ||
connection con1; | ||
BEGIN; | ||
UPDATE t1 SET a=60 WHERE a=50; | ||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
connection con1; | ||
SELECT @@GLOBAL.READ_ONLY; | ||
@@GLOBAL.READ_ONLY | ||
1 | ||
COMMIT; | ||
SELECT * FROM t1; | ||
a | ||
30 | ||
40 | ||
60 | ||
# Clean up | ||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
disconnect con1; | ||
DROP USER test@localhost; |
91 changes: 91 additions & 0 deletions
91
mysql-test/suite/binlog/t/binlog_dmls_on_tmp_tables_readonly.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,91 @@ | ||
# ==== Purpose ==== | ||
# | ||
# Check that DMLs are allowed on temporary tables, when server is in read only | ||
# mode and binary log is enabled with binlog-format being stmt/mixed mode. | ||
# | ||
# ==== Implementation ==== | ||
# | ||
# Start the server with binary log being enabled. Mark the server as read only. | ||
# Create a non-SUPER user and let the user to create a temporary table and | ||
# perform DML operations on that temporary table. DMLs should not be blocked | ||
# with a 'server read-only mode' error. | ||
# | ||
# ==== References ==== | ||
# | ||
# Bug#12818255: READ-ONLY OPTION DOES NOT ALLOW INSERTS/UPDATES ON TEMPORARY | ||
# TABLES | ||
# Bug#14294223: CHANGES NOT ALLOWED TO TEMPORARY TABLES ON READ-ONLY SERVERS | ||
############################################################################### | ||
--source include/have_log_bin.inc | ||
--source include/have_innodb.inc | ||
--disable_warnings | ||
DROP TABLE IF EXISTS t1 ; | ||
--enable_warnings | ||
|
||
--enable_connect_log | ||
--echo # READ_ONLY does nothing to SUPER users | ||
--echo # so we use a non-SUPER one: | ||
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; | ||
|
||
connect (con1,localhost,test,,test); | ||
|
||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
|
||
connection con1; | ||
CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB; | ||
|
||
--echo # Test INSERTS with autocommit being off and on. | ||
BEGIN; | ||
INSERT INTO t1 VALUES (10); | ||
COMMIT; | ||
INSERT INTO t1 VALUES (20); | ||
|
||
--echo # Test UPDATES with autocommit being off and on. | ||
BEGIN; | ||
UPDATE t1 SET a=30 WHERE a=10; | ||
COMMIT; | ||
UPDATE t1 SET a=40 WHERE a=20; | ||
|
||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
|
||
--echo # Test scenario where global read_only is enabled in the middle of transaction. | ||
--echo # Test INSERT operations on temporary tables, INSERTs should be successful even | ||
--echo # when global read_only is enabled. | ||
connection con1; | ||
BEGIN; | ||
INSERT INTO t1 VALUES(50); | ||
|
||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
|
||
connection con1; | ||
SELECT @@GLOBAL.READ_ONLY; | ||
COMMIT; | ||
|
||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
|
||
--echo # Test UPDATE operations on temporary tables, UPDATEs should be successful even | ||
--echo # when global read_only is enabled. | ||
connection con1; | ||
BEGIN; | ||
UPDATE t1 SET a=60 WHERE a=50; | ||
|
||
connection default; | ||
SET GLOBAL READ_ONLY=1; | ||
|
||
connection con1; | ||
SELECT @@GLOBAL.READ_ONLY; | ||
COMMIT; | ||
|
||
SELECT * FROM t1; | ||
|
||
--echo # Clean up | ||
connection default; | ||
SET GLOBAL READ_ONLY=0; | ||
|
||
disconnect con1; | ||
DROP USER test@localhost; | ||
--disable_connect_log |
Oops, something went wrong.