Uploaded image for project: 'Hibernate ORM'
  1. HHH-10718

Underscore in table name can result in SchemaExtractionException: More than one table found

    Details

      Description

      Suppose the schema or catalog contains two tables with similar names, eg an_entity and anoentity. When looking up table metadata via the JDBC metadata for the an_entity the underscore (single character wildcard) will cause two rows of metadata to be returned since the underlying metadata query seems to use a LIKE predicate and hence the wildcard matches both names.

      The method
      InformationExtractorJdbcDatabaseMetaDataImpl.processGetTableResults
      will throw an error in the event that multiple rows are returned.

      A test case is attached. Run first with hbm2ddl.auto to create and then setting to update will show the problem. The test case is in the form of an Eclipse Maven project.

      I also have a suggested fix which I will submit, in which we find the row of metadata whose name actually matches that requested.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: