Commit 3604aa00 authored by unknown's avatar unknown

Added --compatible mode to mysqldump.


client/mysqldump.c:
  Added --compatible mode to mysqldump. This mode can take the following
  values: mysql323,mysql40,postgresql,oracle,mssql,db2,sapdb,no_key_options,
  no_table_options,no_field_options.
  
  The table definition (SHOW CREATE TABLE name) will be compatible with
  the given mode.
mysql-test/r/sql_mode.result:
  Fixed a bug in sql_show.cc, which affected the result.
sql/sql_show.cc:
  Fixed a bug.
parent d08e02eb
......@@ -38,4 +38,5 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH,
OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE,
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM };
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE };
This diff is collapsed.
......@@ -70,7 +70,7 @@ t1 CREATE TABLE `t1` (
`email` varchar(60) NOT NULL default '',
PRIMARY KEY (`a`),
UNIQUE KEY `email` (`email`)
) TYPE=HEAP CHARSET=latin1 ROW_FORMAT=DYNAMIC
) TYPE=HEAP ROW_FORMAT=DYNAMIC
set @@sql_mode="postgresql,oracle,mssql,db2,sapdb";
show variables like 'sql_mode';
Variable_name Value
......
......@@ -1198,7 +1198,9 @@ store_create_info(THD *thd, TABLE *table, String *packet)
char buff[128];
char* p;
if (table->table_charset)
if (table->table_charset &&
!(thd->variables.sql_mode & MODE_MYSQL323) &&
!(thd->variables.sql_mode & MODE_MYSQL40))
{
packet->append(" CHARSET=");
packet->append(table->table_charset->csname);
......
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