-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Labels
area/storageIndicates an issue that touches storage (change in data layout or data manipulation)Indicates an issue that touches storage (change in data layout or data manipulation)kind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/importantMust be worked on very soonMust be worked on very soonrelease/26.5.1release/26.6.0team/core-clientsteam/core-shared
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
No response
Describe the bug
Upgrading database from 26.3.4 -> 26.4.7 failed.
We are using manual strategy for upgrades (--spi-connections-jpa--quarkus--migration-strategy=manual).
SQL generated for upgrades to version 26.4.x is incorrect. It contains:
-- Changeset META-INF/jpa-changelog-26.4.0.xml::26.4.0-40933-saml-encryption-attributes::keycloak
-- WARNING The following SQL may change each run and therefore is possibly incorrect and/or invalid:
INSERT INTO KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES (CLIENT_ID,NAME,VALUE) SELECT ID, ?, ? FROM KEYCLOAK_PUBLIC.CLIENT WHERE PROTOCOL = ? AND ID NOT IN (SELECT CLIENT_ID FROM KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES WHERE NAME = ?);
INSERT INTO KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES (CLIENT_ID,NAME,VALUE) SELECT ID, ?, ? FROM KEYCLOAK_PUBLIC.CLIENT WHERE PROTOCOL = ? AND ID NOT IN (SELECT CLIENT_ID FROM KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES WHERE NAME = ?);
INSERT INTO KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES (CLIENT_ID,NAME,VALUE) SELECT ID, ?, ? FROM KEYCLOAK_PUBLIC.CLIENT WHERE PROTOCOL = ? AND ID NOT IN (SELECT CLIENT_ID FROM KEYCLOAK_PUBLIC.CLIENT_ATTRIBUTES WHERE NAME = ?);Which contains parametrized sql's without values.
We are using Oracle, using: ojdbc17-23.6.0.24.10.jar and orai18n-23.6.0.24.10.jar
Version
26.4.7
Regression
- The issue is a regression
Expected behavior
SQL's for DB upgrade with manual strategy contains proper statements.
Actual behavior
SQL's for DB upgrade with manual strategy contains invalid SQL statements.
How to Reproduce?
Try to generate DB upgrade SQL for database with version 26.3.4 to 26.4.7 (probably every 26.4.x version).
/.../keycloak-26.4.7/bin/kc.sh \
start \
--spi-connections-jpa-quarkus-migration-strategy=manual \
--spi-connections-jpa-quarkus-initialize-empty=false \
--spi-connections-jpa-quarkus-migration-export="$SQL_PATH"
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/storageIndicates an issue that touches storage (change in data layout or data manipulation)Indicates an issue that touches storage (change in data layout or data manipulation)kind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/importantMust be worked on very soonMust be worked on very soonrelease/26.5.1release/26.6.0team/core-clientsteam/core-shared