summaryrefslogtreecommitdiff
path: root/storage/connect/tabzip.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2020-05-19 00:05:56 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2020-05-19 00:05:56 +0200
commit2654ddd2d595c2f8528aafa3af30db90beb0a5b7 (patch)
tree6216c912107e2cbbbb04325257b65192d5d1717e /storage/connect/tabzip.cpp
parentf5f9659b1577befed935b41ce36dda91f218c8e9 (diff)
downloadmariadb-git-2654ddd2d595c2f8528aafa3af30db90beb0a5b7.tar.gz
- 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 - Fix some compiler errors modified: storage/connect/tabcmg.cpp
Diffstat (limited to 'storage/connect/tabzip.cpp')
-rw-r--r--storage/connect/tabzip.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/storage/connect/tabzip.cpp b/storage/connect/tabzip.cpp
index c026744dba8..d9c13e2a58a 100644
--- a/storage/connect/tabzip.cpp
+++ b/storage/connect/tabzip.cpp
@@ -23,6 +23,7 @@
#include "filamzip.h"
#include "resource.h" // for IDS_COLUMNS
#include "tabdos.h"
+#include "tabmul.h"
#include "tabzip.h"
/* -------------------------- Class ZIPDEF --------------------------- */
@@ -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
/* ------------------------------------------------------------------- */
@@ -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
@@ -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