Skip to content

Commit 31eafaf

Browse files
Update test cases to handle changes in behaviour in future versions.
Signed-off-by: Arthur Schreiber <[email protected]>
1 parent 68d143c commit 31eafaf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

go/test/endtoend/preparestmt/stmt_methods_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/stretchr/testify/assert"
2929
"github.com/stretchr/testify/require"
3030

31+
"vitess.io/vitess/go/test/endtoend/cluster"
3132
"vitess.io/vitess/go/vt/vtgate/engine"
3233
)
3334

@@ -570,7 +571,17 @@ func validateBaselineErrSpecializedPlan(t *testing.T, p map[string]any) {
570571
pm, ok := plan.(map[string]any)
571572
require.True(t, ok, "plan is not of type map[string]any")
572573
require.EqualValues(t, "PlanSwitcher", pm["OperatorType"])
573-
require.EqualValues(t, "VT12001: unsupported: OVER CLAUSE with sharded keyspace", pm["BaselineErr"])
574+
575+
ver, err := cluster.GetMajorVersion("vtgate")
576+
require.NoError(t, err)
577+
578+
// v24+ uses new error message format
579+
// v23 and earlier uses old format
580+
expectedErr := "VT12001: unsupported: window functions are only supported for single-shard queries"
581+
if ver < 24 {
582+
expectedErr = "VT12001: unsupported: OVER CLAUSE with sharded keyspace"
583+
}
584+
require.EqualValues(t, expectedErr, pm["BaselineErr"].(string))
574585

575586
pd, err := engine.PrimitiveDescriptionFromMap(plan.(map[string]any))
576587
require.NoError(t, err)

0 commit comments

Comments
 (0)