diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-07-14 17:11:01 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-07-14 23:12:28 +0200 |
commit | e67830fa25b5cf42428d32b544b115fda44383a3 (patch) | |
tree | d8082a82f9fd05fdfa8d5d7a1353e9091e68eec2 /pgsql/types/driver.cxx | |
parent | 92c6c45e7d3d95ef6241502824239a28a38dd7c2 (diff) |
Test VARBIT bit length is handled correctly
Diffstat (limited to 'pgsql/types/driver.cxx')
-rw-r--r-- | pgsql/types/driver.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 5c5145a..17f48f4 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -47,15 +47,17 @@ main (int argc, char* argv[]) string short_str (128, 's'); string medium_str (250, 'm'); string long_str (2040, 'l'); - buffer long_buf (long_str.c_str (), long_str.size ()); - - unsigned char varbit_buf[8] = {1, 2, 1, 2, 1, 1, 1, 1}; o.char_ = short_str; o.varchar_ = medium_str; o.text_ = long_str; + + buffer long_buf (long_str.c_str (), long_str.size ()); o.bytea_ = long_buf; - o.varbit_ = buffer (varbit_buf, 8); + + unsigned char varbit_buf[8] = {1, 3, 1, 3, 1, 3, 1, 3}; + o.varbit_.size = 52; + o.varbit_.ubuffer_ = ubuffer (varbit_buf, 8); o.bit_.a = 0; o.bit_.b = 1; |