Skip to content

Commit

Permalink
fix exec with non DB::Any args mixed with DB::Any
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Cardiff committed Dec 7, 2016
1 parent 4b01993 commit 6c94f0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions spec/driver_spec.cr
Expand Up @@ -216,6 +216,15 @@ describe Driver do
db.scalar("select col1 from table1").should eq({{value}})
end
end

it "insert/get value {{value.id}} from table with binding" do
with_test_db do |db|
db.exec "create table table1 (col0 varchar(25), col1 #{mysql_type_for({{value}})})"
# the next statement will force a union in the *args
db.exec %(insert into table1 (col0, col1) values (?, ?)), "", {{value}}
db.scalar("select col1 from table1").should eq({{value}})
end
end
{% end %}

# zero dates http://dev.mysql.com/doc/refman/5.7/en/datetime.html - work on some mysql not others,
Expand Down
2 changes: 1 addition & 1 deletion src/mysql/types.cr
Expand Up @@ -66,7 +66,7 @@ abstract struct MySql::Type

# Writes in packet the value in ProtocolBinary format.
# Used when sending query params.
def self.write(packet, v : DB::Any)
def self.write(packet, v)
raise "not supported write"
end

Expand Down

0 comments on commit 6c94f0c

Please sign in to comment.