1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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
This commit is contained in:
Olivier Bertrand
2019-10-16 17:40:49 +02:00
parent 425dc6d66f
commit b56589eaf2
4 changed files with 311 additions and 297 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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

File diff suppressed because it is too large Load Diff