diff options
author | monty@donna.mysql.com <> | 2000-10-24 02:39:54 +0300 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-10-24 02:39:54 +0300 |
commit | a67ff1bf0800746d474f44b5886461fbf8fa4781 (patch) | |
tree | 73129936be11d0b1bee843a961a70f81aeae1a6b /sql/sql_show.cc | |
parent | 634b93850edbc1273fbb7312130636532b99dcd1 (diff) | |
download | mariadb-git-a67ff1bf0800746d474f44b5886461fbf8fa4781.tar.gz |
Update of interface for BDB tables.
Fixed bug in SHOW CREATE TABLE
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8c3c5dc6bf5..eb7e1455297 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -718,17 +718,16 @@ store_create_info(THD *thd, TABLE *table, String *packet) field->sql_type(type); packet->append(type.ptr(),type.length()); - bool null_default_value = (field->type() == FIELD_TYPE_TIMESTAMP || - field->unireg_check == Field::NEXT_NUMBER); - bool has_default = (field->type() != FIELD_TYPE_BLOB); + bool has_default = (field->type() != FIELD_TYPE_BLOB && + field->type() != FIELD_TYPE_TIMESTAMP && + field->unireg_check != Field::NEXT_NUMBER); + if (flags & NOT_NULL_FLAG) + packet->append(" NOT NULL", 9); - if((flags & NOT_NULL_FLAG) && !null_default_value) - packet->append(" NOT NULL", 9); - - if(has_default) + if (has_default) { packet->append(" default ", 9); - if (!null_default_value && !field->is_null()) + if (!field->is_null()) { // Not null by default type.set(tmp,sizeof(tmp)); field->val_str(&type,&type); @@ -736,7 +735,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(type.ptr(),type.length()); packet->append('\''); } - else if (field->maybe_null() || null_default_value) + else if (field->maybe_null()) packet->append("NULL", 4); // Null as default else packet->append(tmp,0); |