diff options
author | Chad MILLER <chad@mysql.com> | 2009-01-21 13:45:23 -0500 |
---|---|---|
committer | Chad MILLER <chad@mysql.com> | 2009-01-21 13:45:23 -0500 |
commit | d3629d7489b759bcf3774d5ae958c8436161aa43 (patch) | |
tree | f3c1ce77afa4c0b708ac702616710c680ec86ec2 /sql/sql_show.cc | |
parent | c5738c0051cfd903804afd06353f3dc431ec2726 (diff) | |
parent | 374f49b2629114a9473268da4321af405a9d2394 (diff) | |
download | mariadb-git-d3629d7489b759bcf3774d5ae958c8436161aa43.tar.gz |
Merge from Tim's 5.0.76-release tree to make 5.0.77 .
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index fb53a6bf2d8..778f10f2b36 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -798,7 +798,7 @@ static bool get_field_default_value(THD *thd, TABLE *table, { bool has_default; bool has_now_default; - + enum enum_field_types field_type= field->type(); /* We are using CURRENT_TIMESTAMP instead of NOW because it is more standard @@ -806,7 +806,7 @@ static bool get_field_default_value(THD *thd, TABLE *table, has_now_default= table->timestamp_field == field && field->unireg_check != Field::TIMESTAMP_UN_FIELD; - has_default= (field->type() != FIELD_TYPE_BLOB && + has_default= (field_type != FIELD_TYPE_BLOB && !(field->flags & NO_DEFAULT_VALUE_FLAG) && field->unireg_check != Field::NEXT_NUMBER && !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) @@ -821,7 +821,19 @@ static bool get_field_default_value(THD *thd, TABLE *table, { // Not null by default char tmp[MAX_FIELD_WIDTH]; String type(tmp, sizeof(tmp), field->charset()); - field->val_str(&type); + if (field_type == MYSQL_TYPE_BIT) + { + longlong dec= field->val_int(); + char *ptr= longlong2str(dec, tmp + 2, 2); + uint32 length= (uint32) (ptr - tmp); + tmp[0]= 'b'; + tmp[1]= '\''; + tmp[length]= '\''; + type.length(length + 1); + quoted= 0; + } + else + field->val_str(&type); if (type.length()) { String def_val; @@ -1525,6 +1537,8 @@ static bool show_status_array(THD *thd, const char *wild, case SHOW_FLUSHTIME: nr= (long) (thd->query_start() - flush_status_time); end= int10_to_str(nr, buff, 10); + case SHOW_QUERIES: + end= int10_to_str((long) thd->query_id, buff, 10); break; #ifdef HAVE_REPLICATION case SHOW_RPL_STATUS: |