Skip to content

Commit c63ea0a

Browse files
committed
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 <rohit.yadav@shapeblue.com>
1 parent d518b61 commit c63ea0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ private void addHostDetailsIndex(Connection conn) {
12971297
s_logger.debug("Index already exists on host_details - not adding new one");
12981298
} else {
12991299
// add the index
1300-
try(PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER IGNORE TABLE `cloud`.`host_details` ADD INDEX `fk_host_details__host_id` (`host_id`)");) {
1300+
try(PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER TABLE `cloud`.`host_details` ADD INDEX `fk_host_details__host_id` (`host_id`)");) {
13011301
pstmtUpdate.executeUpdate();
13021302
s_logger.debug("Index did not exist on host_details - added new one");
13031303
}catch (SQLException e) {

0 commit comments

Comments
 (0)