3330 Vasil Dimov 2011-07-29
Do not allow innodb_buffer_pool_filename to be set to NULL.
Without this validation, if one does
SET GLOBAL innodb_buffer_pool_filename=NULL;
then mysqld would crash somewhere inside mysql code, trying to do strlen()
on a NULL pointer.
modified:
storage/innobase/handler/ha_innodb.cc
3329 Vasil Dimov 2011-07-29
Implement part of WL#5533 Deprecate features in Fuchsia
Print a deprecation warning if innodb_locks_unsafe_for_binlog is used.
modified:
storage/innobase/handler/ha_innodb.cc
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc revid:vasil.dimov@stripped
+++ b/storage/innobase/handler/ha_innodb.cc revid:vasil.dimov@stripped
@@ -11081,6 +11081,37 @@ ha_innobase::check_if_incompatible_data(
return(COMPATIBLE_DATA_YES);
}
+/*************************************************************//**
+Check if the value passed is NULL.
+@return 0 for valid (!= NULL) */
+static
+int
+innodb_buffer_pool_filename_validate(
+/*=================================*/
+ THD* thd, /*!< in: thread handle */
+ struct st_mysql_sys_var* var, /*!< in: pointer to system
+ variable */
+ void* save, /*!< out: immediate result
+ for update function */
+ struct st_mysql_value* value) /*!< in: incoming string */
+{
+ const char* p;
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ int len = sizeof(buff);
+
+ ut_a(save != NULL);
+ ut_a(value != NULL);
+
+ p = value->val_str(value, buff, &len);
+
+ *static_cast<const char**>(save) = p;
+
+ if (p != NULL) {
+ return(0);
+ }
+
+ return(1);
+}
/************************************************************//**
Validate the file format name and return its corresponding id.
@return valid file format id */
@@ -12374,7 +12405,7 @@ static MYSQL_SYSVAR_LONG(buffer_pool_ins
static MYSQL_SYSVAR_STR(buffer_pool_filename, srv_buf_dump_filename,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
"Filename to/from which to dump/load the InnoDB buffer pool",
- NULL, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
+ innodb_buffer_pool_filename_validate, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
static MYSQL_SYSVAR_BOOL(buffer_pool_dump_now, innodb_buffer_pool_dump_now,
PLUGIN_VAR_RQCMDARG,
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (vasil.dimov:3329 to 3330) | vasil.dimov | 3 Aug |