diff options
author | monty@mashka.mysql.fi <> | 2003-10-15 21:41:13 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-10-15 21:41:13 +0300 |
commit | 84d9d9807841cbbcb756c24ef56f0d0fe5ec3e2f (patch) | |
tree | 1cffa0627ab98f85815d577bb2824198ce5de99b /mysys | |
parent | 4897c6649d927419d95ad9a315dc6316110be2d4 (diff) | |
download | mariadb-git-84d9d9807841cbbcb756c24ef56f0d0fe5ec3e2f.tar.gz |
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)
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_chsize.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c index 8e46b0808c0..653ea569172 100644 --- a/mysys/my_chsize.c +++ b/mysys/my_chsize.c @@ -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) |