diff options
-rw-r--r-- | test/tc_integration.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/tc_integration.rb b/test/tc_integration.rb index 9d78313..6f1c139 100644 --- a/test/tc_integration.rb +++ b/test/tc_integration.rb @@ -948,6 +948,19 @@ module Integration end end + define_method( "test_type_translation_with_null_column" ) do + @db.type_translation = true + @db.execute "create table bar ( a integer, b datetime, c string )" + @db.execute "insert into bar (a, b, c) values (NULL, '1974-07-25 14:39:00', 'hello')" + @db.execute "insert into bar (a, b, c) values (1, NULL, 'hello')" + @db.execute "insert into bar (a, b, c) values (2, '1974-07-25 14:39:00', NULL)" + @db.query( "select * from bar" ) do |result| + assert_equal [nil, Time.local(1974, 7, 25, 14, 39, 0), 'hello'], result.next + assert_equal [1, nil, 'hello'], result.next + assert_equal [2, Time.local(1974, 7, 25, 14, 39, 0), nil], result.next + end + end + define_method( "test_next_results_as_hash" ) do @db.results_as_hash = true @result.reset( 1 ) |