This one threw me off at first:
/* Skip over generated columns */
- if (resultColumn.isGenerated())
+ if (resultColumn.isGenerated() || resultColumn.isAutoincrementGenerated())
In view of Knut's find,
DERBY-4425, it seems that "generated column" in the code quoted means something else. Perhaps the term is overloaded in the code, which is unfortunate, and may lead to other issues later.
Cf this code fragment later in the same class:
which is the test for real "generated column" in the SQL sense. From 4.14.8:
"A generated column is one whose values are determined by evaluation of a generation
So, the ResultColumn method "isGenerated" means something else, i.e. column synthesized by Derby for various purposes (cf calls to markGenerated in UpdateNode/DeleteNode vs. GroupByNode/WindowResultSetNode).