Below is the list of changes that have just been committed into a local
5.0 repository of gkodinov. When gkodinov does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-02-19 17:27:18+02:00, gkodinov@stripped +4 -0
Bug #30604: different flagging of time_zone_used in normal
and ps-protocol
Finding a routine should be a transparent operation as
far as the binary log is concerned.
But it was influencing the binary log because of the TIMESTAMP
column in the proc table.
Fixed by preserving and restoring the time_zone usage flag when
searching for a stored routine in the proc table.
mysql-test/r/binlog_innodb.result@stripped, 2008-02-19 17:27:17+02:00, gkodinov@stripped +16 -0
Bug #30604: test case
mysql-test/r/ctype_cp932_binlog.result@stripped, 2008-02-19 17:27:17+02:00, gkodinov@stripped +3 -3
Bug #30604: updated test results (a procedure call before that)
mysql-test/t/binlog_innodb.test@stripped, 2008-02-19 17:27:17+02:00, gkodinov@stripped +25 -0
Bug #30604: test case
sql/sp.cc@stripped, 2008-02-19 17:27:17+02:00, gkodinov@stripped +6 -0
Bug #30604: finding a routine should be a transparent operation as
far as the binary log is concerned.
Fixed by preserving and restoring the time_zone usage flag.
diff -Nrup a/mysql-test/r/binlog_innodb.result b/mysql-test/r/binlog_innodb.result
--- a/mysql-test/r/binlog_innodb.result 2007-06-19 10:56:18 +03:00
+++ b/mysql-test/r/binlog_innodb.result 2008-02-19 17:27:17 +02:00
@@ -21,3 +21,19 @@ show status like "binlog_cache_disk_use"
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+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 (2),(10+bug23333());
+SHOW MASTER STATUS;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+# 184136
+DROP FUNCTION bug23333;
+DROP TABLE t1, t2;
diff -Nrup a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result
--- a/mysql-test/r/ctype_cp932_binlog.result 2007-05-24 13:35:42 +03:00
+++ b/mysql-test/r/ctype_cp932_binlog.result 2008-02-19 17:27:17 +02:00
@@ -40,6 +40,6 @@ IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 776 Query 1 995 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
-master-bin.000001 995 Query 1 1084 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1084 Query 1 1163 use `test`; DROP TABLE t4
+master-bin.000001 776 Query 1 987 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
+master-bin.000001 987 Query 1 1076 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1076 Query 1 1155 use `test`; DROP TABLE t4
diff -Nrup a/mysql-test/t/binlog_innodb.test b/mysql-test/t/binlog_innodb.test
--- a/mysql-test/t/binlog_innodb.test 2007-06-19 10:56:18 +03:00
+++ b/mysql-test/t/binlog_innodb.test 2008-02-19 17:27:17 +02:00
@@ -37,3 +37,28 @@ show status like "binlog_cache_disk_use"
drop table t1;
+#
+# Bug #30604: different flagging of time_zone_used in normal and ps-protocol
+#
+
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+
+DELIMITER |;
+# the function does not deal with time objects
+CREATE FUNCTION bug23333()
+RETURNS int(11)
+DETERMINISTIC
+BEGIN
+ INSERT INTO t1 VALUES (NULL);
+ SELECT COUNT(*) FROM t1 INTO @a;
+ RETURN @a;
+END|
+
+DELIMITER ;|
+
+INSERT INTO t2 VALUES (2),(10+bug23333());
+--replace_column 1 #
+SHOW MASTER STATUS;
+DROP FUNCTION bug23333;
+DROP TABLE t1, t2;
diff -Nrup a/sql/sp.cc b/sql/sp.cc
--- a/sql/sp.cc 2007-12-17 10:45:20 +02:00
+++ b/sql/sp.cc 2008-02-19 17:27:17 +02:00
@@ -261,6 +261,7 @@ db_find_routine(THD *thd, int type, sp_n
char buff[65];
String str(buff, sizeof(buff), &my_charset_bin);
ulong sql_mode;
+ bool saved_time_zone_used= thd->time_zone_used;
Open_tables_state open_tables_state_backup;
DBUG_ENTER("db_find_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",
@@ -370,6 +371,11 @@ db_find_routine(THD *thd, int type, sp_n
definer, created, modified);
done:
+ /*
+ Restore the time zone flag as the timezone usage in proc table
+ does not affect replication.
+ */
+ thd->time_zone_used= saved_time_zone_used;
if (table)
close_proc_table(thd, &open_tables_state_backup);
DBUG_RETURN(ret);