Buggy code:
public ExecRow emptyHeapRow ; public boolean deferred ; public ValueNode checkConstraints ; public FKInfo fkInfo ; protected FromTable targetTable ; protected FormatableBitSet readColsBitSet ; protected boolean positionedUpdate ; public static final String COLUMNNAME = "###RowLocationToUpdate" ; public void init ( Object targetTableName , Object resultSet ) { } public String toString ( ) { } public String statementToString ( ) { } public void printSubNodes ( int depth ) { } public void bindStatement ( ) throws StandardException { getCompilerContext ( ) . pushCurrentPrivType ( SELECT_PRIV ) ; FromList fromList = ( ( FromList ) ( getNodeFactory ( ) . getNode ( FROM_LIST , getNodeFactory ( ) . doJoinOrderOptimization ( ) , getContextManager ( ) ) ) ) ; ResultColumn rowLocationColumn = null ; ValueNode rowLocationNode = null ; TableName cursorTargetTableName = null ; CurrentOfNode currentOfNode = null ; FromList resultFromList ; ResultColumnList afterColumns = null ; DataDictionary dataDictionary = getDataDictionary ( ) ; if ( ( targetTableName ) != null ) { TableName synonymTab = resolveTableToSynonym ( this . targetTableName ) ; if ( synonymTab != null ) { this . synonymTableName = targetTableName ; this . targetTableName = synonymTab ; } } bindTables ( dataDictionary ) ; if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( ( ( resultSet ) != null ) && ( ( resultSet ) instanceof SelectNode ) ) , "Update<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>select<seq2seq4repair_space>result<seq2seq4repair_space>set" ) ; } SelectNode sel ; sel = ( ( SelectNode ) ( resultSet ) ) ; targetTable = ( ( FromTable ) ( sel . fromList . elementAt ( 0 ) ) ) ; if ( ( targetTable ) instanceof CurrentOfNode ) { positionedUpdate = true ; currentOfNode = ( ( CurrentOfNode ) ( targetTable ) ) ; cursorTargetTableName = currentOfNode . getBaseCursorTargetTableName ( ) ; if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( cursorTargetTableName != null ) ) ; } } if ( ( targetTable ) instanceof FromVTI ) { targetVTI = ( ( FromVTI ) ( targetTable ) ) ; targetVTI . setTarget ( ) ; } else { if ( ( targetTableName ) == null ) { if ( SanityManager . DEBUG ) SanityManager . ASSERT ( ( cursorTargetTableName != null ) ) ; targetTableName = cursorTargetTableName ; } else if ( cursorTargetTableName != null ) { if ( ! ( targetTableName . equals ( cursorTargetTableName ) ) ) { throw StandardException . newException ( LANG_CURSOR_UPDATE_MISMATCH , targetTableName , currentOfNode . getCursorName ( ) ) ; } } } verifyTargetTable ( ) ; if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( ( fromList . size ( ) ) == 0 ) , ( ( "fromList.size()<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>0,<seq2seq4repair_space>not<seq2seq4repair_space>" + ( fromList . size ( ) ) ) + "<seq2seq4repair_space>on<seq2seq4repair_space>return<seq2seq4repair_space>from<seq2seq4repair_space>RS.bindExpressions()" ) ) ; } ColumnDescriptorList addedGeneratedColumns = new ColumnDescriptorList ( ) ; ColumnDescriptorList affectedGeneratedColumns = new ColumnDescriptorList ( ) ; addGeneratedColumns ( targetTableDescriptor , resultSet , affectedGeneratedColumns , addedGeneratedColumns ) ; resultSet . getResultColumns ( ) . markUpdated ( ) ; if ( SanityManager . DEBUG ) SanityManager . ASSERT ( ( ( resultSet . resultColumns ) != null ) , "resultColumns<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>not<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>null<seq2seq4repair_space>at<seq2seq4repair_space>bind<seq2seq4repair_space>time" ) ; resultFromList = resultSet . getFromList ( ) ; if ( SanityManager . DEBUG ) SanityManager . ASSERT ( ( ( resultFromList . size ( ) ) == 1 ) , "More<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>table<seq2seq4repair_space>in<seq2seq4repair_space>result<seq2seq4repair_space>from<seq2seq4repair_space>list<seq2seq4repair_space>in<seq2seq4repair_space>an<seq2seq4repair_space>update." ) ; if ( ( synonymTableName ) != null ) normalizeSynonymColumns ( resultColumns , targetTable ) ; normalizeCorrelatedColumns ( resultColumns , targetTable ) ; getCompilerContext ( ) . pushCurrentPrivType ( getPrivType ( ) ) ; resultSet . bindResultColumns ( targetTableDescriptor , targetVTI , resultColumns , this , fromList ) ; getCompilerContext ( ) . popCurrentPrivType ( ) ; forbidGenerationOverrides ( resultSet . getResultColumns ( ) , true , addedGeneratedColumns ) ; LanguageConnectionContext lcc = getLanguageConnectionContext ( ) ; if ( ( lcc . getAutoincrementUpdate ( ) ) == false ) <START_BUG> resultSet . getResultColumns ( ) . checkAutoincrement ( null ) ; <END_BUG> boolean allColumns = false ; if ( ( targetTable ) instanceof FromBaseTable ) { ( ( FromBaseTable ) ( targetTable ) ) . markUpdated ( resultSet . getResultColumns ( ) ) ; } else if ( ( targetTable ) instanceof FromVTI ) { resultColumnList = resultSet . getResultColumns ( ) ; } else { if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( currentOfNode != null ) , "currentOfNode<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } ExecPreparedStatement cursorStmt = currentOfNode . getCursorStatement ( ) ; String [ ] ucl = cursorStmt . getUpdateColumns ( ) ; if ( ( ucl == null ) || ( ( ucl . length ) == 0 ) ) { getResultColumnList ( ) ; afterColumns = resultSet . getResultColumns ( ) . expandToAll ( targetTableDescriptor , targetTable . getTableName ( ) ) ; getAffectedIndexes ( targetTableDescriptor , ( ( ResultColumnList ) ( null ) ) , ( ( FormatableBitSet ) ( null ) ) ) ; allColumns = true ; } else { resultSet . getResultColumns ( ) . checkColumnUpdateability ( ucl , currentOfNode . getCursorName ( ) ) ; } } changedColumnIds = getChangedColumnIds ( resultSet . getResultColumns ( ) ) ; if ( ( ! allColumns ) && ( ( targetVTI ) == null ) ) { getCompilerContext ( ) . pushCurrentPrivType ( NULL_PRIV ) ; try { readColsBitSet = new FormatableBitSet ( ) ; FromBaseTable fbt = getResultColumnList ( resultSet . getResultColumns ( ) ) ; afterColumns = resultSet . getResultColumns ( ) . copyListAndObjects ( ) ; readColsBitSet = getReadMap ( dataDictionary , targetTableDescriptor , afterColumns , affectedGeneratedColumns ) ; afterColumns = fbt . addColsToList ( afterColumns , readColsBitSet ) ; resultColumnList = fbt . addColsToList ( resultColumnList , readColsBitSet ) ; int i = 1 ; int size = targetTableDescriptor . getMaxColumnID ( ) ; for ( ; i <= size ; i ++ ) { if ( ! ( readColsBitSet . get ( i ) ) ) { break ; } } if ( i > size ) { readColsBitSet = null ;

Fix:
resultSet . getResultColumns ( ) . forbidOverrides ( null ) ;