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/odbconn.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/odbconn.cpp')
-rw-r--r-- | storage/connect/odbconn.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index ea20672eb29..2f2f5f38c29 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -1,5 +1,5 @@ /************ Odbconn C++ Functions Source Code File (.CPP) ************/ -/* Name: ODBCONN.CPP Version 2.1 */ +/* Name: ODBCONN.CPP Version 2.2 */ /* */ /* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ /* */ @@ -867,8 +867,7 @@ bool DBX::BuildErrorMessage(ODBConn* pdb, HSTMT hstmt) for (int i = 0; i < MAX_NUM_OF_MSG && (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) && strcmp((char*)state, "00000"); i++) { - m_ErrMsg[i] = (PSZ)PlugSubAlloc(g, NULL, strlen((char*)msg) + 1); - strcpy(m_ErrMsg[i], (char*)msg); + m_ErrMsg[i] = (PSZ)PlugDup(g, (char*)msg); if (trace) htrc("%s: %s, Native=%d\n", state, msg, native); @@ -882,8 +881,7 @@ bool DBX::BuildErrorMessage(ODBConn* pdb, HSTMT hstmt) } else { snprintf((char*)msg, SQL_MAX_MESSAGE_LENGTH + 1, "%s: %s", m_Msg, MSG(BAD_HANDLE_VAL)); - m_ErrMsg[0] = (PSZ)PlugSubAlloc(g, NULL, strlen((char*)msg) + 1); - strcpy(m_ErrMsg[0], (char*)msg); + m_ErrMsg[0] = (PSZ)PlugDup(g, (char*)msg); if (trace) htrc("%s: rc=%hd\n", SVP(m_ErrMsg[0]), m_RC); @@ -1012,8 +1010,7 @@ PSZ ODBConn::GetStringInfo(ushort infotype) // *buffer = '\0'; } // endif rc - p = (char *)PlugSubAlloc(m_G, NULL, strlen(buffer) + 1); - strcpy(p, buffer); + p = PlugDup(m_G, buffer); return p; } // end of GetStringInfo |