diff options
| author | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-07-12 06:08:52 +0100 |
|---|---|---|
| committer | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-07-12 06:08:52 +0100 |
| commit | 3c00efc42ebb866f4294ebbadf0119ec65996798 (patch) | |
| tree | c68479d792db74ae20ae25ec0ef40d0dd66d2484 /sql/sql_parse.cc | |
| parent | 986984a314535116e01d212b6ae19c3a0dabc2b8 (diff) | |
| download | mariadb-git-3c00efc42ebb866f4294ebbadf0119ec65996798.tar.gz | |
Bug#11758414/Bug#50614: Default storage_engine not honored when set from within a stored procedure
When CREATE TABLE wasn't given ENGINE=... it would determine
the default ENGINE at parse-time rather than at execution
time, leading to incorrect behaviour (namely, later changes
to the default engine being ignore) when calling CREATE TABLE
from a stored procedure.
We now defer working out the default engine till execution of
CREATE TABLE.
Diffstat (limited to 'sql/sql_parse.cc')
| -rw-r--r-- | sql/sql_parse.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2eeabc2f0c1..14ad77d29fd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2617,6 +2617,12 @@ mysql_execute_command(THD *thd) goto end_with_restore_list; #endif /* + If no engine type was given, work out the default now + rather than at parse-time. + */ + if (!(create_info.used_fields & HA_CREATE_USED_ENGINE)) + create_info.db_type= ha_default_handlerton(thd); + /* If we are using SET CHARSET without DEFAULT, add an implicit DEFAULT to not confuse old users. (This may change). */ |
