开发者

Mysql 5.5 Ruby DBI Segmentation

开发者 https://www.devze.com 2023-02-15 05:02 出处:网络
The Segfault appears to be on closing the connection begin dbh = DBI.connect(\"DBI:Mysql:testdb:localhost\", \"user\", \"pass\")

The Segfault appears to be on closing the connection

begin
  dbh = DBI.connect("DBI:Mysql:testdb:localhost", "user", "pass")

  rows = dbh.do("INSERT IGNORE INTO `HS_pList` (projName, projSource, projLink, projHash, projLoc) Values ('" + dbh.escape_string(@name) + "','" + @source + "','" + @link + "','" + @hash + "','" + @loc + "')")

rescue DBI::DatabaseError => e
  puts "Error code: #{e.err}"
  puts "Error message: #{e.errstr}"
ensure
  dbh.disconnect if dbh
end

I had a ; at the end of the string for the insert but it did not change anything. I get the same error if all i am doing is opening and closing an error does any one have an Idea of why. All the variables are set fo开发者_运维知识库r constructing the string.

mysql 5.5

ruby 1.9.2p180

dbi 0.4.5

dbd-mysql 0.4.4

mysql 2.8.1 x86-mingw32


Figured out what it was I had to copy the libmysql.dll to the ruby bin and I also tried copying the libmysqld.dll and now it works must have the proper disconnects in that one?

0

精彩评论

暂无评论...
验证码 换一张
取 消