You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
6.3 KiB

- NOTE: an experimental implementation of MRR was done but not kept in this version. Sure enough, it never caused any improvement in the execution speed and rather caused a small increase of execution time. This is probably because values are sorted by rowid in each range of CONNECT indexes. This could be reconsidered if a customer have a need for processing very big files. - Fix a bug in ha_connect::CheckCond. The negated form of BETWEEN and IS NULL operators was not recognized. modified: storage/connect/ha_connect.cc - Add long jump initialization in CntReadNext. This was causing a server crash when an error occured in a ReadColumn. modified: storage/connect/connect.cc - General cleanup of CONNECT source code eliminating all code not used by CONNECT, including the MRR test code (saved separately). modified: storage/connect/catalog.h storage/connect/colblk.cpp storage/connect/colblk.h storage/connect/connect.cc storage/connect/connect.h storage/connect/domdoc.h storage/connect/filamap.cpp storage/connect/filamap.h storage/connect/filamdbf.h storage/connect/filamfix.cpp storage/connect/filamfix.h storage/connect/filamtxt.cpp storage/connect/filamtxt.h storage/connect/filamvct.cpp storage/connect/filamvct.h storage/connect/filamzip.cpp storage/connect/filamzip.h storage/connect/global.h storage/connect/ha_connect.cc storage/connect/ha_connect.h storage/connect/myconn.h storage/connect/plgcnx.h storage/connect/plgdbsem.h storage/connect/plugutil.c storage/connect/preparse.h storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/tabcol.h storage/connect/tabdos.cpp storage/connect/tabdos.h storage/connect/tabfix.cpp storage/connect/tabfmt.cpp storage/connect/tabfmt.h storage/connect/table.cpp storage/connect/tabmac.h storage/connect/tabmul.h storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/taboccur.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h storage/connect/tabsys.cpp storage/connect/tabsys.h storage/connect/tabtbl.cpp storage/connect/tabtbl.h storage/connect/tabutil.h storage/connect/tabvct.cpp storage/connect/tabvct.h storage/connect/tabwmi.cpp storage/connect/tabwmi.h storage/connect/tabxml.cpp storage/connect/tabxml.h storage/connect/user_connect.cc storage/connect/user_connect.h storage/connect/valblk.cpp storage/connect/valblk.h storage/connect/value.cpp storage/connect/value.h storage/connect/xindex.cpp storage/connect/xindex.h storage/connect/xobject.cpp storage/connect/xobject.h storage/connect/xtable.h
12 years ago
- NOTE: an experimental implementation of MRR was done but not kept in this version. Sure enough, it never caused any improvement in the execution speed and rather caused a small increase of execution time. This is probably because values are sorted by rowid in each range of CONNECT indexes. This could be reconsidered if a customer have a need for processing very big files. - Fix a bug in ha_connect::CheckCond. The negated form of BETWEEN and IS NULL operators was not recognized. modified: storage/connect/ha_connect.cc - Add long jump initialization in CntReadNext. This was causing a server crash when an error occured in a ReadColumn. modified: storage/connect/connect.cc - General cleanup of CONNECT source code eliminating all code not used by CONNECT, including the MRR test code (saved separately). modified: storage/connect/catalog.h storage/connect/colblk.cpp storage/connect/colblk.h storage/connect/connect.cc storage/connect/connect.h storage/connect/domdoc.h storage/connect/filamap.cpp storage/connect/filamap.h storage/connect/filamdbf.h storage/connect/filamfix.cpp storage/connect/filamfix.h storage/connect/filamtxt.cpp storage/connect/filamtxt.h storage/connect/filamvct.cpp storage/connect/filamvct.h storage/connect/filamzip.cpp storage/connect/filamzip.h storage/connect/global.h storage/connect/ha_connect.cc storage/connect/ha_connect.h storage/connect/myconn.h storage/connect/plgcnx.h storage/connect/plgdbsem.h storage/connect/plugutil.c storage/connect/preparse.h storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/tabcol.h storage/connect/tabdos.cpp storage/connect/tabdos.h storage/connect/tabfix.cpp storage/connect/tabfmt.cpp storage/connect/tabfmt.h storage/connect/table.cpp storage/connect/tabmac.h storage/connect/tabmul.h storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/taboccur.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h storage/connect/tabsys.cpp storage/connect/tabsys.h storage/connect/tabtbl.cpp storage/connect/tabtbl.h storage/connect/tabutil.h storage/connect/tabvct.cpp storage/connect/tabvct.h storage/connect/tabwmi.cpp storage/connect/tabwmi.h storage/connect/tabxml.cpp storage/connect/tabxml.h storage/connect/user_connect.cc storage/connect/user_connect.h storage/connect/valblk.cpp storage/connect/valblk.h storage/connect/value.cpp storage/connect/value.h storage/connect/xindex.cpp storage/connect/xindex.h storage/connect/xobject.cpp storage/connect/xobject.h storage/connect/xtable.h
12 years ago
  1. /************** FilAmZip H Declares Source Code File (.H) **************/
  2. /* Name: FILAMZIP.H Version 1.1 */
  3. /* */
  4. /* (C) Copyright to the author Olivier BERTRAND 2005-2012 */
  5. /* */
  6. /* This file contains the GZIP access method classes declares. */
  7. /***********************************************************************/
  8. #ifndef __FILAMZIP_H
  9. #define __FILAMZIP_H
  10. #include "zlib.h"
  11. typedef class ZIPFAM *PZIPFAM;
  12. typedef class ZBKFAM *PZBKFAM;
  13. typedef class ZIXFAM *PZIXFAM;
  14. typedef class ZLBFAM *PZLBFAM;
  15. /***********************************************************************/
  16. /* This is the access method class declaration for not optimized */
  17. /* variable record length files compressed using the gzip library */
  18. /* functions. File is accessed record by record (row). */
  19. /***********************************************************************/
  20. class DllExport ZIPFAM : public TXTFAM {
  21. // friend class DOSCOL;
  22. public:
  23. // Constructor
  24. ZIPFAM(PDOSDEF tdp) : TXTFAM(tdp) {Zfile = NULL; Zpos = 0;}
  25. ZIPFAM(PZIPFAM txfp);
  26. // Implementation
  27. virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
  28. virtual int GetPos(void);
  29. virtual int GetNextPos(void);
  30. virtual PTXF Duplicate(PGLOBAL g)
  31. {return (PTXF)new(g) ZIPFAM(this);}
  32. // Methods
  33. virtual void Reset(void);
  34. virtual int GetFileLength(PGLOBAL g);
  35. virtual int Cardinality(PGLOBAL g) {return (g) ? -1 : 0;}
  36. virtual bool AllocateBuffer(PGLOBAL g);
  37. virtual int GetRowID(void);
  38. virtual bool RecordPos(PGLOBAL g);
  39. virtual bool SetPos(PGLOBAL g, int recpos);
  40. virtual int SkipRecord(PGLOBAL g, bool header);
  41. virtual bool OpenTableFile(PGLOBAL g);
  42. virtual int ReadBuffer(PGLOBAL g);
  43. virtual int WriteBuffer(PGLOBAL g);
  44. virtual int DeleteRecords(PGLOBAL g, int irc);
  45. virtual void CloseTableFile(PGLOBAL g);
  46. virtual void Rewind(void);
  47. protected:
  48. int Zerror(PGLOBAL g); // GZ error function
  49. // Members
  50. gzFile Zfile; // Points to GZ file structure
  51. z_off_t Zpos; // Uncompressed file position
  52. }; // end of class ZIPFAM
  53. /***********************************************************************/
  54. /* This is the access method class declaration for optimized variable */
  55. /* record length files compressed using the gzip library functions. */
  56. /* The File is accessed by block (requires an opt file). */
  57. /***********************************************************************/
  58. class DllExport ZBKFAM : public ZIPFAM {
  59. public:
  60. // Constructor
  61. ZBKFAM(PDOSDEF tdp);
  62. ZBKFAM(PZBKFAM txfp);
  63. // Implementation
  64. virtual int GetPos(void);
  65. virtual int GetNextPos(void) {return 0;}
  66. virtual PTXF Duplicate(PGLOBAL g)
  67. {return (PTXF)new(g) ZBKFAM(this);}
  68. // Methods
  69. virtual int Cardinality(PGLOBAL g);
  70. virtual bool AllocateBuffer(PGLOBAL g);
  71. virtual int GetRowID(void);
  72. virtual bool RecordPos(PGLOBAL g);
  73. virtual int SkipRecord(PGLOBAL g, bool header);
  74. virtual int ReadBuffer(PGLOBAL g);
  75. virtual int WriteBuffer(PGLOBAL g);
  76. virtual int DeleteRecords(PGLOBAL g, int irc);
  77. virtual void CloseTableFile(PGLOBAL g);
  78. virtual void Rewind(void);
  79. protected:
  80. // Members
  81. char *CurLine; // Position of current line in buffer
  82. char *NxtLine; // Position of Next line in buffer
  83. bool Closing; // True when closing on Insert
  84. }; // end of class ZBKFAM
  85. /***********************************************************************/
  86. /* This is the access method class declaration for fixed record */
  87. /* length files compressed using the gzip library functions. */
  88. /* The file is always accessed by block. */
  89. /***********************************************************************/
  90. class DllExport ZIXFAM : public ZBKFAM {
  91. public:
  92. // Constructor
  93. ZIXFAM(PDOSDEF tdp);
  94. ZIXFAM(PZIXFAM txfp) : ZBKFAM(txfp) {}
  95. // Implementation
  96. virtual int GetNextPos(void) {return 0;}
  97. virtual PTXF Duplicate(PGLOBAL g)
  98. {return (PTXF)new(g) ZIXFAM(this);}
  99. // Methods
  100. virtual int Cardinality(PGLOBAL g);
  101. virtual bool AllocateBuffer(PGLOBAL g);
  102. virtual int ReadBuffer(PGLOBAL g);
  103. virtual int WriteBuffer(PGLOBAL g);
  104. protected:
  105. // No additional Members
  106. }; // end of class ZIXFAM
  107. #if 0
  108. /***********************************************************************/
  109. /* This is the DOS/UNIX Access Method class declaration for PlugDB */
  110. /* fixed/variable files compressed using the zlib library functions. */
  111. /* Physically these are written and read using the same technique */
  112. /* than blocked variable files, only the contain of each block is */
  113. /* compressed using the deflate zlib function. The purpose of this */
  114. /* specific format is to have a fast mechanism for direct access of */
  115. /* records so blocked optimization is fast and direct access (joins) */
  116. /* is allowed. Note that the block length is written ahead of each */
  117. /* block to enable reading when optimization file is not available. */
  118. /***********************************************************************/
  119. class DllExport ZLBFAM : public BLKFAM {
  120. public:
  121. // Constructor
  122. ZLBFAM(PDOSDEF tdp);
  123. ZLBFAM(PZLBFAM txfp);
  124. // Implementation
  125. virtual AMT GetAmType(void) {return TYPE_AM_ZLIB;}
  126. virtual int GetPos(void);
  127. virtual int GetNextPos(void);
  128. virtual PTXF Duplicate(PGLOBAL g)
  129. {return (PTXF)new(g) ZLBFAM(this);}
  130. inline void SetOptimized(bool b) {Optimized = b;}
  131. // Methods
  132. virtual int GetFileLength(PGLOBAL g);
  133. virtual bool AllocateBuffer(PGLOBAL g);
  134. virtual int ReadBuffer(PGLOBAL g);
  135. virtual int WriteBuffer(PGLOBAL g);
  136. virtual void CloseTableFile(PGLOBAL g);
  137. virtual void Rewind(void);
  138. protected:
  139. bool WriteCompressedBuffer(PGLOBAL g);
  140. int ReadCompressedBuffer(PGLOBAL g, void *rdbuf);
  141. // Members
  142. z_streamp Zstream; // Compression/decompression stream
  143. Byte *Zbuffer; // Compressed block buffer
  144. int *Zlenp; // Pointer to block length
  145. bool Optimized; // true when opt file is available
  146. }; // end of class ZLBFAM
  147. #endif // 0
  148. #endif // __FILAMZIP_H