Skip to content

Commit

Permalink
Merge branch 'master'(3.1) into develop(3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrinn committed Apr 28, 2023
2 parents 889c56e + c0d989b commit 0fe450b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -29,7 +29,6 @@ SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

SET(MARIADB_ODBC_VERSION_QUALITY "beta")

SET(MARIADB_ODBC_VERSION "03.02.0001")

SET(MARIADB_DEFAULT_PLUGINS_SUBDIR "plugin")
Expand Down
6 changes: 2 additions & 4 deletions driver/ma_odbc.h
Expand Up @@ -75,7 +75,6 @@ struct MADB_Apd
{
SQLUSMALLINT *ParamOperationPtr;
SQLULEN *ParamOffsetPtr;
/*MADB_ParmBind *ParamBind;*/
MYSQL_BIND *Bind;
SQLLEN ParamsetSize;
SQLUINTEGER ParamBindType;
Expand All @@ -88,8 +87,8 @@ struct MADB_Dbc;
struct MADB_Ird
{
MADB_Stmt* stmt;
SQLULEN* RowsFetched;
SQLUSMALLINT* RowStatusArray;
SQLULEN* RowsFetched;
SQLUSMALLINT* RowStatusArray;
MYSQL_FIELD* Fields;
SQLUINTEGER FieldCount;
SQLSMALLINT Allocated;
Expand All @@ -104,7 +103,6 @@ struct MADB_Ipd
SQLULEN *ParamProcessedPtr; /* SQLParamOptions */
#endif /* ODBCVER */
SQLUSMALLINT *ParamStatusPtr;
/*MADB_ParmBind* Parameters;*/
SQLSMALLINT Allocated;
};

Expand Down
15 changes: 9 additions & 6 deletions test/basic.c
Expand Up @@ -1788,7 +1788,7 @@ ODBC_TEST(t_odbc377)
{
SQLHDBC Hdbc;
SQLHSTMT Hstmt;
SQLCHAR Sqlstate[6];
SQLCHAR Sqlstate[6], ErrMsg[SQL_MAX_MESSAGE_LENGTH];

CHECK_ENV_RC(Env, SQLAllocConnect(Env, &Hdbc));

Expand All @@ -1811,21 +1811,24 @@ ODBC_TEST(t_odbc377)

CHECK_STMT_RC(Hstmt, SQLSetStmtAttr(Hstmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)1, 0));
EXPECT_STMT(Hstmt, SQLExecDirect(Hstmt, "SELECT SLEEP(2)", SQL_NTS), SQL_ERROR);
CHECK_STMT_RC(Hstmt, SQLGetDiagRec(SQL_HANDLE_STMT, Hstmt, 1, Sqlstate, NULL, NULL, 0, NULL));
Sqlstate[0]= '\0';
CHECK_STMT_RC(Hstmt, SQLGetDiagRec(SQL_HANDLE_STMT, Hstmt, 1, Sqlstate, NULL, ErrMsg, sizeof(ErrMsg), NULL));
if (strncmp(Sqlstate, "70100", 6) != 0 && strncmp(Sqlstate, "HY018", 6) != 0)
{
diag("SQL state was %s", Sqlstate);
FAIL_IF(1, "Unexpected SQL State");
diag("Unexpected SQL State %s(%s)", Sqlstate, ErrMsg);
return FAIL;
}
CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));

/* Verifying the same(i.e. query timeout works) for the case of prepare + execute */
CHECK_STMT_RC(Hstmt, SQLPrepare(Hstmt, "SELECT SLEEP(2)", SQL_NTS));
EXPECT_STMT(Hstmt, SQLExecute(Hstmt), SQL_ERROR);
CHECK_STMT_RC(Hstmt, SQLGetDiagRec(SQL_HANDLE_STMT, Hstmt, 1, Sqlstate, NULL, NULL, 0, NULL));
Sqlstate[0]= '\0';
CHECK_STMT_RC(Hstmt, SQLGetDiagRec(SQL_HANDLE_STMT, Hstmt, 1, Sqlstate, NULL, ErrMsg, sizeof(ErrMsg), NULL));
if (strncmp(Sqlstate, "70100", 6) != 0 && strncmp(Sqlstate, "HY018", 6) != 0)
{
FAIL_IF(1, "Unexpected SQL State");
diag("Unexpected SQL State %s(%s)", Sqlstate, ErrMsg);
return FAIL;
}

CHECK_STMT_RC(Hstmt, SQLFreeStmt(Hstmt, SQL_DROP));
Expand Down

0 comments on commit 0fe450b

Please sign in to comment.