checkError(ctx, status, stindex, "unable to bind parameters");
int32_t affected_rows = 0;
+ ScopedMySqlTransactionPtr trans;
MYSQL_BIND obind[1];
if (outputs_row_count) {
// Build the output value bind array.
// Bind the output bind array to the statement
status = mysql_stmt_bind_result(ctx->conn_.getStatement(stindex), obind);
checkError(ctx, status, stindex, "unable to bind output");
+ trans.reset(new MySqlTransaction(ctx->conn_));
}
// Execute the statement
if (status != 0) {
checkError(ctx, status, stindex, "unable to fetch results");
}
+
+ trans->commit();
}
// Insert succeeded
checkError(ctx, status, stindex, "unable to bind parameters");
int32_t affected_rows = 0;
+ ScopedMySqlTransactionPtr trans;
MYSQL_BIND obind[1];
if (outputs_row_count) {
// Build the output value bind array.
// Bind the output bind array to the statement
status = mysql_stmt_bind_result(ctx->conn_.getStatement(stindex), obind);
checkError(ctx, status, stindex, "unable to bind output");
+ trans.reset(new MySqlTransaction(ctx->conn_));
}
// Execute
if (status != 0) {
checkError(ctx, status, stindex, "unable to fetch results");
}
+
+ trans->commit();
}
// Check success case first as it is the most likely outcome.
// one row.
isc_throw(DbOperationError, "apparently updated more than one lease "
"that had the address " << lease->addr_.toText()
- << " row count: " << affected_rows);
+ << ", row count: " << affected_rows);
}
void
checkError(ctx, status, stindex, "unable to bind WHERE clause parameter");
int32_t affected_rows = 0;
+ ScopedMySqlTransactionPtr trans;
MYSQL_BIND obind[1];
if (outputs_row_count) {
// Build the output value bind array.
// Bind the output bind array to the statement
status = mysql_stmt_bind_result(ctx->conn_.getStatement(stindex), obind);
checkError(ctx, status, stindex, "unable to bind output");
+ trans.reset(new MySqlTransaction(ctx->conn_));
}
// Execute
if (status != 0) {
checkError(ctx, status, stindex, "unable to fetch results");
}
+
+ trans->commit();
}
return (affected_rows);
void
SharedFlqAllocator::sanityChecksSflqAllocator6(Subnet6Ptr subnet) {
- for (auto const lease_type : {Lease::TYPE_NA, Lease::TYPE_PD}) {
- for (auto const& pool : subnet->getPools(lease_type)) {
+ if (subnet->getAllocatorType() == "shared-flq") {
+ for (auto const& pool : subnet->getPools(Lease::TYPE_NA)) {
+ auto const& capacity(pool->getCapacity());
+ if (capacity > MAX_V6_POOL_SIZE) {
+ isc_throw(BadValue, "pool capacity " << capacity
+ << " exceeeds limit of " << MAX_V6_POOL_SIZE
+ << " for shared-flq allocator on V6 pool "
+ << pool->toText());
+ }
+ }
+ }
+
+ if (subnet->getPdAllocatorType() == "shared-flq") {
+ for (auto const& pool : subnet->getPools(Lease::TYPE_PD)) {
auto const& capacity(pool->getCapacity());
if (capacity > MAX_V6_POOL_SIZE) {
isc_throw(BadValue, "pool capacity " << capacity