Commit b56589ea authored by Olivier Bertrand's avatar Olivier Bertrand

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
parent 425dc6d6
......@@ -1196,9 +1196,14 @@ int JDBConn::GetResultSize(PCSZ sql, PCOL colp)
if ((rc = ExecuteQuery(sql)) != RC_OK)
return -1;
if ((rc = Fetch()) > 0)
SetColumnValue(1, NULL, colp->GetValue());
else
if ((rc = Fetch()) > 0) {
try {
SetColumnValue(1, NULL, colp->GetValue());
} catch (...) {
return -4;
} // end catch
} else
return -2;
if ((rc = Fetch()) != 0)
......
......@@ -605,8 +605,10 @@ bool TDBODBC::OpenDB(PGLOBAL g)
Cnp->InitValue(g);
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
strcpy(g->Message, "Cannot get result size");
return true;
char* msg = PlugDup(g, g->Message);
sprintf(g->Message, "Get result size: %s (rc=%d)", msg, n);
return true;
} else if (n) {
Ocp->m_Rows = n;
......
......@@ -206,6 +206,7 @@ void VALBLK::ChkIndx(int n)
{
if (n < 0 || n >= Nval) {
PGLOBAL& g = Global;
xtrc(1, "ChkIndx: n=%d Nval=%d\n", n, Nval);
strcpy(g->Message, MSG(BAD_VALBLK_INDX));
throw Type;
} // endif n
......@@ -216,7 +217,8 @@ void VALBLK::ChkTyp(PVAL v)
{
if (Check && (Type != v->GetType() || Unsigned != v->IsUnsigned())) {
PGLOBAL& g = Global;
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
xtrc(1, "ChkTyp: Type=%d valType=%d\n", Type, v->GetType());
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
throw Type;
} // endif Type
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment