mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
fix(Data/MySQL): preserve backwards-compatibility with pre 8.3
This commit is contained in:
parent
3d7fbbf314
commit
a4c7fc6d03
@ -80,8 +80,13 @@ void StatementExecutor::bindParams(MYSQL_BIND* params, std::size_t count)
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
#if LIBMYSQL_VERSION_ID >= 80300
|
||||
if (mysql_stmt_bind_named_param(_pHandle, params, count, nullptr) != 0)
|
||||
throw StatementException("mysql_stmt_bind_named_param() error ", _pHandle, _query);
|
||||
#else
|
||||
if (mysql_stmt_bind_param(_pHandle, params) != 0)
|
||||
throw StatementException("mysql_stmt_bind_param() error ", _pHandle, _query);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -205,7 +205,12 @@ void SQLExecutor::bareboneMySQLTest(const char* host, const char* user, const ch
|
||||
bind_param[4].buffer = &fifth;
|
||||
bind_param[4].buffer_type = MYSQL_TYPE_FLOAT;
|
||||
|
||||
#if LIBMYSQL_VERSION_ID >= 80300
|
||||
rc = mysql_stmt_bind_named_param(hstmt, bind_param, 5, nullptr);
|
||||
#else
|
||||
rc = mysql_stmt_bind_param(hstmt, bind_param);
|
||||
#endif
|
||||
|
||||
assertTrue (rc == 0);
|
||||
|
||||
rc = mysql_stmt_execute(hstmt);
|
||||
|
Loading…
Reference in New Issue
Block a user