BIT values are kept as String instead of being converted to Integer.
This small test unit illustrates this :
require 'test/unit'
require 'dbi'
class TC_Bit < Test::Unit::TestCase
def test_bit
db = DBI.connect('DBI:Mysql:your_database', 'your_user', 'your_password')
db.do "DROP TABLE IF EXISTS test_dbi"
db.do "CREATE TABLE test_dbi (bit_value BIT, int_value INTEGER)"
db.do "INSERT INTO test_dbi (bit_value, int_value) VALUES (0,0)"
assert_equal [0,0], db.select_one("SELECT bit_value, int_value FROM test_dbi")
end
end
The result is :
<[0, 0]> expected but was
<["0", 0]>.
|