@@ -382,10 +382,14 @@ def test_indicator(self):
382
382
383
383
cursor = self .connection .cursor ()
384
384
cursor .execute ("CREATE TEMPORARY TABLE ind1 (a int, b int default 2,c int)" )
385
- vals = ( mariadb .indicator_null , mariadb .indicator_default , 3 )
386
- cursor .executemany ("INSERT INTO ind1 VALUES (?,?,?)" , [ vals ] )
385
+ vals = [( 1 , 4 , 3 ),( mariadb .indicator_null , mariadb .indicator_default , 3 )]
386
+ cursor .executemany ("INSERT INTO ind1 VALUES (?,?,?)" , vals )
387
387
cursor .execute ("SELECT a, b, c FROM ind1" )
388
388
row = cursor .fetchone ()
389
+ self .assertEqual (row [0 ], 1 )
390
+ self .assertEqual (row [1 ], 4 )
391
+ self .assertEqual (row [2 ], 3 )
392
+ row = cursor .fetchone ()
389
393
self .assertEqual (row [0 ], None )
390
394
self .assertEqual (row [1 ], 2 )
391
395
self .assertEqual (row [2 ], 3 )
@@ -889,5 +893,30 @@ def test_conpy59(self):
889
893
self .assertEqual (row [0 ], None )
890
894
del con
891
895
896
+ def test_conpy61 (self ):
897
+ con = create_connection ()
898
+ cursor = con .cursor ()
899
+ cursor .execute ("CREATE TEMPORARY TABLE ind1 (a int, b int default 2,c int)" )
900
+ vals = [(1 ,4 ,3 ),(None , 2 , 3 )]
901
+ cursor .executemany ("INSERT INTO ind1 VALUES (?,?,?)" , vals )
902
+ cursor .execute ("SELECT a, b, c FROM ind1" )
903
+ row = cursor .fetchone ()
904
+ self .assertEqual (row [0 ], 1 )
905
+ row = cursor .fetchone ()
906
+ self .assertEqual (row [0 ], None )
907
+ cursor .execute ("DELETE FROM ind1" )
908
+ vals = [(1 ,4 ,3 ), (mariadb .indicator_null , mariadb .indicator_default , None )]
909
+
910
+ cursor .executemany ("INSERT INTO ind1 VALUES (?,?,?)" , vals )
911
+ cursor .execute ("SELECT a, b, c FROM ind1" )
912
+ row = cursor .fetchone ()
913
+ self .assertEqual (row [0 ], 1 )
914
+ row = cursor .fetchone ()
915
+ self .assertEqual (row [0 ], None )
916
+ self .assertEqual (row [1 ], 2 )
917
+ self .assertEqual (row [2 ], None )
918
+
919
+ del cursor
920
+
892
921
if __name__ == '__main__' :
893
922
unittest .main ()
0 commit comments