diff options
-rw-r--r-- | mysql-test/r/ps_6bdb.result | 6 | ||||
-rw-r--r-- | mysql-test/r/ps_7ndb.result | 6 | ||||
-rw-r--r-- | sql/sql_show.cc | 37 |
3 files changed, 26 insertions, 23 deletions
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index acd7f45de95..ef74e13a41d 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1153,12 +1153,12 @@ def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 -def possible_keys 253 4096 0 Y 0 31 8 +def possible_keys 252 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32928 0 63 -def ref 253 1024 0 Y 0 31 8 +def ref 252 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 252 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 test_sequence diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 27a1ea0925d..e7ffbb7c6ef 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1153,12 +1153,12 @@ def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 -def possible_keys 253 4096 0 Y 0 31 8 +def possible_keys 252 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32928 0 63 -def ref 253 1024 0 Y 0 31 8 +def ref 252 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 252 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b33f78cc84a..647dfe2ac4d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -639,30 +639,33 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) } /* -returns the length of the longest type on the given table. -This is used so that show fields will return the data using the proper -lengths instead of forcing columns such as type to always return with a -given length. + returns the length of the longest type on the given table. + + This is used so that show fields will return the data using the proper + lengths instead of forcing columns such as type to always return with a + given length. */ + uint get_longest_type_in_table(TABLE *table, const char *wild) { - Field **ptr,*field; - char tmp[MAX_FIELD_WIDTH]; - uint max_len = 0; - - for (ptr=table->field; (field= *ptr); ptr++) - { - if (!wild || !wild[0] || - !wild_case_compare(system_charset_info, field->field_name,wild)) + Field **ptr,*field; + char tmp[MAX_FIELD_WIDTH]; + uint max_len= 0; + + for (ptr=table->field; (field= *ptr); ptr++) + { + if (!wild || !wild[0] || + !wild_case_compare(system_charset_info, field->field_name,wild)) { - String type(tmp,sizeof(tmp), system_charset_info); - field->sql_type(type); - max_len = max(max_len, type.length()); - } - } + String type(tmp,sizeof(tmp), system_charset_info); + field->sql_type(type); + max_len= max(max_len, type.length()); + } + } return max_len; } + /*************************************************************************** ** List all columns in a table_list->real_name ***************************************************************************/ |