mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix MDEV-27055 (regression of MDEV-24493)
This commit is contained in:
@@ -1422,7 +1422,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
|
|||||||
PGLOBAL& g = m_G;
|
PGLOBAL& g = m_G;
|
||||||
void *buffer;
|
void *buffer;
|
||||||
bool b;
|
bool b;
|
||||||
UWORD n;
|
UWORD n, k;
|
||||||
SWORD len, tp, ncol = 0;
|
SWORD len, tp, ncol = 0;
|
||||||
ODBCCOL *colp;
|
ODBCCOL *colp;
|
||||||
RETCODE rc;
|
RETCODE rc;
|
||||||
@@ -1498,6 +1498,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
|
|||||||
rc = SQLNumResultCols(hstmt, &ncol);
|
rc = SQLNumResultCols(hstmt, &ncol);
|
||||||
} while (rc == SQL_STILL_EXECUTING);
|
} while (rc == SQL_STILL_EXECUTING);
|
||||||
|
|
||||||
|
k = 0; // used for column number
|
||||||
} // endif Srcdef
|
} // endif Srcdef
|
||||||
|
|
||||||
for (n = 0, colp = tocols; colp; colp = (PODBCCOL)colp->GetNext())
|
for (n = 0, colp = tocols; colp; colp = (PODBCCOL)colp->GetNext())
|
||||||
@@ -1521,16 +1522,21 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
|
|||||||
ThrowDBX(m_G->Message);
|
ThrowDBX(m_G->Message);
|
||||||
} // endif tp
|
} // endif tp
|
||||||
|
|
||||||
|
if (m_Tdb->Srcdef)
|
||||||
|
k = colp->GetIndex();
|
||||||
|
else
|
||||||
|
k++;
|
||||||
|
|
||||||
if (trace(1))
|
if (trace(1))
|
||||||
htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n",
|
htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n",
|
||||||
n, tp, buffer, len, colp->GetStrLen());
|
k, tp, buffer, len, colp->GetStrLen());
|
||||||
|
|
||||||
rc = SQLBindCol(hstmt, colp->GetIndex(), tp, buffer, len, colp->GetStrLen());
|
rc = SQLBindCol(hstmt, k, tp, buffer, len, colp->GetStrLen());
|
||||||
|
|
||||||
if (!Check(rc))
|
if (!Check(rc))
|
||||||
ThrowDBX(rc, "SQLBindCol", hstmt);
|
ThrowDBX(rc, "SQLBindCol", hstmt);
|
||||||
|
|
||||||
} // endif pcol
|
} // endif colp
|
||||||
|
|
||||||
} catch(DBX *x) {
|
} catch(DBX *x) {
|
||||||
if (trace(1))
|
if (trace(1))
|
||||||
|
Reference in New Issue
Block a user