1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-02 16:05:42 +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 = ?
`
deleteEventsByCountFmt = `DELETE FROM "%s_events"
WHERE rowid
NOT IN (
SELECT rowid FROM "%s_events" ORDER BY rowid DESC LIMIT ?
WHERE rowid < (
SELECT MIN(rowid) FROM (
SELECT rowid FROM "%s_events" ORDER BY rowid DESC LIMIT ?
) q
)`
createFieldsTableFmt = `CREATE TABLE "%s_fields" (

View File

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