diff options
author | unknown <kroki@mysql.com> | 2006-05-04 18:36:00 +0400 |
---|---|---|
committer | unknown <kroki@mysql.com> | 2006-05-04 18:36:00 +0400 |
commit | 144d2ec9ee30ef949d79c33b8b5ebb0955b55b5f (patch) | |
tree | 83afe71ff915b30c5030737b15796e3547e5342e /sql | |
parent | a5a4f767b57e38137cd78f9e6bd6f3d4ec8d23d1 (diff) | |
parent | ac94170069e4de0447fa5b76a1e38a437a66a197 (diff) | |
download | mariadb-git-144d2ec9ee30ef949d79c33b8b5ebb0955b55b5f.tar.gz |
Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
Diffstat (limited to 'sql')
-rw-r--r-- | sql/set_var.cc | 4 | ||||
-rw-r--r-- | sql/sql_show.cc | 25 |
2 files changed, 21 insertions, 8 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index f845cdd0c5d..bf68a102537 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3207,10 +3207,6 @@ ulong fix_sql_mode(ulong sql_mode) MODE_IGNORE_SPACE | MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS); - if (sql_mode & MODE_MYSQL40) - sql_mode|= MODE_NO_FIELD_OPTIONS; - if (sql_mode & MODE_MYSQL323) - sql_mode|= MODE_NO_FIELD_OPTIONS; return sql_mode; } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 268292022e4..41e145790e9 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1344,8 +1344,8 @@ store_create_info(THD *thd, TABLE *table, String *packet) has_default= (field->type() != FIELD_TYPE_BLOB && field->unireg_check != Field::NEXT_NUMBER && - !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) && - has_now_default)); + !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) + && has_now_default)); if (has_default) { @@ -1374,8 +1374,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(tmp); } - if (!(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS) && - table->timestamp_field == field && + if (!limited_mysql_mode && table->timestamp_field == field && field->unireg_check != Field::TIMESTAMP_DN_FIELD) packet->append(" on update CURRENT_TIMESTAMP",28); @@ -1480,6 +1479,24 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(" ENGINE=", 8); packet->append(file->table_type()); + /* + Add AUTO_INCREMENT=... if there is an AUTO_INCREMENT column, + and NEXT_ID > 1 (the default). We must not print the clause + for engines that do not support this as it would break the + import of dumps, but as of this writing, the test for whether + AUTO_INCREMENT columns are allowed and wether AUTO_INCREMENT=... + is supported is identical, !(file->table_flags() & HA_NO_AUTO_INCREMENT)) + Because of that, we do not explicitly test for the feature, + but may extrapolate its existence from that of an AUTO_INCREMENT column. + */ + + if(create_info.auto_increment_value > 1) + { + packet->append(" AUTO_INCREMENT=", 16); + end= longlong10_to_str(create_info.auto_increment_value, buff,10); + packet->append(buff, (uint) (end - buff)); + } + if (table->table_charset && !(thd->variables.sql_mode & MODE_MYSQL323) && !(thd->variables.sql_mode & MODE_MYSQL40)) |