1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

create table options bug:

parse_engine_table_options() was only called when there was at least option with a
non-default value. otherwise it was not called and option structure was not
allocated at all. NULL pointer dereference in ::open().
This commit is contained in:
Sergei Golubchik
2010-04-30 22:09:27 +02:00
parent 2b8de050bf
commit 8792d8a3ac
2 changed files with 12 additions and 2 deletions

View File

@@ -367,6 +367,15 @@ int ha_example::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(1);
thr_lock_data_init(&share->lock,&lock,NULL);
example_table_options_struct *options=
(example_table_options_struct *)table->s->option_struct;
DBUG_ASSERT(options);
DBUG_PRINT("info", ("strparam: '%-.64s' ullparam: %llu enumparam: %u "\
"boolparam: %u",
(options->strparam ? options->strparam : "<NULL>"),
options->ullparam, options->enumparam, options->boolparam));
DBUG_RETURN(0);
}