From: Vlad K. <hv...@us...> - 2009-06-03 09:56:35
|
Build Version : T2.5.0.24015 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.24179 2009/06/03 09:56:30 hvlad Exp $ ) Update of /cvsroot/firebird/firebird2/src/jrd In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10144/jrd Modified Files: ext.cpp ext.h req.h Log Message: Implement improvement CORE-2492 : Work correctly with external tables larger then 2GB Index: ext.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/ext.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -b -U3 -r1.85 -r1.86 --- ext.cpp 28 Apr 2009 13:07:38 -0000 1.85 +++ ext.cpp 3 Jun 2009 09:56:29 -0000 1.86 @@ -58,6 +58,14 @@ #include "../jrd/os/path_utils.h" #include "../common/classes/init.h" +#ifdef WIN_NT +#define FTELL64 _ftelli64 +#define FSEEK64 _fseeki64 +#else +#define FTELL64 ftello +#define FSEEK64 fseeko +#endif + using namespace Jrd; using namespace Firebird; @@ -268,8 +276,8 @@ // call it if it is not necessary. Note that we must flush file buffer if we // do read after write if (file->ext_ifi == NULL || - ((ftell(file->ext_ifi) != rpb->rpb_ext_pos || !(file->ext_flags & EXT_last_read)) && - (fseek(file->ext_ifi, rpb->rpb_ext_pos, 0) != 0)) ) + ((FTELL64(file->ext_ifi) != rpb->rpb_ext_pos || !(file->ext_flags & EXT_last_read)) && + (FSEEK64(file->ext_ifi, rpb->rpb_ext_pos, 0) != 0)) ) { ERR_post(Arg::Gds(isc_io_error) << Arg::Str("fseek") << Arg::Str(file->ext_filename) << Arg::Gds(isc_io_open_err) << SYS_ERR(errno)); @@ -509,7 +517,7 @@ // call it if it is not necessary. Note that we must flush file buffer if we // do write after read if (file->ext_ifi == NULL || - (!(file->ext_flags & EXT_last_write) && fseek(file->ext_ifi, (SLONG) 0, 2) != 0) ) + (!(file->ext_flags & EXT_last_write) && FSEEK64(file->ext_ifi, (SINT64) 0, 2) != 0) ) { ERR_post(Arg::Gds(isc_io_error) << Arg::Str("fseek") << Arg::Str(file->ext_filename) << Arg::Gds(isc_io_open_err) << SYS_ERR(errno)); Index: ext.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/ext.h,v retrieving revision 1.15 retrieving revision 1.16 diff -b -U3 -r1.15 -r1.16 --- ext.h 5 Dec 2008 00:56:04 -0000 1.15 +++ ext.h 3 Jun 2009 09:56:29 -0000 1.16 @@ -38,6 +38,7 @@ #endif //UCHAR* ext_stuff; // Random stuff USHORT ext_flags; /* Misc and cruddy flags */ + USHORT ext_tra_cnt; // How many transactions used file #ifdef VMS int ext_ifi; /* Internal file identifier */ int ext_isi; /* Internal stream (default) */ @@ -73,7 +74,6 @@ /* Overload record parameter block with external file stuff */ -#define rpb_ext_pos rpb_page #ifdef VMS #define rpb_ext_isi rpb_f_page #define rpb_ext_dbkey rpb_b_page Index: req.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/req.h,v retrieving revision 1.89 retrieving revision 1.90 diff -b -U3 -r1.89 -r1.90 --- req.h 4 Apr 2009 16:39:20 -0000 1.89 +++ req.h 3 Jun 2009 09:56:29 -0000 1.90 @@ -71,8 +71,13 @@ Record* rpb_undo; /* our first version of data if this is a second modification */ USHORT rpb_format_number; /* format number in relation */ + union { + struct { SLONG rpb_page; /* page number */ USHORT rpb_line; /* line number on page */ + }; + FB_UINT64 rpb_ext_pos; // position in external file + }; SLONG rpb_f_page; /* fragment page number */ USHORT rpb_f_line; /* fragment line number on page */ |