mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge from mysql-next-mr.
This commit is contained in:
161
sql/sql_show.cc
161
sql/sql_show.cc
@ -345,94 +345,6 @@ bool mysqld_show_privileges(THD *thd)
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
List all column types
|
||||
***************************************************************************/
|
||||
|
||||
struct show_column_type_st
|
||||
{
|
||||
const char *type;
|
||||
uint size;
|
||||
const char *min_value;
|
||||
const char *max_value;
|
||||
uint precision;
|
||||
uint scale;
|
||||
const char *nullable;
|
||||
const char *auto_increment;
|
||||
const char *unsigned_attr;
|
||||
const char *zerofill;
|
||||
const char *searchable;
|
||||
const char *case_sensitivity;
|
||||
const char *default_value;
|
||||
const char *comment;
|
||||
};
|
||||
|
||||
/* TODO: Add remaning types */
|
||||
|
||||
static struct show_column_type_st sys_column_types[]=
|
||||
{
|
||||
{"tinyint",
|
||||
1, "-128", "127", 0, 0, "YES", "YES",
|
||||
"NO", "YES", "YES", "NO", "NULL,0",
|
||||
"A very small integer"},
|
||||
{"tinyint unsigned",
|
||||
1, "0" , "255", 0, 0, "YES", "YES",
|
||||
"YES", "YES", "YES", "NO", "NULL,0",
|
||||
"A very small integer"},
|
||||
};
|
||||
|
||||
bool mysqld_show_column_types(THD *thd)
|
||||
{
|
||||
List<Item> field_list;
|
||||
Protocol *protocol= thd->protocol;
|
||||
DBUG_ENTER("mysqld_show_column_types");
|
||||
|
||||
field_list.push_back(new Item_empty_string("Type",30));
|
||||
field_list.push_back(new Item_int("Size",(longlong) 1,
|
||||
MY_INT64_NUM_DECIMAL_DIGITS));
|
||||
field_list.push_back(new Item_empty_string("Min_Value",20));
|
||||
field_list.push_back(new Item_empty_string("Max_Value",20));
|
||||
field_list.push_back(new Item_return_int("Prec", 4, MYSQL_TYPE_SHORT));
|
||||
field_list.push_back(new Item_return_int("Scale", 4, MYSQL_TYPE_SHORT));
|
||||
field_list.push_back(new Item_empty_string("Nullable",4));
|
||||
field_list.push_back(new Item_empty_string("Auto_Increment",4));
|
||||
field_list.push_back(new Item_empty_string("Unsigned",4));
|
||||
field_list.push_back(new Item_empty_string("Zerofill",4));
|
||||
field_list.push_back(new Item_empty_string("Searchable",4));
|
||||
field_list.push_back(new Item_empty_string("Case_Sensitive",4));
|
||||
field_list.push_back(new Item_empty_string("Default",NAME_CHAR_LEN));
|
||||
field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN));
|
||||
|
||||
if (protocol->send_result_set_metadata(&field_list,
|
||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
/* TODO: Change the loop to not use 'i' */
|
||||
for (uint i=0; i < sizeof(sys_column_types)/sizeof(sys_column_types[0]); i++)
|
||||
{
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(sys_column_types[i].type, system_charset_info);
|
||||
protocol->store((ulonglong) sys_column_types[i].size);
|
||||
protocol->store(sys_column_types[i].min_value, system_charset_info);
|
||||
protocol->store(sys_column_types[i].max_value, system_charset_info);
|
||||
protocol->store_short((longlong) sys_column_types[i].precision);
|
||||
protocol->store_short((longlong) sys_column_types[i].scale);
|
||||
protocol->store(sys_column_types[i].nullable, system_charset_info);
|
||||
protocol->store(sys_column_types[i].auto_increment, system_charset_info);
|
||||
protocol->store(sys_column_types[i].unsigned_attr, system_charset_info);
|
||||
protocol->store(sys_column_types[i].zerofill, system_charset_info);
|
||||
protocol->store(sys_column_types[i].searchable, system_charset_info);
|
||||
protocol->store(sys_column_types[i].case_sensitivity, system_charset_info);
|
||||
protocol->store(sys_column_types[i].default_value, system_charset_info);
|
||||
protocol->store(sys_column_types[i].comment, system_charset_info);
|
||||
if (protocol->write())
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
my_eof(thd);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
find_files() - find files in a given directory.
|
||||
|
||||
@ -3428,6 +3340,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
(!lookup_field_vals.table_value.length ||
|
||||
lookup_field_vals.wild_table_value))
|
||||
{
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
|
||||
if (schema_table_store_record(thd, table))
|
||||
goto err; /* Out of space in temporary table */
|
||||
continue;
|
||||
@ -3539,6 +3452,7 @@ bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
|
||||
table->field[1]->store(db_name->str, db_name->length, system_charset_info);
|
||||
table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info);
|
||||
table->field[3]->store(cs->name, strlen(cs->name), system_charset_info);
|
||||
@ -3629,6 +3543,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
|
||||
DBUG_ENTER("get_schema_tables_record");
|
||||
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(table_name->str, table_name->length, cs);
|
||||
if (res)
|
||||
@ -3896,6 +3811,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
|
||||
table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
|
||||
|
||||
#endif
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(table_name->str, table_name->length, cs);
|
||||
table->field[3]->store(field->field_name, strlen(field->field_name),
|
||||
@ -4245,6 +4161,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
|
||||
table->field[3]->store(sp_name.ptr(), sp_name.length(), cs);
|
||||
get_field(thd->mem_root, proc_table->field[3], &tmp_string);
|
||||
table->field[0]->store(tmp_string.ptr(), tmp_string.length(), cs);
|
||||
table->field[1]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[2]->store(sp_db.ptr(), sp_db.length(), cs);
|
||||
get_field(thd->mem_root, proc_table->field[2], &tmp_string);
|
||||
table->field[4]->store(tmp_string.ptr(), tmp_string.length(), cs);
|
||||
@ -4388,6 +4305,7 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
|
||||
for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
|
||||
{
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(table_name->str, table_name->length, cs);
|
||||
table->field[3]->store((longlong) ((key_info->flags &
|
||||
@ -4504,6 +4422,7 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
|
||||
tmp_db_name= db_name;
|
||||
tmp_table_name= table_name;
|
||||
}
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(tmp_db_name->str, tmp_db_name->length, cs);
|
||||
table->field[2]->store(tmp_table_name->str, tmp_table_name->length, cs);
|
||||
if (!only_share)
|
||||
@ -4594,6 +4513,7 @@ bool store_constraints(THD *thd, TABLE *table, LEX_STRING *db_name,
|
||||
{
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(key_name, key_len, cs);
|
||||
table->field[3]->store(db_name->str, db_name->length, cs);
|
||||
@ -4678,10 +4598,12 @@ static bool store_trigger(THD *thd, TABLE *table, LEX_STRING *db_name,
|
||||
LEX_STRING sql_mode_rep;
|
||||
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(trigger_name->str, trigger_name->length, cs);
|
||||
table->field[3]->store(trg_event_type_names[event].str,
|
||||
trg_event_type_names[event].length, cs);
|
||||
table->field[4]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[5]->store(db_name->str, db_name->length, cs);
|
||||
table->field[6]->store(table_name->str, table_name->length, cs);
|
||||
table->field[9]->store(trigger_stmt->str, trigger_stmt->length, cs);
|
||||
@ -4777,8 +4699,10 @@ void store_key_column_usage(TABLE *table, LEX_STRING *db_name,
|
||||
longlong idx)
|
||||
{
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(key_name, key_len, cs);
|
||||
table->field[3]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[4]->store(db_name->str, db_name->length, cs);
|
||||
table->field[5]->store(table_name->str, table_name->length, cs);
|
||||
table->field[6]->store(con_type, con_len, cs);
|
||||
@ -4904,6 +4828,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
|
||||
PARTITION_INFO stat_info;
|
||||
MYSQL_TIME time;
|
||||
file->get_dynamic_partition_info(&stat_info, part_id);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[12]->store((longlong) stat_info.records, TRUE);
|
||||
table->field[13]->store((longlong) stat_info.mean_rec_length, TRUE);
|
||||
table->field[14]->store((longlong) stat_info.data_file_length, TRUE);
|
||||
@ -5006,6 +4931,7 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
|
||||
uint part_pos= 0, part_id= 0;
|
||||
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[2]->store(table_name->str, table_name->length, cs);
|
||||
|
||||
@ -5266,8 +5192,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
|
||||
is_schema_db(et.dbname.str)))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
/* ->field[0] is EVENT_CATALOG and is by default NULL */
|
||||
|
||||
sch_table->field[ISE_EVENT_CATALOG]->store(STRING_WITH_LEN("def"), scs);
|
||||
sch_table->field[ISE_EVENT_SCHEMA]->
|
||||
store(et.dbname.str, et.dbname.length,scs);
|
||||
sch_table->field[ISE_EVENT_NAME]->
|
||||
@ -5548,10 +5473,12 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
|
||||
while ((f_key_info= it++))
|
||||
{
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[1]->store(db_name->str, db_name->length, cs);
|
||||
table->field[9]->store(table_name->str, table_name->length, cs);
|
||||
table->field[2]->store(f_key_info->forein_id->str,
|
||||
f_key_info->forein_id->length, cs);
|
||||
table->field[3]->store(STRING_WITH_LEN("def"), cs);
|
||||
table->field[4]->store(f_key_info->referenced_db->str,
|
||||
f_key_info->referenced_db->length, cs);
|
||||
table->field[10]->store(f_key_info->referenced_table->str,
|
||||
@ -6217,7 +6144,7 @@ int fill_schema_files(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
|
||||
ST_FIELD_INFO schema_fields_info[]=
|
||||
{
|
||||
{"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"SCHEMA_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database",
|
||||
SKIP_OPEN_TABLE},
|
||||
{"DEFAULT_CHARACTER_SET_NAME", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
@ -6231,7 +6158,7 @@ ST_FIELD_INFO schema_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO tables_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
|
||||
SKIP_OPEN_TABLE},
|
||||
@ -6270,7 +6197,7 @@ ST_FIELD_INFO tables_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO columns_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Field",
|
||||
@ -6344,7 +6271,7 @@ ST_FIELD_INFO engines_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO events_fields_info[]=
|
||||
{
|
||||
{"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"EVENT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db",
|
||||
SKIP_OPEN_TABLE},
|
||||
{"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
|
||||
@ -6393,7 +6320,7 @@ ST_FIELD_INFO coll_charset_app_fields_info[]=
|
||||
ST_FIELD_INFO proc_fields_info[]=
|
||||
{
|
||||
{"SPECIFIC_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"ROUTINE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db",
|
||||
SKIP_OPEN_TABLE},
|
||||
{"ROUTINE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
|
||||
@ -6430,7 +6357,7 @@ ST_FIELD_INFO proc_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO stat_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table", OPEN_FRM_ONLY},
|
||||
{"NON_UNIQUE", 1, MYSQL_TYPE_LONGLONG, 0, 0, "Non_unique", OPEN_FRM_ONLY},
|
||||
@ -6454,7 +6381,7 @@ ST_FIELD_INFO stat_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO view_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
@ -6473,7 +6400,7 @@ ST_FIELD_INFO view_fields_info[]=
|
||||
ST_FIELD_INFO user_privileges_fields_info[]=
|
||||
{
|
||||
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
@ -6483,7 +6410,7 @@ ST_FIELD_INFO user_privileges_fields_info[]=
|
||||
ST_FIELD_INFO schema_privileges_fields_info[]=
|
||||
{
|
||||
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
@ -6494,7 +6421,7 @@ ST_FIELD_INFO schema_privileges_fields_info[]=
|
||||
ST_FIELD_INFO table_privileges_fields_info[]=
|
||||
{
|
||||
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
@ -6506,7 +6433,7 @@ ST_FIELD_INFO table_privileges_fields_info[]=
|
||||
ST_FIELD_INFO column_privileges_fields_info[]=
|
||||
{
|
||||
{"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
@ -6518,7 +6445,7 @@ ST_FIELD_INFO column_privileges_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO table_constraints_fields_info[]=
|
||||
{
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
@ -6533,12 +6460,12 @@ ST_FIELD_INFO table_constraints_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO key_column_usage_fields_info[]=
|
||||
{
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
@ -6557,7 +6484,7 @@ ST_FIELD_INFO key_column_usage_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO table_names_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Tables_in_",
|
||||
SKIP_OPEN_TABLE},
|
||||
@ -6580,12 +6507,12 @@ ST_FIELD_INFO open_tables_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO triggers_fields_info[]=
|
||||
{
|
||||
{"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TRIGGER_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TRIGGER_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger",
|
||||
OPEN_FULL_TABLE},
|
||||
{"EVENT_MANIPULATION", 6, MYSQL_TYPE_STRING, 0, 0, "Event", OPEN_FULL_TABLE},
|
||||
{"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0,
|
||||
{"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"EVENT_OBJECT_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
@ -6618,7 +6545,7 @@ ST_FIELD_INFO triggers_fields_info[]=
|
||||
|
||||
ST_FIELD_INFO partitions_fields_info[]=
|
||||
{
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"PARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
@ -6708,7 +6635,7 @@ ST_FIELD_INFO files_fields_info[]=
|
||||
{"FILE_TYPE", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
|
||||
SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
|
||||
{"LOGFILE_GROUP_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
|
||||
@ -6769,12 +6696,12 @@ void init_fill_schema_files_row(TABLE* table)
|
||||
|
||||
ST_FIELD_INFO referential_constraints_fields_info[]=
|
||||
{
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0,
|
||||
{"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
@ -6827,11 +6754,12 @@ ST_SCHEMA_TABLE schema_tables[]=
|
||||
fill_variables, make_old_format, 0, 0, -1, 0, 0},
|
||||
{"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
|
||||
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0,
|
||||
OPEN_TABLE_ONLY},
|
||||
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
|
||||
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
|
||||
fill_open_tables, make_old_format, 0, -1, -1, 1, 0},
|
||||
{"PARTITIONS", partitions_fields_info, create_schema_table,
|
||||
get_all_tables, 0, get_schema_partitions_record, 1, 2, 0, OPEN_TABLE_ONLY},
|
||||
get_all_tables, 0, get_schema_partitions_record, 1, 2, 0,
|
||||
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
|
||||
{"PLUGINS", plugin_fields_info, create_schema_table,
|
||||
fill_plugins, make_old_format, 0, -1, -1, 0, 0},
|
||||
{"PROCESSLIST", processlist_fields_info, create_schema_table,
|
||||
@ -6841,7 +6769,7 @@ ST_SCHEMA_TABLE schema_tables[]=
|
||||
NULL, -1, -1, false, 0},
|
||||
{"REFERENTIAL_CONSTRAINTS", referential_constraints_fields_info,
|
||||
create_schema_table, get_all_tables, 0, get_referential_constraints_record,
|
||||
1, 9, 0, OPEN_TABLE_ONLY},
|
||||
1, 9, 0, OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
|
||||
{"ROUTINES", proc_fields_info, create_schema_table,
|
||||
fill_schema_proc, make_proc_old_format, 0, -1, -1, 0, 0},
|
||||
{"SCHEMATA", schema_fields_info, create_schema_table,
|
||||
@ -6861,14 +6789,15 @@ ST_SCHEMA_TABLE schema_tables[]=
|
||||
get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0,
|
||||
OPTIMIZE_I_S_TABLE},
|
||||
{"TABLE_CONSTRAINTS", table_constraints_fields_info, create_schema_table,
|
||||
get_all_tables, 0, get_schema_constraints_record, 3, 4, 0, OPEN_TABLE_ONLY},
|
||||
get_all_tables, 0, get_schema_constraints_record, 3, 4, 0,
|
||||
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
|
||||
{"TABLE_NAMES", table_names_fields_info, create_schema_table,
|
||||
get_all_tables, make_table_names_old_format, 0, 1, 2, 1, 0},
|
||||
{"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
|
||||
fill_schema_table_privileges, 0, 0, -1, -1, 0, 0},
|
||||
{"TRIGGERS", triggers_fields_info, create_schema_table,
|
||||
get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0,
|
||||
OPEN_TABLE_ONLY},
|
||||
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
|
||||
{"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
|
||||
fill_schema_user_privileges, 0, 0, -1, -1, 0, 0},
|
||||
{"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
|
||||
|
Reference in New Issue
Block a user