1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Enhance the implementation of ODBC tables when using scrollable cursor

modified:
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabodbc.cpp
This commit is contained in:
Olivier Bertrand
2014-11-24 18:26:44 +01:00
parent 6211708a95
commit c89b8a38de
3 changed files with 16 additions and 16 deletions

View File

@@ -2439,29 +2439,31 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g)
/***********************************************************************/
/* Restart from beginning of result set */
/***********************************************************************/
bool ODBConn::Rewind(char *sql, ODBCCOL *tocols)
int ODBConn::Rewind(char *sql, ODBCCOL *tocols)
{
RETCODE rc;
int rc, rbuf = -1;
if (!m_hstmt)
return false;
return rbuf;
if (m_Scrollable) {
SQLULEN crow;
try {
rc = SQLFetchScroll(m_hstmt, SQL_FETCH_ABSOLUTE, 0);
rc = SQLExtendedFetch(m_hstmt, SQL_FETCH_FIRST, 1, &crow, NULL);
if (rc != SQL_NO_DATA_FOUND)
ThrowDBX(rc, "SQLFetchScroll", m_hstmt);
if (!Check(rc))
ThrowDBX(rc, "SQLExtendedFetch", m_hstmt);
rbuf = (int)crow;
} catch(DBX *x) {
strcpy(m_G->Message, x->GetErrorMessage(0));
return true;
} // end try/catch
} else if (ExecDirectSQL(sql, tocols) < 0)
return true;
} else if (ExecDirectSQL(sql, tocols) >= 0)
rbuf = 0;
return false;
return rbuf;
} // end of Rewind
/***********************************************************************/