| 1 |
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); |
| 2 |
CREATE TABLE t1 (a DOUBLE DEFAULT (PI()), |
| 3 |
b DOUBLE DEFAULT (RAND())); |
| 4 |
CREATE TABLE t2 (x INT); |
| 5 |
CREATE TABLE t3 (y DOUBLE DEFAULT (PI())); |
| 6 |
# Test R1. |
| 7 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 8 |
FOR EACH ROW INSERT INTO t1 VALUES (); |
| 9 |
INSERT INTO t2 VALUES (); |
| 10 |
Warnings: |
| 11 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 12 |
DROP TRIGGER t2_trigger; |
| 13 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 14 |
FOR EACH ROW INSERT INTO t1(a) VALUES (1); |
| 15 |
INSERT INTO t2 VALUES (); |
| 16 |
Warnings: |
| 17 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 18 |
DROP TRIGGER t2_trigger; |
| 19 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 20 |
FOR EACH ROW INSERT INTO t1(b) VALUES (DEFAULT); |
| 21 |
INSERT INTO t2 VALUES (); |
| 22 |
Warnings: |
| 23 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 24 |
DROP TRIGGER t2_trigger; |
| 25 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 26 |
FOR EACH ROW INSERT INTO t1(b) VALUES (1); |
| 27 |
INSERT INTO t2 VALUES (); |
| 28 |
Warnings: |
| 29 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 30 |
DROP TRIGGER t2_trigger; |
| 31 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 32 |
FOR EACH ROW UPDATE t1 SET a = DEFAULT; |
| 33 |
INSERT INTO t2 VALUES (); |
| 34 |
Warnings: |
| 35 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 36 |
DROP TRIGGER t2_trigger; |
| 37 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 38 |
FOR EACH ROW UPDATE t1 SET b = DEFAULT; |
| 39 |
INSERT INTO t2 VALUES (); |
| 40 |
Warnings: |
| 41 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it invokes a trigger or a stored function that modifies a table that has a column with a DEFAULT expression that may return a different value on the replica. |
| 42 |
DROP TRIGGER t2_trigger; |
| 43 |
# Test R2. |
| 44 |
CREATE TRIGGER t2_trigger AFTER INSERT ON t2 |
| 45 |
FOR EACH ROW INSERT INTO t3 VALUES (); |
| 46 |
INSERT INTO t2 VALUES (); |
| 47 |
DROP TRIGGER t2_trigger; |
| 48 |
# Test R3. |
| 49 |
INSERT INTO t1 VALUES (); |
| 50 |
Warnings: |
| 51 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the replica. |
| 52 |
INSERT INTO t1 (b) VALUES (DEFAULT); |
| 53 |
Warnings: |
| 54 |
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the replica. |
| 55 |
INSERT INTO t1 (b) VALUES (1); |
| 56 |
DROP TABLE t1, t2, t3; |