integer values do not unpack correctly in prepared stmt
Bug #1148425 reported by
Wim Lewis
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-
There's a unit test which shows this problem in http://
Related branches
lp:~wiml/libdrizzle/integer-sizes
- Andrew Hutchings: Approve
-
Diff: 618 lines (+134/-80)14 files modifiedlibdrizzle-5.1/constants.h (+15/-21)
libdrizzle-5.1/field_client.h (+17/-2)
libdrizzle/binlog.cc (+5/-5)
libdrizzle/conn.cc (+6/-0)
libdrizzle/field.cc (+36/-18)
libdrizzle/handshake.cc (+2/-2)
libdrizzle/pack.cc (+19/-7)
libdrizzle/pack.h (+2/-1)
libdrizzle/result.cc (+10/-8)
libdrizzle/result.h (+6/-6)
libdrizzle/statement.cc (+1/-1)
libdrizzle/statement_param.cc (+8/-2)
libdrizzle/structs.h (+6/-6)
tests/unit/statement.c (+1/-1)
lp:~wiml/libdrizzle/unit-tests
- Andrew Hutchings: Approve
-
Diff: 1326 lines (+1094/-59)11 files modifiedMakefile.am (+1/-0)
libdrizzle/statement.cc (+1/-0)
tests/unit/binlog.cc (+5/-14)
tests/unit/column.c (+11/-31)
tests/unit/common.c (+93/-0)
tests/unit/common.h (+26/-8)
tests/unit/connect_uds.c (+2/-2)
tests/unit/datetypes.c (+330/-0)
tests/unit/include.am (+21/-4)
tests/unit/nulls.c (+278/-0)
tests/unit/numbers.c (+326/-0)
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.