← Back to team overview

maria-developers team mailing list archive

Re: Bug in ENUM options handling?

 

Hi, Steve!

On Oct 28, Steve Ellcey wrote:
> While working on MariaDB on HP-UX we noticed an inconsistency involving
> the type of enum arguments.
> 
> In init_variables and init_one_value (mysys/my_getopt.c), ENUM options
> are treated as unsigned longs but the enum arguments are actually
> declared as uint instead of ulong.  While this doesn't matter in 32 bit
> mode when int's and longs's are the same size, it can cause problems in
> 64 bit mode when long's are 64 bits and int's 32 bits.
> 
> We found 4 variables that we think should be ulong instead of uint:
> 
> 	plugin_maturity
> 	plugin_maturity_map
> 	thread_handling
> 	delay_key_write_options

Yes.
In 5.5 I've added an assert:

       DBUG_ASSERT(size == sizeof(ulong));

to Sys_var_enum class (5.5 has slightly different syntax for defining
variables). So in 5.5 all these variables are already ulong.

Regards,
Sergei



References