[JIRA] (HHH-16279) Hibernate ORM with hibernate.hbm2ddl.import_files_sql_extractor = multi-line fails to process import.sql containing
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTY1OTc0Y2Uy... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16279?atlOrigin=eyJpIjoiZTY1OT... ) HHH-16279 ( https://hibernate.atlassian.net/browse/HHH-16279?atlOrigin=eyJpIjoiZTY1OT... ) Hibernate ORM with hibernate.hbm2ddl.import_files_sql_extractor = multi-line fails to process import.sql containing ( https://hibernate.atlassian.net/browse/HHH-16279?atlOrigin=eyJpIjoiZTY1OT... )
Issue Type: Bug Assignee: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) Components: hibernate-core Created: 10/Mar/2023 05:01 AM Fix Versions: 6.2.0 Priority: Major Reporter: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
Affects ORM 6.2.0.CR3 and the latest main for sure; I didn’t check 5.6.
When configured to use MultiLineSqlScriptExtractor , Hibernate ORM fails to process this import.sql :
-- This file allow to write SQL commands that will be emitted in test and dev.
-- The commands are commented as their support depends of the database
-- insert into myentity (id, field) values(nextval('hibernate_sequence'), 'field-1');
-- insert into myentity (id, field) values(nextval('hibernate_sequence'), 'field-2');
-- insert into myentity (id, field) values(nextval('hibernate_sequence'), 'field-3');
This results in the given output (there’s definitely an exception in there, but I’m not sure where the rest comes from):
line 5:85 extraneous input '<EOF>' expecting {CHAR, ' ', '\t', NEWLINE, QUOTED_TEXT}
org.hibernate.tool.schema.spi.SqlScriptException: Error during sql-script parsing.
at org.hibernate.tool.schema.internal.script.MultiLineSqlScriptExtractor.extractCommands(MultiLineSqlScriptExtractor.java:53)
at org.hibernate.orm.test.tool.schema.scripts.MultiLineImportExtractorTest.testExtractionFromCommentsOnlyScript(MultiLineImportExtractorTest.java:79)
...
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "terminalNodes" is null
at org.hibernate.tool.schema.internal.script.SqlScriptVisitor.visitScript(SqlScriptVisitor.java:46)
at org.hibernate.tool.schema.internal.script.MultiLineSqlScriptExtractor.extractCommands(MultiLineSqlScriptExtractor.java:47)
... 28 more
( https://hibernate.atlassian.net/browse/HHH-16279#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16279#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:dd34e91 )
1 year, 10 months