diff options
-rw-r--r-- | storage/connect/connect.cc | 2 | ||||
-rw-r--r-- | storage/connect/ha_connect.cc | 5 | ||||
-rw-r--r-- | storage/connect/mycat.cc | 5 | ||||
-rw-r--r-- | storage/connect/odbconn.cpp | 6 | ||||
-rw-r--r-- | storage/connect/osutil.c | 2 | ||||
-rw-r--r-- | storage/connect/tabutil.cpp | 10 |
6 files changed, 16 insertions, 14 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 41fb061bd7f..e0c722bc01f 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -816,7 +816,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, p+= valp->GetClen(); - if (len[i] == p - kp) { + if (len[i] == (unsigned)(p - kp)) { n++; break; } else if (len[i] < (unsigned)(p - kp)) { diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 786997cc76d..3325d39f1d8 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -3433,7 +3433,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); bool bif, ok= false, dbf= false; TABTYPE ttp= TAB_UNDEF; - PQRYRES qrp; + PQRYRES qrp= NULL; PCOLRES crp; PGLOBAL g= GetPlug(thd, NULL); PTOS topt= table_s->option_struct; @@ -3709,7 +3709,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, if (fnc != FNC_NO || src || ttp == TAB_PIVOT) { // Catalog like table - for (crp=qrp->Colresp; !b && crp; crp= crp->Next) { + for (crp= qrp->Colresp; !b && crp; crp= crp->Next) { cnm= encode(g, crp->Name); type= PLGtoMYSQLtype(crp->Type, dbf); len= crp->Length; @@ -3726,6 +3726,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, rem= NULL; typ= len= dec= 0; tm= NOT_NULL_FLAG; + cnm= (char*)"noname"; for (crp= qrp->Colresp; crp; crp= crp->Next) switch (crp->Fld) { diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index fe93751d600..3c75c0b63b3 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -383,7 +383,7 @@ int MYCAT::GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size) /***********************************************************************/ char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef) { - char *sval, *s= Hc->GetStringOption(what, sdef); + char *sval= NULL, *s= Hc->GetStringOption(what, sdef); if (s) { sval= (char*)PlugSubAlloc(g, NULL, strlen(s) + 1); @@ -408,8 +408,7 @@ char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef) } // endif FileType - } else - sval = NULL; + } // endif s return sval; } // end of GetStringCatInfo diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 5808bf266bd..69fddb2d9f8 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -242,7 +242,7 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *table, int maxres; PQRYRES qrp; CATPARM *cap; - ODBConn *ocp; + ODBConn *ocp = NULL; /************************************************************************/ /* Do an evaluation of the result size. */ @@ -497,7 +497,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) int maxres; PQRYRES qrp; CATPARM *cap; - ODBConn *ocp; + ODBConn *ocp = NULL; /************************************************************************/ /* Do an evaluation of the result size. */ @@ -1654,7 +1654,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) PCOLRES crp; RETCODE rc; HSTMT hstmt = NULL; - SQLLEN *vl, *vlen; + SQLLEN *vl, *vlen = NULL; PVAL *pval = NULL; try { diff --git a/storage/connect/osutil.c b/storage/connect/osutil.c index 4cdd7c560f0..ad92caefe95 100644 --- a/storage/connect/osutil.c +++ b/storage/connect/osutil.c @@ -181,7 +181,7 @@ char *_fullpath(char *absPath, const char *relPath, size_t maxLength) } else { char buff[2*_MAX_PATH]; - getcwd(buff, _MAX_PATH); + assert(getcwd(buff, _MAX_PATH) != NULL); strcat(buff,"/"); strcat(buff, relPath); strncpy(absPath, buff, maxLength); diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 21dee4e1856..6e5f6784d3a 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -133,7 +133,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, int i, n, ncol = sizeof(buftyp) / sizeof(int); int len, type, prec; bool mysql; - TABLE_SHARE *s; + TABLE_SHARE *s = NULL; Field* *field; Field *fp; PQRYRES qrp; @@ -243,7 +243,9 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, /**********************************************************************/ /* Return the result pointer for use by GetData routines. */ /**********************************************************************/ - free_table_share(s); + if (s) + free_table_share(s); + return qrp; } // end of TabColumns @@ -315,12 +317,12 @@ TDBPRX::TDBPRX(PPRXDEF tdp) : TDBASE(tdp) /***********************************************************************/ PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b) { - const char *sp; + const char *sp = NULL; char *db, *name; bool mysql = true; PTDB tdbp = NULL; TABLE_SHARE *s = NULL; - Field* *fp; + Field* *fp = NULL; PCATLG cat = To_Def->GetCat(); PHC hc = ((MYCAT*)cat)->GetHandler(); LPCSTR cdb, curdb = hc->GetDBName(NULL); |