1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-13132 Information Schema does not show whether column default is expression or literal

Fix INFORMATION_SCHEMA.COLUMNS.COLUMN_DEFAULT to be standard-compliant,
but keep SHOW COLUMNS backward-compatibly unchanged.
This commit is contained in:
Sergei Golubchik
2017-06-29 00:57:20 +02:00
parent 0559f12972
commit 291411c96c
18 changed files with 872 additions and 871 deletions

View File

@ -5447,6 +5447,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
TABLE *show_table;
Field **ptr, *field;
int count;
bool quoted_defaults= lex->sql_command != SQLCOM_SHOW_FIELDS;
DBUG_ENTER("get_schema_column_record");
if (res)
@ -5516,7 +5517,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
cs);
table->field[4]->store((longlong) count, TRUE);
if (get_field_default_value(thd, field, &type, 0))
if (get_field_default_value(thd, field, &type, quoted_defaults))
{
table->field[5]->store(type.ptr(), type.length(), cs);
table->field[5]->set_notnull();