Fix for Bug#50221 Server refuses to start from non-default installdir on Solaris 32-bit
When starting mysqld it did not recognize most of the options given on the command line when it was compiled for 32-bit Solaris using Sun Studio compiler. The cause for this was that most of the entries in the my_long_options array contained "garbage" data. The garbage data was caused by a compiler bug. When initilizing the def_value member for the "default-storage-engine" entry it was initialized like this: (longlong)"MyISAM" i.e. casting a 32 bit pointer to a 64 bit integer value. Due to the compiler bug only 4 bytes was allocated (instead of 8 bytes). This caused everything following this entry to be stored at a location that was 4 byte wrong. The fix/work-around for this problem is initialize the def_value for default-storage-engine in my_long_options to 0 and instead initialize the default_storage_engine variable to "MyISAM" in init_common_variables(). sql/mysqld.cc: Due to a bug in Sun Studio compiler when generating 32 bit code the initialization of the def_value member of the default-storage-engine entry in my_long_options only got 4 bytes allocated instead of 8 bytes. The compiler bug was triggered by casting a 32 bit pointer to a 64 bit integer value in the initialization code for my_long_options. To avoid triggering the compiler bug the intialization of the def_value in my_long_options is set to 0 and instead the default_storage_engine is initialized to "MyISAM" in init_common_variables().
Showing
Please register or sign in to comment