MCPcopy Create free account
hub / github.com/MariaDB/server / make_schema_select

Function make_schema_select

sql/sql_show.cc:9589–9616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9587*/
9588
9589int make_schema_select(THD *thd, SELECT_LEX *sel,
9590 ST_SCHEMA_TABLE *schema_table)
9591{
9592 LEX_CSTRING db, table;
9593 DBUG_ENTER("make_schema_select");
9594 DBUG_PRINT("enter", ("mysql_schema_select: %s", schema_table->table_name.str));
9595 /*
9596 We have to make non const db_name & table_name
9597 because of lower_case_table_names
9598 */
9599 if (!thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str,
9600 INFORMATION_SCHEMA_NAME.length))
9601 DBUG_RETURN(1);
9602
9603 if (!thd->make_lex_string(&table, schema_table->table_name.str,
9604 schema_table->table_name.length))
9605 DBUG_RETURN(1);
9606
9607 if (schema_table->old_format(thd, schema_table))
9608 DBUG_RETURN(1);
9609
9610 if (!sel->add_table_to_list(thd, new Table_ident(thd, &db, &table, 0),
9611 0, 0, TL_READ, MDL_SHARED_READ))
9612 DBUG_RETURN(1);
9613
9614 sel->table_list.first->schema_table_reformed= 1;
9615 DBUG_RETURN(0);
9616}
9617
9618
9619/*

Callers 1

prepare_schema_tableFunction · 0.85

Calls 2

make_lex_stringMethod · 0.80
add_table_to_listMethod · 0.80

Tested by

no test coverage detected