summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp_trans.result
diff options
context:
space:
mode:
authorunknown <aelkin/elkin@andrepl.(none)>2007-03-23 17:12:58 +0200
committerunknown <aelkin/elkin@andrepl.(none)>2007-03-23 17:12:58 +0200
commit4a76ac5fa6e844c78ec565c2e15ac88f0bb9a8a6 (patch)
tree69b3937c478753aaf68e93fe328ccf451a4ab2f6 /mysql-test/r/sp_trans.result
parentb444f808828e42b64cdd4fa8bc9e901b1ae6e119 (diff)
downloadmariadb-git-4a76ac5fa6e844c78ec565c2e15ac88f0bb9a8a6.tar.gz
Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit was not restored at the end of SF() invocation, where SF() modified non-ta table. As the result of this artifact it was not possible to detect whether there were any side-effects when top-level query ends. If the top level query table was not modified and the bit is lost there would be no binlogging. Fixed with preserving the bit inside of thd->no_trans_update struct. The struct agregates two bool flags telling whether the current query and the current transaction modified any non-ta table. The flags stmt, all are dropped at the end of the query and the transaction. mysql-test/r/sp_trans.result: results will be changed once again after bug#23333 will be fixed. mysql-test/t/sp_trans.test: regression test added sql/ha_ndbcluster.cc: replacing thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit and bool thd->no_trans_update with thd->no_trans_update as struct sql/handler.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/log.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/set_var.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sp_head.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_class.h: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_delete.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_insert.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_load.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_parse.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_table.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_update.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools.
Diffstat (limited to 'mysql-test/r/sp_trans.result')
-rw-r--r--mysql-test/r/sp_trans.result32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 564e31c9e32..513bbc43ce3 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -530,3 +530,35 @@ count(*)
drop table t3, t4|
drop procedure bug14210|
set @@session.max_heap_table_size=default|
+drop function if exists bug23333|
+drop table if exists t1,t2|
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
+CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
+reset master|
+insert into t2 values (1,1)|
+create function bug23333()
+RETURNS int(11)
+DETERMINISTIC
+begin
+insert into t1 values (null);
+select count(*) from t1 into @a;
+return @a;
+end|
+insert into t2 values (bug23333(),1)|
+ERROR 23000: Duplicate entry '1' for key 1
+show binlog events /* must show the insert */|
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 98 Server ver: 5.0.40-debug-log, Binlog ver: 4
+master-bin.000001 98 Query 1 90 use `test`; insert into t2 values (1,1)
+master-bin.000001 188 Xid 1 215 COMMIT /* xid=1165 */
+master-bin.000001 215 Query 1 446 use `test`; CREATE DEFINER=`root`@`localhost` function bug23333()
+RETURNS int(11)
+DETERMINISTIC
+begin
+insert into t1 values (null);
+select count(*) from t1 into @a;
+return @a;
+end
+select count(*),@a from t1 /* must be 1,1 */|
+count(*) @a
+1 1