Skip to content

Syntax error in generated SQL of ALTER INDEX or ALTER SCHEMA statement, when identifiers aren't quoted #16080

@padeledicq

Description

@padeledicq

Hi,

After upgrading from 3.18.7 to 3.19.2, the generator is failing on this statement:

ALTER INDEX produits_composes_produits_composes_ibfk1_idx RENAME TO kit_id_sous_produit_idx;

I get the following error, it just seems a space is missing before 'rename':

[ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.19.2:generate (generate-jooq-sources) on project scanandstock-api: Error running jOOQ code generation tool: Error while exporting schema: SQL [alter index PRODUITS_COMPOSES_PRODUITS_COMPOSES_IBFK1_IDXrename to KIT_ID_SOUS_PRODUIT_IDX]; Erreur de syntaxe dans l'instruction SQL "alter index PRODUITS_COMPOSES_PRODUITS_COMPOSES_IBFK1_IDXrename []to KIT_ID_SOUS_PRODUIT_IDX"; attendu "., RENAME"
[ERROR] Syntax error in SQL statement "alter index PRODUITS_COMPOSES_PRODUITS_COMPOSES_IBFK1_IDXrename [
]to KIT_ID_SOUS_PRODUIT_IDX"; expected "., RENAME"; SQL statement:
[ERROR] alter index PRODUITS_COMPOSES_PRODUITS_COMPOSES_IBFK1_IDXrename to KIT_ID_SOUS_PRODUIT_IDX [42001-224]

Here is my generator configuration.

          <execution>
            <id>generate-jooq-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <logging>WARN</logging>
              <generator>
                <generate>
                  <pojos>true</pojos>
                  <fluentSetters>true</fluentSetters>
                  <pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>
                  <generatedAnnotation>true</generatedAnnotation>
                  <generatedAnnotationType>DETECT_FROM_JDK</generatedAnnotationType>
                  <generatedAnnotationDate>true</generatedAnnotationDate>
                  <validationAnnotations>true</validationAnnotations>
                  <constructorPropertiesAnnotation>true</constructorPropertiesAnnotation>
                  <constructorPropertiesAnnotationOnPojos>true</constructorPropertiesAnnotationOnPojos>
                  <constructorPropertiesAnnotationOnRecords>true</constructorPropertiesAnnotationOnRecords>
                  <javaTimeTypes>true</javaTimeTypes>
                  <deprecated>false</deprecated>
                </generate>
                <database>
                  <name>org.jooq.meta.extensions.ddl.DDLDatabase</name>
                  <includes>.*</includes>
                  <excludes>flyway_schema_history|event_publication</excludes>
                  <properties>
                    <property>
                      <key>sort</key>
                      <value>flyway</value>
                    </property>
                    <property>
                      <key>scripts</key>
                      <value>src/main/resources/db/migration/*.sql</value>
                    </property>
                  </properties>
                </database>
                <target>
                  <clean>true</clean>
                  <packageName>com.wallsweb.sns.data</packageName>
                  <encoding>UTF-8</encoding>
                </target>
              </generator>
            </configuration>
          </execution>

If you need a mcve, just ask me.

Thank you.

jOOQ Version

3.19.2 Open Source

Database product and version

H2

Java Version

Oracle jdk 21

OS Version

Windows 11

JDBC driver name and version (include name if unofficial driver)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions