1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-22 17:44:29 +03:00

mysql-5.5.18 merge

This commit is contained in:
Sergei Golubchik
2011-11-03 19:17:05 +01:00
1160 changed files with 12821 additions and 6204 deletions

View File

@@ -99,6 +99,8 @@ alter table t1 drop b;
create table t3 like t1;
insert into t1 select * from t3;
replace into t1 select * from t3;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
select * from t1;
a
select * from t2;

View File

@@ -2352,6 +2352,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
@@ -2368,6 +2369,7 @@ END|
CALL p1();
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
@@ -2650,4 +2652,40 @@ a
13:46:40
1970-01-12 13:46:40
DROP TABLE t1;
CREATE TABLE filler_table (a INT, b INT);
INSERT INTO filler_table values (1,1),(1,2);
CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
INSERT INTO replace_table values (1,1),(2,2);
CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
INSERT INTO update_table values (1,1),(2,2);
INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
TRUNCATE TABLE insert_table;
INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
TRUNCATE TABLE insert_table;
REPLACE INTO replace_table SELECT * FROM filler_table;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
UPDATE IGNORE update_table SET a=2;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
DROP TABLE filler_table;
DROP TABLE insert_table;
DROP TABLE update_table;
DROP TABLE replace_table;
DROP TABLE create_ignore_test;
DROP TABLE create_replace_test;
"End of tests"

View File

@@ -12,6 +12,11 @@
# - insert into two autoinc columns;
# - statements using UDF's.
# - statements reading from log tables in the mysql database.
# - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
# - REPLACE ... SELECT
# - CREATE TABLE [IGNORE/REPLACE] SELECT
# - INSERT IGNORE...SELECT
# - UPDATE IGNORE
#
# Note that statements that use stored functions, stored procedures,
# triggers, views, or prepared statements that invoke unsafe
@@ -79,6 +84,7 @@
# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED
# BUG#47995: Mark user functions as unsafe
# BUG#49222: Mark RAND() unsafe
# BUG#11758262: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE...SEL,CREATE...[IGN|REPL] SEL
#
# ==== Related test cases ====
#
@@ -700,5 +706,47 @@ INSERT INTO t1 VALUES
SELECT * FROM t1;
DROP TABLE t1;
#
#BUG#11758262-50439: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE..
#The following statement may be unsafe when logged in statement format.
#INSERT IGNORE...SELECT
#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
#REPLACE ... SELECT
#UPDATE IGNORE
#CREATE TABLE... IGNORE SELECT
#CREATE TABLE... REPLACE SELECT
#setup tables
CREATE TABLE filler_table (a INT, b INT);
INSERT INTO filler_table values (1,1),(1,2);
CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
INSERT INTO replace_table values (1,1),(2,2);
CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
INSERT INTO update_table values (1,1),(2,2);
#INSERT IGNORE... SELECT
INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
TRUNCATE TABLE insert_table;
#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
TRUNCATE TABLE insert_table;
#REPLACE...SELECT
REPLACE INTO replace_table SELECT * FROM filler_table;
#UPDATE IGNORE
UPDATE IGNORE update_table SET a=2;
#CREATE TABLE [IGNORE/REPLACE] SELECT
CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
#temporary tables should not throw the warning.
CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
###clean up
DROP TABLE filler_table;
DROP TABLE insert_table;
DROP TABLE update_table;
DROP TABLE replace_table;
DROP TABLE create_ignore_test;
DROP TABLE create_replace_test;
--echo "End of tests"