Commit 286819ae authored by Olivier Bertrand's avatar Olivier Bertrand

Fix gcc errors and warnings.

  modified:   storage/connect/filamzip.cpp

Remove unused variables in connect_assisted_discovery
  modified:   storage/connect/ha_connect.cc
parent b1bd990e
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
#define WRITEBUFFERSIZE (16384) #define WRITEBUFFERSIZE (16384)
bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool mul);
/***********************************************************************/ /***********************************************************************/
/* Compress a file in zip when creating a table. */ /* Compress a file in zip when creating a table. */
/***********************************************************************/ /***********************************************************************/
...@@ -252,7 +254,7 @@ void ZIPUTIL::getTime(tm_zip& tmZip) ...@@ -252,7 +254,7 @@ void ZIPUTIL::getTime(tm_zip& tmZip)
{ {
time_t rawtime; time_t rawtime;
time(&rawtime); time(&rawtime);
auto timeinfo = localtime(&rawtime); struct tm *timeinfo = localtime(&rawtime);
tmZip.tm_sec = timeinfo->tm_sec; tmZip.tm_sec = timeinfo->tm_sec;
tmZip.tm_min = timeinfo->tm_min; tmZip.tm_min = timeinfo->tm_min;
tmZip.tm_hour = timeinfo->tm_hour; tmZip.tm_hour = timeinfo->tm_hour;
...@@ -321,7 +323,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append) ...@@ -321,7 +323,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
fp->Memory = NULL; fp->Memory = NULL;
fp->Mode = mode; fp->Mode = mode;
fp->File = this; fp->File = this;
fp->Handle = NULL; fp->Handle = 0;
} else } else
return true; return true;
...@@ -339,7 +341,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append) ...@@ -339,7 +341,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
bool ZIPUTIL::addEntry(PGLOBAL g, char *entry) bool ZIPUTIL::addEntry(PGLOBAL g, char *entry)
{ {
//?? we dont need the stinking time //?? we dont need the stinking time
zip_fileinfo zi = { 0 }; zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
getTime(zi.tmz_date); getTime(zi.tmz_date);
target = entry; target = entry;
...@@ -432,7 +434,7 @@ bool UNZIPUTL::WildMatch(PSZ pat, PSZ str) { ...@@ -432,7 +434,7 @@ bool UNZIPUTL::WildMatch(PSZ pat, PSZ str) {
if (!*++pat) return TRUE; if (!*++pat) return TRUE;
goto loopStart; goto loopStart;
default: default:
if (mapCaseTable[*s] != mapCaseTable[*p]) if (mapCaseTable[(uint)*s] != mapCaseTable[(uint)*p])
goto starCheck; goto starCheck;
break; break;
} /* endswitch */ } /* endswitch */
...@@ -486,7 +488,7 @@ int UNZIPUTL::findEntry(PGLOBAL g, bool next) ...@@ -486,7 +488,7 @@ int UNZIPUTL::findEntry(PGLOBAL g, bool next)
if (rc == UNZ_END_OF_LIST_OF_FILE) if (rc == UNZ_END_OF_LIST_OF_FILE)
return RC_EF; return RC_EF;
else if (rc != UNZ_OK) { else if (rc != UNZ_OK) {
sprintf(g->Message, "unzGoToNextFile rc = ", rc); sprintf(g->Message, "unzGoToNextFile rc = %d", rc);
return RC_FX; return RC_FX;
} // endif rc } // endif rc
...@@ -596,7 +598,7 @@ bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn) ...@@ -596,7 +598,7 @@ bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn)
fp->Memory = memory; fp->Memory = memory;
fp->Mode = mode; fp->Mode = mode;
fp->File = this; fp->File = this;
fp->Handle = NULL; fp->Handle = 0;
} // endif fp } // endif fp
} else } else
...@@ -632,7 +634,7 @@ bool UNZIPUTL::openEntry(PGLOBAL g) ...@@ -632,7 +634,7 @@ bool UNZIPUTL::openEntry(PGLOBAL g)
memory = new char[size + 1]; memory = new char[size + 1];
if ((rc = unzReadCurrentFile(zipfile, memory, size)) < 0) { if ((rc = unzReadCurrentFile(zipfile, memory, size)) < 0) {
sprintf(g->Message, "unzReadCurrentFile rc = ", rc); sprintf(g->Message, "unzReadCurrentFile rc = %d", rc);
unzCloseCurrentFile(zipfile); unzCloseCurrentFile(zipfile);
free(memory); free(memory);
memory = NULL; memory = NULL;
......
...@@ -5174,7 +5174,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, ...@@ -5174,7 +5174,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
TABLE_SHARE *table_s, TABLE_SHARE *table_s,
HA_CREATE_INFO *create_info) HA_CREATE_INFO *create_info)
{ {
char v=0, spc= ',', qch= 0; char v=0;
const char *fncn= "?"; const char *fncn= "?";
const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src; const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src;
const char *col, *ocl, *rnk, *pic, *fcl, *skc, *zfn; const char *col, *ocl, *rnk, *pic, *fcl, *skc, *zfn;
...@@ -5226,8 +5226,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd, ...@@ -5226,8 +5226,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
fncn= topt->catfunc; fncn= topt->catfunc;
fnc= GetFuncID(fncn); fnc= GetFuncID(fncn);
sep= topt->separator; sep= topt->separator;
spc= (!sep) ? ',' : *sep;
qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0;
mul = (int)topt->multiple; mul = (int)topt->multiple;
tbl= topt->tablist; tbl= topt->tablist;
col= topt->colist; col= topt->colist;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment