The JDBC driver checks both RDB$RELATION_FIELDS.RDB$NULL_FLAG as well as RDB$FIELDS.RDB$NULL_FLAG. If either value is 1, then the resulting value is 1.
I have committed a fix for issue #3382, which seems to take care of your problem: https://github.com/jOOQ/jOOQ/commit/9a74f5c41ff35d5fabe2ea9be2b17b5f7719e2e4 By the end of the week, I'll be publishing patch releases for 3.2, 3.3, and 3.4. This fix has high chances of being included. If you need a fix before Friday, you can build 3.5.0-SNAPSHOT from GitHub. However, I could not reproduce the part where the VARCHAR type has a reported length of 88. Do you have any specific Firebird setting enabled, related to character encoding? 2014-07-09 17:55 GMT+02:00 Lukas Eder <[email protected]>: > Thank you for the additional information. The query that jOOQ executes to > collect column and data type information is roughly this one: > > SELECT > TRIM( > "r" . "RDB$FIELD_NAME" > ) , > "r" . "RDB$DESCRIPTION" , > "r" . "RDB$DEFAULT_VALUE" , > CASE > WHEN "r" . "RDB$NULL_FLAG" IS NOT NULL > THEN "r" . "RDB$NULL_FLAG" > ELSE 0 > END , > "r" . "RDB$DEFAULT_SOURCE" , > "r" . "RDB$FIELD_POSITION" , > CASE > "f" . "RDB$FIELD_TYPE" WHEN 261 > THEN 0 > ELSE "f" . "RDB$FIELD_LENGTH" > END "FIELD_LENGTH" , > "f" . "RDB$FIELD_PRECISION" , > -( > "f" . "RDB$FIELD_SCALE" > ) "FIELD_SCALE" , > CASE > "f" . "RDB$FIELD_TYPE" WHEN 7 > THEN CASE > WHEN "f" . "RDB$FIELD_SUB_TYPE" = 1 > THEN 'NUMERIC' WHEN( > "f" . "RDB$FIELD_SUB_TYPE" = 0 > AND "f" . "RDB$FIELD_SCALE" < 0 > ) > THEN 'NUMERIC' WHEN "f" . "RDB$FIELD_SUB_TYPE" = 2 > THEN 'DECIMAL' > ELSE 'SMALLINT' > END WHEN 8 > THEN CASE > WHEN "f" . "RDB$FIELD_SUB_TYPE" = 1 > THEN 'NUMERIC' WHEN( > "f" . "RDB$FIELD_SUB_TYPE" = 0 > AND "f" . "RDB$FIELD_SCALE" < 0 > ) > THEN 'NUMERIC' WHEN "f" . "RDB$FIELD_SUB_TYPE" = 2 > THEN 'DECIMAL' > ELSE 'INTEGER' > END WHEN 9 > THEN 'QUAD' WHEN 10 > THEN 'FLOAT' WHEN 11 > THEN 'D_FLOAT' WHEN 12 > THEN 'DATE' WHEN 13 > THEN 'TIME' WHEN 14 > THEN 'CHAR' WHEN 16 > THEN CASE > WHEN "f" . "RDB$FIELD_SUB_TYPE" = 1 > THEN 'NUMERIC' WHEN( > "f" . "RDB$FIELD_SUB_TYPE" = 0 > AND "f" . "RDB$FIELD_SCALE" < 0 > ) > THEN 'NUMERIC' WHEN "f" . "RDB$FIELD_SUB_TYPE" = 2 > THEN 'DECIMAL' > ELSE 'BIGINT' > END WHEN 27 > THEN 'DOUBLE' WHEN 35 > THEN 'TIMESTAMP' WHEN 37 > THEN 'VARCHAR' WHEN 40 > THEN 'CSTRING' WHEN 261 > THEN CASE > "f" . "RDB$FIELD_SUB_TYPE" WHEN 0 > THEN 'BLOB' WHEN 1 > THEN 'BLOB SUB_TYPE TEXT' > ELSE 'BLOB' > END > ELSE 'UNKNOWN' > END "FIELD_TYPE" , > "f" . "RDB$FIELD_SUB_TYPE" > FROM > "RDB$RELATION_FIELDS" "r" LEFT OUTER JOIN "RDB$FIELDS" "f" > ON "r" . "RDB$FIELD_SOURCE" = "f" . "RDB$FIELD_NAME" > WHERE > "r" . "RDB$RELATION_NAME" = 'BUPDATERLINKS' > ORDER BY > "r" . "RDB$FIELD_POSITION" ASC > > > The parts marked in yellow don't seem to be correct in the case of column > types originating from domains. The JDBC driver gets this correctly, when > executing DatabaseMetaData.getColumns(). I'll see how this can be fixed. > > Cheers > Lukas > > 2014-07-09 16:47 GMT+02:00 <[email protected]>: > > ok i attach the entire ddl >> >> Le vendredi 4 juillet 2014 17:01:36 UTC+2, [email protected] a écrit : >> >>> I post the DDL of the table and i attache table result >>> >>> /*********************************************************** >>> *******************/ >>> /**** Tables >>> ****/ >>> /*********************************************************** >>> *******************/ >>> >>> >>> >>> CREATE TABLE BUPDATERLINKS ( >>> IDBUPDATERLINKS IDENT /* IDENT = VARCHAR(22) NOT NULL */, >>> BULREFPARENT REFERENCE /* REFERENCE = VARCHAR(22) DEFAULT '-1' >>> */, >>> BULTYPE ENTIER /* ENTIER = INTEGER DEFAULT 0 */, >>> BULREFBYTYPE REFERENCE /* REFERENCE = VARCHAR(22) DEFAULT '-1' >>> */, >>> BULDEST LIB500 /* LIB500 = VARCHAR(500) */, >>> BULJSON BLOBTEXT /* BLOBTEXT = BLOB SUB_TYPE 1 SEGMENT SIZE >>> 80 */, >>> BULSTATE ENTIER /* ENTIER = INTEGER DEFAULT 0 */, >>> BULDATEACTION DATECOMPLETE /* DATECOMPLETE = TIMESTAMP */, >>> BULACTIF ENTIER /* ENTIER = INTEGER DEFAULT 0 */, >>> FTPDATE DATECOMPLETE2 /* DATECOMPLETE2 = TIMESTAMP DEFAULT >>> 'now' NOT NULL */, >>> CREATEDATE DATECOMPLETE2 /* DATECOMPLETE2 = TIMESTAMP DEFAULT >>> 'now' NOT NULL */ >>> ); >>> >>> >>> >>> >>> /*********************************************************** >>> *******************/ >>> /**** Primary Keys >>> ****/ >>> /*********************************************************** >>> *******************/ >>> >>> ALTER TABLE BUPDATERLINKS ADD CONSTRAINT PK_BUPDATERLINKS PRIMARY KEY >>> (IDBUPDATERLINKS); >>> >>> >>> /*********************************************************** >>> *******************/ >>> /**** Triggers >>> ****/ >>> /*********************************************************** >>> *******************/ >>> >>> >>> SET TERM ^ ; >>> >>> >>> >>> /*********************************************************** >>> *******************/ >>> /**** Triggers for tables >>> ****/ >>> /*********************************************************** >>> *******************/ >>> >>> >>> >>> /* Trigger: BUPDATERLINKS_BI */ >>> CREATE OR ALTER TRIGGER BUPDATERLINKS_BI FOR BUPDATERLINKS >>> ACTIVE BEFORE INSERT POSITION 0 >>> as >>> begin >>> IF (NEW.idbupdaterlinks IS NULL) THEN >>> BEGIN >>> EXECUTE PROCEDURE SYS_GET_UUID RETURNING_VALUES NEW.idbupdaterlinks; >>> END >>> end >>> ^ >>> >>> Le vendredi 4 juillet 2014 16:49:52 UTC+2, [email protected] a écrit : >>>> >>>> i think the problem is in the mapping of table the definition of my >>>> primary key is : >>>> >>>> IDMYTABLE VARCHAR(22) NOT NULL via a domain >>>> >>>> but field.getDataType().nullable => returns true and field size is 88 >>>> ???? >>>> >>>> >>>> >>>> Le vendredi 4 juillet 2014 16:15:46 UTC+2, [email protected] a écrit : >>>>> >>>>> I have debug a little bit and it try to do an update (i don't know why >>>>> for moment) >>>>> >>>>> Le vendredi 4 juillet 2014 16:09:07 UTC+2, [email protected] a écrit : >>>>>> >>>>>> Hi, >>>>>> >>>>>> my database is firebird and now when i doing that the insert don't >>>>>> work : >>>>>> >>>>>> record = getDsl().newRecord(MYTABLE); >>>>>> record.setState(0); >>>>>> record.store(); >>>>>> >>>>>> no warning, no error but nothing is inserted and i have a primary key >>>>>> on MYTABLE. >>>>>> >>>>>> it works fine on 3.2.2. >>>>>> >>>>>> any sugestions ? >>>>>> >>>>> -- >> 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.
