Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-90

SQLBulkOperations/SQLSetPos SQL_ADD would fail if TIMESTAMP column ignored

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.0.13
    • Fix Version/s: 2.0.14, 3.0.1
    • Component/s: None
    • Labels:
      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]=

      {SQL_COLUMN_IGNORE, 0}

      , ind2[MAODBC_ROWS]=

      {sizeof(int), sizeof(int)}

      ,
      ind3[MAODBC_ROWS]=

      {8, 9}

      , ind4[MAODBC_ROWS]=

      {SQL_COLUMN_IGNORE, SQL_COLUMN_IGNORE}

      ;
      SQLINTEGER nval[MAODBC_ROWS]=

      {100, 500}

      , 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));

        Attachments

          Activity

            People

            Assignee:
            Lawrin Lawrin Novitsky
            Reporter:
            Lawrin Lawrin Novitsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration