diff options
Diffstat (limited to 'storage/connect/tabxml.cpp')
-rw-r--r-- | storage/connect/tabxml.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 19490d350e8..489fcae303b 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -218,8 +218,8 @@ 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,6 +234,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; @@ -694,7 +695,7 @@ PTDB TDBXML::Clone(PTABS t) /***********************************************************************/ const CHARSET_INFO *TDBXML::data_charset() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } // end of data_charset /***********************************************************************/ @@ -1268,7 +1269,7 @@ int TDBXML::ReadDB(PGLOBAL g) /***********************************************************************/ bool TDBXML::CheckRow(PGLOBAL g, bool b) { - if (NewRow && Mode == MODE_INSERT) + if (NewRow && Mode == MODE_INSERT) { if (Rowname) { TabNode->AddText(g, "\n\t"); RowNode = TabNode->AddChildNode(g, Rowname, RowNode); @@ -1276,6 +1277,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); @@ -1522,12 +1524,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->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 @@ -1773,11 +1776,12 @@ void XMLCOL::WriteColumn(PGLOBAL g) else break; - if (ColNode) + 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 @@ -1790,7 +1794,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) /* Create missing nodes. */ /*********************************************************************/ if (ColNode == NULL) { - if (TopNode == NULL) + if (TopNode == NULL) { if (Tdbp->Clist) { Tdbp->RowNode->AddText(g, "\n\t\t"); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); @@ -1798,7 +1802,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"); @@ -2012,7 +2016,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) TopNode = ColNode; } // endfor k - if (ColNode) + if (ColNode) { if (Inod == Nod) { /***************************************************************/ /* The node value can be multiple. */ @@ -2034,7 +2038,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) 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) @@ -2046,7 +2050,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) /* Create missing nodes. */ /*********************************************************************/ if (ColNode == NULL) { - if (TopNode == NULL) + if (TopNode == NULL) { if (Tdbp->Clist) { Tdbp->RowNode->AddText(g, "\n\t\t"); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); @@ -2054,7 +2058,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) TopNode = ColNode; } else TopNode = Tdbp->RowNode; - + } for (; k < Nod && TopNode; k++) { if (!done) { TopNode->AddText(g, "\n\t\t"); |