integer values do not unpack correctly in prepared stmt

Bug #1148425 reported by Wim Lewis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle Client & Protocol Library
Fix Released
High
Wim Lewis

Bug Description

Integer values returned by drizzle_stmt_get*() are sometimes corrupted. I think the problem is if your char type is signed, then the unpack macros in constants.h will sign-extend less-significant bytes before ORing them into the result. So a SHORT column with a value of 0x1F0 will read back as 0xFFF0.

The non-prepared-statement API doesn't have this problem, presumably because the results are converted to ASCII text by the server.

There's a unit test which shows this problem in http://bazaar.launchpad.net/~wiml/libdrizzle/unit-tests/revision/109 , and a proposed fix in http://bazaar.launchpad.net/~wiml/libdrizzle/integer-sizes/revision/110 .

Related branches

Changed in libdrizzle:
importance: Undecided → High
assignee: nobody → Wim Lewis (wiml)
status: New → In Progress
Changed in libdrizzle:
status: In Progress → Fix Released
Changed in libdrizzle:
milestone: none → 5.1.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.