@@ -914,7 +914,7 @@ def test_4369_bind_order_for_plsql(self):
914914 self .assertEqual (fetched_rows , rows )
915915
916916 def test_4370_rebuild_table_with_lob_in_cached_query (self ):
917- "4370 - test rebuild of table with LOB in cached query"
917+ "4370 - test rebuild of table with LOB in cached query (as string) "
918918 table_name = "test_4370"
919919 drop_sql = f"drop table { table_name } purge"
920920 create_sql = f"""
@@ -945,5 +945,39 @@ def test_4370_rebuild_table_with_lob_in_cached_query(self):
945945 self .cursor .execute (query_sql )
946946 self .assertEqual (self .cursor .fetchall (), data )
947947
948+ def test_4371_rebuild_table_with_lob_in_cached_query (self ):
949+ "4371 - test rebuild of table with LOB in cached query (as LOB)"
950+ table_name = "test_4371"
951+ drop_sql = f"drop table { table_name } purge"
952+ create_sql = f"""
953+ create table { table_name } (
954+ Col1 number(9) not null,
955+ Col2 clob not null
956+ )"""
957+ insert_sql = f"insert into { table_name } values (:1, :2)"
958+ query_sql = f"select * from { table_name } order by Col1"
959+ data = [
960+ (1 , "CLOB value 1" ),
961+ (2 , "CLOB value 2" )
962+ ]
963+ try :
964+ self .cursor .execute (drop_sql )
965+ except :
966+ pass
967+ self .cursor .execute (create_sql )
968+ self .cursor .executemany (insert_sql , data )
969+ self .cursor .execute (query_sql )
970+ fetched_data = [(n , c .read ()) for n , c in self .cursor ]
971+ self .assertEqual (fetched_data , data )
972+ self .cursor .execute (query_sql )
973+ fetched_data = [(n , c .read ()) for n , c in self .cursor ]
974+ self .assertEqual (fetched_data , data )
975+ self .cursor .execute (drop_sql )
976+ self .cursor .execute (create_sql )
977+ self .cursor .executemany (insert_sql , data )
978+ self .cursor .execute (query_sql )
979+ fetched_data = [(n , c .read ()) for n , c in self .cursor ]
980+ self .assertEqual (fetched_data , data )
981+
948982if __name__ == "__main__" :
949983 test_env .run_test_cases ()
0 commit comments