File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ Base.isopen(conn::Connection) = API.isopen(conn.mysql)
302302
303303function juliatype (field_type, notnullable, isunsigned, isbinary)
304304 T = API. juliatype (field_type)
305- T2 = isunsigned ? unsigned (T) : T
305+ T2 = isunsigned && ! (T <: AbstractFloat ) ? unsigned (T) : T
306306 T3 = ! isbinary && T2 == Vector{UInt8} ? String : T2
307307 return notnullable ? T3 : Union{Missing, T3}
308308end
Original file line number Diff line number Diff line change @@ -279,6 +279,14 @@ ret = columntable(res)
279279# multiple-queries not supported by mysql w/ prepared statements
280280@test_throws MySQL. API. StmtError DBInterface. prepare (conn, " select * from Employee; select DeptNo, OfficeNo from Employee where OfficeNo IS NOT NULL" )
281281
282+ # GitHub issue [#173](https://github.com/JuliaDatabases/MySQL.jl/issues/173)
283+ DBInterface. execute (conn, " DROP TABLE if exists unsigned_float" )
284+ DBInterface. execute (conn, " CREATE TABLE unsigned_float(x FLOAT unsigned)" )
285+ DBInterface. execute (conn, " INSERT INTO unsigned_float VALUES (1.1), (1.2)" )
286+ res = DBInterface. execute (conn, " select x from unsigned_float" ) |> columntable
287+ @test res. x == Vector {Float32} ([1.1 , 1.2 ])
288+ # end issue #173
289+
282290# 156
283291res = DBInterface. execute (conn, " select * from Employee" )
284292DBInterface. close! (conn)
You can’t perform that action at this time.
0 commit comments