Michael Widenius
c4bb7cd6dc
Fix for MDEV-5589: "Discrepancy in binlog on half-failed CREATE OR REPLACE"
...
Now if CREATE OR REPLACE fails but we have deleted a table already, we will generate a DROP TABLE in the binary log.
This fixes this issue.
In addition, for a failing CREATE OR REPLACE TABLE ... SELECT we don't generate a log of all the inserted rows, only the DROP TABLE.
I added code for not logging DROP TEMPORARY TABLE for tables where the CREATE TABLE was not logged. This code will be activated in 10.1
by removing the code protected by DONT_LOG_DROP_OF_TEMPORARY_TABLES.
mysql-test/suite/rpl/r/create_or_replace_mix.result:
More test cases
mysql-test/suite/rpl/r/create_or_replace_row.result:
More test cases
mysql-test/suite/rpl/r/create_or_replace_statement.result:
More test cases
mysql-test/suite/rpl/t/create_or_replace.inc:
More test cases
sql/log.cc:
Added binlog_reset_cache() to clear the binary log.
sql/log.h:
Added prototype
sql/sql_insert.cc:
If CREATE OR REPLACE TABLE ... SELECT fails:
- Don't log anything if nothing changed
- If table was deleted, log a DROP TABLE.
Remember if we table creation of temporary tables was logged.
sql/sql_table.cc:
Added log_drop_table()
Remember if we table creation of temporary tables was logged.
If CREATE OR REPLACE TABLE ... SELECT fails and a table was deleted, log a DROP TABLE.
sql/sql_table.h:
Added prototype
sql/sql_truncate.cc:
Remember if we table creation of temporary tables was logged.
sql/table.h:
Added table_creation_was_logged
2014-03-20 00:59:13 +02:00
..
2014-02-05 19:01:59 +02:00
2014-02-05 19:01:59 +02:00
2014-02-05 19:01:59 +02:00
2014-02-05 19:01:59 +02:00
2014-02-05 19:01:59 +02:00
2014-02-05 19:01:59 +02:00
2014-03-20 00:59:13 +02:00
2013-08-27 19:18:04 +03:00
2013-08-27 19:18:04 +03:00
2013-02-28 16:47:03 +02:00
2011-12-12 23:58:40 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2012-02-06 18:42:18 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2012-02-09 23:28:33 +05:30
2010-12-19 18:15:12 +01:00
2012-04-23 11:51:19 +03:00
2010-12-19 18:07:28 +01:00
2010-11-30 10:47:08 +01:00
2010-12-19 18:07:28 +01:00
2010-08-17 11:14:46 +04:00
2010-08-17 11:14:46 +04:00
2010-12-19 18:15:12 +01:00
2011-10-19 21:45:18 +02:00
2010-11-30 23:32:51 +00:00
2011-12-15 22:07:58 +01:00
2012-02-07 16:22:36 +01:00
2012-01-16 20:16:35 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2011-07-02 22:08:51 +02:00
2011-12-15 22:07:58 +01:00
2012-11-20 12:37:23 +00:00
2011-12-15 22:07:58 +01:00
2011-04-14 00:18:08 +04:00
2011-12-15 22:07:58 +01:00
2011-02-20 18:51:43 +02:00
2009-11-20 15:30:35 +02:00
2012-07-13 10:04:59 +01:00
2013-05-15 16:28:12 +03:00
2011-10-19 21:45:18 +02:00
2013-05-08 13:36:17 +04:00
2010-12-19 18:07:28 +01:00
2011-05-03 14:01:11 +02:00
2011-05-03 14:01:11 +02:00
2012-03-29 16:02:19 +02:00
2011-07-02 22:08:51 +02:00
2013-06-06 17:51:28 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-08-17 11:14:46 +04:00
2010-12-19 18:15:12 +01:00
2012-05-31 22:39:11 +03:00
2011-11-24 14:51:18 +00:00
2011-05-03 14:01:11 +02:00
2011-05-03 14:01:11 +02:00
2013-05-03 01:54:47 +03:00
2010-12-19 18:07:28 +01:00
2014-01-29 15:37:17 +02:00
2014-01-22 15:29:36 +01:00
2010-12-19 18:07:28 +01:00
2012-02-06 18:42:18 +01:00
2011-01-17 18:51:01 +00:00
2010-12-19 18:07:28 +01:00
2013-11-03 16:31:52 +01:00
2010-08-17 11:14:46 +04:00
2012-02-07 16:22:36 +01:00
2010-08-17 11:14:46 +04:00
2011-02-20 18:51:43 +02:00
2010-12-19 18:07:28 +01:00
2013-05-03 01:54:47 +03:00
2014-02-06 16:28:05 +01:00
2012-02-23 09:18:48 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-12-14 15:33:43 +02:00
2013-08-07 15:55:17 +04:00
2010-12-19 18:15:12 +01:00
2012-01-16 09:17:40 +00:00
2012-01-16 09:17:40 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-03-19 15:00:23 -07:00
2013-05-03 01:54:47 +03:00
2008-08-26 18:01:49 +08:00
2013-05-03 01:54:47 +03:00
2012-03-19 15:00:23 -07:00
2009-12-03 16:59:58 +08:00
2012-10-03 01:44:54 +03:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-10-17 15:43:56 +03:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2009-10-29 10:26:59 +08:00
2011-12-15 22:07:58 +01:00
2010-12-19 18:07:28 +01:00
2013-02-18 15:41:17 +01:00
2014-02-11 14:06:03 +01:00
2013-11-21 14:42:25 +01:00
2013-11-21 14:42:25 +01:00
2013-03-21 11:03:31 +01:00
2014-02-10 15:12:17 +01:00
2014-02-07 20:24:39 +01:00
2014-02-10 12:53:04 +01:00
2013-05-15 19:52:21 +02:00
2013-05-22 17:36:48 +02:00
2013-05-03 11:27:29 +02:00
2013-05-22 17:36:48 +02:00
2013-05-22 17:36:48 +02:00
2013-05-22 17:36:48 +02:00
2013-08-22 12:36:42 +02:00
2013-05-29 11:41:25 +02:00
2014-02-11 14:06:03 +01:00
2013-08-16 15:10:25 +02:00
2013-03-18 15:09:36 +01:00
2014-02-07 20:24:39 +01:00
2013-06-07 08:43:21 +02:00
2014-02-10 15:12:17 +01:00
2013-04-09 11:46:38 +02:00
2014-02-07 20:24:39 +01:00
2013-05-28 13:28:31 +02:00
2013-05-22 17:36:48 +02:00
2010-12-19 18:15:12 +01:00
2011-02-04 22:07:48 +03:00
2009-10-02 23:24:40 +04:00
2014-03-04 20:32:52 +02:00
2010-12-19 18:15:12 +01:00
2012-02-06 18:42:18 +01:00
2011-03-01 13:24:36 +01:00
2011-03-01 13:24:36 +01:00
2013-05-03 01:54:47 +03:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-05-03 01:54:47 +03:00
2013-10-14 00:24:05 +03:00
2011-12-15 22:07:58 +01:00
2010-12-19 18:07:28 +01:00
2010-08-17 11:14:46 +04:00
2010-08-17 11:14:46 +04:00
2011-07-02 22:08:51 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-08-17 11:14:46 +04:00
2012-02-06 22:55:17 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-01-31 14:31:33 +00:00
2011-07-02 22:08:51 +02:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:15:12 +01:00
2009-11-23 17:38:42 +01:00
2012-01-16 20:16:35 +01:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2011-12-15 22:07:58 +01:00
2011-07-02 22:08:51 +02:00
2012-01-16 20:16:35 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2013-05-03 01:54:47 +03:00
2013-03-27 11:59:40 +05:30
2011-03-25 12:57:27 +02:00
2011-03-25 12:57:27 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2009-11-28 12:43:16 +08:00
2010-11-05 15:26:38 +01:00
2009-11-28 12:43:16 +08:00
2010-11-05 15:26:38 +01:00
2011-07-02 22:08:51 +02:00
2010-12-19 18:15:12 +01:00
2012-05-31 22:39:11 +03:00
2012-02-06 18:42:18 +01:00
2010-12-19 18:07:28 +01:00
2013-09-10 16:12:25 +08:00
2014-01-22 15:29:36 +01:00
2012-01-19 16:56:43 +00:00
2010-12-19 18:07:28 +01:00
2014-03-04 13:10:14 +01:00
2010-12-19 18:15:12 +01:00
2014-02-01 00:54:03 +01:00
2013-12-22 17:06:50 +01:00
2009-11-28 02:34:47 +03:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2014-01-22 15:29:36 +01:00
2012-09-27 20:09:46 +02:00
2011-07-02 22:08:51 +02:00
2012-09-27 20:09:46 +02:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2012-02-09 23:28:33 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-11-13 23:03:48 +01:00
2010-12-19 18:07:28 +01:00
2012-09-27 20:09:46 +02:00
2012-09-27 20:09:46 +02:00
2012-09-27 20:09:46 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2014-03-04 08:48:32 +01:00
2012-03-28 01:04:46 +02:00
2010-03-03 22:22:02 +03:00
2012-06-12 12:59:56 +05:30
2013-05-03 01:54:47 +03:00
2014-01-08 11:00:44 +01:00
2014-01-06 16:05:52 +01:00
2014-02-10 12:53:04 +01:00
2012-04-20 22:25:59 +01:00
2014-03-11 00:02:22 +04:00
2013-09-27 16:58:49 +04:00
2013-09-27 16:58:49 +04:00
2013-09-27 16:58:49 +04:00
2013-09-27 16:58:49 +04:00
2013-09-27 16:58:49 +04:00
2013-04-18 22:17:29 +02:00
2012-01-24 18:07:35 +02:00
2012-02-23 07:50:11 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2011-02-15 12:01:52 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-03-03 22:22:02 +03:00
2011-07-02 22:08:51 +02:00
2011-05-19 16:45:45 +01:00
2012-09-27 20:09:46 +02:00
2010-12-19 18:07:28 +01:00
2012-12-04 18:14:01 +05:30
2010-12-19 18:07:28 +01:00
2009-08-28 10:45:57 +01:00
2010-12-19 18:07:28 +01:00
2014-02-01 00:54:03 +01:00
2011-10-27 17:14:41 +03:00
2013-02-27 10:43:07 +04:00
2013-12-09 12:37:45 +01:00
2010-12-19 18:07:28 +01:00
2011-07-02 22:08:51 +02:00
2011-09-23 12:00:52 +02:00
2011-09-23 12:00:52 +02:00
2011-01-10 14:53:09 +01:00
2011-09-23 12:00:52 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-06-17 22:51:35 +02:00
2013-05-03 01:54:47 +03:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-05-03 01:54:47 +03:00
2013-05-03 01:54:47 +03:00
2011-07-14 12:15:24 +01:00
2011-12-15 22:07:58 +01:00
2014-01-29 15:37:17 +02:00
2010-12-19 18:07:28 +01:00
2012-09-27 20:09:46 +02:00
2010-12-19 18:07:28 +01:00
2008-08-13 23:12:51 +04:00
2008-08-13 23:12:51 +04:00
2012-01-16 20:16:35 +01:00
2010-12-19 18:07:28 +01:00
2011-07-02 22:12:12 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-05-03 01:54:47 +03:00
2011-07-02 22:08:51 +02:00
2011-12-15 22:07:58 +01:00
2013-05-03 01:54:47 +03:00
2011-04-25 17:22:25 +02:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2008-11-13 20:19:00 +01:00
2012-02-24 16:07:43 +00:00
2012-09-27 20:09:46 +02:00
2012-02-06 18:42:18 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-03-24 10:52:40 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2011-07-02 22:08:51 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-07-02 22:08:51 +02:00
2010-12-19 18:07:28 +01:00
2014-03-19 11:00:56 +02:00
2014-03-19 11:00:56 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-06-06 17:51:28 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-07-02 22:08:51 +02:00
2013-04-09 23:28:21 +02:00
2013-04-09 23:28:21 +02:00
2010-12-19 18:07:28 +01:00
2013-03-26 10:35:34 +01:00
2009-10-02 16:15:54 +03:00
2011-12-14 15:33:43 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2009-10-20 14:30:15 +08:00
2012-02-28 14:02:27 +05:30
2012-02-06 18:42:18 +01:00
2013-05-03 01:54:47 +03:00
2012-03-01 12:41:49 +01:00
2013-05-03 01:54:47 +03:00
2010-12-19 18:07:28 +01:00
2013-05-03 01:54:47 +03:00
2009-03-18 10:31:17 +00:00
2013-05-03 01:54:47 +03:00
2010-12-19 18:15:12 +01:00
2014-01-14 19:00:38 +01:00
2013-08-13 13:35:36 +02:00
2011-03-16 16:38:30 +00:00
2010-12-19 18:15:12 +01:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2013-05-07 13:05:09 +02:00
2009-11-04 12:28:20 +00:00
2009-11-04 12:28:20 +00:00
2010-12-19 18:15:12 +01:00
2009-10-03 22:21:44 +04:00
2010-12-19 18:15:12 +01:00
2011-12-12 23:58:40 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-08-17 11:14:46 +04:00
2012-09-09 01:22:06 +03:00
2014-02-01 00:54:03 +01:00
2010-12-19 18:15:12 +01:00
2010-01-20 19:08:16 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-07-02 22:12:12 +02:00
2010-12-19 18:15:12 +01:00
2011-07-02 22:08:51 +02:00
2012-02-06 18:42:18 +01:00
2010-06-17 22:51:35 +02:00
2010-12-19 18:15:12 +01:00
2008-09-01 11:00:52 +02:00
2014-02-05 19:01:59 +02:00
2011-10-19 21:45:18 +02:00
2010-12-19 18:07:28 +01:00
2012-02-06 18:42:18 +01:00
2012-09-27 20:09:46 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-03-12 12:28:27 +00:00
2012-03-12 23:26:00 +00:00
2010-12-19 18:07:28 +01:00
2012-01-18 00:16:19 +02:00
2010-12-19 18:15:12 +01:00
2013-06-06 17:51:28 +02:00
2013-08-07 13:18:26 -07:00
2014-01-27 12:10:53 +01:00
2012-02-06 18:42:18 +01:00
2011-10-19 21:45:18 +02:00
2011-10-19 21:45:18 +02:00
2013-05-22 17:36:48 +02:00
2011-10-19 21:45:18 +02:00
2011-10-19 21:45:18 +02:00
2010-12-19 18:15:12 +01:00
2013-12-06 19:02:55 +04:00
2013-07-10 11:49:17 +04:00
2013-11-14 15:08:29 +01:00
2012-02-06 18:42:18 +01:00
2011-10-19 21:45:18 +02:00
2011-10-19 21:45:18 +02:00
2011-07-10 19:47:24 +02:00
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2011-02-20 18:51:43 +02:00
2012-08-09 17:22:00 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-08-17 11:14:46 +04:00
2013-05-03 01:54:47 +03:00
2012-03-02 08:32:16 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-02-23 09:18:48 +01:00
2012-02-06 18:42:18 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2013-04-09 23:28:21 +02:00