diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index e8021e375b5..8386e5be481 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -48,7 +48,7 @@ ZIPFAM::ZIPFAM(PDOSDEF tdp) : MAPFAM(tdp) { zipfile = NULL; - zfn = tdp->Fn; +//zfn = tdp->Fn; target = tdp->Entry; //*fn = 0; entryopen = false; @@ -65,7 +65,7 @@ ZIPFAM::ZIPFAM(PDOSDEF tdp) : MAPFAM(tdp) ZIPFAM::ZIPFAM(PZIPFAM txfp) : MAPFAM(txfp) { zipfile = txfp->zipfile; - zfn = txfp->zfn; +//zfn = txfp->zfn; target = txfp->target; //strcpy(fn, txfp->fn); finfo = txfp->finfo; @@ -129,7 +129,7 @@ int ZIPFAM::GetFileLength(PGLOBAL g) bool ZIPFAM::open(PGLOBAL g, const char *filename) { if (!zipfile && !(zipfile = unzOpen64(filename))) - sprintf(g->Message, "Zipfile open error"); + sprintf(g->Message, "Zipfile open error on %s", filename); return (zipfile == NULL); } // end of open @@ -205,7 +205,7 @@ bool ZIPFAM::OpenTableFile(PGLOBAL g) /*********************************************************************/ if (mode == MODE_READ) { // We used the file name relative to recorded datapath - PlugSetPath(filename, zfn, Tdbp->GetPath()); + PlugSetPath(filename, To_File, Tdbp->GetPath()); bool b = open(g, filename); @@ -258,7 +258,8 @@ bool ZIPFAM::OpenTableFile(PGLOBAL g) } // endif fp To_Fb = fp; // Useful when closing - } // endif b + } else + return true; } else { strcpy(g->Message, "Only READ mode supported for ZIP files"); diff --git a/storage/connect/filamzip.h b/storage/connect/filamzip.h index 85c1f907d20..c3c04b2b3bb 100644 --- a/storage/connect/filamzip.h +++ b/storage/connect/filamzip.h @@ -51,7 +51,7 @@ protected: // Members unzFile zipfile; // The ZIP container file - PSZ zfn; // The ZIP file name +//PSZ zfn; // The ZIP file name PSZ target; // The target file name unz_file_info finfo; // The current file info //char fn[FILENAME_MAX]; // The current file name diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index 34eb7cdcdfb..2c4d605e66c 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -108,6 +108,11 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info) goto skipit; } // endif info + if (GetIntegerTableOption(g, topt, "Multiple", 0)) { + strcpy(g->Message, "Cannot find column definition for multiple table"); + return NULL; + } // endif Multiple + // num_max = atoi(p+1); // Max num of record to test imax = hmax = nerr = 0; @@ -124,18 +129,15 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info) tdp = new(g) CSVDEF; #if defined(ZIP_SUPPORT) tdp->Entry = GetStringTableOption(g, topt, "Entry", NULL); - tdp->Multiple = GetIntegerTableOption(g, topt, "Multiple", 0); tdp->Zipped = GetBooleanTableOption(g, topt, "Zipped", false); #endif // ZIP_SUPPORT - tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); + fn = tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); if (!tdp->Fn) { strcpy(g->Message, MSG(MISSING_FNAME)); return NULL; } // endif Fn - fn = (tdp->Fn) ? tdp->Fn : "unnamed"; - if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0))) tdp->Lrecl = 4096; @@ -497,12 +499,6 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode) if (Zipped) { #if defined(ZIP_SUPPORT) txfp = new(g) ZIPFAM(this); - - if (!Fmtd) - tdbp = new(g) TDBCSV(this, txfp); - else - tdbp = new(g) TDBFMT(this, txfp); - #else // !ZIP_SUPPORT strcpy(g->Message, "ZIP not supported"); return NULL; diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index a27e43e5ffd..eff95445a3a 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -94,7 +94,12 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info) goto skipit; } // endif info - /*********************************************************************/ + if (GetIntegerTableOption(g, topt, "Multiple", 0)) { + strcpy(g->Message, "Cannot find column definition for multiple table"); + return NULL; + } // endif Multiple + + /*********************************************************************/ /* Open the input file. */ /*********************************************************************/ lvl = GetIntegerTableOption(g, topt, "Level", 0); @@ -103,7 +108,6 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info) tdp = new(g) JSONDEF; #if defined(ZIP_SUPPORT) tdp->Entry = GetStringTableOption(g, topt, "Entry", NULL); - tdp->Multiple = GetIntegerTableOption(g, topt, "Multiple", 0); tdp->Zipped = GetBooleanTableOption(g, topt, "Zipped", false); #endif // ZIP_SUPPORT tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 57d204a4286..1993b07eb7a 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -136,7 +136,12 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) goto skipit; } // endif info - /*********************************************************************/ + if (GetIntegerTableOption(g, topt, "Multiple", 0)) { + strcpy(g->Message, "Cannot find column definition for multiple table"); + return NULL; + } // endif Multiple + + /*********************************************************************/ /* Open the input file. */ /*********************************************************************/ if (!(fn = GetStringTableOption(g, topt, "Filename", NULL))) {