Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.0, 2.0.13
-
None
-
None
Description
If indicator for TIMESTAMP column set to SQL_COLUMN_IGNORE, and that would be the case for ADO, SQL_ADD operation would fail.
SQLCHAR sval[MAODBC_ROWS][32]=
{"Record 1", "Record 21"};
SQLLEN ind1[MAODBC_ROWS]=
, ind2[MAODBC_ROWS]=
{sizeof(int), sizeof(int)},
ind3[MAODBC_ROWS]=
, ind4[MAODBC_ROWS]=
{SQL_COLUMN_IGNORE, SQL_COLUMN_IGNORE};
SQLINTEGER nval[MAODBC_ROWS]=
, id[MAODBC_ROWS]=
{2, 7};
OK_SIMPLE_STMT(Stmt, "DROP TABLE IF EXISTS odbc90");
OK_SIMPLE_STMT(Stmt, "CREATE TABLE odbc90 (id int not null primary key auto_increment, \
nval int not null, sval varchar(32) not null, ts timestamp)");
/* odbc 3 */
/* This cursor closing is required, otherwise DM(on Windows) freaks out */
CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));
CHECK_STMT_RC(Stmt, SQLSetStmtAttr(Stmt, SQL_ATTR_CURSOR_TYPE,
(SQLPOINTER)SQL_CURSOR_STATIC, 0));
CHECK_STMT_RC(Stmt,
SQLSetStmtAttr(Stmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)MAODBC_ROWS, 0));
CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 1, SQL_C_LONG, id, 0, ind1));
CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 2, SQL_C_LONG, nval, 0, ind2));
CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 3, SQL_C_CHAR, sval, sizeof(sval[0]), ind3));
CHECK_STMT_RC(Stmt, SQLBindCol(Stmt, 4, SQL_C_CHAR, NULL, 0, ind4));
OK_SIMPLE_STMT(Stmt, "SELECT id, nval, sval, ts FROM odbc90");
FAIL_IF(SQLFetchScroll(Stmt, SQL_FETCH_NEXT, 0)!=SQL_NO_DATA_FOUND, "SQL_NO_DATA_FOUND expected");
CHECK_STMT_RC(Stmt, SQLBulkOperations(Stmt, SQL_ADD));