@@ -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