@@ -1017,6 +1017,48 @@ end
10171017 tbl = DBInterface. execute (db, " select x from tmp" ) |> columntable
10181018 @test isequal (tbl. x, [missing , :a ])
10191019
1020+ # Symbol in TEXT type doesn't work
1021+ # when strict and first row is NULL
1022+ tbl =
1023+ DBInterface. execute (
1024+ DBInterface. prepare (db, " select x from tmp" ),
1025+ ();
1026+ strict = true ,
1027+ ) |> columntable
1028+ @test isequal (tbl. x, [missing , " 7JL\x 1e\x 04" ])
1029+
1030+ # Symbol in BLOB type does work strict
1031+ db = SQLite. DB ()
1032+ DBInterface. execute (db, " create table tmp ( x BLOB )" )
1033+ DBInterface. execute (db, " insert into tmp values (?)" , (nothing ,))
1034+ DBInterface. execute (db, " insert into tmp values (?)" , (:a ,))
1035+ tbl = DBInterface. execute (db, " select x from tmp" ) |> columntable
1036+ @test isequal (tbl. x, [missing , :a ])
1037+
1038+ tbl =
1039+ DBInterface. execute (
1040+ DBInterface. prepare (db, " select x from tmp" ),
1041+ ();
1042+ strict = true ,
1043+ ) |> columntable
1044+ @test isequal (tbl. x, [missing , :a ])
1045+
1046+ # Symbol in TEXT always works when first row is not NULL
1047+ db = SQLite. DB ()
1048+ DBInterface. execute (db, " create table tmp ( x TEXT )" )
1049+ DBInterface. execute (db, " insert into tmp values (?)" , (:a ,))
1050+ DBInterface. execute (db, " insert into tmp values (?)" , (nothing ,))
1051+ tbl = DBInterface. execute (db, " select x from tmp" ) |> columntable
1052+ @test isequal (tbl. x, [:a , missing ])
1053+
1054+ tbl =
1055+ DBInterface. execute (
1056+ DBInterface. prepare (db, " select x from tmp" ),
1057+ ();
1058+ strict = true ,
1059+ ) |> columntable
1060+ @test isequal (tbl. x, [:a , missing ])
1061+
10201062 db = SQLite. DB ()
10211063 DBInterface. execute (
10221064 db,
0 commit comments