mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix gcc compiler warnings reported by Sergei
modified: storage/connect/array.cpp modified: storage/connect/array.h modified: storage/connect/blkfil.cpp modified: storage/connect/blkfil.h modified: storage/connect/block.h modified: storage/connect/colblk.cpp modified: storage/connect/colblk.h modified: storage/connect/csort.h modified: storage/connect/filamvct.cpp modified: storage/connect/filter.cpp modified: storage/connect/filter.h modified: storage/connect/global.h modified: storage/connect/json.h modified: storage/connect/plgdbsem.h modified: storage/connect/plgdbutl.cpp modified: storage/connect/tabcol.cpp modified: storage/connect/tabcol.h modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabjson.cpp modified: storage/connect/table.cpp modified: storage/connect/tabodbc.cpp modified: storage/connect/tabodbc.h modified: storage/connect/tabsys.h modified: storage/connect/tabxml.h modified: storage/connect/value.cpp modified: storage/connect/value.h modified: storage/connect/xindex.cpp modified: storage/connect/xindex.h modified: storage/connect/xobject.cpp modified: storage/connect/xobject.h modified: storage/connect/xtable.h Set values as nullable when retrieving catalog info modified: storage/connect/jdbconn.cpp modified: storage/connect/mysql-test/connect/r/odbc_oracle.result modified: storage/connect/odbconn.cpp Change format of Jpath modified: storage/connect/json.cpp modified: storage/connect/jsonudf.cpp modified: storage/connect/mysql-test/connect/r/json.result modified: storage/connect/mysql-test/connect/r/json_udf.result modified: storage/connect/mysql-test/connect/r/json_udf_bin.result modified: storage/connect/mysql-test/connect/r/zip.result modified: storage/connect/mysql-test/connect/t/json.test modified: storage/connect/mysql-test/connect/t/json_udf.test modified: storage/connect/mysql-test/connect/t/json_udf_bin.test modified: storage/connect/mysql-test/connect/t/zip.test modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/tabmgo.cpp Change null representation from ??? to <null> modified: storage/connect/json.cpp Change the name of UDF that are equal to a native JSON function name modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h modified: storage/connect/mysql-test/connect/t/json_udf.inc modified: storage/connect/mysql-test/connect/t/json_udf2.inc Fix bug in making JSON project info modified: storage/connect/mongofam.cpp Fix COMPUTE when one argument is null modified: storage/connect/value.cpp Value is null only when nullable modified: storage/connect/value.h
This commit is contained in:
@@ -35,9 +35,9 @@
|
||||
/***********************************************************************/
|
||||
/* CONDFIL Constructor. */
|
||||
/***********************************************************************/
|
||||
CONDFIL::CONDFIL(const Item *cond, uint idx, AMT type)
|
||||
CONDFIL::CONDFIL(uint idx, AMT type)
|
||||
{
|
||||
Cond = cond;
|
||||
//Cond = cond;
|
||||
Idx = idx;
|
||||
Type = type;
|
||||
Op = OP_XX;
|
||||
@@ -61,7 +61,7 @@ int CONDFIL::Init(PGLOBAL g, PHC hc)
|
||||
bool h;
|
||||
|
||||
if (options)
|
||||
alt = GetListOption(g, "Alias", options->oplist, NULL);
|
||||
alt = (char*)GetListOption(g, "Alias", options->oplist, NULL);
|
||||
|
||||
while (alt) {
|
||||
if (!(p = strchr(alt, '='))) {
|
||||
@@ -267,7 +267,7 @@ TDBEXT::TDBEXT(PTDBEXT tdbp) : TDB(tdbp)
|
||||
/******************************************************************/
|
||||
/* Convert an UTF-8 string to latin characters. */
|
||||
/******************************************************************/
|
||||
int TDBEXT::Decode(char *txt, char *buf, size_t n)
|
||||
int TDBEXT::Decode(PCSZ txt, char *buf, size_t n)
|
||||
{
|
||||
uint dummy_errors;
|
||||
uint32 len = copy_and_convert(buf, n, &my_charset_latin1,
|
||||
@@ -285,20 +285,20 @@ int TDBEXT::Decode(char *txt, char *buf, size_t n)
|
||||
/***********************************************************************/
|
||||
bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
{
|
||||
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3];
|
||||
PCSZ schmp = NULL;
|
||||
char *catp = NULL, buf[NAM_LEN * 3];
|
||||
int len;
|
||||
bool oom = false, first = true;
|
||||
bool first = true;
|
||||
PTABLE tablep = To_Table;
|
||||
PCOL colp;
|
||||
|
||||
if (Srcdef) {
|
||||
if ((catp = strstr(Srcdef, "%s"))) {
|
||||
char *fil1, *fil2;
|
||||
PSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
||||
PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
||||
|
||||
if (!ph)
|
||||
ph = (strstr(catp + 2, "%s")) ? const_cast<char*>("WH") :
|
||||
const_cast<char*>("W");
|
||||
ph = (strstr(catp + 2, "%s")) ? "WH" : "W";
|
||||
|
||||
if (stricmp(ph, "H")) {
|
||||
fil1 = (To_CondFil && *To_CondFil->Body)
|
||||
@@ -342,7 +342,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
for (colp = Columns; colp; colp = colp->GetNext())
|
||||
if (!colp->IsSpecial()) {
|
||||
if (!first)
|
||||
oom |= Query->Append(", ");
|
||||
Query->Append(", ");
|
||||
else
|
||||
first = false;
|
||||
|
||||
@@ -351,11 +351,11 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
|
||||
if (Quote) {
|
||||
// Put column name between identifier quotes in case in contains blanks
|
||||
oom |= Query->Append(Quote);
|
||||
oom |= Query->Append(buf);
|
||||
oom |= Query->Append(Quote);
|
||||
Query->Append(Quote);
|
||||
Query->Append(buf);
|
||||
Query->Append(Quote);
|
||||
} else
|
||||
oom |= Query->Append(buf);
|
||||
Query->Append(buf);
|
||||
|
||||
((PEXTCOL)colp)->SetRank(++Ncol);
|
||||
} // endif colp
|
||||
@@ -363,13 +363,13 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
} else
|
||||
// !Columns can occur for queries such that sql count(*) from...
|
||||
// for which we will count the rows from sql * from...
|
||||
oom |= Query->Append('*');
|
||||
Query->Append('*');
|
||||
|
||||
} else
|
||||
// SQL statement used to retrieve the size of the result
|
||||
oom |= Query->Append("count(*)");
|
||||
Query->Append("count(*)");
|
||||
|
||||
oom |= Query->Append(" FROM ");
|
||||
Query->Append(" FROM ");
|
||||
|
||||
if (Catalog && *Catalog)
|
||||
catp = Catalog;
|
||||
@@ -381,17 +381,17 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
schmp = Schema;
|
||||
|
||||
if (catp) {
|
||||
oom |= Query->Append(catp);
|
||||
Query->Append(catp);
|
||||
|
||||
if (schmp) {
|
||||
oom |= Query->Append('.');
|
||||
oom |= Query->Append(schmp);
|
||||
Query->Append('.');
|
||||
Query->Append(schmp);
|
||||
} // endif schmp
|
||||
|
||||
oom |= Query->Append('.');
|
||||
Query->Append('.');
|
||||
} else if (schmp) {
|
||||
oom |= Query->Append(schmp);
|
||||
oom |= Query->Append('.');
|
||||
Query->Append(schmp);
|
||||
Query->Append('.');
|
||||
} // endif schmp
|
||||
|
||||
// Table name can be encoded in UTF-8
|
||||
@@ -399,18 +399,18 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
|
||||
if (Quote) {
|
||||
// Put table name between identifier quotes in case in contains blanks
|
||||
oom |= Query->Append(Quote);
|
||||
oom |= Query->Append(buf);
|
||||
oom |= Query->Append(Quote);
|
||||
Query->Append(Quote);
|
||||
Query->Append(buf);
|
||||
Query->Append(Quote);
|
||||
} else
|
||||
oom |= Query->Append(buf);
|
||||
Query->Append(buf);
|
||||
|
||||
len = Query->GetLength();
|
||||
|
||||
if (To_CondFil) {
|
||||
if (Mode == MODE_READ) {
|
||||
oom |= Query->Append(" WHERE ");
|
||||
oom |= Query->Append(To_CondFil->Body);
|
||||
Query->Append(" WHERE ");
|
||||
Query->Append(To_CondFil->Body);
|
||||
len = Query->GetLength() + 1;
|
||||
} else
|
||||
len += (strlen(To_CondFil->Body) + 256);
|
||||
@@ -418,10 +418,11 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
} else
|
||||
len += ((Mode == MODE_READX) ? 256 : 1);
|
||||
|
||||
if (oom || Query->Resize(len)) {
|
||||
if (Query->IsTruncated()) {
|
||||
strcpy(g->Message, "MakeSQL: Out of memory");
|
||||
return true;
|
||||
} // endif oom
|
||||
} else
|
||||
Query->Resize(len);
|
||||
|
||||
if (trace)
|
||||
htrc("Query=%s\n", Query->GetStr());
|
||||
@@ -435,15 +436,17 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
||||
/***********************************************************************/
|
||||
bool TDBEXT::MakeCommand(PGLOBAL g)
|
||||
{
|
||||
char *p, *stmt, name[68], *body = NULL;
|
||||
PCSZ schmp = NULL;
|
||||
char *p, *stmt, name[132], *body = NULL;
|
||||
char *qrystr = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 1);
|
||||
bool qtd = Quoted > 0;
|
||||
char q = qtd ? *Quote : ' ';
|
||||
int i = 0, k = 0;
|
||||
|
||||
// Make a lower case copy of the originale query and change
|
||||
// back ticks to the data source identifier quoting character
|
||||
do {
|
||||
qrystr[i] = (Qrystr[i] == '`') ? *Quote : tolower(Qrystr[i]);
|
||||
qrystr[i] = (Qrystr[i] == '`') ? q : tolower(Qrystr[i]);
|
||||
} while (Qrystr[i++]);
|
||||
|
||||
if (To_CondFil && (p = strstr(qrystr, " where "))) {
|
||||
@@ -460,27 +463,50 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
|
||||
strlwr(strcat(strcat(strcpy(name, " "), Name), " "));
|
||||
|
||||
if (strstr(" update delete low_priority ignore quick from ", name)) {
|
||||
strlwr(strcat(strcat(strcpy(name, Quote), Name), Quote));
|
||||
k += 2;
|
||||
if (Quote) {
|
||||
strlwr(strcat(strcat(strcpy(name, Quote), Name), Quote));
|
||||
k += 2;
|
||||
} else {
|
||||
strcpy(g->Message, "Quoted must be specified");
|
||||
return true;
|
||||
} // endif Quote
|
||||
|
||||
} else
|
||||
strlwr(strcpy(name, Name)); // Not a keyword
|
||||
|
||||
if ((p = strstr(qrystr, name))) {
|
||||
for (i = 0; i < p - qrystr; i++)
|
||||
stmt[i] = (Qrystr[i] == '`') ? *Quote : Qrystr[i];
|
||||
stmt[i] = (Qrystr[i] == '`') ? q : Qrystr[i];
|
||||
|
||||
stmt[i] = 0;
|
||||
|
||||
k += i + (int)strlen(Name);
|
||||
|
||||
if (qtd && *(p - 1) == ' ')
|
||||
if (Schema && *Schema)
|
||||
schmp = Schema;
|
||||
|
||||
if (qtd && *(p - 1) == ' ') {
|
||||
if (schmp)
|
||||
strcat(strcat(stmt, schmp), ".");
|
||||
|
||||
strcat(strcat(strcat(stmt, Quote), TableName), Quote);
|
||||
else
|
||||
} else {
|
||||
if (schmp) {
|
||||
if (qtd && *(p - 1) != ' ') {
|
||||
stmt[i - 1] = 0;
|
||||
strcat(strcat(strcat(stmt, schmp), "."), Quote);
|
||||
} else
|
||||
strcat(strcat(stmt, schmp), ".");
|
||||
|
||||
} // endif schmp
|
||||
|
||||
strcat(stmt, TableName);
|
||||
} // endif's
|
||||
|
||||
i = (int)strlen(stmt);
|
||||
|
||||
do {
|
||||
stmt[i++] = (Qrystr[k] == '`') ? *Quote : Qrystr[k];
|
||||
stmt[i++] = (Qrystr[k] == '`') ? q : Qrystr[k];
|
||||
} while (Qrystr[k++]);
|
||||
|
||||
if (body)
|
||||
@@ -539,7 +565,7 @@ int TDBEXT::GetProgMax(PGLOBAL g)
|
||||
/***********************************************************************/
|
||||
/* EXTCOL public constructor. */
|
||||
/***********************************************************************/
|
||||
EXTCOL::EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
||||
EXTCOL::EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||
: COLBLK(cdp, tdbp, i)
|
||||
{
|
||||
if (cprec) {
|
||||
|
Reference in New Issue
Block a user