diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-27 08:45:36 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-27 08:45:36 +0100 |
commit | 9b4a179d69a1c795bef303a88f9d3195669f00ec (patch) | |
tree | 87811d81af231e2945468ead0cba58cfc5514548 /storage/connect/tabxml.cpp | |
parent | 020dc54dabe64f238e8ef4f50a630a22e0f06949 (diff) | |
parent | 7db489fc7dea2b4c236807035e57f169074c6682 (diff) | |
download | mariadb-git-10.3-merge.tar.gz |
Merge branch '10.2' into bb-10.3-release10.3-merge
Diffstat (limited to 'storage/connect/tabxml.cpp')
-rw-r--r-- | storage/connect/tabxml.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index cb428f5a94c..7357d2373c8 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) { |