Hi Jens,

Sorry, I overlooked that this is still an open issue. I cannot reproduce
this problem yet. Do you have any additional heads-up for me with respect
to what could have gone wrong during the code generation, or what might be
causing this? Do you get the correct key columns from my original query?

Cheers,
Lukas

2016-11-07 17:32 GMT+01:00 jklingsporn <[email protected]>:

> Yes, but I was smart and added a
>
> AND table_schema = 'test'
>
> to the query ^^
>
> Am Montag, 7. November 2016 16:19:34 UTC+1 schrieb Lukas Eder:
>>
>> It shouldn't be an issue on the jOOQ side, although there may always be
>> hidden bugs. In this case, however, I haven't seen that table in any other
>> schema. The query I've sent you and whose results you posted checked only
>> for the table name, not the schema as well:
>>
>> SELECT *
>> FROM information_schema.statistics
>> WHERE index_name = 'PRIMARY'
>> AND table_name = 'config_preset_track_part'
>> ORDER BY seq_in_index
>>
>> So, if you really have this table twice in your database, it should have
>> appeared twice in the results as well, no?
>>
>> 2016-11-07 16:06 GMT+01:00 jklingsporn <[email protected]>:
>>
>>> One additional note: I have two databases containing the same schema
>>> (one for integration tests, the other for development). Could that be an
>>> issue?
>>>
>>> Am Montag, 7. November 2016 15:50:26 UTC+1 schrieb Lukas Eder:
>>>>
>>>> Hi Jens,
>>>>
>>>> Hmm, interesting, that looks correct to me then. I'm afraid I cannot be
>>>> of any further help right now as I cannot reproduce this and the data
>>>> produced by your MySQL instance also looks correct.
>>>>
>>>> If you're willing to debug this, there are two interesting pointers
>>>> where stuff might go wrong:
>>>>
>>>> 1. At the collection of primary key columns:
>>>> https://github.com/jOOQ/jOOQ/blob/version-3.8.6/jOOQ-meta/sr
>>>> c/main/java/org/jooq/util/mysql/MySQLDatabase.java#L105
>>>>
>>>> 2. Where the code is generated:
>>>> https://github.com/jOOQ/jOOQ/blob/version-3.8.6/jOOQ-codegen
>>>> /src/main/java/org/jooq/util/JavaGenerator.java#L1047
>>>>
>>>> Let me know if you need any additional info.
>>>> Lukas
>>>>
>>>> 2016-11-07 15:40 GMT+01:00 jklingsporn <[email protected]>:
>>>>
>>>>> # TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, NON_UNIQUE, INDEX_SCHEMA,
>>>>> INDEX_NAME, SEQ_IN_INDEX, COLUMN_NAME, COLLATION, CARDINALITY, SUB_PART,
>>>>> PACKED, NULLABLE, INDEX_TYPE, COMMENT, INDEX_COMMENT
>>>>> def, test, config_preset_track_part, 0, test, PRIMARY, 1, trackId, A,
>>>>> 1, , , , BTREE, ,
>>>>> def, test, config_preset_track_part, 0, test, PRIMARY, 2,
>>>>> trackPartIndex, A, 1, , , , BTREE, ,
>>>>> def, test, config_preset_track_part, 0, test, PRIMARY, 3,
>>>>> checkPointIndex, A, 1, , , , BTREE, ,
>>>>>
>>>>>
>>>>> Am Montag, 7. November 2016 14:18:07 UTC+1 schrieb Lukas Eder:
>>>>>>
>>>>>> Thank you very much for reporting this, Jens. I have registered an
>>>>>> issue for this:
>>>>>> https://github.com/jOOQ/jOOQ/issues/5652
>>>>>>
>>>>>> Unfortunately, I cannot yet seem to reproduce this on MySQL 5.7.
>>>>>> Could you perhaps test on your side if this query yields the correct
>>>>>> columns?
>>>>>>
>>>>>> SELECT *
>>>>>> FROM information_schema.statistics
>>>>>> WHERE index_name = 'PRIMARY'
>>>>>> AND table_name = 'config_preset_track_part'
>>>>>> ORDER BY seq_in_index
>>>>>>
>>>>>>
>>>>>> That's a simplified version of the one jOOQ runs to fetch primary key
>>>>>> columns...
>>>>>>
>>>>>> Cheers,
>>>>>> Lukas
>>>>>>
>>>>>> 2016-11-07 10:04 GMT+01:00 jklingsporn <[email protected]>:
>>>>>>
>>>>>>> Hi,
>>>>>>> I just noticed that the key()-method in my generated record does not
>>>>>>> return the actual primary key of that table but only a key type of 
>>>>>>> Record1
>>>>>>> (and not Record3).
>>>>>>>
>>>>>>>
>>>>>>> I'm using jOOQ 3.8.6 and MySQL 5.6.16.
>>>>>>> Here is the table schema:
>>>>>>>
>>>>>>> CREATE TABLE `config_preset_track_part` (
>>>>>>>  `trackId` int(10) NOT NULL,
>>>>>>>  `configId` int(10) NOT NULL,
>>>>>>>  `trackPartIndex` int(10) NOT NULL,
>>>>>>>  `checkPointIndex` int(10) NOT NULL,
>>>>>>>  PRIMARY KEY (`trackId`,`trackPartIndex`,`checkPointIndex`)
>>>>>>> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
>>>>>>>
>>>>>>>
>>>>>>> Edit: It works fine when I define the primary key columns in order,
>>>>>>> so this
>>>>>>>
>>>>>>>
>>>>>>> CREATE TABLE `config_preset_track_part` (
>>>>>>> `trackId` int(10) NOT NULL,
>>>>>>> `trackPartIndex` int(10) NOT NULL,
>>>>>>> `checkPointIndex` int(10) NOT NULL,
>>>>>>> `configId` int(10) NOT NULL,
>>>>>>>  PRIMARY KEY (`trackId`,`trackPartIndex`,`checkPointIndex`)
>>>>>>> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
>>>>>>>
>>>>>>> works.
>>>>>>>
>>>>>>> --
>>>>>>> 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.
>>>>>
>>>>
>>>> --
>>> 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.
>

-- 
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