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

The generation of the drop schema does not filter sequence with schemaFilter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0, 5.0.9, 5.2.1
    • Fix Version/s: 5.2.2, 5.1.1
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Suitable for new contributors:
      Yes, likely
    • Last commented by a user?:
      true
    • Sprint:

      Description

      When using SchemaExport to generate DDL, the drop schema does not rely on the SchemaFilter to filter sequences.

      The suggested correction is to add a call to this filter after ligne L243

      https://github.com/aleksabl/hibernate-core/blob/master/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaDropperImpl.java#L243

      Current code ( SchemaDropperImpl line 243)

      			for ( Sequence sequence : namespace.getSequences() ) {
      				checkExportIdentifier( sequence, exportIdentifiers );
      				applySqlStrings( dialect.getSequenceExporter().getSqlDropStrings( sequence, metadata ), formatter, options, targets );
      			}
       

      Suggested correction :

      			for ( Sequence sequence : namespace.getSequences() ) {
      				if ( !schemaFilter.includeSequence( sequence ) ) {
      					continue;
      				}
      				checkExportIdentifier( sequence, exportIdentifiers );
      				applySqlStrings( dialect.getSequenceExporter().getSqlDropStrings( sequence, metadata ), formatter, options, targets );
      			}
      

      Remark : this is done on the create schema in this line :

      https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaCreatorImpl.java#L285

      This is just a mirror correction on the drop side.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: