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

fix: EXPOSED-135 Oracle does not use setSchema value as currentScheme #1828

Merged
merged 1 commit into from
Aug 9, 2023

Commits on Aug 9, 2023

  1. fix: EXPOSED-135 Oracle does not use setSchema value as currentScheme

    The following test fails when run on Oracle:
    
    CreateIndexTests/'test possibility to create indexes when table exists in different schemas'()
    
    Fails with 'ORA-01430: column being added already exists in table' due to this
    statement being incorrectly generated:
    ALTER TABLE TEST_TABLE ADD ID NUMBER(12) NOT NULL
    
    This happens because metadata returns an empty map of existing table ColumnMetadata
    when columns() is invoked in JdbcDatabaseMetadataImpl. getColumns() relies on the
    value of currentScheme which is invariably set to return databaseName in Oracle;
    that is, the default user set up at connection, EXPOSEDTEST.
    
    So, even though a correct statement is executed, which changes schema in the DB,
    Exposed is using the default schema to query metadata.
    
    currentScheme now attempts to get a connection schema first before using databaseName.
    bog-walk committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    27e705c View commit details
    Browse the repository at this point in the history