| 1129 | */ |
| 1130 | |
| 1131 | static |
| 1132 | bool 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 | |
| 1162 | void TABLE_LIST::register_as_derived_with_rec_ref(With_element *rec_elem) |
no test coverage detected