diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-22 14:06:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-22 17:57:00 +0200 |
commit | aa82673655e7aecd7cf2e7e9b5fd407eee2b01f2 (patch) | |
tree | dc9565b669b8715152dbaf9b34a8a3929d72f634 /mysql/types/test.hxx | |
parent | 6b224b9b316fd3c3d7642ba7ace2dd6b2cdcf953 (diff) |
Test automatic and custom ENUM mappings
Diffstat (limited to 'mysql/types/test.hxx')
-rw-r--r-- | mysql/types/test.hxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index fa1d7b3..209782e 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -210,12 +210,17 @@ struct object // Test ENUM representations (integer and string). // - color enum_; + color enum_def_; - #pragma db type ("ENUM ('red', 'green', 'blue')") + // Map to a custom MySQL ENUM type. + // + #pragma db type ("ENUM('R', 'G', 'B')") + color enum_cst_; + + #pragma db type ("ENUM('red', 'green', 'blue')") std::string enum_str_; - #pragma db type ("SET ('red', 'green', 'blue')") + #pragma db type ("SET('red', 'green', 'blue')") set set_; // Test NULL value. @@ -261,7 +266,8 @@ struct object longtext_ == y.longtext_ && longblob_ == y.longblob_ && bit_ == y.bit_ && - enum_ == y.enum_ && + enum_def_ == y.enum_def_ && + enum_cst_ == y.enum_cst_ && enum_str_ == y.enum_str_ && set_ == y.set_ && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); |