| 386 | //------------------------------------------------------------------------------ |
| 387 | |
| 388 | bool vtkMySQLQueryInternals::BindParametersToStatement() |
| 389 | { |
| 390 | if (this->Statement == nullptr) |
| 391 | { |
| 392 | vtkGenericWarningMacro(<< "BindParametersToStatement: No prepared statement available"); |
| 393 | return false; |
| 394 | } |
| 395 | |
| 396 | this->FreeBoundParameters(); |
| 397 | unsigned long numParams = mysql_stmt_param_count(this->Statement); |
| 398 | this->BoundParameters = new MYSQL_BIND[numParams]; |
| 399 | for (unsigned int i = 0; i < numParams; ++i) |
| 400 | { |
| 401 | if (this->UserParameterList[i]) |
| 402 | { |
| 403 | this->BoundParameters[i] = this->UserParameterList[i]->BuildParameterStruct(); |
| 404 | } |
| 405 | else |
| 406 | { |
| 407 | this->BoundParameters[i] = BuildNullParameterStruct(); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | return mysql_stmt_bind_param(this->Statement, this->BoundParameters); |
| 412 | } |
| 413 | |
| 414 | //------------------------------------------------------------------------------ |
| 415 |
no test coverage detected