From: Date: December 21 2004 5:21pm Subject: bk commit into 4.0 tree (heikki:1.2021) List-Archive: http://lists.mysql.com/internals/19917 Message-Id: <200412211621.iBLGLK9G022899@hundin.mysql.fi> Below is the list of changes that have just been committed into a local 4.0 repository of heikki. When heikki does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://www.mysql.com/doc/I/n/Installing_source_tree.html ChangeSet 1.2021 04/12/21 18:21:17 heikki@stripped +1 -0 os0file.c: Fix InnoDB bug: on HP-UX, with a 32-bit binary, InnoDB was only able to read or write <= 2 GB files; the reason was that InnoDB treated the return value of lseek() as a 32-bit integer; lseek was used on HP-UX-11 as a replacement for pread() and pwrite() because HAVE_BROKEN_PREAD was defined on that platform innobase/os/os0file.c 1.79 04/12/21 18:21:09 heikki@stripped +10 -8 Fix InnoDB bug: on HP-UX, with a 32-bit binary, InnoDB was only able to read or write <= 2 GB files; the reason was that InnoDB treated the return value of lseek() as a 32-bit integer; lseek was used on HP-UX-11 as a replacement for pread() and pwrite() because HAVE_BROKEN_PREAD was defined on that platform # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: heikki # Host: hundin.mysql.fi # Root: /home/heikki/mysql-4.0 --- 1.78/innobase/os/os0file.c Fri Oct 22 10:44:23 2004 +++ 1.79/innobase/os/os0file.c Tue Dec 21 18:21:09 2004 @@ -6,6 +6,8 @@ Created 10/21/1995 Heikki Tuuri *******************************************************/ +#define HAVE_BROKEN_PREAD + #include "os0file.h" #include "os0sync.h" #include "os0thread.h" @@ -14,8 +16,6 @@ #include "fil0fil.h" #include "buf0buf.h" -#undef HAVE_FDATASYNC - #ifdef POSIX_ASYNC_IO /* We assume in this case that the OS has standard Posix aio (at least SunOS 2.6, HP-UX 11i and AIX 4.3 have) */ @@ -1195,6 +1195,7 @@ return(n_bytes); #else { + off_t ret_offset; ssize_t ret; ulint i; @@ -1203,12 +1204,12 @@ os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = read(file, buf, (ssize_t)n); @@ -1281,6 +1282,7 @@ return(ret); #else { + off_t ret_offset; ulint i; /* Protect the seek / write operation with a mutex */ @@ -1288,12 +1290,12 @@ os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = write(file, buf, (ssize_t)n);