summaryrefslogtreecommitdiff
path: root/storage/connect/odbconn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/odbconn.cpp')
-rw-r--r--storage/connect/odbconn.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index f7b1a43a95d..6687513fa6c 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -2354,11 +2354,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
if (!Check(rc))
ThrowDBX(rc, fnc, hstmt);
- rc = SQLNumResultCols(hstmt, &ncol);
-
- // n because we no more ignore the first column
- if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol)
- ThrowDBX(MSG(COL_NUM_MISM));
+ // Some data source do not implement SQLNumResultCols
+ if (Check(SQLNumResultCols(hstmt, &ncol)))
+ // n because we no more ignore the first column
+ if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol)
+ ThrowDBX(MSG(COL_NUM_MISM));
// Unconditional to handle STRBLK's
pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL));