2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#2869] Added count statements

This commit is contained in:
Francis Dupont
2023-05-25 00:28:45 +02:00
parent 400ca653c0
commit 592e913a26
4 changed files with 18 additions and 0 deletions

View File

@@ -511,6 +511,10 @@ tagged_statements = { {
"WHERE remote_id = ? AND lease_addr BETWEEN ? AND ? "
"ORDER BY lease_addr "
"LIMIT ?"},
{MySqlLeaseMgr::COUNT_RELAY_ID6,
"SELECT COUNT(*) FROM lease6_relay_id"},
{MySqlLeaseMgr::COUNT_REMOTE_ID6,
"SELECT COUNT(*) FROM lease6_remote_id"},
} }; // tagged_statements
} // namespace

View File

@@ -778,6 +778,8 @@ public:
GET_REMOTE_ID6, // Get lease6_remote_id entries
GET_RELAY_ID6_LINK, // Get lease6_relay_id entries by link
GET_REMOTE_ID6_LINK, // Get lease6_remote_id entries by link
COUNT_RELAY_ID6, // Count the lease6_relay_id number of entries
COUNT_REMOTE_ID6, // Count the lease6_remote_id number of entries
NUM_STATEMENTS // Number of statements
};

View File

@@ -618,6 +618,16 @@ PgSqlTaggedStatement tagged_statements[] = {
"ORDER BY lease_addr "
"LIMIT $4"},
// COUNT_RELAY_ID6
{ 0, { OID_NONE },
"count_relay_id6",
"SELECT COUNT(*) FROM lease6_relay_id"},
// COUNT_REMOTE_ID6
{ 0, { OID_NONE },
"count_remote_id6",
"SELECT COUNT(*) FROM lease6_remote_id"},
// End of list sentinel
{ 0, { 0 }, NULL, NULL }
};

View File

@@ -754,6 +754,8 @@ public:
GET_REMOTE_ID6, // Get lease6_remote_id entries
GET_RELAY_ID6_LINK, // Get lease6_relay_id entries by link
GET_REMOTE_ID6_LINK, // Get lease6_remote_id entries by link
COUNT_RELAY_ID6, // Count the lease6_relay_id number of entries
COUNT_REMOTE_ID6, // Count the lease6_remote_id number of entries
NUM_STATEMENTS // Number of statements
};