1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixed compiler warnings from gcc 7.4.1

- Fixed possible error in rocksdb/rdb_datadic.cc
This commit is contained in:
Monty
2020-01-29 16:41:04 +02:00
parent cd2c0e013c
commit 4d61f1247a
47 changed files with 282 additions and 197 deletions

View File

@@ -218,8 +218,10 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
while (true) {
if (!vp->atp &&
!(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL)
: NULL))
!(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ?
node : NULL)
: NULL))
{
if (j) {
vp = lvlp[--j];
@@ -234,7 +236,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
continue;
} else
break;
}
xcol->Name[vp->n] = 0;
fmt[vp->m] = 0;
@@ -248,6 +250,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
switch (vp->atp->GetText(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
/* falls through */
case RC_OK:
strncat(fmt, "@", XLEN(fmt));
break;
@@ -308,6 +311,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
switch (node->GetContent(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
/* falls through */
case RC_OK:
xcol->Cbn = !strlen(buf);
break;
@@ -1271,6 +1275,7 @@ int TDBXML::ReadDB(PGLOBAL g)
bool TDBXML::CheckRow(PGLOBAL g, bool b)
{
if (NewRow && Mode == MODE_INSERT)
{
if (Rowname) {
TabNode->AddText(g, "\n\t");
RowNode = TabNode->AddChildNode(g, Rowname, RowNode);
@@ -1278,6 +1283,7 @@ bool TDBXML::CheckRow(PGLOBAL g, bool b)
strcpy(g->Message, MSG(NO_ROW_NODE));
return true;
} // endif Rowname
}
if (Colname && (NewRow || b))
Clist = RowNode->SelectNodes(g, Colname, Clist);
@@ -1525,11 +1531,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode)
// Analyze the Xpath for this column
for (i = 0, p = pbuf; (p2 = strchr(p, '/')); i++, p = p2 + 1) {
if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p))
{
if (!Tdbp->Xpand && mode) {
strcpy(g->Message, MSG(CONCAT_SUBNODE));
return true;
} else
Inod = i; // Index of multiple node
}
if (mode) {
// For Update or Insert the Xpath must be explicit
@@ -1776,10 +1784,12 @@ void XMLCOL::WriteColumn(PGLOBAL g)
break;
if (ColNode)
{
if (Type)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else
AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
if (TopNode || ValNode || AttNode)
break; // We found the good column
@@ -1793,6 +1803,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
/*********************************************************************/
if (ColNode == NULL) {
if (TopNode == NULL)
{
if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
@@ -1800,7 +1811,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode;
} else
TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) {
if (!done) {
TopNode->AddText(g, "\n\t\t");
@@ -2015,6 +2026,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
} // endfor k
if (ColNode)
{
if (Inod == Nod) {
/***************************************************************/
/* The node value can be multiple. */
@@ -2032,11 +2044,13 @@ void XMULCOL::WriteColumn(PGLOBAL g)
ValNode = Nlx->GetItem(g, Tdbp->Nsub, Vxnp);
} else // Inod != Nod
{
if (Type)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else
AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
}
if (TopNode || ValNode || AttNode)
break; // We found the good column
else if (Tdbp->Clist)
@@ -2049,6 +2063,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
/*********************************************************************/
if (ColNode == NULL) {
if (TopNode == NULL)
{
if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
@@ -2056,6 +2071,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode;
} else
TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) {
if (!done) {