MCPcopy Create free account
hub / github.com/Kitware/VTK / BindParametersToStatement

Method BindParametersToStatement

IO/MySQL/vtkMySQLQuery.cxx:388–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386//------------------------------------------------------------------------------
387
388bool 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

Callers 1

ExecuteMethod · 0.45

Calls 2

FreeBoundParametersMethod · 0.95
BuildNullParameterStructFunction · 0.85

Tested by

no test coverage detected