Skip to content

Commit 26b32f6

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent 6c49d83 commit 26b32f6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sql/types/enum_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,45 +208,45 @@ func TestEnumZero(t *testing.T) {
208208
func TestEnumStrictMode(t *testing.T) {
209209
// Test enum conversion with 0 values in strict mode
210210
enumType := MustCreateEnumType([]string{"red", "green", "blue"}, sql.Collation_Default)
211-
211+
212212
// Test in strict mode
213213
t.Run("strict mode rejects zero", func(t *testing.T) {
214214
// For now, let's skip this test since we need to figure out system variables
215215
t.Skip("Need to initialize system variables properly")
216-
216+
217217
ctx := sql.NewEmptyContext()
218218
ctx.SetSessionVariable(ctx, "SQL_MODE", "STRICT_TRANS_TABLES")
219-
219+
220220
// Debug: Check if sql_mode is set correctly
221221
sessionVal, err := ctx.Session.GetSessionVariable(ctx, "SQL_MODE")
222222
t.Logf("Session SQL_MODE: %v, err: %v", sessionVal, err)
223-
223+
224224
sqlMode := sql.LoadSqlMode(ctx)
225225
t.Logf("SQL Mode: %v", sqlMode)
226226
t.Logf("STRICT_TRANS_TABLES enabled: %v", sqlMode.ModeEnabled(sql.StrictTransTables))
227-
227+
228228
_, _, err = enumType.Convert(ctx, 0)
229229
require.Error(t, err)
230230
assert.True(t, ErrDataTruncatedForColumn.Is(err))
231231
})
232-
232+
233233
// Test in non-strict mode
234234
t.Run("non-strict mode allows zero", func(t *testing.T) {
235235
ctx := sql.NewEmptyContext()
236236
// In non-strict mode, 0 values are allowed
237-
237+
238238
val, inRange, err := enumType.Convert(ctx, 0)
239239
require.NoError(t, err)
240240
assert.Equal(t, sql.InRange, inRange)
241241
assert.Equal(t, uint16(0), val)
242242
})
243-
244-
// Test with enum that has explicit empty string
243+
244+
// Test with enum that has explicit empty string
245245
t.Run("enum with empty string allows zero", func(t *testing.T) {
246246
enumWithEmpty := MustCreateEnumType([]string{"", "red", "green"}, sql.Collation_Default)
247247
ctx := sql.NewEmptyContext()
248248
// This should work even in strict mode since empty string is valid
249-
249+
250250
// Since empty string is the first element, it should be at index 1, not 0
251251
// But converting 0 should still give us the empty string at index 0
252252
val, inRange, err := enumWithEmpty.Convert(ctx, 0)

0 commit comments

Comments
 (0)