diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-03-18 13:30:14 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-03-18 13:30:14 +0100 |
commit | 2bb42803df520285dacd753f728ed21994027116 (patch) | |
tree | 7eb4d32d2c91cda4d0959a42035fd11966ad8d04 /storage/connect/taboccur.cpp | |
parent | 57aaccef52c22760450f02618213ec90ba0e873e (diff) | |
download | mariadb-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/taboccur.cpp')
-rw-r--r-- | storage/connect/taboccur.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/storage/connect/taboccur.cpp b/storage/connect/taboccur.cpp index f34d5f9bb11..82c4f888833 100644 --- a/storage/connect/taboccur.cpp +++ b/storage/connect/taboccur.cpp @@ -1,7 +1,7 @@ /************ TabOccur CPP Declares Source Code File (.CPP) ************/ /* Name: TABOCCUR.CPP Version 1.1 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2013 */ +/* (C) Copyright to the author Olivier BERTRAND 2013 - 2015 */ /* */ /* OCCUR: Table that provides a view of a source table where the */ /* contain of several columns of the source table is placed in only */ @@ -93,8 +93,7 @@ bool OcrColumns(PGLOBAL g, PQRYRES qrp, const char *col, } // endif col // Prepare the column list - colist = (char*)PlugSubAlloc(g, NULL, strlen(col) + 1); - strcpy(colist, col); + colist = PlugDup(g, col); m = PrepareColist(colist); if ((rk = (rank && *rank))) { @@ -191,8 +190,7 @@ bool OcrSrcCols(PGLOBAL g, PQRYRES qrp, const char *col, } // endif col // Prepare the column list - colist = (char*)PlugSubAlloc(g, NULL, strlen(col) + 1); - strcpy(colist, col); + colist = PlugDup(g, col); m = PrepareColist(colist); if ((rk = (rank && *rank))) |