diff options
author | Piotrek Zadroga <piotrek@isc.org> | 2024-04-17 14:22:34 +0200 |
---|---|---|
committer | Piotrek Zadroga <piotrek@isc.org> | 2024-04-23 09:27:35 +0200 |
commit | 387edbe9b9d2fb52ca37c12d8a5faed65824349b (patch) | |
tree | 5d3d721b822d8fabdc021b5506dc0c1325b777fa | |
parent | [#3315] use enum SpawnMode instead of bool (diff) | |
download | kea-387edbe9b9d2fb52ca37c12d8a5faed65824349b.tar.xz kea-387edbe9b9d2fb52ca37c12d8a5faed65824349b.zip |
[#3294] fix reservation-del psql query
- fixing a bug where when postgresql used as hosts reservations backend and
when trying to delete only one reservation with host_cmds reservation-del
by ipv6 and subnet-id, all host reservations in given subnet were deleted
-rw-r--r-- | src/lib/dhcpsrv/pgsql_host_data_source.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/dhcpsrv/pgsql_host_data_source.cc index 8db86ffa49..5732f74d99 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/dhcpsrv/pgsql_host_data_source.cc @@ -2191,7 +2191,8 @@ TaggedStatementArray tagged_statements = { { { OID_INT8, OID_VARCHAR }, "del_host_addr6", "DELETE FROM hosts USING ipv6_reservations " - " WHERE dhcp6_subnet_id = $1 AND ipv6_reservations.address = cast($2 as inet)" + " WHERE hosts.host_id = ipv6_reservations.host_id" + " AND dhcp6_subnet_id = $1 AND ipv6_reservations.address = cast($2 as inet)" }, // PgSqlHostDataSourceImpl::DEL_HOST_SUBID4_ID |