Commit 94fb9d93 authored by Olivier Bertrand's avatar Olivier Bertrand

Fix MDEV-24493

parent 46fed496
/*************** Colblk H Declares Source Code File (.H) ***************/ /*************** Colblk H Declares Source Code File (.H) ***************/
/* Name: COLBLK.H Version 1.7 */ /* Name: COLBLK.H Version 1.7 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2019 */
/* */ /* */
/* This file contains the COLBLK and derived classes declares. */ /* This file contains the COLBLK and derived classes declares. */
/***********************************************************************/ /***********************************************************************/
......
/***********************************************************************/ /***********************************************************************/
/* Name: ODBCONN.CPP Version 2.3 */ /* Name: ODBCONN.CPP Version 2.4 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2017 */ /* (C) Copyright to the author Olivier BERTRAND 1998-2021 */
/* */ /* */
/* This file contains the ODBC connection classes functions. */ /* This file contains the ODBC connection classes functions. */
/***********************************************************************/ /***********************************************************************/
...@@ -1509,7 +1509,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) ...@@ -1509,7 +1509,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
ThrowDBX(MSG(COL_NUM_MISM)); ThrowDBX(MSG(COL_NUM_MISM));
// Now bind the column buffers // Now bind the column buffers
for (n = 1, colp = tocols; colp; colp = (PODBCCOL)colp->GetNext()) for (colp = tocols; colp; colp = (PODBCCOL)colp->GetNext())
if (!colp->IsSpecial()) { if (!colp->IsSpecial()) {
buffer = colp->GetBuffer(m_RowsetSize); buffer = colp->GetBuffer(m_RowsetSize);
len = colp->GetBuflen(); len = colp->GetBuflen();
...@@ -1525,12 +1525,11 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) ...@@ -1525,12 +1525,11 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
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()); n, tp, buffer, len, colp->GetStrLen());
rc = SQLBindCol(hstmt, n, tp, buffer, len, colp->GetStrLen()); rc = SQLBindCol(hstmt, colp->GetIndex(), tp, buffer, len, colp->GetStrLen());
if (!Check(rc)) if (!Check(rc))
ThrowDBX(rc, "SQLBindCol", hstmt); ThrowDBX(rc, "SQLBindCol", hstmt);
n++;
} // endif pcol } // endif pcol
} catch(DBX *x) { } catch(DBX *x) {
......
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