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:
unknown 2003-10-15 21:41:13 +03:00
commit b06eb4d81a
10 changed files with 86 additions and 33 deletions

View file

@ -51,16 +51,17 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
#if defined(HAVE_SETFILEPOINTER)
/* This is for the moment only true on windows */
{
long is_success;
HANDLE win_file= (HANDLE) _get_osfhandle(fd);
long length_low, length_high;
length_low= (long) (ulong) newlength;
length_high= (long) ((ulonglong) newlength >> 32);
if (SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN))
{
if (SetEndOfFile(win_file))
DBUG_RETURN(0);
}
my_errno= errno;
is_success= SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN);
if (is_success == -1 && (my_errno= GetLastError()) != NO_ERROR)
goto err;
if (SetEndOfFile(win_file))
DBUG_RETURN(0);
my_errno= GetLastError();
goto err;
}
#elif defined(HAVE_FTRUNCATE)