Commit 4d4ba60c authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix MDEV-13463 unescape table name during detection of table structure

  modified:   storage/connect/myconn.cpp

- Remove a few gcc warnings
  modified:   storage/connect/jmgoconn.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/tabjson.cpp
parent 017d9ccf
...@@ -732,7 +732,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp) ...@@ -732,7 +732,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
return RC_FX; return RC_FX;
if (env->CallBooleanMethod(job, docaddid, updlist, jkey, val)) if (env->CallBooleanMethod(job, docaddid, updlist, jkey, val))
return NULL; return RC_OK;
env->DeleteLocalRef(jkey); env->DeleteLocalRef(jkey);
} // endfor colp } // endfor colp
...@@ -742,7 +742,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp) ...@@ -742,7 +742,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
jkey = env->NewStringUTF("$set"); jkey = env->NewStringUTF("$set");
if (env->CallBooleanMethod(job, docaddid, upd, jkey, updlist)) if (env->CallBooleanMethod(job, docaddid, upd, jkey, updlist))
return NULL; return RC_OK;
env->DeleteLocalRef(jkey); env->DeleteLocalRef(jkey);
......
...@@ -53,6 +53,8 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char *fn, int pretty); ...@@ -53,6 +53,8 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char *fn, int pretty);
bool SerializeArray(JOUT *js, PJAR jarp, bool b); bool SerializeArray(JOUT *js, PJAR jarp, bool b);
bool SerializeObject(JOUT *js, PJOB jobp); bool SerializeObject(JOUT *js, PJOB jobp);
bool SerializeValue(JOUT *js, PJVAL jvp); bool SerializeValue(JOUT *js, PJVAL jvp);
bool IsNum(PSZ s);
char *NextChr(PSZ s, char sep);
/***********************************************************************/ /***********************************************************************/
/* Class JOUT. Used by Serialize. */ /* Class JOUT. Used by Serialize. */
......
...@@ -139,7 +139,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db, ...@@ -139,7 +139,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
unsigned int length[] = {0, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0}; unsigned int length[] = {0, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
PCSZ fmt; PCSZ fmt;
char *fld, *colname, *chset, v, buf[128], uns[16], zero[16]; char *fld, *colname, *chset, v, buf[128], uns[16], zero[16];
int i, n, nf, ncol = sizeof(buftyp) / sizeof(int); int i, n, nf = 0, ncol = sizeof(buftyp) / sizeof(int);
int len, type, prec, rc, k = 0; int len, type, prec, rc, k = 0;
bool b; bool b;
PQRYRES qrp; PQRYRES qrp;
...@@ -160,7 +160,9 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db, ...@@ -160,7 +160,9 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
/* Do an evaluation of the result size. */ /* Do an evaluation of the result size. */
/********************************************************************/ /********************************************************************/
STRING cmd(g, 64, "SHOW FULL COLUMNS FROM "); STRING cmd(g, 64, "SHOW FULL COLUMNS FROM ");
b = cmd.Append((PSZ)table); b = cmd.Append('`');
b |= cmd.Append((PSZ)table);
b |= cmd.Append('`');
b |= cmd.Append(" FROM "); b |= cmd.Append(" FROM ");
b |= cmd.Append((PSZ)(db ? db : PlgGetUser(g)->DBName)); b |= cmd.Append((PSZ)(db ? db : PlgGetUser(g)->DBName));
......
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
/* External functions. */ /* External functions. */
/***********************************************************************/ /***********************************************************************/
USETEMP UseTemp(void); USETEMP UseTemp(void);
bool IsNum(PSZ s);
char *NextChr(PSZ s, char sep);
char *GetJsonNull(void); char *GetJsonNull(void);
typedef struct _jncol { typedef struct _jncol {
......
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