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

- Fix MDEV-7489 (in add_field)

modified:
  storage/connect/ha_connect.cc

- Fix MDEV-7494 (adding Insert_quoted in the STRING class)
modified:
  storage/connect/tabmysql.cpp
  storage/connect/xobject.cpp
  storage/connect/xobject.h

- Fix MDEV-7498 in value.cpp (AllocateValue)
modified:
  storage/connect/value.cpp

- Handle backslash in Json serialize + uchar + typo.
modified:
  storage/connect/json.cpp
  storage/connect/tabjson.cpp
This commit is contained in:
Olivier Bertrand
2015-01-23 17:54:53 +01:00
parent e576772383
commit dc091a2935
7 changed files with 55 additions and 20 deletions

View File

@@ -312,18 +312,19 @@ err:
/***********************************************************************/
char *ParseString(PGLOBAL g, int& i, STRG& src)
{
char *p, *s = src.str;
int n = 0, len = src.len;
char *s = src.str;
uchar *p;
int n = 0, len = src.len;
// The size to allocate is not known yet
p = (char*)PlugSubAlloc(g, NULL, 0);
p = (uchar*)PlugSubAlloc(g, NULL, 0);
for (; i < len; i++)
switch (s[i]) {
case '"':
p[n++] = 0;
PlugSubAlloc(g, NULL, n);
return p;
return (char*)p;
case '\\':
if (++i < len) {
if (s[i] == 'u') {
@@ -675,12 +676,13 @@ bool JOUTSTR::Escape(const char *s)
for (unsigned int i = 0; i < strlen(s); i++)
switch (s[i]) {
case '"':
case '\\':
case '\t':
case '\n':
case '\r':
case '\b':
case '\f':
case '"': WriteChr('\\');
case '\f': WriteChr('\\');
// passthru
default:
WriteChr(s[i]);