mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
Fixed chsize() problem on windows Extend default timeout on windows clients to 1 year (to avoid timeout problems) include/mysql.h: Added client timeouts (for TCP/IP) libmysql/libmysql.c: Added client timeouts (for TCP/IP) mysql-test/r/create.result: More tests for CREATE TABLE IF NOT EXISTS ... SELECT mysql-test/t/create.test: More tests for CREATE TABLE IF NOT EXISTS ... SELECT mysys/my_chsize.c: Fix for windows sql/handler.h: Remove not used field 'if_not_exists' Ordered fields to be more optimized for new CPU's Added field 'table_existed' sql/slave.cc: Cleanup temporary tables when slave ends sql/sql_class.h: Remove not used 'do_not_drop' field sql/sql_insert.cc: Better fix for CREATE TABLE IF NOT EXISTS ... SELECT sql/sql_table.cc: Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
This commit is contained in:
@@ -728,7 +728,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
&& find_temporary_table(thd,db,table_name))
|
||||
{
|
||||
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||
{
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
@@ -739,13 +742,17 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
{
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||
{
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
|
||||
thd->proc_info="creating table";
|
||||
create_info->table_existed= 0; // Mark that table is created
|
||||
|
||||
if (thd->sql_mode & MODE_NO_DIR_IN_CREATE)
|
||||
create_info->data_file_name= create_info->index_file_name= 0;
|
||||
|
||||
Reference in New Issue
Block a user