--- ha_innodb.cc.orig 2009-11-13 15:16:37.000000000 +0100 +++ ha_innodb.cc 2009-11-13 18:12:21.000000000 +0100 @@ -9657,6 +9657,7 @@ struct st_mysql_value* value) /*!< in: incoming string */ { const char* file_format_input; + char* file_format_input_strdup; char buff[STRING_BUFFER_USUAL_SIZE]; int len = sizeof(buff); @@ -9673,8 +9674,18 @@ if (format_id <= DICT_TF_FORMAT_MAX) { - *static_cast(save) = file_format_input; - return(0); + /* Copy out from stack-allocated memory (which will not + survive return from this function). The memory will be + freed in innodb_file_format_check_update(). */ + file_format_input_strdup = thd_strmake(thd, file_format_input, len); + + *static_cast(save) = file_format_input_strdup; + + if (file_format_input_strdup == NULL) { + return(1); + } else { + return(0); + } } } @@ -9734,6 +9745,7 @@ struct st_mysql_value* value) /*!< in: incoming string */ { const char* file_format_input; + char* file_format_input_strdup; char buff[STRING_BUFFER_USUAL_SIZE]; int len = sizeof(buff); @@ -9755,9 +9767,18 @@ } else if (innobase_file_format_check_validate( file_format_input)) { - *static_cast(save) = file_format_input; - - return(0); + /* Copy out from stack-allocated memory (which will not + survive return from this function). The memory will be + freed in innodb_file_format_check_update(). */ + file_format_input_strdup = thd_strmake(thd, file_format_input, len); + + *static_cast(save) = file_format_input_strdup; + + if (file_format_input_strdup == NULL) { + return(1); + } else { + return(0); + } } else { sql_print_warning(