From 1bd0393ca14d2a15568b506178178ac73db7e5b5 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Sat, 13 Jan 2024 23:36:22 -0500 Subject: [PATCH] Any Execute is assumed to change the database --- store/provider_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/store/provider_test.go b/store/provider_test.go index c112d2ba..abb242f1 100644 --- a/store/provider_test.go +++ b/store/provider_test.go @@ -189,6 +189,8 @@ func Test_SingleNodeProvideLastIndex(t *testing.T) { } lm = newLI + // Right now any "execute" will be assumed to change the database. It's possible + // that by checking the Error field of the response we could avoid this. er = executeRequestFromStrings([]string{ `INSERT INTO foo(id, name) VALUES(1, "fiona")`, // Constraint violation. }, false, false) @@ -200,8 +202,8 @@ func Test_SingleNodeProvideLastIndex(t *testing.T) { if err != nil { t.Fatalf("failed to get last modified: %s", err.Error()) } - if newLI != lm { - t.Fatalf("last index should not have changed with constraint violation") + if newLI == lm { + t.Fatalf("last index should changed even with constraint violation") } lm = newLI