3704 Mattias Jonsson 2012-01-05
WL#4443
Updated test results after removing locking in create view.
modified:
mysql-test/include/commit.inc
mysql-test/r/commit_1innodb.result
mysql-test/suite/binlog/r/binlog_unsafe.result
sql/sql_view.cc
3703 Mattias Jonsson 2012-01-05
WL#4443
sql_view.cc:
no need of locking tables during create view.
Updated results files after derived handling was removed
from update (now the explain and execution is the same
as for the same select).
updated results files affected by bug#13559657.
modified:
mysql-test/r/innodb_explain_non_select_none.result
mysql-test/r/myisam_explain_non_select_none.result
mysql-test/r/partition_locking.result
mysql-test/suite/parts/inc/partition-dml-1-9.inc
mysql-test/suite/parts/r/partition-dml-1-9-innodb.result
mysql-test/suite/parts/r/partition-dml-1-9-myisam.result
mysql-test/t/partition_locking.test
sql/sql_view.cc
=== modified file 'mysql-test/include/commit.inc'
--- a/mysql-test/include/commit.inc revid:mattias.jonsson@stripped
+++ b/mysql-test/include/commit.inc revid:mattias.jonsson@stripped
@@ -763,7 +763,11 @@ call p_verify_status_increment(0, 0, 0,
truncate table t3;
call p_verify_status_increment(2, 0, 2, 0);
create view v1 as select * from t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(0, 0, 0, 0);
+select * from v1;
+call p_verify_status_increment(1, 0, 1, 0);
+commit;
+call p_verify_status_increment(1, 0, 1, 0);
check table t1;
call p_verify_status_increment(2, 0, 2, 0);
--echo # Sic: after this bug is fixed, CHECK leaves no pending transaction
=== modified file 'mysql-test/r/commit_1innodb.result'
--- a/mysql-test/r/commit_1innodb.result revid:mattias.jonsson@stripped
+++ b/mysql-test/r/commit_1innodb.result revid:mattias.jonsson@stripped
@@ -852,7 +852,18 @@ call p_verify_status_increment(2, 0, 2,
SUCCESS
create view v1 as select * from t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(0, 0, 0, 0);
+SUCCESS
+
+select * from v1;
+a
+8
+8
+call p_verify_status_increment(1, 0, 1, 0);
+SUCCESS
+
+commit;
+call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
check table t1;
=== modified file 'mysql-test/suite/binlog/r/binlog_unsafe.result'
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result revid:mattias.jonsson@stripped
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result revid:mattias.jonsson@stripped
@@ -85,8 +85,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-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 slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -149,8 +147,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-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 slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -411,8 +407,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -475,8 +469,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -657,8 +649,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_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.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1049,8 +1039,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1245,8 +1233,6 @@ DROP TRIGGER trig_2;
Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF.
CREATE VIEW view_retval_2 AS SELECT func_retval_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_retval_2;
Warnings:
@@ -1309,8 +1295,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1551,8 +1535,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_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 the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
* binlog_format = STATEMENT: expect 1 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -1819,13 +1801,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_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. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave.
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
-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 slave.
* binlog_format = STATEMENT: expect 6 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -2080,9 +2055,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_2 AS SELECT func_sidef_1();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
-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 slave.
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
@@ -2216,9 +2188,6 @@ DROP TRIGGER trig_1;
Invoking view view_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_1 AS SELECT multi_unsafe_func();
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
-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 slave.
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t1 SELECT * FROM view_sidef_1;
Warnings:
@@ -2262,9 +2231,6 @@ DROP TRIGGER trig_2;
Invoking view view_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times.
CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
-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 slave.
* binlog_format = STATEMENT: expect 2 warnings.
INSERT INTO t2 SELECT * FROM view_sidef_2;
Warnings:
=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc revid:mattias.jonsson@stripped
+++ b/sql/sql_view.cc revid:mattias.jonsson@stripped
@@ -575,18 +575,6 @@ bool mysql_create_view(THD *thd, TABLE_L
goto err;
}
-#if 0
- /* TODO: Is it really neccesary to lock the tables? */
- lex->link_first_table_back(view, link_to_local);
- if (lock_query_tables(thd))
- {
- view= lex->unlink_first_table(&link_to_local);
- res= TRUE;
- goto err;
- }
- view= lex->unlink_first_table(&link_to_local);
-#endif
-
/* view list (list of view fields names) */
if (lex->view_list.elements)
{
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (mattias.jonsson:3703 to 3704) WL#4443 | Mattias Jonsson | 9 Jan |