Details
-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
This should fail:
mysqld --plugin-load=EXAMPLE=ha_example.so --plugin-example-enum-var=noexist
But it does not in current MariaDB 5.1, due to an incorrect cast/unsigned comparison. Instead it sets the variable to some value (0 I think).
Fix:
=== modified file 'mysys/my_getopt.c'
— mysys/my_getopt.c 2009-05-20 15:34:34 +0000
+++ mysys/my_getopt.c 2009-09-02 08:13:14 +0000
@@ -603,6 +603,7 @@ static int setval(const struct my_option
my_bool set_maximum_value)
{
int err= 0;
+ int pos;
if (value && argument)
{
@@ -647,7 +648,9 @@ static int setval(const struct my_option
return EXIT_OUT_OF_MEMORY;
break;
case GET_ENUM:
- if (((*(ulong *)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0)
+ pos= find_type(argument, opts->typelib, 2) - 1;
+ (*(ulong *)result_pos)= pos;
+ if (pos < 0)
return EXIT_ARGUMENT_INVALID;
break;
case GET_SET:
Bug was introduced with this patch:
------------------------------------------------------------
revno: 2703
revision-id: <email address hidden>
parent: <email address hidden>
committer: <email address hidden>
branch nick: work-5.1-ourdelta
timestamp: Wed 2009-05-20 17:34:34 +0200
message:
Fix accessing ulong enum option as uint, failing on 64-bit big-endian.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Launchpad bug id: 423035