mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add comments in mysql handle part to find mysql errors
This commit is contained in:
parent
af340f95de
commit
b40d674bbb
@ -133,6 +133,12 @@ void MySQLStatementImpl::bindImpl()
|
||||
std::size_t pos = 0;
|
||||
Poco::Data::AbstractBindingVec::iterator it = binds.begin();
|
||||
Poco::Data::AbstractBindingVec::iterator itEnd = binds.end();
|
||||
for (; it != itEnd; ++it) {
|
||||
if (!(*it)->canBind()) {
|
||||
printf("[MySQLStatementImpl::bindImpl] canBind return false, name: %s\n", (*it)->name().data());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; it != itEnd && (*it)->canBind(); ++it)
|
||||
{
|
||||
(*it)->bind(pos);
|
||||
|
||||
@ -75,8 +75,10 @@ void StatementExecutor::bindParams(MYSQL_BIND* params, std::size_t count)
|
||||
if (_state < STMT_COMPILED)
|
||||
throw StatementException("Statement is not compiled yet");
|
||||
|
||||
if (count != mysql_stmt_param_count(_pHandle))
|
||||
if (count != mysql_stmt_param_count(_pHandle)) {
|
||||
printf("[StatementExecutor::bindParams] count: %d, count return from mysql: %d\n", count, mysql_stmt_param_count(_pHandle));
|
||||
throw StatementException("wrong bind parameters count", 0, _query);
|
||||
}
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user