Commit 30a37ca9 authored by Nisha Gopalakrishnan's avatar Nisha Gopalakrishnan

BUG#15844882: MYSQLDUMP FROM 5.5 FAILS WITH AN ERROR WHEN TRYING

              TO DUMP DATA FROM MYSQL-5.6

Analysis
--------
Dumping mysql-5.6 data using mysql-5.1/mysql-5.5 'myqldump'
utility fails with a syntax error.

Server system variable 'sql_quote_show_create' which quotes the
identifiers is set in the mysqldump utility. The mysldump utility
of mysql-5.1/mysql-5.5 uses deprecated syntax 'SET OPTION' to set
the 'sql_quote_show_create' option. The support for the syntax is
removed in mysql-5.6. Hence syntax error is reported while taking
the dump.

Fix:
---
Changed the 'mysqldump' code to use the syntax
'SET SQL_QUOTE_SHOW_CREATE' to set the 'sql_quote_show_create'
option. That syntax is supported on mysql-5.1, mysql-5.5 and
mysql-5.6.

NOTE: I have not added an mtr test case since it is difficult
to simulate the condition. Also the syntax may not be further
simplified in the future.
parent c088c9c4
...@@ -2502,7 +2502,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, ...@@ -2502,7 +2502,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg("-- Retrieving table structure for table %s...\n", table); verbose_msg("-- Retrieving table structure for table %s...\n", table);
len= my_snprintf(query_buff, sizeof(query_buff), len= my_snprintf(query_buff, sizeof(query_buff),
"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", "SET SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords)); (opt_quoted || opt_keywords));
if (!create_options) if (!create_options)
strmov(query_buff+len, strmov(query_buff+len,
...@@ -5063,7 +5063,7 @@ static my_bool get_view_structure(char *table, char* db) ...@@ -5063,7 +5063,7 @@ static my_bool get_view_structure(char *table, char* db)
verbose_msg("-- Retrieving view structure for table %s...\n", table); verbose_msg("-- Retrieving view structure for table %s...\n", table);
#ifdef NOT_REALLY_USED_YET #ifdef NOT_REALLY_USED_YET
sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", sprintf(insert_pat, "SET SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords)); (opt_quoted || opt_keywords));
#endif #endif
......
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