ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject ambari git commit: AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)
Date Fri, 02 Dec 2016 14:53:39 GMT
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 <mpapyrkovskyy@hortonworks.com>
Authored: Fri Dec 2 16:41:40 2016 +0200
Committer: Myroslav Papirkovskyi <mpapyrkovskyy@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,


Mime
View raw message