Skip to content

clojure long values are being cast to floats or doubles #4

@paulrd

Description

@paulrd

Hi!

I have very strange bug where one of my column values gets cast to Double or Float before being written to sqlite. It only happens in very particular instances so I imagine it has some macro bug.

  (d/q (:writer db)
       ["create table region (id, min_x, max_x, min_y, max_y, population, binary_path)"])
  (d/q (:writer db)
       [(str "INSERT INTO region (min_x, max_x, min_y, max_y, population, binary_path) "
             "values(?, ?, ?, ?, ?, ?)") -180 180 -90 90 8 "p"])

The population value will get cast from 8 to 8.0. If you change the name of the table or any of the column names the bug usually goes away. For instance rename region to regioj or population to populatioj. The problem also goes away if I do not use the str method to create the query string. It usually goes away if I remove an unrelated column as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions