summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorgluh@eagle.intranet.mysql.r18.ru <>2005-09-29 16:17:45 +0500
committergluh@eagle.intranet.mysql.r18.ru <>2005-09-29 16:17:45 +0500
commitf9762c47d084037e99cd631e66b7473dfd7b0669 (patch)
tree60f22f93150c2c37bee8209cb44f0f5f1b0d8e33 /sql/sql_show.cc
parent68bc5a31e404a4650d598db1e144c57071abf33a (diff)
downloadmariadb-git-f9762c47d084037e99cd631e66b7473dfd7b0669.tar.gz
Fix for bug #7977 in sql_mode=ANSI, show create table ignores auto_increment
"CHARACTER SET", "COLLATE", and "DEFAULT" are always printed(excepting MODE_MYSQL323 and MODE_MYSQL40) "AUTO_INCREMENT", "ON UPDATE CURRENT_TIMESTAMP" are printed only if NO_FIELD_OPTIONS is not set.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index c3c28535954..e619b148f3a 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1299,7 +1299,8 @@ store_create_info(THD *thd, TABLE *table, String *packet)
field->sql_type(type);
packet->append(type.ptr(), type.length(), system_charset_info);
- if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode)
+ if (field->has_charset() &&
+ !(thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)))
{
if (field->charset() != table->table_charset)
{
@@ -1337,7 +1338,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
has_default= (field->type() != FIELD_TYPE_BLOB &&
field->unireg_check != Field::NEXT_NUMBER &&
- !((foreign_db_mode || limited_mysql_mode) &&
+ !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) &&
has_now_default));
if (has_default)
@@ -1367,12 +1368,13 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(tmp);
}
- if (!foreign_db_mode && !limited_mysql_mode &&
+ if (!(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS) &&
table->timestamp_field == field &&
field->unireg_check != Field::TIMESTAMP_DN_FIELD)
packet->append(" on update CURRENT_TIMESTAMP",28);
- if (field->unireg_check == Field::NEXT_NUMBER && !foreign_db_mode)
+ if (field->unireg_check == Field::NEXT_NUMBER &&
+ !(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS))
packet->append(" auto_increment", 15 );
if (field->comment.length)