Skip to content

Commit

Permalink
Handle nulls of type decimal.
Browse files Browse the repository at this point in the history
Also, remove redundant line.
  • Loading branch information
Chris Couzens committed Mar 8, 2012
1 parent bb0159f commit a1dc8f1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -661,7 +661,6 @@ def exec_query(sql, name = 'SQL', binds = [])
result, col_num, name, ruby_type, native_type, precision, scale, max_size, nullable = SA.instance.api.sqlany_get_column_info(stmt, i)
sqlanywhere_error_test(sql) if result==0
fields << name
native_type = SA.instance.api.sqlany_get_column_info(stmt, i)[4]
native_types << native_type
end
rows = []
Expand Down Expand Up @@ -727,6 +726,7 @@ def query(sql)
# the types are taken from here
# http://dcx.sybase.com/1101/en/dbprogramming_en11/pg-c-api-native-type-enum.html
def native_type_to_ruby_type(native_type, value)
return nil if value.nil?
case native_type
when 484 # DT_DECIMAL (also and more importantly numeric)
BigDecimal.new(value)
Expand Down

0 comments on commit a1dc8f1

Please sign in to comment.