You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: enginetest/queries/queries.go
+18-8Lines changed: 18 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,16 @@ import (
29
29
"github.com/dolthub/go-mysql-server/sql/types"
30
30
)
31
31
32
+
// WrapBehavior determines how the test engine will process sql.AnyWrapper values in query results before comparing them to expected results.
33
+
typeWrapBehaviorint
34
+
35
+
const (
36
+
// WrapBehavior_Unwrap causes the engine to return the unwrapped value. Use this for tests that verify the semantic meaning of the result. (Most tests)
37
+
WrapBehavior_Unwrap=iota
38
+
// WrapBehavior_Hash causes the engine to return the result of the wrapper's Hash() function. Use this for tests that verify the specific representation of the result.
39
+
WrapBehavior_Hash
40
+
)
41
+
32
42
typeQueryTeststruct {
33
43
// Query is the query string to execute
34
44
Querystring
@@ -47,10 +57,10 @@ type QueryTest struct {
47
57
// Dialect is the supported dialect for this query, which must match the dialect of the harness if specified.
48
58
// The query is skipped if the dialect doesn't match.
49
59
Dialectstring
50
-
// DontUnwrap indicates whether to skip normalizing the select results via unwrapping wrapped values.
51
-
// Instead, the test engine will replace wrapped values with their hash (as determined by sql.AnyWrapped.Hash).
52
-
// Set this to test the exact encodings being returned by the query.
53
-
DontUnwrapbool
60
+
// WrapBehavior indicates whether to normalize the select results via unwrapping wrapped values (the default),
61
+
// or replace wrapped values with their hash as determined by sql.AnyWrapped.Hash.
62
+
// Set this to WrapBehvior_Hash to test the exact encodings being returned by the query.
63
+
WrapBehaviorWrapBehavior
54
64
}
55
65
56
66
typeQueryPlanTeststruct {
@@ -11391,10 +11401,10 @@ type WriteQueryTest struct {
11391
11401
// Dialect is the supported dialect for this test, which must match the dialect of the harness if specified.
11392
11402
// The script is skipped if the dialect doesn't match.
11393
11403
Dialectstring
11394
-
// DontUnwrap indicates whether to skip normalizing the select results via unwrapping wrapped values.
11395
-
// Instead, the test engine will replace wrapped values with their hash (as determined by sql.AnyWrapped.Hash).
11396
-
// Set this to test the exact encodings being returned by the query.
11397
-
DontUnwrapbool
11404
+
// WrapBehavior indicates whether to normalize the select results via unwrapping wrapped values (the default),
11405
+
// or replace wrapped values with their hash as determined by sql.AnyWrapped.Hash.
11406
+
// Set this to WrapBehvior_Hash to test the exact encodings being returned by the query.
11407
+
WrapBehaviorWrapBehavior
11398
11408
}
11399
11409
11400
11410
// GenericErrorQueryTest is a query test that is used to assert an error occurs for some query, without specifying what
0 commit comments