690
691
new_name_buff[0]= '\0';
692
if (table_list && table_list->schema_table)
694
* @todo this is a result of retaining the behavior that was here before. This should be removed
695
* and the correct error handling should be done in doDropTable for the I_S engine.
697
plugin::InfoSchemaTable *sch_table= plugin::InfoSchemaTable::getTable(table_list->table_name);
694
700
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", INFORMATION_SCHEMA_NAME.c_str());
968
974
alter_info->build_method= HA_BUILD_OFFLINE;
970
976
snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%"PRIx64, TMP_FILE_PREFIX, (unsigned long) current_pid, session->thread_id);
972
978
/* Safety fix for innodb */
973
979
my_casedn_str(files_charset_info, tmp_name);
1433
/** @TODO This will soon die. */
1434
bool create_like_schema_frm(Session* session,
1435
TableList* schema_table,
1436
message::Table* table_proto)
1438
HA_CREATE_INFO local_create_info;
1439
AlterInfo alter_info;
1440
bool lex_identified_temp_table= (table_proto->type() == drizzled::message::Table::TEMPORARY);
1441
uint32_t keys= schema_table->table->s->keys;
1442
uint32_t db_options= 0;
1444
memset(&local_create_info, 0, sizeof(local_create_info));
1445
local_create_info.db_type= schema_table->table->s->db_type();
1446
local_create_info.row_type= schema_table->table->s->row_type;
1447
local_create_info.default_table_charset=default_charset_info;
1448
alter_info.flags.set(ALTER_CHANGE_COLUMN);
1449
alter_info.flags.set(ALTER_RECREATE);
1450
schema_table->table->use_all_columns();
1451
if (mysql_prepare_alter_table(session, schema_table->table,
1452
&local_create_info, table_proto, &alter_info))
1455
/* I_S tables are created with MAX_ROWS for some efficiency drive.
1456
When CREATE LIKE, we don't want to keep it coming across */
1457
message::Table::TableOptions *table_options;
1458
table_options= table_proto->mutable_options();
1459
table_options->clear_max_rows();
1461
if (mysql_prepare_create_table(session, &local_create_info, table_proto,
1463
lex_identified_temp_table, &db_options,
1464
schema_table->table->cursor,
1465
&schema_table->table->s->key_info, &keys, 0))
1468
table_proto->set_name("system_stupid_i_s_fix_nonsense");
1471
message::Table::StorageEngine *protoengine;
1472
protoengine= table_proto->mutable_engine();
1474
plugin::StorageEngine *engine= local_create_info.db_type;
1476
protoengine->set_name(engine->getName());
1479
if (fill_table_proto(table_proto, "system_stupid_i_s_fix_nonsense",
1480
alter_info.create_list, &local_create_info,
1481
keys, schema_table->table->s->key_info))
1488
1439
static Table *open_alter_table(Session *session, Table *table, char *db, char *table_name)
1490
1441
Table *new_table;