diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2018-02-16 15:16:11 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2018-02-16 15:16:11 +0100 |
commit | 18e6a81bab2ea148b008b9d0106bbcc0d42ac026 (patch) | |
tree | 7976a211066aa1893f6eb3eb140b7779e2874f5c /storage/connect/json.cpp | |
parent | 46f3e320dafe409cb1abc29199d80c04111638c1 (diff) | |
download | mariadb-git-18e6a81bab2ea148b008b9d0106bbcc0d42ac026.tar.gz |
- Make Json_Array_Add to accept a non JSON item as 1st parameter
This is a test that will extended to some other UDF functions.
modified: storage/connect/json.cpp
modified: storage/connect/json.h
modified: storage/connect/jsonudf.cpp
Diffstat (limited to 'storage/connect/json.cpp')
-rw-r--r-- | storage/connect/json.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index f6ed48c4d06..ce5ac457a65 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -1224,6 +1224,7 @@ PJVAL JARRAY::AddValue(PGLOBAL g, PJVAL jvp, int *x) Last->Next = jvp; Last = jvp; + Last->Next = NULL; } // endif x return jvp; @@ -1319,6 +1320,24 @@ bool JARRAY::IsNull(void) /* -------------------------- Class JVALUE- -------------------------- */ /***********************************************************************/ +/* Constructor for a JSON. */ +/***********************************************************************/ +JVALUE::JVALUE(PJSON jsp) : JSON() +{ + if (jsp->GetType() == TYPE_JVAL) { + Jsp = NULL; + Value = jsp->GetValue(); + } else { + Jsp = jsp; + Value = NULL; + } // endif Type + + Next = NULL; + Del = false; + Size = 1; +} // end of JVALUE constructor + +/***********************************************************************/ /* Constructor for a Value with a given string or numeric value. */ /***********************************************************************/ JVALUE::JVALUE(PGLOBAL g, PVAL valp) : JSON() |