Skip to content

DB.asAny and DB.asString are not checking for null #1180

Closed
indrajitr opened this Issue Jan 10, 2012 · 3 comments

4 participants

@indrajitr
Lift Web Framework member

When I perform a query with net.liftweb.db.DB.performQuery(sql) for my int and double columns I am getting zeros when the database has null. It seems to me that DB.asAny and DB.asString should check for null and leave that value as null instead of calling (for example) rs.getDouble(pos) and getting back 0.0

Problem code is at:
https://github.com/lift/framework/blob/master/persistence/db/src/main/scala/net/liftweb/db/DB.scala#L414

@dpp
Lift Web Framework member
dpp commented Jan 10, 2012

(In [[r:d0baf2e1f0d6963ffa4b6f36c081e2badfe698e9]]) Closes #1180. Return types for DB columns that are primitives will come back as null rather than 0/false if the columns are null

Branch: dpp_issue_1180

@dpp dpp was assigned Mar 1, 2012
@pbrant pbrant pushed a commit to pbrant/framework that referenced this issue May 8, 2012
@dpp dpp Closes #1180. Return types for DB columns that are primitives will co…
…me back as null rather than 0/false if the columns are null
d0baf2e
@Shadowfiend
Lift Web Framework member

This has been fixed since 2.5.1 as per above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.