diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-09-11 15:20:03 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-09-11 15:20:03 +0200 |
commit | 829c6099b7e0a9eb689456db4160362d1e1c8011 (patch) | |
tree | 6ba803d2b34c2c76296781f94c054521d4e3407a /mysys/my_getopt.c | |
parent | 66a1902a01bcdc6ad42187339417a739847a4dd4 (diff) | |
download | mariadb-git-829c6099b7e0a9eb689456db4160362d1e1c8011.tar.gz |
After-merge fix for MySQL 5.1.38 merge into MariaDB.
Due to a bugfix for enum options in MariaDB, my_getopt parses enums into an ulong.
However, some new code from MySQL was written to assume enums take an uint.
Fix by using the correct type.
(The new MySQL code in addition had an implicit assumption that my_bool and uint were
compatible; remove this assumption).
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r-- | mysys/my_getopt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index e57c1d71a13..ceb99975cdb 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -414,11 +414,17 @@ invalid value '%s'", (optp->var_type & GET_TYPE_MASK) == GET_ENUM)) { if (optend == disabled_my_option) - *((my_bool*) value)= (my_bool) 0; + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + *((my_bool*) value)= (my_bool) 0; + else + *((ulong*) value)= (ulong) 0; else { if (!optend) /* No argument -> enable option */ - *((my_bool*) value)= (my_bool) 1; + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + *((my_bool*) value)= (my_bool) 1; + else + *((ulong*) value)= (ulong) 1; else argument= optend; } |