You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In version 3.0.0 of Benerator CE the default value of 'now()' on a date column in a PostgreSQL will cause a crash while generating data for the table containing the column.
To Reproduce
Steps to reproduce the behavior:
Run Benerator for a table with a data column, non-nullable and with default value 'now()'.
You'll see the following error:
[ERROR] 2022-12-11 17:57:56.503 [main] Benerator - Error in Benerator execution
com.rapiddweller.common.ConversionException: Failed to convert now()
at com.rapiddweller.common.exception.ExceptionFactory.conversionFailed(ExceptionFactory.java:163) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.String2DateConverter.convert(String2DateConverter.java:102) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.String2DateConverter.convert(String2DateConverter.java:61) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.String2DateConverter.convert(String2DateConverter.java:34) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.String2TimestampConverter.convert(String2TimestampConverter.java:68) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.String2TimestampConverter.convert(String2TimestampConverter.java:31) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.AnyConverter.convert(AnyConverter.java:94) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.common.converter.AnyConverter.convert(AnyConverter.java:71) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.SimpleTypeGeneratorFactory.createConstantGenerator(SimpleTypeGeneratorFactory.java:254) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.SimpleTypeGeneratorFactory.createExplicitGenerator(SimpleTypeGeneratorFactory.java:109) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.SimpleTypeGeneratorFactory.createExplicitGenerator(SimpleTypeGeneratorFactory.java:89) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.TypeGeneratorFactory.createRootGenerator(TypeGeneratorFactory.java:83) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.TypeGeneratorFactory.createGenerator(TypeGeneratorFactory.java:72) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.MetaGeneratorFactory.createTypeGenerator(MetaGeneratorFactory.java:74) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.InstanceGeneratorFactory.createSingleInstanceGenerator(InstanceGeneratorFactory.java:87) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.ComponentBuilderFactory.createPartBuilder(ComponentBuilderFactory.java:161) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.ComponentBuilderFactory.createComponentBuilder(ComponentBuilderFactory.java:107) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.factory.GenerationStepFactory.createGenerationStep(GenerationStepFactory.java:92) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.parser.xml.AbstractGenIterParser.parseTask(AbstractGenIterParser.java:330) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.parser.xml.AbstractGenIterParser.parseGenerate(AbstractGenIterParser.java:197) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.parser.xml.AbstractGenIterParser$1.evaluate(AbstractGenIterParser.java:155) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.parser.xml.AbstractGenIterParser$1.evaluate(AbstractGenIterParser.java:152) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.statement.LazyStatement.getRealStatement(LazyStatement.java:56) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.statement.LazyStatement.execute(LazyStatement.java:63) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.statement.SequentialStatement.executeSubStatements(SequentialStatement.java:72) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.statement.SequentialStatement.execute(SequentialStatement.java:61) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.BeneratorRootStatement.execute(BeneratorRootStatement.java:65) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.DescriptorRunner.execute(DescriptorRunner.java:128) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.DescriptorRunner.runWithoutShutdownHook(DescriptorRunner.java:102) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.engine.DescriptorRunner.run(DescriptorRunner.java:94) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.main.Benerator.runFile(Benerator.java:261) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.main.Benerator.run(Benerator.java:192) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.main.Benerator.runWithArgs(Benerator.java:164) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
at com.rapiddweller.benerator.main.Benerator.main(Benerator.java:110) ~[rapiddweller-benerator-ce-3.0.0-jdk-11.jar:?]
Caused by: java.text.ParseException: Unparseable date: "now()"
at java.text.DateFormat.parse(DateFormat.java:395) ~[?:?]
at com.rapiddweller.common.converter.String2DateConverter.convert(String2DateConverter.java:91) ~[rd-lib-common-2.0.0-jdk-11.jar:?]
... 32 more
[ERROR] 2022-12-11 17:57:56.511 [main] Benerator - Error: Failed to convert now()
Expected behavior
I'd expect the column to be either filled with a generated date (ignoring the default) or be omitted from the generation process.
Desktop (please complete the following information):
OS: Windows 10
Browser Chrome
The text was updated successfully, but these errors were encountered:
jeenkhoorn
changed the title
Default value of 'now()' in date column causes issues
Default value of 'now()' in date column causes error
Dec 12, 2022
We implement a handler for database date functions and extended tests with different variants. So it should be fixed now and included in a hotfix version we will release shortly.
Describe the bug
In version 3.0.0 of Benerator CE the default value of 'now()' on a date column in a PostgreSQL will cause a crash while generating data for the table containing the column.
To Reproduce
Steps to reproduce the behavior:
Run Benerator for a table with a data column, non-nullable and with default value 'now()'.
You'll see the following error:
Expected behavior
I'd expect the column to be either filled with a generated date (ignoring the default) or be omitted from the generation process.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: