weizhouapache commented on code in PR #7028:
URL: https://github.com/apache/cloudstack/pull/7028#discussion_r1059361082
##########
engine/schema/src/main/resources/META-INF/db/schema-41720to41800.sql:
##########
@@ -869,3 +869,17 @@ WHERE usage_unit = 'Policy-Month';
-- delete configuration task.cleanup.retry.interval #6910
DELETE FROM `cloud`.`configuration` WHERE name='task.cleanup.retry.interval';
+
+--- #6888 add index to speed up querying IPs in the network-tab
+DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_KEY`;
+
+CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_KEY` (
+ IN in_index_name VARCHAR(200)
+ , IN in_table_name VARCHAR(200)
+ , IN in_key_definition VARCHAR(1000)
+)
+BEGIN
+
+ DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT('ALTER
TABLE ', in_tablename); SET @ddl = CONCAT(@ddl, ' ', ' ADD KEY ') ; SET @ddl =
CONCAT(@ddl, ' ', in_index_name); SET @ddl = CONCAT(@ddl, ' ',
in_index_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE
stmt; END;
Review Comment:
```suggestion
DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT('ALTER
TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', ' ADD KEY ') ; SET @ddl =
CONCAT(@ddl, ' ', in_index_name); SET @ddl = CONCAT(@ddl, ' ',
in_key_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE
stmt; END;
```
with this change, the CALL works. @DaanHoogland
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]