Bug #3379
do not copy index definitions when defining WORKFILE like TABLE
100%
History
#1 Updated by Eric Faulhaber over 8 years ago
- Assignee set to Eric Faulhaber
A customer pointed out that when defining a WORKFILE using LIKE to copy the definition of a table, index information is not copied over. This behavior differs than when using LIKE to define a TEMP-TABLE.
#3 Updated by Eric Faulhaber almost 7 years ago
- Assignee changed from Eric Faulhaber to Vladimir Tsichevski
Greg, what do you think? Assuming all indices are to be ignored in the copy as we were told, does the fix belong in the parser's like_clause rule, or in the temp_table_use_index rule, or somewhere else entirely? Ultimately, I think we just want to bypass telling the SymbolResolver to addIndexFrom if the target table is a WORKFILE, don't we?
#4 Updated by Greg Shah almost 7 years ago
like_clause uses SymbolResolver.addFieldsFrom() to search for the LIKE table and load the fields using SchemaDictionary.addFieldEntries() which calls SchemaDictionary.addEntries() which calls downstream to addEntries(NameNode fromNode, NameNode toNode, int type). It is not clear if the index nodes are duplicated downstream but that seems the most likely place.
I think we just want to bypass telling the SymbolResolver to addIndexFrom if the target table is a WORKFILE, don't we?
like_clause only calls temp_table_use_index if there is a USE-INDEX clause. I don't think this is the primary place the index definitions get copied. The 4GL docs don't show that the USE-INDEX clause is allowed for DEFINE WORK-TABLE but perhaps we should confirm it. Still, this is not the place where all indexes get copied.
#5 Updated by Vladimir Tsichevski almost 7 years ago
Greg Shah wrote:
The 4GL docs don't show that the
USE-INDEXclause is allowed forDEFINE WORK-TABLEbut perhaps we should confirm it.
Progress does no allow the USE-INDEX for WORK-TABLE. The following code will not compile:
define temp-table t-shipto like shipto use-index ship-no. DEF WORKFILE w-shipto LIKE shipto use-index ship-no.
with the message:
** Unable to understand after -- "w-shipto LIKE shipto". (247)
#6 Updated by Greg Shah almost 7 years ago
Good, that makes it simpler. Please dig into addEntries() to see how the indexes get copied. The SchemaDictionary already knows if the target is a work table, so I think excluding the index copy should not be too tricky.
#7 Updated by Vladimir Tsichevski almost 7 years ago
See the explanation and a proposed fix in #4103.
#8 Updated by Vladimir Tsichevski almost 7 years ago
- Status changed from New to WIP
The fix committed to the 4103a branch. The new revno is 11328.
#9 Updated by Vladimir Tsichevski almost 7 years ago
- Status changed from WIP to Review
#10 Updated by Greg Shah almost 7 years ago
4103a was merged to trunk as revision 11331. Can this task be closed?
#11 Updated by Vladimir Tsichevski almost 7 years ago
Greg Shah wrote:
4103a was merged to trunk as revision 11331. Can this task be closed?
I think yes.
#12 Updated by Eric Faulhaber almost 7 years ago
- % Done changed from 0 to 100
- Status changed from Review to Closed
I'm ok with the changes.