summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2017-10-17 21:50:17 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2017-10-17 21:50:17 +0200
commit74ffcbc135a24d924a87b530ed293864b135a555 (patch)
tree80283599369e6b59e739a9f934402f84682a4873 /storage/connect
parentc83e2a63452946cf58241380f03a23ab4884c42b (diff)
downloadmariadb-git-74ffcbc135a24d924a87b530ed293864b135a555.tar.gz
- Typo (from 10.1) Modified: storage/connect/value.cpp
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/value.cpp77
1 files changed, 38 insertions, 39 deletions
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index c7a6c8dd06a..7af70ea1349 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -1659,46 +1659,45 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
if (trace)
htrc("Compute: np=%d op=%d\n", np, op);
- for (i = 0; i < np; i++) {
- p[i] = vp[i]->IsNull() ? NULL : vp[i]->GetCharString(val[i]);
-
- if (trace)
- htrc("p[%d]=%s\n", i, p[i]);
-
- } // endfor i
-
- if (p[0] && p[np - 1]) {
- switch (op) {
- case OP_CNC:
- assert(np == 1 || np == 2);
-
- if (np == 2)
- SetValue_psz(p[0]);
-
- if ((i = Len - (signed)strlen(Strp)) > 0)
- strncat(Strp, p[np - 1], i);
-
- if (trace)
- htrc("Strp=%s\n", Strp);
-
- break;
- case OP_MIN:
- assert(np == 2);
- SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
- break;
- case OP_MAX:
- assert(np == 2);
- SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
- break;
- default:
- // sprintf(g->Message, MSG(BAD_EXP_OPER), op);
- strcpy(g->Message, "Function not supported");
- return true;
- } // endswitch op
-
- Null = false;
- } // endif p[i]
+ for (i = 0; i < np; i++)
+ if (!vp[i]->IsNull()) {
+ p[i] = vp[i]->GetCharString(val[i]);
+
+ if (trace)
+ htrc("p[%d]=%s\n", i, p[i]);
+
+ } else
+ return false;
+
+ switch (op) {
+ case OP_CNC:
+ assert(np == 1 || np == 2);
+
+ if (np == 2)
+ SetValue_psz(p[0]);
+
+ if ((i = Len - (signed)strlen(Strp)) > 0)
+ strncat(Strp, p[np - 1], i);
+
+ if (trace)
+ htrc("Strp=%s\n", Strp);
+
+ break;
+ case OP_MIN:
+ assert(np == 2);
+ SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
+ break;
+ case OP_MAX:
+ assert(np == 2);
+ SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
+ break;
+ default:
+ // sprintf(g->Message, MSG(BAD_EXP_OPER), op);
+ strcpy(g->Message, "Function not supported");
+ return true;
+ } // endswitch op
+ Null = false;
return false;
} // end of Compute