Hi Matheus,

Can you share your database host distro and specific package/version/build 
details to help investigate this further? You can also log issues here to have 
the developer community look at your bug report: 
https://github.com/apache/cloudstack/issues/new


Regards.

________________________________
From: Matheus Fontes <[email protected]>
Sent: Thursday, July 28, 2022 20:48
To: users <[email protected]>
Subject: Upgrade 4.16.1 to 4.17 fails on db schema

Hi,
We are trying to upgrade 4.16.1 to 4.17 but it fails on db schema upgrade.
When script tries to create procedure it fails.

DROP PROCEDURE IF EXISTS `cloud`.`ADD_GUEST_OS_AND_HYPERVISOR_MAPPING`;
CREATE PROCEDURE `cloud`.`ADD_GUEST_OS_AND_HYPERVISOR_MAPPING` (
    IN guest_os_category_id bigint(20) unsigned,
    IN guest_os_display_name VARCHAR(255),
    IN guest_os_hypervisor_hypervisor_type VARCHAR(32),
    IN guest_os_hypervisor_hypervisor_version VARCHAR(32),
    IN guest_os_hypervisor_guest_os_name VARCHAR(255)
        )
BEGIN
INSERT  INTO cloud.guest_os (uuid, category_id, display_name, created)
SELECT  UUID(), guest_os_category_id, guest_os_display_name, now()
FROM    DUAL
WHERE   not exists( SELECT  1
                     FROM    cloud.guest_os
                     WHERE   cloud.guest_os.category_id = guest_os_category_id
                       AND     cloud.guest_os.display_name = 
guest_os_display_name)

;       INSERT  INTO cloud.guest_os_hypervisor (uuid, hypervisor_type, 
hypervisor_version, guest_os_name, guest_os_id, created)
     SELECT     UUID(), guest_os_hypervisor_hypervisor_type, 
guest_os_hypervisor_hypervisor_version, guest_os_hypervisor_guest_os_name, 
guest_os.id, now()
     FROM       cloud.guest_os
     WHERE      guest_os.category_id = guest_os_category_id
       AND      guest_os.display_name = guest_os_display_name
       AND      NOT EXISTS (SELECT  1
                          FROM    cloud.guest_os_hypervisor as hypervisor
                          WHERE   hypervisor_type = 
guest_os_hypervisor_hypervisor_type
                            AND     hypervisor_version = 
guest_os_hypervisor_hypervisor_version
                            AND     hypervisor.guest_os_id = guest_os.id
                            AND     hypervisor.guest_os_name = 
guest_os_hypervisor_guest_os_name)
;END;

I tried to run it manually and same error occurs.

mysql> CREATE PROCEDURE `cloud`.`ADD_GUEST_OS_AND_HYPERVISOR_MAPPING` (
    ->     IN guest_os_category_id bigint(20) unsigned,
    ->     IN guest_os_display_name VARCHAR(255),
    ->     IN guest_os_hypervisor_hypervisor_type VARCHAR(32),
    ->     IN guest_os_hypervisor_hypervisor_version VARCHAR(32),
    ->     IN guest_os_hypervisor_guest_os_name VARCHAR(255)
    ->         )
    -> BEGIN
    -> INSERT  INTO cloud.guest_os (uuid, category_id, display_name, created)
    -> SELECT UUID(), guest_os_category_id, guest_os_display_name, now()
    -> FROM    DUAL
    -> WHERE not exists( SELECT  1
    ->                      FROM    cloud.guest_os
    ->                      WHERE   cloud.guest_os.category_id = 
guest_os_category_id
    ->                        AND     cloud.guest_os.display_name = 
guest_os_display_name)
    ->
    -> ;INSERT  INTO cloud.guest_os_hypervisor (uuid, hypervisor_type, 
hypervisor_version, guest_os_name, guest_os_id, created)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near '' at 
line 15
    ->      SELECT UUID(), guest_os_hypervisor_hypervisor_type, 
guest_os_hypervisor_hypervisor_version, guest_os_hypervisor_guest_os_name, 
guest_os.id, now()
    ->      FROM cloud.guest_os
    ->      WHERE guest_os.category_id = guest_os_category_id
    ->        AND guest_os.display_name = guest_os_display_name
    ->        AND NOT EXISTS (SELECT  1
    ->                           FROM    cloud.guest_os_hypervisor as hypervisor
    ->                           WHERE   hypervisor_type = 
guest_os_hypervisor_hypervisor_type
    ->                             AND     hypervisor_version = 
guest_os_hypervisor_hypervisor_version
    ->                             AND     hypervisor.guest_os_id = guest_os.id
    ->                             AND     hypervisor.guest_os_name = 
guest_os_hypervisor_guest_os_name)
    -> ;END;
ERROR 1054 (42S22): Unknown column 'guest_os_hypervisor_hypervisor_type' in 
'field list'
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near 'END' 
at line 1


** Mysql version 8.0



 

Reply via email to