summaryrefslogtreecommitdiff
path: root/storage/connect/libdoc.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-03-18 13:30:14 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2015-03-18 13:30:14 +0100
commit2bb42803df520285dacd753f728ed21994027116 (patch)
tree7eb4d32d2c91cda4d0959a42035fd11966ad8d04 /storage/connect/libdoc.cpp
parent57aaccef52c22760450f02618213ec90ba0e873e (diff)
downloadmariadb-git-2bb42803df520285dacd753f728ed21994027116.tar.gz
This commit includes changes done in a previous (deleted) branch plus new ones.
From the previous branch: commit eda4928ff122a0845baf5ade83b4aa29244a3a89 Author: Olivier Bertrand <bertrandop@gmail.com> Date: Mon Mar 9 22:34:56 2015 +0100 - Add discovery to JSON tables When columns are not defined, CONNECT analyses the json file to find column definitions. This wors only on table that are an array of objects. Pair keys are used to generate the column names and pair values are used for its definition. When the LEVEL option is defined as a not null integer, the eventual JPATH is scanned up to the LEVEL value. From the current one: - Fix MDEV-7521 when column names are utf8 encoded (not a general multi-charset fix) - Adds more to JSON discovery processing and UDF's - Use PlugDup everywhere it replaces PlugSubAlloc + strcpy.
Diffstat (limited to 'storage/connect/libdoc.cpp')
-rw-r--r--storage/connect/libdoc.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp
index e576c1cf5fa..e5c0ee6cfff 100644
--- a/storage/connect/libdoc.cpp
+++ b/storage/connect/libdoc.cpp
@@ -1,6 +1,6 @@
/******************************************************************/
/* Implementation of XML document processing using libxml2 */
-/* Author: Olivier Bertrand 2007-2013 */
+/* Author: Olivier Bertrand 2007-2015 */
/******************************************************************/
#include "my_global.h"
#include <string.h>
@@ -408,8 +408,7 @@ PFBLOCK LIBXMLDOC::LinkXblock(PGLOBAL g, MODE m, int rc, char *fn)
xp->Next = (PX2BLOCK)dup->Openlist;
dup->Openlist = (PFBLOCK)xp;
xp->Type = TYPE_FB_XML2;
- xp->Fname = (LPCSTR)PlugSubAlloc(g, NULL, strlen(fn) + 1);
- strcpy((char*)xp->Fname, fn);
+ xp->Fname = (LPCSTR)PlugDup(g, fn);
xp->Count = 1;
xp->Length = (m == MODE_READ) ? 1 : 0;
xp->Retcode = rc;