summaryrefslogtreecommitdiff
path: root/storage/connect/tabodbc.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2016-02-20 01:02:48 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2016-02-20 01:02:48 +0100
commit02fa3b8eea24ae3366d2f0bd69db487ccf33c715 (patch)
tree0b491b642d3dd4aa29abc18dba0f8970eb943c61 /storage/connect/tabodbc.cpp
parent481e6433f4da5bf283a1f75391abc522c1790eff (diff)
downloadmariadb-git-02fa3b8eea24ae3366d2f0bd69db487ccf33c715.tar.gz
- Fix to MDEV-9579 be testing for void result.
modified: storage/connect/tabodbc.cpp
Diffstat (limited to 'storage/connect/tabodbc.cpp')
-rw-r--r--storage/connect/tabodbc.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index fd9a049a05a..b8961789ccd 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
-/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */
+/* (C) Copyright to the author Olivier BERTRAND 2000-2016 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@@ -912,19 +912,21 @@ bool TDBODBC::OpenDB(PGLOBAL g)
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
strcpy(g->Message, "Cannot get result size");
return true;
- } // endif n
+ } else if (n) {
+ Ocp->m_Rows = n;
- Ocp->m_Rows = n;
+ if ((Qrp = Ocp->AllocateResult(g)))
+ Memory = 2; // Must be filled
+ else {
+ strcpy(g->Message, "Result set memory allocation failed");
+ return true;
+ } // endif n
- if ((Qrp = Ocp->AllocateResult(g)))
- Memory = 2; // Must be filled
- else {
- strcpy(g->Message, "Result set memory allocation failed");
- return true;
- } // endif n
+ } else // Void result
+ Memory = 0;
- Ocp->m_Rows = 0;
- } else
+ Ocp->m_Rows = 0;
+ } else
return true;
} // endif Memory