Skip to content

Commit e316352

Browse files
committed
- Fix MDEV-22571 and MDEV-22572. Allow multiple ZIP table
and enable using special column in them. modified: storage/connect/tabzip.cpp modified: storage/connect/tabzip.h
1 parent 674197e commit e316352

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

storage/connect/tabzip.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "filamzip.h"
2424
#include "resource.h" // for IDS_COLUMNS
2525
#include "tabdos.h"
26+
#include "tabmul.h"
2627
#include "tabzip.h"
2728

2829
/* -------------------------- Class ZIPDEF --------------------------- */
@@ -41,7 +42,14 @@ bool ZIPDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
4142
/***********************************************************************/
4243
PTDB ZIPDEF::GetTable(PGLOBAL g, MODE m)
4344
{
44-
return new(g) TDBZIP(this);
45+
PTDB tdbp = NULL;
46+
47+
tdbp = new(g) TDBZIP(this);
48+
49+
if (Multiple)
50+
tdbp = new(g) TDBMUL(tdbp);
51+
52+
return tdbp;
4553
} // end of GetTable
4654

4755
/* ------------------------------------------------------------------- */
@@ -108,7 +116,7 @@ int TDBZIP::Cardinality(PGLOBAL g)
108116

109117
Cardinal = (err == UNZ_OK) ? (int)ginfo.number_entry : 0;
110118
} else
111-
Cardinal = 0;
119+
Cardinal = 10; // Dummy for multiple tables
112120

113121
} // endif Cardinal
114122

@@ -187,6 +195,7 @@ int TDBZIP::DeleteDB(PGLOBAL g, int irc)
187195
void TDBZIP::CloseDB(PGLOBAL g)
188196
{
189197
close();
198+
nexterr = UNZ_OK; // For multiple tables
190199
Use = USE_READY; // Just to be clean
191200
} // end of CloseDB
192201

storage/connect/tabzip.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class DllExport TDBZIP : public TDBASE {
4848

4949
// Implementation
5050
virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
51+
virtual PCSZ GetFile(PGLOBAL) {return zfn;}
52+
virtual void SetFile(PGLOBAL, PCSZ fn) {zfn = fn;}
5153

5254
// Methods
5355
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);

0 commit comments

Comments
 (0)