Skip to content

Commit

Permalink
AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpa…
Browse files Browse the repository at this point in the history
…pirkovskyy)
  • Loading branch information
Myroslav Papirkovskyi committed Dec 2, 2016
1 parent e242fc0 commit 80084a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
Expand Up @@ -26,7 +26,16 @@ delimiter ;

# USE @schema;

SET default_storage_engine=INNODB;
-- Set default_storage_engine to InnoDB
-- storage_engine variable should be used for versions prior to MySQL 5.6
set @version_short = substring_index(@@version, '.', 2);
set @major = cast(substring_index(@version_short, '.', 1) as SIGNED);
set @minor = cast(substring_index(@version_short, '.', -1) as SIGNED);
set @engine_stmt = IF(@major >= 5 AND @minor>=6, 'SET default_storage_engine=INNODB', 'SET storage_engine=INNODB');
prepare statement from @engine_stmt;
execute statement;
DEALLOCATE PREPARE statement;


CREATE TABLE stack(
stack_id BIGINT NOT NULL,
Expand Down

0 comments on commit 80084a9

Please sign in to comment.