Sha256: 9ba14b0f0c944a23ce0114f23a81a04f1d5fb0b6f46cff00536d51b4c81872bc

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

class TestMySQLBlob < DBDConfig.testbase(:mysql)
    def test_blob_round_trip
        data =(0..255).collect{|n| n.chr}.join("")
        sql = "INSERT INTO blob_test (name, data) VALUES (?, ?)"

        @dbh.do(sql, 'test1', DBI::Binary.new(data)) 
        @dbh.do(sql, 'test2', data) 

        @dbh.prepare(sql) do |sth|
            sth.execute('test3', DBI::Binary.new(data))
            sth.execute('test4', data)
        end

        @dbh.select_all("SELECT name, data FROM blob_test") do |name, fetch_data|
            assert_equal fetch_data, data
        end
    end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
ydbi-0.6.0 test/dbd/mysql/test_blob.rb
ydbi-0.5.7 test/dbd/mysql/test_blob.rb
ydbi-0.5.0 test/dbd/mysql/test_blob.rb
rails-dbd-mysql-0.1.0 test/dbd/mysql/test_blob.rb
dbd-mysql-0.4.4 test/dbd/mysql/test_blob.rb
dbd-mysql-0.4.3 test/dbd/mysql/test_blob.rb
dbd-mysql-0.4.2 test/dbd/mysql/test_blob.rb
dbd-mysql-0.4.1 test/dbd/mysql/test_blob.rb
dbd-mysql-0.4.0 test/dbd/mysql/test_blob.rb
dbd-mysql-0.3.3 test/dbd/mysql/test_blob.rb