1615
1614
pthread_mutex_lock(&LOCK_open); /* CREATE TABLE (some confussion on naming, double check) */
1616
if (!internal_tmp_table && ! lex_identified_temp_table)
1615
if (not internal_tmp_table && not lex_identified_temp_table)
1618
if (plugin::StorageEngine::getTableDefinition(*session,
1619
identifier)==EEXIST)
1617
if (plugin::StorageEngine::doesTableExist(*session,
1618
identifier, false)==EEXIST)
1621
1620
if (is_if_not_exists)
1655
1656
one else is attempting to discover the table. Since
1656
1657
it's not on disk as a frm cursor, no one could be using it!
1658
if (! lex_identified_temp_table)
1659
if (not lex_identified_temp_table)
1660
int retcode= plugin::StorageEngine::getTableDefinition(*session, identifier);
1661
bool exists= plugin::StorageEngine::doesTableExist(*session, identifier, false);
1665
/* Normal case, no table exists. we can go and create it */
1668
if (is_if_not_exists)
1671
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1672
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
1673
identifier.getTableName());
1674
create_info->table_existed= 1; // Mark that table existed
1675
goto unlock_and_end;
1677
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), identifier.getTableName());
1678
goto unlock_and_end;
1680
my_error(retcode, MYF(0), identifier.getTableName());
1681
goto unlock_and_end;
1665
if (is_if_not_exists)
1668
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1669
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
1670
identifier.getTableName());
1671
create_info->table_existed= 1; // Mark that table existed
1672
goto unlock_and_end;
1675
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), identifier.getTableName());
1676
goto unlock_and_end;
1692
1687
create_info, alter_info->create_list,
1693
1688
key_count, key_info_buffer))
1694
1690
goto unlock_and_end;
1696
1693
if (lex_identified_temp_table)
1698
1695
/* Open table and put in temporary table list */
1699
if (!(session->open_temporary_table(identifier)))
1696
if (not (session->open_temporary_table(identifier)))
1701
1698
(void) session->rm_temporary_table(create_info->db_type, identifier);
1702
1699
goto unlock_and_end;
1710
1707
- The binary log is not open.
1711
1708
Otherwise, the statement shall be binlogged.
1713
if (!internal_tmp_table && ! lex_identified_temp_table)
1710
if (not internal_tmp_table && not lex_identified_temp_table)
1714
1711
write_bin_log(session, session->query.c_str());
1716
1713
unlock_and_end: