You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mp...@apache.org on 2016/12/02 14:53:39 UTC
ambari git commit: AMBARI-18951. Force InnoDB usage for MySQL. Fix
for MySQL < 5.6. (mpapirkovskyy)
Repository: ambari
Updated Branches:
refs/heads/trunk e242fc091 -> 80084a9d8
AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/80084a9d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/80084a9d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/80084a9d
Branch: refs/heads/trunk
Commit: 80084a9d8de9110365c6f1ef68362b502e07cf28
Parents: e242fc0
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Fri Dec 2 16:41:40 2016 +0200
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Fri Dec 2 16:52:55 2016 +0200
----------------------------------------------------------------------
.../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/80084a9d/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index b01ed2f..82ce31e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -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,