Thank you very much for your report. I can reproduce this even without the
parser. I've created an issue for this:
https://github.com/jOOQ/jOOQ/issues/7633

Thanks,
Lukas

Am So., 1. Juli 2018 um 17:45 Uhr schrieb Manuel Rossetti <
[email protected]>:

> I was testing the parser to see if I can use it for processing database
> creation scripts.  It is stripping schema references from tables in alter
> statements.
>
> Here is example output of what it is doing:
>
> Line 1
> Original:    CREATE SCHEMA JSL_DB
> Jooq Parser: create schema JSL_DB
>
> Line 2
> Original:    CREATE TABLE JSL_DB.SIMULATION_RUN ( ID INTEGER NOT NULL
> PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1),
> SIM_NAME VARCHAR(510) NOT NULL, MODEL_NAME VARCHAR(510) NOT NULL, EXP_NAME
> VARCHAR(510) NOT NULL, EXP_START_TIME_STAMP TIMESTAMP, EXP_END_TIME_STAMP
> TIMESTAMP, NUM_REPS INTEGER NOT NULL CHECK (NUM_REPS >=1), LAST_REP
> INTEGER, LENGTH_OF_REP DOUBLE, LENGTH_OF_WARM_UP DOUBLE, HAS_MORE_REPS
> BOOLEAN, REP_ALLOWED_EXEC_TIME BIGINT, REP_INIT_OPTION BOOLEAN,
> RESET_START_STREAM_OPTION BOOLEAN, ANTITHETIC_OPTION BOOLEAN,
> ADV_NEXT_SUB_STREAM_OPTION BOOLEAN, NUM_STREAM_ADVANCES INTEGER )
> Jooq Parser: create table JSL_DB.SIMULATION_RUN(ID int generated by
> default as identity not null, SIM_NAME varchar(510) not null, MODEL_NAME
> varchar(510) not null, EXP_NAME varchar(510) not null, EXP_START_TIME_STAMP
> timestamp, EXP_END_TIME_STAMP timestamp, NUM_REPS int not null, LAST_REP
> int, LENGTH_OF_REP double, LENGTH_OF_WARM_UP double, HAS_MORE_REPS boolean,
> REP_ALLOWED_EXEC_TIME bigint, REP_INIT_OPTION boolean,
> RESET_START_STREAM_OPTION boolean, ANTITHETIC_OPTION boolean,
> ADV_NEXT_SUB_STREAM_OPTION boolean, NUM_STREAM_ADVANCES int, primary key
> (ID), check (NUM_REPS >= 1))
>
> Line 3
> Original:    CREATE TABLE JSL_DB.MODEL_ELEMENT ( SIM_RUN_ID_FK INTEGER NOT
> NULL, ELEMENT_NAME VARCHAR(510) NOT NULL, ELEMENT_ID BIGINT NOT NULL,
> CLASS_NAME VARCHAR(510) NOT NULL, PARENT_NAME_FK VARCHAR(510) )
> Jooq Parser: create table JSL_DB.MODEL_ELEMENT(SIM_RUN_ID_FK int not null,
> ELEMENT_NAME varchar(510) not null, ELEMENT_ID bigint not null, CLASS_NAME
> varchar(510) not null, PARENT_NAME_FK varchar(510))
>
> Line 4
> Original:    ALTER TABLE JSL_DB.MODEL_ELEMENT ADD CONSTRAINT ME_PRIM_KY
> PRIMARY KEY (SIM_RUN_ID_FK, ELEMENT_NAME)
> Jooq Parser: alter table JSL_DB.MODEL_ELEMENT add constraint ME_PRIM_KY
> primary key (SIM_RUN_ID_FK, ELEMENT_NAME)
>
> Line 5
> Original:    ALTER TABLE JSL_DB.MODEL_ELEMENT ADD CONSTRAINT ME_SIMRUN_FK
> FOREIGN KEY (SIM_RUN_ID_FK) REFERENCES JSL_DB.SIMULATION_RUN (ID)
> Jooq Parser: alter table JSL_DB.MODEL_ELEMENT add constraint ME_SIMRUN_FK
> foreign key (SIM_RUN_ID_FK) references SIMULATION_RUN (ID)
>
> *Notice in line 5, the missing JSL_DB after the "references" keyword.
> This causes the execution of the query to fail because the referenced table
> does not exist.*
>
> I am using jooq 3.10.4 with the Derby dialect.
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to