MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / make_schemata_old_format

Function make_schemata_old_format

sql/sql_show.cc:778–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776
777
778int make_schemata_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
779{
780 char tmp[128];
781 LEX *lex= thd->lex;
782 SELECT_LEX *sel= lex->current_select;
783 Name_resolution_context *context= &sel->context;
784
785 if (!sel->item_list.elements)
786 {
787 ST_FIELD_INFO *field_info= &schema_table->fields_info[1];
788 String buffer(tmp,sizeof(tmp), system_charset_info);
789 Item_field *field= new Item_field(context,
790 NullS, NullS, field_info->field_name);
791 if (!field || add_item_to_list(thd, field))
792 return 1;
793 buffer.length(0);
794 buffer.append(field_info->old_name);
795 if (lex->wild && lex->wild->ptr())
796 {
797 buffer.append(STRING_WITH_LEN(" ("));
798 buffer.append(lex->wild->ptr());
799 buffer.append(')');
800 }
801 field->item_name.copy(buffer.ptr(), buffer.length(), system_charset_info);
802 }
803 return 0;
804}
805
806
807int make_table_names_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)

Callers

nothing calls this directly

Calls 5

add_item_to_listFunction · 0.85
lengthMethod · 0.45
appendMethod · 0.45
ptrMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected