Buggy code:
resultSet . bindResultColumns ( targetTableDescriptor , targetVTI , resultColumns , this , fromList ) ; getCompilerContext ( ) . popCurrentPrivType ( ) ; LanguageConnectionContext lcc = getLanguageConnectionContext ( ) ; if ( ( lcc . getAutoincrementUpdate ( ) ) == false ) resultSet . getResultColumns ( ) . checkAutoincrement ( null ) ; 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 ) ; 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 ; allColumns = true ; } } finally { getCompilerContext ( ) . popCurrentPrivType ( ) ; } } if ( ( targetVTI ) == null ) { emptyHeapRow = targetTableDescriptor . getEmptyExecRow ( ) ; resultColumnList . appendResultColumns ( afterColumns , false ) ; rowLocationNode = ( ( CurrentRowLocationNode ) ( getNodeFactory ( ) . getNode ( CURRENT_ROW_LOCATION_NODE , getContextManager ( ) ) ) ) ; } else { rowLocationNode = ( ( NumericConstantNode ) ( getNodeFactory ( ) . getNode ( INT_CONSTANT_NODE , ReuseFactory . getInteger ( 0 ) , getContextManager ( ) ) ) ) ; } rowLocationColumn = ( ( ResultColumn ) ( getNodeFactory ( ) . getNode ( RESULT_COLUMN , UpdateNode . COLUMNNAME , rowLocationNode , getContextManager ( ) ) ) ) ; rowLocationColumn . markGenerated ( ) ; resultColumnList . addResultColumn ( rowLocationColumn ) ; checkTableNameAndScrubResultColumns ( resultColumnList ) ; resultSet . setResultColumns ( resultColumnList ) ; getCompilerContext ( ) . pushCurrentPrivType ( getPrivType ( ) ) ; super . bindExpressions ( ) ; getCompilerContext ( ) . popCurrentPrivType ( ) ; resultSet . getResultColumns ( ) . bindUntypedNullsToResultColumns ( resultColumnList ) ; if ( null != rowLocationColumn ) { rowLocationColumn . bindResultColumnToExpression ( ) ; } resultColumnList . checkStorableExpressions ( ) ; if ( ! ( resultColumnList . columnTypesAndLengthsMatch ( ) ) ) { <START_BUG> resultSet = resultSet . genNormalizeResultSetNode ( resultSet , true ) ; <END_BUG> resultColumnList . copyTypesAndLengthsToSource ( resultSet . getResultColumns ( ) ) ; if ( hasCheckConstraints ( dataDictionary , targetTableDescriptor ) ) { int afterColumnsSize = afterColumns . size ( ) ; afterColumns = ( ( ResultColumnList ) ( getNodeFactory ( ) . getNode ( RESULT_COLUMN_LIST , getContextManager ( ) ) ) ) ; ResultColumnList normalizedRCs = resultSet . getResultColumns ( ) ; for ( int index = 0 ; index < afterColumnsSize ; index ++ ) { afterColumns . addElement ( normalizedRCs . elementAt ( ( index + afterColumnsSize ) ) ) ; } } } if ( null != ( targetVTI ) ) { deferred = VTIDeferModPolicy . deferIt ( UPDATE_STATEMENT , targetVTI , resultColumnList . getColumnNames ( ) , sel . getWhereClause ( ) ) ; } else { boolean hasTriggers = ( getAllRelevantTriggers ( dataDictionary , targetTableDescriptor , changedColumnIds , true ) . size ( ) ) > 0 ; checkConstraints = bindConstraints ( dataDictionary , getNodeFactory ( ) , targetTableDescriptor , null , ( hasTriggers ? resultColumnList : afterColumns ) , changedColumnIds , readColsBitSet , false , true ) ; if ( ( resultSet . subqueryReferencesTarget ( targetTableDescriptor . getName ( ) , true ) ) || ( requiresDeferredProcessing ( ) ) ) { deferred = true ; } } getCompilerContext ( ) . popCurrentPrivType ( ) ; } int getPrivType ( ) { } public boolean referencesSessionSchema ( ) throws StandardException { } public ConstantAction makeConstantAction ( ) throws StandardException { } protected void setDeferredForUpdateOfIndexColumn ( ) { } public void generate ( ActivationClassBuilder acb , MethodBuilder mb ) throws StandardException { } protected final int getStatementType ( ) { } public FormatableBitSet getReadMap ( DataDictionary dd , TableDescriptor baseTable , ResultColumnList updateColumnList ) throws StandardException { } private int [ ] getChangedColumnIds ( ResultColumnList rcl ) { } public static FormatableBitSet getUpdateReadMap ( TableDescriptor baseTable , ResultColumnList updateColumnList , Vector conglomVector , ConstraintDescriptorList relevantConstraints , GenericDescriptorList relevantTriggers , boolean [ ] needsDeferredProcessing ) throws StandardException { } private void normalizeCorrelatedColumns ( ResultColumnList rcl , FromTable fromTable ) throws StandardException { } private void checkTableNameAndScrubResultColumns ( ResultColumnList rcl ) throws StandardException { } private void normalizeSynonymColumns ( ResultColumnList rcl , FromTable fromTable ) throws StandardException { }

Fix:
resultSet = resultSet . genNormalizeResultSetNode ( true ) ;