diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index 7c222eb3c80..490ca3a5fba 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -427,7 +427,7 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g) for (i = 0; i < Posar->GetNval(); i++) { if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]), - Sosar->GetIntValue(ix[i])) == RC_FX)) + Sosar->GetIntValue(ix[i]))) == RC_FX) goto err; // Now delete the sorted rows diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 1bb689000f8..9627a85eee4 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -108,13 +108,8 @@ #define MYSQL_SERVER 1 #define DONT_DEFINE_VOID #include -#include "sql_class.h" -#include "create_options.h" -#include "mysql_com.h" -#include "field.h" #include "sql_parse.h" #include "sql_base.h" -#include #include "sql_partition.h" #undef OFFSET @@ -175,7 +170,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.06.0007 March 11, 2018"; + char version[]= "Version 1.06.0007 May 01, 2018"; #if defined(__WIN__) char compver[]= "Version 1.06.0007 " __DATE__ " " __TIME__; char slash= '\\'; @@ -238,7 +233,7 @@ uint GetWorkSize(void); void SetWorkSize(uint); extern "C" const char *msglang(void); -static char *strz(PGLOBAL g, LEX_STRING &ls); +static char *strz(PGLOBAL g, LEX_CSTRING &ls); static void PopUser(PCONNECT xp); static PCONNECT GetUser(THD *thd, PCONNECT xp); @@ -1322,7 +1317,7 @@ PCSZ ha_connect::GetStringOption(PCSZ opname, PCSZ sdef) if (!stricmp(opname, "Connect")) { LEX_CSTRING cnc= (tshp) ? tshp->connect_string - : table->s->connect_string; + : table->s->connect_string; if (cnc.length) opval= strz(xp->g, cnc); @@ -5571,7 +5566,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } // endif p } else if (ttp != TAB_ODBC || !(fnc & (FNC_TABLE | FNC_COL))) - tab = (char *) table_s->table_name.str; // Default value + tab = (char*) table_s->table_name.str; // Default value } // endif tab diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index ca51712af0c..b10060c7541 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -41,8 +41,6 @@ static PJSON JsonNew(PGLOBAL g, JTYP type); static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL); static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64); -void json_array_deinit(UDF_INIT* initid); - static uint JsonGrpSize = 10; /*********************************************************************************/ @@ -1669,7 +1667,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i) int j = 0, n = args->attribute_lengths[i]; my_bool b; // true if attribute is zero terminated PSZ p; - const char *s = args->attributes[i]; + PCSZ s = args->attributes[i]; if (s && *s && (n || *s == '\'')) { if ((b = (!n || !s[n]))) @@ -1688,7 +1686,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i) } // endif *s if (n < 1) - return (char*) "Key"; + return "Key"; if (!b) { if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) { @@ -1702,10 +1700,10 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i) } // endif s - return (char*) s; + return s; } // endif count - return (char*) "Key"; + return "Key"; } // end of MakeKey /*********************************************************************************/ diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index dd04d667e58..5aef6d9c660 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -18,7 +18,7 @@ /* ------------- */ /* Version 1.6 */ /* */ -/* Author: Olivier Bertrand 2012 - 2017 */ +/* Author: Olivier Bertrand 2012 - 2018 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -31,10 +31,7 @@ #define DONT_DEFINE_VOID #include -#if defined(__WIN__) -//#include -//#include -#elif defined(UNIX) +#if defined(UNIX) #include #include #endif diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp index 7be6c0e8328..139e4199ed9 100644 --- a/storage/connect/tabext.cpp +++ b/storage/connect/tabext.cpp @@ -286,7 +286,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g) char *catp = strstr(Srcdef, "%s"); if (catp) { - char *fil1= 0, *fil2; + char *fil1 = 0, *fil2; PCSZ ph = ((EXTDEF*)To_Def)->Phpos; if (!ph) diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp index adbfb2168ae..275b5edaeae 100644 --- a/storage/connect/tabjdbc.cpp +++ b/storage/connect/tabjdbc.cpp @@ -572,7 +572,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g) if (Memory < 3) { // Method will depend on cursor type - if ((Rbuf = Jcp->Rewind(Query->GetStr())) < 0) + if ((Rbuf = Query ? Jcp->Rewind(Query->GetStr()) : 0) < 0) if (Mode != MODE_READX) { Jcp->Close(); return true; diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 6151d924a9f..9e4f5ab987d 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -195,7 +195,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); if (!(tdp->Database = SetPath(g, db))) - return 0ULL; + return 0; tdp->Objname = GetStringTableOption(g, topt, "Object", NULL); tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0; @@ -243,14 +243,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tjsp = new(g) TDBJSON(tdp, new(g) MAPFAM(tdp)); if (tjsp->MakeDocument(g)) - return 0ULL; + return 0; jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL; } else { if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0))) if (!mgo) { sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty); - return 0ULL; + return 0; } else tdp->Lrecl = 8192; // Should be enough @@ -269,14 +269,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tjnp = new(g) TDBJSN(tdp, new(g) CMGFAM(tdp)); #else sprintf(g->Message, "Mongo %s Driver not available", "C"); - return 0ULL; + return 0; #endif } else if (tdp->Driver && toupper(*tdp->Driver) == 'J') { #if defined(JAVA_SUPPORT) tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp)); #else sprintf(g->Message, "Mongo %s Driver not available", "Java"); - return 0ULL; + return 0; #endif } else { // Driver not specified #if defined(CMGO_SUPPORT) @@ -285,7 +285,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp)); #else sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "MONGO"); - return 0ULL; + return 0; #endif } // endif Driver @@ -304,7 +304,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tjnp->SetG(G); if (tjnp->OpenDB(g)) - return 0ULL; + return 0; switch (tjnp->ReadDB(g)) { case RC_EF: diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index b2dbdd70e06..77f0a1c4001 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -232,7 +232,7 @@ bool TDBTBL::InitTableList(PGLOBAL g) { int n; uint sln; - const char *scs; + const char *scs; PTABLE tp, tabp; PCOL colp; PTBLDEF tdp = (PTBLDEF)To_Def;