diff options
author | Monty <monty@mariadb.org> | 2018-02-10 14:42:59 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-02-10 14:42:59 +0200 |
commit | a610badb5daf33cffd7a85822d2712eb0beee7b6 (patch) | |
tree | 1cd5819fd1eaf69adcd2ee9669ce304214b945cb /sql/sql_show.cc | |
parent | a801ba5ce6bda1c2dee41724307bf59f244dda14 (diff) | |
download | mariadb-git-bb-10.2-ext2.tar.gz |
Added Max_index_length and Temporary to SHOW TABLE STATUSbb-10.2-ext2
- Max_index_length is supported by MyISAM and Aria tables.
- Temporary is a placeholder to signal that a table is a
temporary table. For the moment this is always "N", except
"Y" for generated information_schema tables and NULL for
views. Full temporary table support will be done in another task.
(No reason to have to update a lot of result files twice in a row)
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 604b228b263..fb0d871e7b8 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5288,7 +5288,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; @@ -5466,8 +5466,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) { @@ -5502,6 +5509,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: @@ -8685,6 +8697,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} }; |