Skip to content

Commit

Permalink
- Fix MDEV-22571 and MDEV-22572. Allow multiple ZIP table
Browse files Browse the repository at this point in the history
  and enable using special column in them.
  modified:   storage/connect/tabzip.cpp
  modified:   storage/connect/tabzip.h

- Fix some compiler errors
  modified:   storage/connect/tabcmg.cpp
  • Loading branch information
Buggynours committed May 18, 2020
1 parent f5f9659 commit 2654ddd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions storage/connect/tabcmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "tabmul.h"
#include "filter.h"

PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info);

/* -------------------------- Class CMGDISC -------------------------- */

/***********************************************************************/
Expand Down
13 changes: 11 additions & 2 deletions storage/connect/tabzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "filamzip.h"
#include "resource.h" // for IDS_COLUMNS
#include "tabdos.h"
#include "tabmul.h"
#include "tabzip.h"

/* -------------------------- Class ZIPDEF --------------------------- */
Expand All @@ -41,7 +42,14 @@ bool ZIPDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
PTDB ZIPDEF::GetTable(PGLOBAL g, MODE m)
{
return new(g) TDBZIP(this);
PTDB tdbp = NULL;

tdbp = new(g) TDBZIP(this);

if (Multiple)
tdbp = new(g) TDBMUL(tdbp);

return tdbp;
} // end of GetTable

/* ------------------------------------------------------------------- */
Expand Down Expand Up @@ -108,7 +116,7 @@ int TDBZIP::Cardinality(PGLOBAL g)

Cardinal = (err == UNZ_OK) ? (int)ginfo.number_entry : 0;
} else
Cardinal = 0;
Cardinal = 10; // Dummy for multiple tables

} // endif Cardinal

Expand Down Expand Up @@ -187,6 +195,7 @@ int TDBZIP::DeleteDB(PGLOBAL g, int irc)
void TDBZIP::CloseDB(PGLOBAL g)
{
close();
nexterr = UNZ_OK; // For multiple tables
Use = USE_READY; // Just to be clean
} // end of CloseDB

Expand Down
2 changes: 2 additions & 0 deletions storage/connect/tabzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class DllExport TDBZIP : public TDBASE {

// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
virtual PCSZ GetFile(PGLOBAL) {return zfn;}
virtual void SetFile(PGLOBAL, PCSZ fn) {zfn = fn;}

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

0 comments on commit 2654ddd

Please sign in to comment.