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

Function mysql_derived_create

sql/sql_derived.cc:1131–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1129*/
1130
1131static
1132bool mysql_derived_create(THD *thd, LEX *lex, TABLE_LIST *derived)
1133{
1134 DBUG_ENTER("mysql_derived_create");
1135 DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
1136 (derived->alias.str ? derived->alias.str : "<NULL>"),
1137 derived->get_unit()));
1138 TABLE *table= derived->table;
1139 SELECT_LEX_UNIT *unit= derived->get_unit();
1140
1141 if (table->is_created())
1142 DBUG_RETURN(FALSE);
1143 select_unit *result= derived->derived_result;
1144 if (table->s->db_type() == TMP_ENGINE_HTON)
1145 {
1146 result->tmp_table_param.keyinfo= table->s->key_info;
1147 if (create_internal_tmp_table(table, result->tmp_table_param.keyinfo,
1148 result->tmp_table_param.start_recinfo,
1149 &result->tmp_table_param.recinfo,
1150 (unit->first_select()->options |
1151 thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS)))
1152 DBUG_RETURN(TRUE);
1153 }
1154 if (open_tmp_table(table))
1155 DBUG_RETURN(TRUE);
1156 table->file->extra(HA_EXTRA_WRITE_CACHE);
1157 table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
1158 DBUG_RETURN(FALSE);
1159}
1160
1161
1162void TABLE_LIST::register_as_derived_with_rec_ref(With_element *rec_elem)

Callers 2

mysql_derived_mergeFunction · 0.85
mysql_derived_optimizeFunction · 0.85

Calls 7

open_tmp_tableFunction · 0.85
get_unitMethod · 0.80
db_typeMethod · 0.80
first_selectMethod · 0.80
is_createdMethod · 0.45
extraMethod · 0.45

Tested by

no test coverage detected