summaryrefslogtreecommitdiff
path: root/storage/connect/tabxml.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2020-10-18 17:20:44 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2020-10-18 17:20:44 +0200
commitdc3a693b7039cb4b1d46d797ca86364ac3173be7 (patch)
tree90f1f7c314a0df94d7ad57d59eac82c8cf50a218 /storage/connect/tabxml.cpp
parent5d2ddef26e3fce9784e4befb9e2e0960ff2434cd (diff)
downloadmariadb-git-dc3a693b7039cb4b1d46d797ca86364ac3173be7.tar.gz
- Inline MakePtr and MakeOff with OFFSET as size_t
Also add a new member Saved_Size in the Global structure. modified: storage/connect/global.h modified: storage/connect/plugutil.cpp modified: storage/connect/user_connect.cc modified: storage/connect/jsonudf.cpp - Add session variables json_all_path and default_depth modified: storage/connect/ha_connect.cc modified: storage/connect/mongo.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/tabxml.cpp - ADD column options JPATH and XPATH Work as FIELD_FORMAT but are more readable modified: storage/connect/ha_connect.cc modified: storage/connect/ha_connect.h modified: storage/connect/mysql-test/connect/r/json_java_2.result modified: storage/connect/mysql-test/connect/r/json_java_3.result modified: storage/connect/mysql-test/connect/r/json_mongo_c.result - Handle negative numbes in the option list modified: storage/connect/ha_connect.cc - Fix Json parse that could crash the server. Was because it could use THROW out of the TRY block. Also handle all error by THROW. It is now done by a new class JSON. modified: storage/connect/json.cpp modified: storage/connect/json.h - Add a new UDF function jfile_translate. It translate a Json file to pretty = 0. Fast because it does not a real parse of the file. modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h - Add a now options JSIZE and STRINGIFY to Json tables. STRINGIFY makes Objects or Arrays to be returned by their json representation instead of by their concatenated values. JSIZE allows to specify the LRECL (was 256) defaults to 1024. Also fix a bug about locating the sub-table by its path. modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h
Diffstat (limited to 'storage/connect/tabxml.cpp')
-rw-r--r--storage/connect/tabxml.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp
index fa140ea0699..6c9e9597cec 100644
--- a/storage/connect/tabxml.cpp
+++ b/storage/connect/tabxml.cpp
@@ -3,7 +3,7 @@
/* ------------- */
/* Version 3.0 */
/* */
-/* Author Olivier BERTRAND 2007 - 2017 */
+/* Author Olivier BERTRAND 2007 - 2020 */
/* */
/* This program are the XML tables classes using MS-DOM or libxml2. */
/***********************************************************************/
@@ -62,6 +62,8 @@ extern "C" char version[];
#define TYPE_UNKNOWN 12 /* Must be greater than other types */
#define XLEN(M) sizeof(M) - strlen(M) - 1 /* To avoid overflow*/
+int GetDefaultDepth(void);
+
/***********************************************************************/
/* Class and structure used by XMLColumns. */
/***********************************************************************/
@@ -149,7 +151,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
strcpy(g->Message, MSG(MISSING_FNAME));
return NULL;
} else {
- lvl = GetIntegerTableOption(g, topt, "Level", 0);
+ lvl = GetIntegerTableOption(g, topt, "Level", GetDefaultDepth());
lvl = GetIntegerTableOption(g, topt, "Depth", lvl);
lvl = (lvl < 0) ? 0 : (lvl > 16) ? 16 : lvl;
} // endif fn