mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/kent/bk/mysql-5.1-release
into mysql.com:/home/kent/bk/build/mysql-5.1-build
This commit is contained in:
@ -16,3 +16,33 @@ ERROR HY000: The MySQL server is running with the --read-only option so it canno
|
||||
set global read_only=0;
|
||||
drop table table_11733 ;
|
||||
drop user test@localhost;
|
||||
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
|
||||
CREATE TABLE t1(a INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (0), (1);
|
||||
SET GLOBAL read_only=1;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
1
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
1
|
||||
COMMIT;
|
||||
SET GLOBAL read_only=0;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
1
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
1
|
||||
COMMIT;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
DROP USER test@localhost;
|
||||
echo End of 5.1 tests
|
||||
|
@ -417,3 +417,17 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'a'
|
||||
INSERT INTO t1 VALUES (2);
|
||||
*** the proof of the fix:
|
||||
select must show that the last insert performed on the slave ***
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
end of the tests
|
||||
|
@ -234,3 +234,30 @@ SELECT * FROM t2 ORDER BY a;
|
||||
connection master;
|
||||
DROP TABLE t1,t2;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# bug#35762 Failing CREATE-SELECT produces bad binlog in row mode
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
--error ER_DUP_ENTRY
|
||||
CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
sync_slave_with_master;
|
||||
# connection slave;
|
||||
|
||||
--echo *** the proof of the fix:
|
||||
--echo select must show that the last insert performed on the slave ***
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
--echo end of the tests
|
||||
|
@ -41,3 +41,45 @@ set global read_only=0;
|
||||
drop table table_11733 ;
|
||||
drop user test@localhost;
|
||||
|
||||
disconnect con1;
|
||||
|
||||
#
|
||||
# Bug #35732: read-only blocks SELECT statements in InnoDB
|
||||
#
|
||||
# Test 1: read only mode
|
||||
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
|
||||
connect(con1, localhost, test, , test);
|
||||
|
||||
connection default;
|
||||
CREATE TABLE t1(a INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (0), (1);
|
||||
SET GLOBAL read_only=1;
|
||||
|
||||
connection con1;
|
||||
SELECT * FROM t1;
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
|
||||
connection default;
|
||||
SET GLOBAL read_only=0;
|
||||
|
||||
#
|
||||
# Test 2: global read lock
|
||||
#
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
|
||||
connection con1;
|
||||
SELECT * FROM t1;
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
|
||||
connection default;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
DROP USER test@localhost;
|
||||
|
||||
disconnect con1;
|
||||
|
||||
--echo echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user