mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Fix MDEV-15735 CONNECT [filamtxt.cpp:429]: Suspicious condition
modified: storage/connect/filamtxt.cpp - Fix MDEV-15577 CONNECT engine JDBC remote index prevents UPDATE Fixed in TDBJDBC::OpenDB because query can be null for updates modified: storage/connect/tabjdbc.cpp - Fix wrong updates of 10.3 distribution modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/tabjson.cpp - Typo from 10.3 modified: storage/connect/mycat.cc modified: storage/connect/tabext.cpp modified: storage/connect/tabtbl.cpp modified: storage/connect/user_connect.cc
This commit is contained in:
@@ -427,7 +427,7 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g)
|
|||||||
|
|
||||||
for (i = 0; i < Posar->GetNval(); i++) {
|
for (i = 0; i < Posar->GetNval(); i++) {
|
||||||
if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]),
|
if ((irc = InitDelete(g, Posar->GetIntValue(ix[i]),
|
||||||
Sosar->GetIntValue(ix[i])) == RC_FX))
|
Sosar->GetIntValue(ix[i]))) == RC_FX)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
// Now delete the sorted rows
|
// Now delete the sorted rows
|
||||||
|
@@ -108,13 +108,8 @@
|
|||||||
#define MYSQL_SERVER 1
|
#define MYSQL_SERVER 1
|
||||||
#define DONT_DEFINE_VOID
|
#define DONT_DEFINE_VOID
|
||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
#include "sql_class.h"
|
|
||||||
#include "create_options.h"
|
|
||||||
#include "mysql_com.h"
|
|
||||||
#include "field.h"
|
|
||||||
#include "sql_parse.h"
|
#include "sql_parse.h"
|
||||||
#include "sql_base.h"
|
#include "sql_base.h"
|
||||||
#include <sys/stat.h>
|
|
||||||
#include "sql_partition.h"
|
#include "sql_partition.h"
|
||||||
#undef OFFSET
|
#undef OFFSET
|
||||||
|
|
||||||
@@ -175,7 +170,7 @@
|
|||||||
#define JSONMAX 10 // JSON Default max grp size
|
#define JSONMAX 10 // JSON Default max grp size
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char version[]= "Version 1.06.0007 March 11, 2018";
|
char version[]= "Version 1.06.0007 May 01, 2018";
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
char compver[]= "Version 1.06.0007 " __DATE__ " " __TIME__;
|
char compver[]= "Version 1.06.0007 " __DATE__ " " __TIME__;
|
||||||
char slash= '\\';
|
char slash= '\\';
|
||||||
@@ -238,7 +233,7 @@ uint GetWorkSize(void);
|
|||||||
void SetWorkSize(uint);
|
void SetWorkSize(uint);
|
||||||
extern "C" const char *msglang(void);
|
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 void PopUser(PCONNECT xp);
|
||||||
static PCONNECT GetUser(THD *thd, 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")) {
|
if (!stricmp(opname, "Connect")) {
|
||||||
LEX_CSTRING cnc= (tshp) ? tshp->connect_string
|
LEX_CSTRING cnc= (tshp) ? tshp->connect_string
|
||||||
: table->s->connect_string;
|
: table->s->connect_string;
|
||||||
|
|
||||||
if (cnc.length)
|
if (cnc.length)
|
||||||
opval= strz(xp->g, cnc);
|
opval= strz(xp->g, cnc);
|
||||||
@@ -5571,7 +5566,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
} // endif p
|
} // endif p
|
||||||
|
|
||||||
} else if (ttp != TAB_ODBC || !(fnc & (FNC_TABLE | FNC_COL)))
|
} 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
|
} // endif tab
|
||||||
|
|
||||||
|
@@ -41,8 +41,6 @@ static PJSON JsonNew(PGLOBAL g, JTYP type);
|
|||||||
static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL);
|
static PJVAL JvalNew(PGLOBAL g, JTYP type, void *vp = NULL);
|
||||||
static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64);
|
static PJSNX JsnxNew(PGLOBAL g, PJSON jsp, int type, int len = 64);
|
||||||
|
|
||||||
void json_array_deinit(UDF_INIT* initid);
|
|
||||||
|
|
||||||
static uint JsonGrpSize = 10;
|
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];
|
int j = 0, n = args->attribute_lengths[i];
|
||||||
my_bool b; // true if attribute is zero terminated
|
my_bool b; // true if attribute is zero terminated
|
||||||
PSZ p;
|
PSZ p;
|
||||||
const char *s = args->attributes[i];
|
PCSZ s = args->attributes[i];
|
||||||
|
|
||||||
if (s && *s && (n || *s == '\'')) {
|
if (s && *s && (n || *s == '\'')) {
|
||||||
if ((b = (!n || !s[n])))
|
if ((b = (!n || !s[n])))
|
||||||
@@ -1688,7 +1686,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
|||||||
} // endif *s
|
} // endif *s
|
||||||
|
|
||||||
if (n < 1)
|
if (n < 1)
|
||||||
return (char*) "Key";
|
return "Key";
|
||||||
|
|
||||||
if (!b) {
|
if (!b) {
|
||||||
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
|
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
|
||||||
@@ -1702,10 +1700,10 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
|||||||
|
|
||||||
} // endif s
|
} // endif s
|
||||||
|
|
||||||
return (char*) s;
|
return s;
|
||||||
} // endif count
|
} // endif count
|
||||||
|
|
||||||
return (char*) "Key";
|
return "Key";
|
||||||
} // end of MakeKey
|
} // end of MakeKey
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
/* ------------- */
|
/* ------------- */
|
||||||
/* Version 1.6 */
|
/* Version 1.6 */
|
||||||
/* */
|
/* */
|
||||||
/* Author: Olivier Bertrand 2012 - 2017 */
|
/* Author: Olivier Bertrand 2012 - 2018 */
|
||||||
/* */
|
/* */
|
||||||
/* WHAT THIS PROGRAM DOES: */
|
/* WHAT THIS PROGRAM DOES: */
|
||||||
/* ----------------------- */
|
/* ----------------------- */
|
||||||
@@ -31,10 +31,7 @@
|
|||||||
#define DONT_DEFINE_VOID
|
#define DONT_DEFINE_VOID
|
||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
|
|
||||||
#if defined(__WIN__)
|
#if defined(UNIX)
|
||||||
//#include <windows.h>
|
|
||||||
//#include <sqlext.h>
|
|
||||||
#elif defined(UNIX)
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -286,7 +286,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g)
|
|||||||
char *catp = strstr(Srcdef, "%s");
|
char *catp = strstr(Srcdef, "%s");
|
||||||
|
|
||||||
if (catp) {
|
if (catp) {
|
||||||
char *fil1= 0, *fil2;
|
char *fil1 = 0, *fil2;
|
||||||
PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
||||||
|
|
||||||
if (!ph)
|
if (!ph)
|
||||||
|
@@ -572,7 +572,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
|
|||||||
|
|
||||||
if (Memory < 3) {
|
if (Memory < 3) {
|
||||||
// Method will depend on cursor type
|
// 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) {
|
if (Mode != MODE_READX) {
|
||||||
Jcp->Close();
|
Jcp->Close();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -195,7 +195,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
|||||||
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
|
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
|
||||||
|
|
||||||
if (!(tdp->Database = SetPath(g, db)))
|
if (!(tdp->Database = SetPath(g, db)))
|
||||||
return 0ULL;
|
return 0;
|
||||||
|
|
||||||
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
|
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
|
||||||
tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0;
|
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));
|
tjsp = new(g) TDBJSON(tdp, new(g) MAPFAM(tdp));
|
||||||
|
|
||||||
if (tjsp->MakeDocument(g))
|
if (tjsp->MakeDocument(g))
|
||||||
return 0ULL;
|
return 0;
|
||||||
|
|
||||||
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
|
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
|
||||||
} else {
|
} else {
|
||||||
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
|
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
|
||||||
if (!mgo) {
|
if (!mgo) {
|
||||||
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
|
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
|
||||||
return 0ULL;
|
return 0;
|
||||||
} else
|
} else
|
||||||
tdp->Lrecl = 8192; // Should be enough
|
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));
|
tjnp = new(g) TDBJSN(tdp, new(g) CMGFAM(tdp));
|
||||||
#else
|
#else
|
||||||
sprintf(g->Message, "Mongo %s Driver not available", "C");
|
sprintf(g->Message, "Mongo %s Driver not available", "C");
|
||||||
return 0ULL;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
} else if (tdp->Driver && toupper(*tdp->Driver) == 'J') {
|
} else if (tdp->Driver && toupper(*tdp->Driver) == 'J') {
|
||||||
#if defined(JAVA_SUPPORT)
|
#if defined(JAVA_SUPPORT)
|
||||||
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
|
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
|
||||||
#else
|
#else
|
||||||
sprintf(g->Message, "Mongo %s Driver not available", "Java");
|
sprintf(g->Message, "Mongo %s Driver not available", "Java");
|
||||||
return 0ULL;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
} else { // Driver not specified
|
} else { // Driver not specified
|
||||||
#if defined(CMGO_SUPPORT)
|
#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));
|
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
|
||||||
#else
|
#else
|
||||||
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "MONGO");
|
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "MONGO");
|
||||||
return 0ULL;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
} // endif Driver
|
} // endif Driver
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
|||||||
tjnp->SetG(G);
|
tjnp->SetG(G);
|
||||||
|
|
||||||
if (tjnp->OpenDB(g))
|
if (tjnp->OpenDB(g))
|
||||||
return 0ULL;
|
return 0;
|
||||||
|
|
||||||
switch (tjnp->ReadDB(g)) {
|
switch (tjnp->ReadDB(g)) {
|
||||||
case RC_EF:
|
case RC_EF:
|
||||||
|
@@ -232,7 +232,7 @@ bool TDBTBL::InitTableList(PGLOBAL g)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
uint sln;
|
uint sln;
|
||||||
const char *scs;
|
const char *scs;
|
||||||
PTABLE tp, tabp;
|
PTABLE tp, tabp;
|
||||||
PCOL colp;
|
PCOL colp;
|
||||||
PTBLDEF tdp = (PTBLDEF)To_Def;
|
PTBLDEF tdp = (PTBLDEF)To_Def;
|
||||||
|
Reference in New Issue
Block a user