Attached is a patch proposal. This patch is quite similar to the idea in
this patch uses resultColumn.isGeneratedForUnmatchedColumnInInsert() rather than
the isAutoincrementGenerated() method.
The patch includes a regression test, but I haven't run the entire suite, just the GeneratedColumnsTest.
It appears that the use of isGeneratedForUnmanagedColumnInsert not only fixes
this problem, but also fixes
DERBY-4419, so I'm going to return to that issue and
see if I can get a single code patch (although with different regression tests) that fixes both problems.