You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The development PF branch fails to upgrade the database with the error message "PREVIOUS VERSION 14.1 DOES NOT MATCH 14.0" regardless of which previous DB version is entered. The upgrade script asks for that information, but then ignores it and uses the hard-coded values. The issue probably exists because 14.1 is not the released version, the DB script upgrade-X.X-X.Y.sql has 14.0 as the hard coded previous version. That's the only version that we can possibly be upgrading from? This means that an upgrade from 14.0 to 14.1 works. But "upgrading" from 14.1 to 14.1 doesn't.
upgrade-X.X-X.Y.sql contents:
SET @PREV_MAJOR_VERSION = 14;
SET @PREV_MINOR_VERSION = 0;
Why does it ask for the old version but then ignore the input?
Why is it asking questions at all? It can programmatically determine the old DB version since it's in the database and it already knows the version that the upgrade IS.
The text "You need to input the PF version that comes before $UPGRADE_TO" is not clear. It should say "What database version are you upgrading from? :" or something to that effect. But as I mention above, it really shouldn't be asking at all.
If I am staying in 14.1, it shouldn't be trying to upgrade the database at all, unless it really needs to.
To Reproduce
Steps to reproduce the behavior:
Update 14.1 with the upgrade script
See error "PREVIOUS VERSION 14.1 DOES NOT MATCH 14.0" failure.
Upgrade to a devel package detected. Renaming DB upgrade schema accordingly
---------------------------------------------------------------------------------
You need to input the PF version that comes before 14.1. This will replace X.X in the upgrade-X.X-X.Y.sql filename. Only input the minor version (ex: 11.2): 14.1
=================================================================================
Database pf runs version 14.1
Found upgrade path: /usr/local/pf/db/upgrade-14.1-14.1.sql
---------------------------------------------------------------------------------
Running /usr/local/pf/db/upgrade-14.1-14.1.sql
--------------
SET sql_mode = "NO_ENGINE_SUBSTITUTION"
--------------
--------------
SET @MAJOR_VERSION = 14
--------------
--------------
SET @MINOR_VERSION = 1
--------------
--------------
SET @PREV_MAJOR_VERSION = 14
--------------
--------------
SET @PREV_MINOR_VERSION = 0
--------------
--------------
SET @VERSION_INT = @MAJOR_VERSION << 16 | @MINOR_VERSION << 8
--------------
--------------
SET @PREV_VERSION_INT = @PREV_MAJOR_VERSION << 16 | @PREV_MINOR_VERSION << 8
--------------
--------------
DROP PROCEDURE IF EXISTS ValidateVersion
--------------
--------------
CREATE PROCEDURE ValidateVersion()
BEGIN
DECLARE PREVIOUS_VERSION int(11);
DECLARE PREVIOUS_VERSION_STRING varchar(11);
DECLARE _message varchar(255);
SELECT id, version INTO PREVIOUS_VERSION, PREVIOUS_VERSION_STRING FROM pf_version ORDER BY id DESC LIMIT 1;
IF PREVIOUS_VERSION != @PREV_VERSION_INT THEN
SELECT CONCAT('PREVIOUS VERSION ', PREVIOUS_VERSION_STRING, ' DOES NOT MATCH ', CONCAT_WS('.', @PREV_MAJOR_VERSION, @PREV_MINOR_VERSION)) INTO _message;
SIGNAL SQLSTATE VALUE '99999'
SET MESSAGE_TEXT = _message;
END IF;
END
--------------
Checking PacketFence schema version...
--------------
call ValidateVersion
--------------
ERROR 1644 (99999) at line 50: PREVIOUS VERSION 14.1 DOES NOT MATCH 14.0
Expected behavior
dev->dev branch upgrade should work
The text was updated successfully, but these errors were encountered:
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
dev->dev branch upgrade should work
The text was updated successfully, but these errors were encountered: