summaryrefslogtreecommitdiff
path: root/storage/connect/jsonudf.cpp
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-10-26 00:00:16 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-26 00:00:16 +0200
commita8136719fee91d510a1ea3a8ba2009db752a5eb0 (patch)
tree3b2edb4b57dba07a539af0e542d1cfa1bb11e559 /storage/connect/jsonudf.cpp
parentcbd0da66e48a2ea31917dae0b49a4ca6092959e7 (diff)
parent74ffcbc135a24d924a87b530ed293864b135a555 (diff)
downloadmariadb-git-a8136719fee91d510a1ea3a8ba2009db752a5eb0.tar.gz
Merge branch 'connect/10.2' into 10.2
Diffstat (limited to 'storage/connect/jsonudf.cpp')
-rw-r--r--storage/connect/jsonudf.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 5c8896d1bc9..bcb1dfaf90d 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -499,28 +499,23 @@ PVAL JSNX::ExpandArray(PGLOBAL g, PJAR arp, int n)
/*********************************************************************************/
PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
{
-//int i, ars, nv = 0, nextsame = Tjp->NextSame;
- int i, nv = 0, nextsame = 0;
- my_bool err;
+ int i, ars = arp->size(), nv = 0;
+ bool err;
OPVAL op = Nodes[n].Op;
PVAL val[2], vp = Nodes[n].Valp;
PJVAL jvrp, jvp;
JVALUE jval;
vp->Reset();
-//ars = arp->size();
if (trace)
- htrc("CalculateArray size=%d\n", arp->size());
-// htrc("CalculateArray size=%d\n", ars);
+ htrc("CalculateArray size=%d op=%d\n", ars, op);
- for (i = 0; i < arp->size(); i++) {
-//for (i = 0; i < ars; i++) { because compiler bug
+ for (i = 0; i < ars; i++) {
jvrp = arp->GetValue(i);
if (trace)
- htrc("Value %s null=%d nv=%d\n",
- jvrp->GetString(g), jvrp->IsNull() ? 1 : 0, nv);
+ htrc("i=%d nv=%d\n", i, nv);
if (!jvrp->IsNull() || (op == OP_CNC && GetJsonNull())) {
if (jvrp->IsNull()) {
@@ -532,6 +527,10 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
} else
jvp = jvrp;
+ if (trace)
+ htrc("jvp=%s null=%d\n",
+ jvp->GetString(g), jvp->IsNull() ? 1 : 0);
+
if (!nv++) {
SetJsonValue(g, vp, jvp, n);
continue;
@@ -564,6 +563,13 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
if (err)
vp->Reset();
+ if (trace) {
+ char buf(32);
+
+ htrc("vp='%s' err=%d\n",
+ vp->GetCharString(&buf), err ? 1 : 0);
+ } // endif trace
+
} // endif Zero
} // endif jvrp
@@ -581,7 +587,6 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
} // endif Op
-//Tjp->NextSame = nextsame;
return vp;
} // end of CalculateArray