summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index eb0c014f060..6d5c4adc521 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2698,7 +2698,7 @@ public:
{ return alloc_root(mem_root, size); }
static void operator delete(void *ptr __attribute__((unused)),
size_t size __attribute__((unused)))
- { TRASH(ptr, size); }
+ { TRASH_FREE(ptr, size); }
static void operator delete(void *, MEM_ROOT *){}
my_thread_id thread_id;
@@ -5434,7 +5434,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
table->field[3]->store(STRING_WITH_LEN("BASE TABLE"), cs);
}
- for (int i= 4; i < 20; i++)
+ for (uint i= 4; i < table->s->fields; i++)
{
if (i == 7 || (i > 12 && i < 17) || i == 18)
continue;
@@ -5612,8 +5612,15 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
{
table->field[10]->store((longlong) file->stats.max_data_file_length,
TRUE);
+ table->field[10]->set_notnull();
}
table->field[11]->store((longlong) file->stats.index_file_length, TRUE);
+ if (file->stats.max_index_file_length)
+ {
+ table->field[21]->store((longlong) file->stats.max_index_file_length,
+ TRUE);
+ table->field[21]->set_notnull();
+ }
table->field[12]->store((longlong) file->stats.delete_length, TRUE);
if (show_table->found_next_number_field)
{
@@ -5648,6 +5655,11 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
table->field[18]->set_notnull();
}
}
+ /* If table is a temporary table */
+ LEX_CSTRING tmp= { STRING_WITH_LEN("N") };
+ if (show_table->s->tmp_table != NO_TMP_TABLE)
+ tmp.str= "Y";
+ table->field[22]->store(tmp.str, tmp.length, cs);
}
err:
@@ -8855,6 +8867,9 @@ ST_FIELD_INFO tables_fields_info[]=
OPEN_FULL_TABLE},
{"TABLE_COMMENT", TABLE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
"Comment", OPEN_FRM_ONLY},
+ {"MAX_INDEX_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Max_index_length", OPEN_FULL_TABLE},
+ {"TEMPORARY", 1, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, "Temporary", OPEN_FRM_ONLY},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};