You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sw...@apache.org on 2016/04/28 22:06:47 UTC

[1/2] git commit: updated refs/heads/master to ad138a1

Repository: cloudstack
Updated Branches:
  refs/heads/master 12d8e53dd -> ad138a15d


engine/schema: fix upgrade path to work with MySQL 5.7

Found this issue when using MySQL 5.7 with Ubuntu 16.04 with following settings:

sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
server-id   = 1
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c63ea0a2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c63ea0a2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c63ea0a2

Branch: refs/heads/master
Commit: c63ea0a240df0c5af2802b424d70083bbfd0e919
Parents: d518b61
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Mon Apr 25 14:47:22 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Mon Apr 25 14:47:22 2016 +0530

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c63ea0a2/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index b816fdc..7d67d2e 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -1297,7 +1297,7 @@ public class Upgrade410to420 implements DbUpgrade {
                     s_logger.debug("Index already exists on host_details - not adding new one");
                 } else {
                     // add the index
-                    try(PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER IGNORE TABLE `cloud`.`host_details` ADD INDEX `fk_host_details__host_id` (`host_id`)");) {
+                    try(PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER TABLE `cloud`.`host_details` ADD INDEX `fk_host_details__host_id` (`host_id`)");) {
                         pstmtUpdate.executeUpdate();
                         s_logger.debug("Index did not exist on host_details -  added new one");
                     }catch (SQLException e) {


[2/2] git commit: updated refs/heads/master to ad138a1

Posted by sw...@apache.org.
Merge pull request #1517 from shapeblue/mysql-5.7-upgradefix

engine/schema: fix upgrade path to work with MySQL 5.7Found this issue when using MySQL 5.7 with Ubuntu 16.04. The upgrade path fix removes an invalid `IGNORE` param that is deprecated now, in the upgrade path we run the alter statement to add an index only if it does not exist so we're good.

For MySQL 5.7, we'll also need to update the docs at some point to include `server-id` along with other parameters. Some of the SQL statements used throughout engine/schema don't adhere to SQL 99 standard which is enforced by default in MySQL 5.7, therefore the following sql-mode (for backward compatibility with mysql 5.6 modes) will be necessary for anyone willing to use MySQL 5.7 (until we fix codebase wide raw and generated sql statements to be SQL99 compliant):

sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
server-id   = 1
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'

/cc @swill @jburwell @agneya2001 @wido @DaanHoogland  and others

* pr/1517:
  engine/schema: fix upgrade path to work with MySQL 5.7

Signed-off-by: Will Stevens <wi...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ad138a15
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ad138a15
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ad138a15

Branch: refs/heads/master
Commit: ad138a15d7cf62306ad827c404167716dd5fed3e
Parents: 12d8e53 c63ea0a
Author: Will Stevens <wi...@gmail.com>
Authored: Thu Apr 28 16:06:20 2016 -0400
Committer: Will Stevens <wi...@gmail.com>
Committed: Thu Apr 28 16:06:20 2016 -0400

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------