@@ -694,6 +694,59 @@ def test_numeric_types_and_limits():
694694 assert_wait (lambda : len (ch .select (TEST_TABLE_NAME , 'test7=18446744073709551586' )) == 2 )
695695
696696
697+ def test_different_types_2 ():
698+ cfg = config .Settings ()
699+ cfg .load (CONFIG_FILE )
700+
701+ mysql = mysql_api .MySQLApi (
702+ database = None ,
703+ mysql_settings = cfg .mysql ,
704+ )
705+
706+ ch = clickhouse_api .ClickhouseApi (
707+ database = TEST_DB_NAME ,
708+ clickhouse_settings = cfg .clickhouse ,
709+ )
710+
711+ prepare_env (cfg , mysql , ch )
712+
713+ mysql .execute ("SET sql_mode = 'ALLOW_INVALID_DATES';" )
714+
715+ mysql .execute (f'''
716+ CREATE TABLE { TEST_TABLE_NAME } (
717+ `id` int unsigned NOT NULL AUTO_INCREMENT,
718+ test1 bit(1),
719+ PRIMARY KEY (id)
720+ );
721+ ''' )
722+
723+ mysql .execute (
724+ f"INSERT INTO { TEST_TABLE_NAME } (test1) VALUES "
725+ f"(0);" ,
726+ commit = True ,
727+ )
728+
729+ binlog_replicator_runner = BinlogReplicatorRunner ()
730+ binlog_replicator_runner .run ()
731+ db_replicator_runner = DbReplicatorRunner (TEST_DB_NAME )
732+ db_replicator_runner .run ()
733+
734+ assert_wait (lambda : TEST_DB_NAME in ch .get_databases ())
735+
736+ ch .execute_command (f'USE { TEST_DB_NAME } ' )
737+
738+ assert_wait (lambda : TEST_TABLE_NAME in ch .get_tables ())
739+ assert_wait (lambda : len (ch .select (TEST_TABLE_NAME )) == 1 )
740+
741+ mysql .execute (
742+ f"INSERT INTO { TEST_TABLE_NAME } (test1) VALUES "
743+ f"(1);" ,
744+ commit = True ,
745+ )
746+ assert_wait (lambda : len (ch .select (TEST_TABLE_NAME )) == 2 )
747+ assert_wait (lambda : len (ch .select (TEST_TABLE_NAME , 'test1=True' )) == 1 )
748+
749+
697750def test_json ():
698751 cfg = config .Settings ()
699752 cfg .load (CONFIG_FILE )
0 commit comments