diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-29 15:41:05 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-29 15:41:05 +0100 |
commit | 41a163ac5ccf4ac5394edc84e40b3f47acea6b08 (patch) | |
tree | 60d5259e290b4a0166d8ef1651975b14b5afe304 /storage/connect/tabxml.cpp | |
parent | a85d942be9008cf19086d8bd330c4be83a18167f (diff) | |
parent | e2b50213cf12623da31c8b49be4d40772876223c (diff) | |
download | mariadb-git-41a163ac5ccf4ac5394edc84e40b3f47acea6b08.tar.gz |
Merge branch '10.2' into 10.3mariadb-10.3.33
Diffstat (limited to 'storage/connect/tabxml.cpp')
-rw-r--r-- | storage/connect/tabxml.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index cb428f5a94c..f17f5278c96 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -1511,9 +1511,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) if (!mode) // Take care of an eventual extra column node a la html if (Tdbp->Colname) { - sprintf(pbuf, Tdbp->Colname, Rank + ((Tdbp->Usedom) ? 0 : 1)); - strcat(pbuf, "/"); - } // endif Colname + char *p = strstr(Tdbp->Colname, "%d"); + if (p) + snprintf(pbuf, len + 3, "%.*s%d%s/", (int) (p - Tdbp->Colname), Tdbp->Colname, + Rank + (Tdbp->Usedom ? 0 : 1), p + 2); + else + snprintf(pbuf, len + 3, "%s/", Tdbp->Colname); + } // endif Colname if (Xname) { if (Type == 2) { @@ -1799,6 +1803,9 @@ void XMLCOL::WriteColumn(PGLOBAL g) else if (Tdbp->Clist) ColNode = NULL; + // refresh CList in case its Listp was freed in SelectSingleNode above + if (Tdbp->Clist) + Tdbp->RowNode->SelectNodes(g, Tdbp->Colname, Tdbp->Clist); } // endfor i /*********************************************************************/ |