8000 ODBC: consecutive SQLExecute() calls on prepared statements don't work · Issue #135 · tarantool/tarantool-c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ODBC: consecutive SQLExecute() calls on prepared statements don't work  #135
Open
@SudoBobo

Description

@SudoBobo

Example:

SQLRETURN rc;
SQLHSTMT hstmt = handles->hstmt;

rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
SQL_SUCCEEDED(rc);
rc = SQLFreeStmt(hstmt, SQL_CLOSE);
SQL_SUCCEEDED(rc);

rc = SQLExecDirect(hstmt, "CREATE TABLE reproduce (id INTEGER PRIMARY KEY)");
SQL_SUCCEEDED(rc);

rc = SQLPrepare(hstmt, (SQLCHAR *) "INSERT INTO reproduce VALUES(?)",
		SQL_NTS);
SQL_SUCCEEDED(rc);

SQLINTEGER id;
rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER,
		      0, 0, &id, 0, NULL);
SQL_SUCCEEDED(rc);

id = 1;
rc = SQLExecute(hstmt);
SQL_SUCCEEDED(rc);

id = 2;
rc = SQLExecute(hstmt);
SQL_SUCCEEDED(rc);

Then you may print diagnostic information, print_diag() from /test/odbc/util.h
It says:
[24000] errno=0 Invalid cursor state

Reproducer can also be found in /test/odbc/prepare_input.c in reproduce_gh_135()

Metadata

Metadata

Assignees

No one assigned

    Labels

    ODBCODBC ProjectbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0