Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24634

unquotedCaseStrategy defaults to UPPER with Sybase

XMLWordPrintable

      Hibernate ORM 6.2.0.CR3 + Sybase 16.0 + Sybase JDBC driver (jConnect (TM) for JDBC(TM)/16.0 SP04 PL03 (Build 27544) + extra connection parameters: `SQLINITSTRING=set quoted_identifier on&SQLINITSTRING=set ansinull on`

      unquotedCaseStrategy defaults to UPPER and it is causing test failures in schema validation tests, an example from `EnumValidationTest`:

      org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [TestEntity]
              at app//org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:134)
              at app//org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:46)
              at app//org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:97)
              at app//org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:75)
              at app//org.hibernate.orm.test.schemavalidation.EnumValidationTest.doValidation(EnumValidationTest.java:116)
              at app//org.hibernate.orm.test.schemavalidation.EnumValidationTest.testValidation(EnumValidationTest.java:111)
      
      09:46:25,413 DEBUG IdentifierHelperBuilder:89 - JDBC driver metadata reported database stores unquoted identifiers in neither upper, lower nor mixed case
      09:46:25,414 DEBUG IdentifierHelperBuilder:116 - JDBC driver metadata reported database stores quoted identifiers in neither upper, lower nor mixed case
      

      it then defaults to https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/IdentifierHelperBuilder.java#L44

      private IdentifierCaseStrategy unquotedCaseStrategy = IdentifierCaseStrategy.UPPER;
      private IdentifierCaseStrategy quotedCaseStrategy = IdentifierCaseStrategy.MIXED;
      

      and then it fails to find a table in https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/NameSpaceTablesInformation.java#L31
      because `"TestEntity != "TESTENTITY"`.

      List of affected tests::

      org.hibernate.orm.test.tool.schema.SchemaToolTransactionHandlingTest.testValidateInExistingJtaTransaction
      org.hibernate.orm.test.schemaupdate.ColumnNamesTest.testSchemaUpdateWithQuotedColumnNames
      org.hibernate.orm.test.schemavalidation.EnumValidationTest.testValidation
      org.hibernate.orm.test.schemavalidation.InstantValidationTest.testValidation
      org.hibernate.orm.test.schemavalidation.LongVarcharValidationTest.testValidation
      org.hibernate.orm.test.schemavalidation.NumericValidationTest.testValidation
      org.hibernate.orm.test.version.db.DbVersionTest.testCollectionNoVersion
      

            Unassigned Unassigned
            msimka@redhat.com Martin Simka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: