Skip to content

Commit b56589e

Browse files
committed
Some small changes.
=================== - Fix unhandled throws, add some trace + typo modified: storage/connect/jdbconn.cpp modified: storage/connect/tabodbc.cpp modified: storage/connect/valblk.cpp modified: storage/connect/value.cpp
1 parent 425dc6d commit b56589e

File tree

4 files changed

+311
-297
lines changed

4 files changed

+311
-297
lines changed

storage/connect/jdbconn.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,9 +1196,14 @@ int JDBConn::GetResultSize(PCSZ sql, PCOL colp)
11961196
if ((rc = ExecuteQuery(sql)) != RC_OK)
11971197
return -1;
11981198

1199-
if ((rc = Fetch()) > 0)
1200-
SetColumnValue(1, NULL, colp->GetValue());
1201-
else
1199+
if ((rc = Fetch()) > 0) {
1200+
try {
1201+
SetColumnValue(1, NULL, colp->GetValue());
1202+
} catch (...) {
1203+
return -4;
1204+
} // end catch
1205+
1206+
} else
12021207
return -2;
12031208

12041209
if ((rc = Fetch()) != 0)

storage/connect/tabodbc.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,10 @@ bool TDBODBC::OpenDB(PGLOBAL g)
605605
Cnp->InitValue(g);
606606

607607
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
608-
strcpy(g->Message, "Cannot get result size");
609-
return true;
608+
char* msg = PlugDup(g, g->Message);
609+
610+
sprintf(g->Message, "Get result size: %s (rc=%d)", msg, n);
611+
return true;
610612
} else if (n) {
611613
Ocp->m_Rows = n;
612614

storage/connect/valblk.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ void VALBLK::ChkIndx(int n)
206206
{
207207
if (n < 0 || n >= Nval) {
208208
PGLOBAL& g = Global;
209+
xtrc(1, "ChkIndx: n=%d Nval=%d\n", n, Nval);
209210
strcpy(g->Message, MSG(BAD_VALBLK_INDX));
210211
throw Type;
211212
} // endif n
@@ -216,7 +217,8 @@ void VALBLK::ChkTyp(PVAL v)
216217
{
217218
if (Check && (Type != v->GetType() || Unsigned != v->IsUnsigned())) {
218219
PGLOBAL& g = Global;
219-
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
220+
xtrc(1, "ChkTyp: Type=%d valType=%d\n", Type, v->GetType());
221+
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
220222
throw Type;
221223
} // endif Type
222224

0 commit comments

Comments
 (0)