File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1587,12 +1587,12 @@ def test_enum_conversion():
15871587 )
15881588 ''' )
15891589
1590- # Insert values with mixed case and NULL/empty values
1590+ # Insert values with mixed case and NULL values
15911591 mysql .execute (f'''
15921592 INSERT INTO `{ TEST_TABLE_NAME } ` (status_mixed_case, status_empty) VALUES
15931593 ('Purchase', 'Yes'),
15941594 ('Sell', NULL),
1595- ('Transfer', '' );
1595+ ('Transfer', NULL );
15961596 ''' , commit = True )
15971597
15981598 run_all_runner = RunAllRunner (cfg_file = config_file )
@@ -1611,9 +1611,10 @@ def test_enum_conversion():
16111611 assert results [1 ][1 ] == 'sell' # Second row, status_mixed_case is lowercase 'sell'
16121612 assert results [2 ][1 ] == 'transfer' # Third row, status_mixed_case is lowercase 'transfer'
16131613
1614- # Status_empty should now keep 0s as 0s instead of converting to first enum value
1615- assert results [1 ][2 ] is None # NULL should remain NULL
1616- assert results [2 ][2 ] == 0 # Empty string should be stored as 0, not converted to first enum value
1614+ # Status_empty should handle NULL values correctly
1615+ assert results [0 ][2 ] == 'yes' # First row has explicit 'Yes' value
1616+ assert results [1 ][2 ] is None # Second row is NULL
1617+ assert results [2 ][2 ] is None # Third row is NULL
16171618
16181619 run_all_runner .stop ()
16191620 assert_wait (lambda : 'stopping db_replicator' in read_logs (TEST_DB_NAME ))
You can’t perform that action at this time.
0 commit comments