1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-28 17:36:30 +03:00

Fix info cardinality for catalog tables.

Was returning 0, which caused an assert error when retreiving records.
  modified:   storage/connect/connect.cc
  modified:   storage/connect/xtable.h

Add the create and insert possibility to zipped tables
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/domdoc.h
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.c
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plgxml.cpp
  modified:   storage/connect/plgxml.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabzip.cpp
  modified:   storage/connect/tabzip.h

Fix skipping header record for mulentries zipped CSV tabled
  modified:   storage/connect/filamap.cpp

Accept M (memo) column type for DBF tables
Fix miscalculation of Blksize when LRECL was replaced by DBF LRECL
  modified:   storage/connect/filamdbf.cpp

Change the names of GZ compress classes (not to be confused with ZIP)
  modified:   storage/connect/filamgz.cpp
  modified:   storage/connect/filamgz.h

add trace in PlugSetPath
  modified:   storage/connect/plugutil.c

Add tests fir ZIP
  added:      storage/connect/mysql-test/connect/r/xml_zip.result
  added:      storage/connect/mysql-test/connect/r/zip.result
  added:      storage/connect/mysql-test/connect/std_data/bios.json
  added:      storage/connect/mysql-test/connect/std_data/xsample2.xml
  added:      storage/connect/mysql-test/connect/t/have_zip.inc
  added:      storage/connect/mysql-test/connect/t/xml_zip.test
  added:      storage/connect/mysql-test/connect/t/zip.test
This commit is contained in:
Olivier Bertrand
2017-01-16 15:13:40 +01:00
parent df21d45fdd
commit 707cd98592
31 changed files with 1731 additions and 178 deletions

View File

@@ -102,6 +102,7 @@ DOSDEF::DOSDEF(void)
Mapped = false;
Zipped = false;
Mulentries = false;
Append = false;
Padded = false;
Huge = false;
Accept = false;
@@ -132,10 +133,13 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
: (am && (*am == 'B' || *am == 'b')) ? "B"
: (am && !stricmp(am, "DBF")) ? "D" : "V";
if ((Zipped = GetBoolCatInfo("Zipped", false)))
Mulentries = ((Entry = GetStringCatInfo(g, "Entry", NULL)))
? strchr(Entry, '*') || strchr(Entry, '?')
: GetBoolCatInfo("Mulentries", false);
if ((Zipped = GetBoolCatInfo("Zipped", false))) {
Entry = GetStringCatInfo(g, "Entry", NULL);
Mulentries = (Entry && *Entry) ? strchr(Entry, '*') || strchr(Entry, '?')
: false;
Mulentries = GetBoolCatInfo("Mulentries", Mulentries);
Append = GetBoolCatInfo("Append", false);
}
Desc = Fn = GetStringCatInfo(g, "Filename", NULL);
Ofn = GetStringCatInfo(g, "Optname", Fn);
@@ -347,10 +351,26 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
if (Zipped) {
#if defined(ZIP_SUPPORT)
if (Recfm == RECFM_VAR) {
txfp = new(g)ZIPFAM(this);
tdbp = new(g)TDBDOS(this, txfp);
if (mode == MODE_READ || mode == MODE_ANY) {
txfp = new(g) UNZFAM(this);
} else if (mode == MODE_INSERT) {
txfp = new(g) ZIPFAM(this);
} else {
strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's mode
tdbp = new(g) TDBDOS(this, txfp);
} else {
txfp = new(g)ZPXFAM(this);
if (mode == MODE_READ || mode == MODE_ANY) {
txfp = new(g) UZXFAM(this);
} else if (mode == MODE_INSERT) {
txfp = new(g) ZPXFAM(this);
} else {
strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's mode
tdbp = new(g)TDBFIX(this, txfp);
} // endif Recfm
@@ -376,7 +396,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
txfp = new(g) MPXFAM(this);
else if (Compressed) {
#if defined(GZ_SUPPORT)
txfp = new(g) ZIXFAM(this);
txfp = new(g) GZXFAM(this);
#else // !GZ_SUPPORT
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "GZ");
return NULL;