Commit a6f96946 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-29736 mysqldump sets system_versioning_insert_history=1 twice and doesn't...

MDEV-29736 mysqldump sets system_versioning_insert_history=1 twice and doesn't restore previous value
parent 73b2a326
...@@ -4329,7 +4329,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, ...@@ -4329,7 +4329,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
if (versioned && !opt_xml && opt_dump_history) if (versioned && !opt_xml && opt_dump_history)
{ {
fprintf(md_result_file,"/*!101100 SET system_versioning_insert_history=1 */;\n"); fprintf(md_result_file,"/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;\n");
check_io(md_result_file); check_io(md_result_file);
} }
if (opt_lock) if (opt_lock)
...@@ -4631,7 +4631,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, ...@@ -4631,7 +4631,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
} }
if (versioned && !opt_xml && opt_dump_history) if (versioned && !opt_xml && opt_dump_history)
{ {
fprintf(md_result_file,"/*!101100 SET system_versioning_insert_history=1 */;\n"); fprintf(md_result_file,"/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;\n");
check_io(md_result_file); check_io(md_result_file);
} }
mysql_free_result(res); mysql_free_result(res);
......
...@@ -93,10 +93,10 @@ CREATE TABLE `t1` ( ...@@ -93,10 +93,10 @@ CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL `x` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET system_versioning_insert_history=1 */; /*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `t1` (`x`, row_start, row_end) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'), INSERT INTO `t1` (`x`, row_start, row_end) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'),
(2,'2010-10-10 10:10:10.101010','2038-01-19 03:14:07.999999'); (2,'2010-10-10 10:10:10.101010','2038-01-19 03:14:07.999999');
/*!101100 SET system_versioning_insert_history=1 */; /*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
...@@ -106,10 +106,10 @@ CREATE TABLE `t2` ( ...@@ -106,10 +106,10 @@ CREATE TABLE `t2` (
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET system_versioning_insert_history=1 */; /*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `t2` (`x`, `row_start`, `row_end`) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'), INSERT INTO `t2` (`x`, `row_start`, `row_end`) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'),
(2,'2010-10-10 10:10:10.101010','2038-01-19 03:14:07.999999'); (2,'2010-10-10 10:10:10.101010','2038-01-19 03:14:07.999999');
/*!101100 SET system_versioning_insert_history=1 */; /*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
mysqldump: --dump-history can't be used with --as-of. mysqldump: --dump-history can't be used with --as-of.
mysqldump: --dump-history can't be used with --replace. mysqldump: --dump-history can't be used with --replace.
mysqldump: --xml can't be used with --dump-history. mysqldump: --xml can't be used with --dump-history.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment