Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop searching the 'am_api_policy_mapping' on each database of the db server when it doesn't exist on the pointed database - MariaDB #3521

Open
nadeepoornima opened this issue Jan 13, 2025 · 0 comments
Labels

Comments

@nadeepoornima
Copy link

Description

The 'am_api_policy_mapping' table doesn't exist in the database, the catalog will be null[1], however, the search will occur across all databases. In other words, if another accessible APIM-related database exists and contains the AM_API_POLICY_MAPPING table, the search will return true because the catalog (the first argument) is set to null in [1]. When the catalog is null in [1], the database name is not used to narrow the search.

[1]. https://github.com/wso2-support/carbon-apimgt/blob/53af28b5efec80d06196f772336d6a09d80021bc/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L20955

Steps to Reproduce

Did a migration from APIM 3.2.0 to APIM 4.2.0

  • The migration DB doesn't exist in the 'AM_API_POLICY_MAPPING' table, and it will be created during the migration from APIM 4.0.0 to APIM 4.1.0
  • There is a test DB which contains the 'AM_API_POLICY_MAPPING' table
  • During APIM 4.2.0 migration start-up. the 'AM_API_POLICY_MAPPING' table exists 'true'[2] even though it doesn't exit the pointed database.

[2]. https://github.com/wso2-support/carbon-apimgt/blob/53af28b5efec80d06196f772336d6a09d80021bc/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L20940

Version

APIM 4.2.0

Environment Details (with versions)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant