Created
February 12, 2014 04:31
-
-
Save DanielHeath/8950079 to your computer and use it in GitHub Desktop.
Mysql2 bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'mysql2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
mysql2 (0.3.15) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
mysql2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.require | |
$client = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "float_bug") | |
$client.query("drop table if exists float_bug") | |
$client.query("create table float_bug (field float)") | |
$client.query("insert into float_bug (field) values (999.9999)") | |
def logged_select(string) | |
puts string | |
puts $client.query(string).first["field"] | |
end | |
logged_select "select field from float_bug" | |
logged_select "select field * 1.0000000 as field from float_bug" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment