1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-03 16:35:25 +00:00

vai: Rework events garbage collection delete query (#682)

This commit is contained in:
Peter Matseykanets
2025-06-26 12:22:40 -04:00
committed by GitHub
parent 6495e7879c
commit 952305e096
2 changed files with 4 additions and 5 deletions

View File

@@ -98,9 +98,10 @@ const (
WHERE rv = ? WHERE rv = ?
` `
deleteEventsByCountFmt = `DELETE FROM "%s_events" deleteEventsByCountFmt = `DELETE FROM "%s_events"
WHERE rowid WHERE rowid < (
NOT IN ( SELECT MIN(rowid) FROM (
SELECT rowid FROM "%s_events" ORDER BY rowid DESC LIMIT ? SELECT rowid FROM "%s_events" ORDER BY rowid DESC LIMIT ?
) q
)` )`
createFieldsTableFmt = `CREATE TABLE "%s_fields" ( createFieldsTableFmt = `CREATE TABLE "%s_fields" (

View File

@@ -348,8 +348,6 @@ func TestNewListOptionIndexerEasy(t *testing.T) {
partitions []partition.Partition partitions []partition.Partition
ns string ns string
items []*unstructured.Unstructured
extraIndexedFields [][]string extraIndexedFields [][]string
expectedList *unstructured.UnstructuredList expectedList *unstructured.UnstructuredList
expectedTotal int expectedTotal int