1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.context.ContextManager; 25 26 import org.apache.derby.iapi.services.loader.GeneratedMethod; 27 28 import org.apache.derby.iapi.services.compiler.MethodBuilder; 29 30 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 31 import org.apache.derby.iapi.sql.conn.Authorizer; 32 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 33 import org.apache.derby.impl.sql.execute.FKInfo; 34 import org.apache.derby.iapi.services.compiler.MethodBuilder; 35 36 import org.apache.derby.iapi.services.sanity.SanityManager; 37 import org.apache.derby.iapi.error.StandardException; 38 import org.apache.derby.iapi.sql.compile.CompilerContext; 39 import org.apache.derby.iapi.sql.compile.C_NodeTypes; 40 import org.apache.derby.iapi.sql.compile.Visitable; 41 import org.apache.derby.iapi.sql.compile.Visitor; 42 43 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 44 45 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; 46 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList; 47 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor; 48 import org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor; 49 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 50 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator; 51 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 52 import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList; 53 54 import org.apache.derby.iapi.reference.SQLState; 55 import org.apache.derby.iapi.sql.execute.ConstantAction; 56 import org.apache.derby.iapi.sql.execute.CursorResultSet; 57 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement; 58 import org.apache.derby.iapi.sql.execute.ExecRow; 59 60 import org.apache.derby.iapi.sql.Activation; 61 import org.apache.derby.iapi.sql.ResultSet; 62 import org.apache.derby.iapi.sql.StatementType; 63 64 import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; 65 import org.apache.derby.iapi.store.access.TransactionController; 66 67 import org.apache.derby.vti.DeferModification; 68 69 import org.apache.derby.iapi.services.io.FormatableBitSet; 70 import org.apache.derby.iapi.reference.ClassName; 71 72 import org.apache.derby.iapi.util.ReuseFactory; 73 import org.apache.derby.iapi.services.classfile.VMOpcode; 74 75 import java.lang.reflect.Modifier ; 76 import java.sql.SQLException ; 77 import java.util.Properties ; 78 import java.util.Vector ; 79 80 89 90 public final class UpdateNode extends DMLModStatementNode 91 { 92 public int[] changedColumnIds; 95 public ExecRow emptyHeapRow; 96 public boolean deferred; 97 public ValueNode checkConstraints; 98 public FKInfo fkInfo; 99 100 protected FromTable targetTable; 101 protected FormatableBitSet readColsBitSet; 102 protected boolean positionedUpdate; 103 104 105 public static final String COLUMNNAME = "###RowLocationToUpdate"; 106 107 114 115 public void init( 116 Object targetTableName, 117 Object resultSet) 118 { 119 super.init(resultSet); 120 this.targetTableName = (TableName) targetTableName; 121 } 122 123 129 130 public String toString() 131 { 132 if (SanityManager.DEBUG) 133 { 134 return targetTableName.toString() + "\n" + 135 super.toString(); 136 } 137 else 138 { 139 return ""; 140 } 141 } 142 143 public String statementToString() 144 { 145 return "UPDATE"; 146 } 147 148 154 155 public void printSubNodes(int depth) 156 { 157 if (SanityManager.DEBUG) 158 { 159 super.printSubNodes(depth); 160 161 if (targetTableName != null) 162 { 163 printLabel(depth, "targetTableName: "); 164 targetTableName.treePrint(depth + 1); 165 } 166 167 168 } 169 } 170 171 187 188 public QueryTreeNode bind() throws StandardException 189 { 190 getCompilerContext().pushCurrentPrivType( Authorizer.SELECT_PRIV); 192 193 FromList fromList = (FromList) getNodeFactory().getNode( 194 C_NodeTypes.FROM_LIST, 195 getNodeFactory().doJoinOrderOptimization(), 196 getContextManager()); 197 ResultColumn rowLocationColumn = null; 198 ValueNode rowLocationNode = null; 199 TableName cursorTargetTableName = null; 200 CurrentOfNode currentOfNode = null; 201 FromList resultFromList; 202 ResultColumnList afterColumns = null; 203 204 DataDictionary dataDictionary = getDataDictionary(); 205 206 if (targetTableName != null) 208 { 209 TableName synonymTab = resolveTableToSynonym(this.targetTableName); 210 if (synonymTab != null) 211 { 212 this.synonymTableName = targetTableName; 213 this.targetTableName = synonymTab; 214 } 215 } 216 217 bindTables(dataDictionary); 218 219 223 if (SanityManager.DEBUG) 225 { 226 SanityManager.ASSERT((resultSet!=null && resultSet instanceof SelectNode), 227 "Update must have a select result set"); 228 } 229 230 SelectNode sel; 231 sel = (SelectNode)resultSet; 232 targetTable = (FromTable) sel.fromList.elementAt(0); 233 234 if (targetTable instanceof CurrentOfNode) 235 { 236 positionedUpdate = true; 237 currentOfNode = (CurrentOfNode) targetTable; 238 cursorTargetTableName = currentOfNode.getBaseCursorTargetTableName(); 239 240 if (SanityManager.DEBUG) 242 { 243 SanityManager.ASSERT(cursorTargetTableName != null); 244 } 245 } 246 247 if (targetTable instanceof FromVTI) 248 { 249 targetVTI = (FromVTI) targetTable; 250 targetVTI.setTarget(); 251 } 252 else 253 { 254 if (targetTableName == null) 257 { 258 if (SanityManager.DEBUG) 260 SanityManager.ASSERT(cursorTargetTableName!=null); 261 262 targetTableName = cursorTargetTableName; 263 } 264 else if (cursorTargetTableName != null) 267 { 268 if ( !targetTableName.equals(cursorTargetTableName)) 271 { 272 throw StandardException.newException(SQLState.LANG_CURSOR_UPDATE_MISMATCH, 273 targetTableName, 274 currentOfNode.getCursorName()); 275 } 276 } 277 } 278 279 verifyTargetTable(); 283 284 316 317 318 if (SanityManager.DEBUG) 319 { 320 SanityManager.ASSERT(fromList.size() == 0, 321 "fromList.size() is expected to be 0, not " + 322 fromList.size() + 323 " on return from RS.bindExpressions()"); 324 } 325 326 332 resultSet.getResultColumns().markUpdated(); 333 334 335 if (SanityManager.DEBUG) 336 SanityManager.ASSERT((resultSet.resultColumns != null), 337 "resultColumns is expected not to be null at bind time"); 338 339 343 resultFromList = resultSet.getFromList(); 344 if (SanityManager.DEBUG) 345 SanityManager.ASSERT(resultFromList.size() == 1, 346 "More than one table in result from list in an update."); 347 348 349 if (synonymTableName != null) 350 normalizeSynonymColumns( resultSet.resultColumns, targetTable ); 351 352 353 normalizeCorrelatedColumns( resultSet.resultColumns, targetTable ); 354 355 getCompilerContext().pushCurrentPrivType(getPrivType()); resultSet.bindResultColumns(targetTableDescriptor, 357 targetVTI, 358 resultSet.resultColumns, this, 359 fromList); 360 getCompilerContext().popCurrentPrivType(); 361 362 LanguageConnectionContext lcc = getLanguageConnectionContext(); 363 if (lcc.getAutoincrementUpdate() == false) 364 resultSet.getResultColumns().checkAutoincrement(null); 365 366 373 boolean allColumns = false; 374 if (targetTable instanceof FromBaseTable) 375 { 376 ((FromBaseTable) targetTable).markUpdated( 377 resultSet.getResultColumns()); 378 } 379 else if (targetTable instanceof FromVTI) 380 { 381 resultColumnList = resultSet.getResultColumns(); 382 } 383 else 384 { 385 388 if (SanityManager.DEBUG) 389 { 390 SanityManager.ASSERT(currentOfNode != null, "currentOfNode is null"); 391 } 392 393 ExecPreparedStatement cursorStmt = currentOfNode.getCursorStatement(); 394 String [] ucl = cursorStmt.getUpdateColumns(); 395 396 400 if (ucl == null || (ucl.length == 0)) 401 { 402 406 getResultColumnList(); 407 408 415 afterColumns = resultSet.getResultColumns().expandToAll( 416 targetTableDescriptor, 417 targetTable.getTableName()); 418 419 423 getAffectedIndexes(targetTableDescriptor, 424 (ResultColumnList)null, (FormatableBitSet)null); 425 allColumns = true; 426 } 427 else 428 { 429 430 resultSet.getResultColumns().checkColumnUpdateability(ucl, 431 currentOfNode.getCursorName()); 432 } 433 } 434 435 changedColumnIds = getChangedColumnIds(resultSet.getResultColumns()); 436 437 441 if (!allColumns && targetVTI == null) 442 { 443 getCompilerContext().pushCurrentPrivType( Authorizer.NULL_PRIV); 444 try 445 { 446 readColsBitSet = new FormatableBitSet(); 447 FromBaseTable fbt = getResultColumnList(resultSet.getResultColumns()); 448 afterColumns = resultSet.getResultColumns().copyListAndObjects(); 449 450 readColsBitSet = getReadMap(dataDictionary, 451 targetTableDescriptor, 452 afterColumns); 453 454 afterColumns = fbt.addColsToList(afterColumns, readColsBitSet); 455 resultColumnList = fbt.addColsToList(resultColumnList, readColsBitSet); 456 457 461 int i = 1; 462 int size = targetTableDescriptor.getMaxColumnID(); 463 for (; i <= size; i++) 464 { 465 if (!readColsBitSet.get(i)) 466 { 467 break; 468 } 469 } 470 471 if (i > size) 472 { 473 readColsBitSet = null; 474 allColumns = true; 475 } 476 } 477 finally 478 { 479 getCompilerContext().popCurrentPrivType(); 480 } 481 } 482 483 if (targetVTI == null) 484 { 485 488 emptyHeapRow = targetTableDescriptor.getEmptyExecRow(getContextManager()); 489 490 494 resultColumnList.appendResultColumns(afterColumns, false); 495 496 497 rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode( 498 C_NodeTypes.CURRENT_ROW_LOCATION_NODE, 499 getContextManager()); 500 } 501 else 502 { 503 rowLocationNode = (NumericConstantNode) getNodeFactory().getNode( 504 C_NodeTypes.INT_CONSTANT_NODE, 505 ReuseFactory.getInteger( 0), 506 getContextManager()); 507 } 508 509 rowLocationColumn = 510 (ResultColumn) getNodeFactory().getNode( 511 C_NodeTypes.RESULT_COLUMN, 512 COLUMNNAME, 513 rowLocationNode, 514 getContextManager()); 515 rowLocationColumn.markGenerated(); 516 517 518 resultColumnList.addResultColumn(rowLocationColumn); 519 520 525 checkTableNameAndScrubResultColumns(resultColumnList); 526 527 528 resultSet.setResultColumns(resultColumnList); 529 530 531 getCompilerContext().pushCurrentPrivType(getPrivType()); super.bindExpressions(); 533 getCompilerContext().popCurrentPrivType(); 534 535 536 resultSet. 537 getResultColumns(). 538 bindUntypedNullsToResultColumns(resultColumnList); 539 540 if (null != rowLocationColumn) 541 { 542 543 rowLocationColumn.bindResultColumnToExpression(); 544 } 545 546 resultColumnList.checkStorableExpressions(); 547 548 551 if (! resultColumnList.columnTypesAndLengthsMatch()) 552 { 553 resultSet = resultSet.genNormalizeResultSetNode(resultSet, true); 554 resultColumnList.copyTypesAndLengthsToSource(resultSet.getResultColumns()); 555 556 if (hasCheckConstraints(dataDictionary, targetTableDescriptor)) 557 { 558 565 int afterColumnsSize = afterColumns.size(); 566 afterColumns = (ResultColumnList) getNodeFactory().getNode( 567 C_NodeTypes.RESULT_COLUMN_LIST, 568 getContextManager()); 569 ResultColumnList normalizedRCs = resultSet.getResultColumns(); 570 for (int index = 0; index < afterColumnsSize; index++) 571 { 572 afterColumns.addElement(normalizedRCs.elementAt(index + afterColumnsSize)); 573 } 574 } 575 } 576 577 if( null != targetVTI) 578 { 579 deferred = VTIDeferModPolicy.deferIt( DeferModification.UPDATE_STATEMENT, 580 targetVTI, 581 resultColumnList.getColumnNames(), 582 sel.getWhereClause()); 583 } 584 else { 586 587 boolean hasTriggers = (getAllRelevantTriggers(dataDictionary, targetTableDescriptor, 588 changedColumnIds, true).size() > 0); 589 590 591 checkConstraints = bindConstraints( dataDictionary, 592 getNodeFactory(), 593 targetTableDescriptor, 594 null, 595 hasTriggers ? resultColumnList : afterColumns, 596 changedColumnIds, 597 readColsBitSet, 598 false, 599 true); 600 601 607 if (resultSet.subqueryReferencesTarget( 608 targetTableDescriptor.getName(), true) || 609 requiresDeferredProcessing()) 610 { 611 deferred = true; 612 } 613 } 614 615 getCompilerContext().popCurrentPrivType(); 616 617 return this; 618 } 620 int getPrivType() 621 { 622 return Authorizer.UPDATE_PRIV; 623 } 624 625 632 public boolean referencesSessionSchema() 633 throws StandardException 634 { 635 return(resultSet.referencesSessionSchema()); 637 638 } 639 640 645 public ConstantAction makeConstantAction() throws StandardException 646 { 647 651 if (! deferred ) 652 { 653 ConglomerateDescriptor updateCD = 654 targetTable. 655 getTrulyTheBestAccessPath(). 656 getConglomerateDescriptor(); 657 658 if (updateCD != null && updateCD.isIndex()) 659 { 660 int [] baseColumns = 661 updateCD.getIndexDescriptor().baseColumnPositions(); 662 663 if (resultSet. 664 getResultColumns(). 665 updateOverlaps(baseColumns)) 666 { 667 deferred = true; 668 } 669 } 670 } 671 672 if( null == targetTableDescriptor) 673 { 674 679 return getGenericConstantActionFactory().getUpdatableVTIConstantAction( DeferModification.UPDATE_STATEMENT, 680 deferred, changedColumnIds); 681 } 682 683 int lockMode = resultSet.updateTargetLockMode(); 684 long heapConglomId = targetTableDescriptor.getHeapConglomerateId(); 685 TransactionController tc = 686 getLanguageConnectionContext().getTransactionCompile(); 687 StaticCompiledOpenConglomInfo[] indexSCOCIs = 688 new StaticCompiledOpenConglomInfo[indexConglomerateNumbers.length]; 689 690 for (int index = 0; index < indexSCOCIs.length; index++) 691 { 692 indexSCOCIs[index] = tc.getStaticCompiledConglomInfo(indexConglomerateNumbers[index]); 693 } 694 695 699 if (targetTableDescriptor.getLockGranularity() == TableDescriptor.TABLE_LOCK_GRANULARITY) 700 { 701 lockMode = TransactionController.MODE_TABLE; 702 } 703 704 705 return getGenericConstantActionFactory().getUpdateConstantAction 706 ( heapConglomId, 707 targetTableDescriptor.getTableType(), 708 tc.getStaticCompiledConglomInfo(heapConglomId), 709 indicesToMaintain, 710 indexConglomerateNumbers, 711 indexSCOCIs, 712 indexNames, 713 emptyHeapRow, 714 deferred, 715 targetTableDescriptor.getUUID(), 716 lockMode, 717 false, 718 changedColumnIds, null, null, 719 getFKInfo(), 720 getTriggerInfo(), 721 (readColsBitSet == null) ? (FormatableBitSet)null : new FormatableBitSet(readColsBitSet), 722 getReadColMap(targetTableDescriptor.getNumberOfColumns(),readColsBitSet), 723 resultColumnList.getStreamStorableColIds(targetTableDescriptor.getNumberOfColumns()), 724 (readColsBitSet == null) ? 725 targetTableDescriptor.getNumberOfColumns() : 726 readColsBitSet.getNumBitsSet(), 727 positionedUpdate, 728 resultSet.isOneRowResultSet() 729 ); 730 } 731 732 736 protected void setDeferredForUpdateOfIndexColumn() 737 { 738 739 if (! deferred ) 740 { 741 742 ConglomerateDescriptor updateCD = 743 targetTable. 744 getTrulyTheBestAccessPath(). 745 getConglomerateDescriptor(); 746 747 748 if (updateCD != null && updateCD.isIndex()) 749 { 750 int [] baseColumns = 751 updateCD.getIndexDescriptor().baseColumnPositions(); 752 753 754 if (resultSet. 755 getResultColumns(). 756 updateOverlaps(baseColumns)) 757 { 758 deferred = true; 759 } 760 } 761 } 762 } 763 764 782 public void generate(ActivationClassBuilder acb, 783 MethodBuilder mb) 784 throws StandardException 785 { 786 generateCodeForTemporaryTable(acb, mb); 788 789 790 if(!isDependentTable) 791 generateParameterValueSet(acb); 792 793 794 798 acb.newFieldDeclaration(Modifier.PRIVATE, 799 ClassName.CursorResultSet, 800 acb.newRowLocationScanResultSetName()); 801 802 806 807 acb.pushGetResultSetFactoryExpression(mb); 808 resultSet.generate(acb, mb); 810 if( null != targetVTI) 811 { 812 targetVTI.assignCostEstimate(resultSet.getNewCostEstimate()); 813 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getUpdateVTIResultSet", ClassName.ResultSet, 1); 814 } 815 else 816 { 817 generateCheckConstraints( checkConstraints, acb, mb ); 820 if(isDependentTable) 821 { 822 mb.push(acb.addItem(makeConstantAction())); 823 mb.push(acb.addItem(makeResultDescription())); 824 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getDeleteCascadeUpdateResultSet", 825 ClassName.ResultSet, 4); 826 }else 827 { 828 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getUpdateResultSet", 829 ClassName.ResultSet, 2); 830 } 831 } 832 } 833 834 840 protected final int getStatementType() 841 { 842 return StatementType.UPDATE; 843 } 844 845 846 869 public FormatableBitSet getReadMap 870 ( 871 DataDictionary dd, 872 TableDescriptor baseTable, 873 ResultColumnList updateColumnList 874 ) 875 throws StandardException 876 { 877 boolean[] needsDeferredProcessing = new boolean[1]; 878 needsDeferredProcessing[0] = requiresDeferredProcessing(); 879 880 Vector conglomVector = new Vector (); 881 relevantCdl = new ConstraintDescriptorList(); 882 relevantTriggers = new GenericDescriptorList(); 883 884 FormatableBitSet columnMap = UpdateNode.getUpdateReadMap(baseTable, 885 updateColumnList, conglomVector, relevantCdl, relevantTriggers, needsDeferredProcessing ); 886 887 markAffectedIndexes( conglomVector ); 888 889 adjustDeferredFlag( needsDeferredProcessing[0] ); 890 891 return columnMap; 892 } 893 894 895 899 private int[] getChangedColumnIds(ResultColumnList rcl) 900 { 901 if (rcl == null) { return (int[])null; } 902 else { return rcl.sortMe(); } 903 } 904 933 public static FormatableBitSet getUpdateReadMap 934 ( 935 TableDescriptor baseTable, 936 ResultColumnList updateColumnList, 937 Vector conglomVector, 938 ConstraintDescriptorList relevantConstraints, 939 GenericDescriptorList relevantTriggers, 940 boolean[] needsDeferredProcessing 941 ) 942 throws StandardException 943 { 944 if (SanityManager.DEBUG) 945 { 946 SanityManager.ASSERT(updateColumnList != null, "updateColumnList is null"); 947 } 948 949 int columnCount = baseTable.getMaxColumnID(); 950 FormatableBitSet columnMap = new FormatableBitSet(columnCount + 1); 951 952 959 int[] changedColumnIds = updateColumnList.sortMe(); 960 961 for (int ix = 0; ix < changedColumnIds.length; ix++) 962 { 963 columnMap.set(changedColumnIds[ix]); 964 } 965 966 972 DMLModStatementNode.getXAffectedIndexes(baseTable, updateColumnList, columnMap, conglomVector ); 973 974 980 baseTable.getAllRelevantConstraints 981 ( StatementType.UPDATE, false, changedColumnIds, needsDeferredProcessing, relevantConstraints ); 982 983 int rclSize = relevantConstraints.size(); 984 for (int index = 0; index < rclSize; index++) 985 { 986 ConstraintDescriptor cd = relevantConstraints.elementAt(index); 987 if (cd.getConstraintType() != DataDictionary.CHECK_CONSTRAINT) 988 { 989 continue; 990 } 991 992 int[] refColumns = ((CheckConstraintDescriptor)cd).getReferencedColumns(); 993 for (int i = 0; i < refColumns.length; i++) 994 { 995 columnMap.set(refColumns[i]); 996 } 997 } 998 999 1004 1005 baseTable.getAllRelevantTriggers( StatementType.UPDATE, changedColumnIds, relevantTriggers ); 1006 if ( relevantTriggers.size() > 0 ) { needsDeferredProcessing[0] = true; } 1007 1008 if (relevantTriggers.size() > 0) 1009 { 1010 for (int i = 1; i <= columnCount; i++) 1011 { 1012 columnMap.set(i); 1013 } 1014 } 1015 1016 return columnMap; 1017 } 1018 1019 1024 private void normalizeCorrelatedColumns( ResultColumnList rcl, FromTable fromTable ) 1025 throws StandardException 1026 { 1027 String correlationName = fromTable.getCorrelationName(); 1028 1029 if ( correlationName == null ) { return; } 1030 1031 TableName tableNameNode; 1032 1033 if ( fromTable instanceof CurrentOfNode ) 1034 { tableNameNode = ((CurrentOfNode) fromTable).getBaseCursorTargetTableName(); } 1035 else { tableNameNode = makeTableName( null, fromTable.getBaseTableName() ); } 1036 1037 int count = rcl.size(); 1038 1039 for ( int i = 0; i < count; i++ ) 1040 { 1041 ResultColumn column = (ResultColumn) rcl.elementAt( i ); 1042 ColumnReference reference = column.getReference(); 1043 1044 if ( (reference != null) && correlationName.equals( reference.getTableName() ) ) 1045 { 1046 reference.setTableNameNode( tableNameNode ); 1047 } 1048 } 1049 1050 } 1051 1052 1057 private void checkTableNameAndScrubResultColumns(ResultColumnList rcl) 1058 throws StandardException 1059 { 1060 int columnCount = rcl.size(); 1061 int tableCount = ((SelectNode)resultSet).fromList.size(); 1062 1063 for ( int i = 0; i < columnCount; i++ ) 1064 { 1065 boolean foundMatchingTable = false; 1066 ResultColumn column = (ResultColumn) rcl.elementAt( i ); 1067 1068 if (column.getTableName() != null) { 1069 for (int j = 0; j < tableCount; j++) { 1070 FromTable fromTable = (FromTable) ((SelectNode)resultSet). 1071 fromList.elementAt(j); 1072 final String tableName; 1073 if ( fromTable instanceof CurrentOfNode ) { 1074 tableName = ((CurrentOfNode)fromTable). 1075 getBaseCursorTargetTableName().getTableName(); 1076 } else { 1077 tableName = fromTable.getBaseTableName(); 1078 } 1079 1080 if (column.getTableName().equals(tableName)) { 1081 foundMatchingTable = true; 1082 break; 1083 } 1084 } 1085 1086 if (!foundMatchingTable) { 1087 throw StandardException.newException( 1088 SQLState.LANG_COLUMN_NOT_FOUND, 1089 column.getTableName() + "." + column.getName()); 1090 } 1091 } 1092 1093 1102 column.clearTableName(); 1103 } 1104 } 1105 1106 1114 private void normalizeSynonymColumns( 1115 ResultColumnList rcl, 1116 FromTable fromTable) 1117 throws StandardException 1118 { 1119 if (fromTable.getCorrelationName() != null) 1120 { 1121 return; 1122 } 1123 1124 TableName tableNameNode; 1125 if (fromTable instanceof CurrentOfNode) 1126 { 1127 tableNameNode = 1128 ((CurrentOfNode) fromTable).getBaseCursorTargetTableName(); 1129 } 1130 else 1131 { 1132 tableNameNode = makeTableName(null, fromTable.getBaseTableName()); 1133 } 1134 1135 super.normalizeSynonymColumns(rcl, tableNameNode); 1136 } 1137 1138} | Popular Tags |