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

- Fix conversion bug for MS-DOM XML tables. The node content was written

and read as if the table DATA_CHARSET was ANSI instead of UTF-8. Warning
  are now provided when the read content of a node is truncated.

modified:
  storage/connect/domdoc.cpp
  storage/connect/domdoc.h
  storage/connect/libdoc.cpp
  storage/connect/libdoc.h
  storage/connect/plgxml.h
  storage/connect/tabxml.cpp

- Conditional compilation of pre_create depending on the MARIADB setting.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
This commit is contained in:
Olivier Bertrand
2013-03-02 17:58:18 +01:00
parent 8c8fe2f3a6
commit 5972b56a6d
8 changed files with 91 additions and 27 deletions

View File

@@ -463,8 +463,10 @@ PXNODE XML2NODE::GetChild(PGLOBAL g)
/******************************************************************/
/* Return the content of a node and subnodes. */
/******************************************************************/
char *XML2NODE::GetText(char *buf, int len)
RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
{
RCODE rc = RC_OK;
if (Content)
xmlFree(Content);
@@ -474,18 +476,24 @@ char *XML2NODE::GetText(char *buf, int len)
bool b = false;
// Copy content eliminating extra characters
for (; *p1 && (p2 - buf) < len; p1++)
if (strchr(extra, *p1)) {
if (b) {
// This to have one blank between sub-nodes
*p2++ = ' ';
b = false;
} // endif b
for (; *p1; p1++)
if ((p2 - buf) < len) {
if (strchr(extra, *p1)) {
if (b) {
// This to have one blank between sub-nodes
*p2++ = ' ';
b = false;
} // endif b
} else {
*p2++ = *p1;
b = true;
} // endif p1
} else {
*p2++ = *p1;
b = true;
} // endif p1
sprintf(g->Message, "Truncated %s content", Nodep->name);
rc = RC_INFO;
} // endif len
*p2 = 0;
@@ -497,7 +505,7 @@ char *XML2NODE::GetText(char *buf, int len)
} else
*buf = '\0';
return buf;
return rc;
} // end of GetText
/******************************************************************/