| 402 |
402 |
<rule>newIdx = newIdx + 1</rule>
|
| 403 |
403 |
</while>
|
| 404 |
404 |
</function>
|
|
405 |
|
| 405 |
406 |
</func-library>
|
| 406 |
407 |
|
| 407 |
408 |
<!-- global variables -->
|
| ... | ... | |
| 673 |
674 |
<variable name="extentVal" type="java.lang.Long" />
|
| 674 |
675 |
<variable name="extents" type="java.util.Collection" /> <!-- TODO: not used? -->
|
| 675 |
676 |
<variable name="extentMap" init="#(java.util.Map) create('java.util.HashMap')" /> <!-- TODO: not used? -->
|
|
677 |
<variable name="extIndex" type="java.lang.Long" />
|
| 676 |
678 |
<variable name="hasUsualExtent" type="java.lang.Boolean" />
|
|
679 |
<variable name="useExpandedExtent" type="java.lang.Boolean" />
|
| 677 |
680 |
<variable name="storeTTPeer" type="java.lang.Boolean" />
|
| 678 |
681 |
<variable name="tmpTabCrit" type="java.util.Map" />
|
| 679 |
682 |
<variable name="tmpTabKey" type="com.goldencode.p2j.uast.AstKey" />
|
| ... | ... | |
| 1333 |
1336 |
|
| 1334 |
1337 |
<!-- reset usual extent/custom extent flags for all fields-->
|
| 1335 |
1338 |
<rule>evalLib('fields_all', this)
|
|
1339 |
<action>useExpandedExtent = false</action>
|
| 1336 |
1340 |
<action>hasUsualExtent = false</action>
|
| 1337 |
1341 |
</rule>
|
| 1338 |
1342 |
|
| ... | ... | |
| 1386 |
1390 |
</rule>
|
| 1387 |
1391 |
</rule>
|
| 1388 |
1392 |
|
|
1393 |
<rule>getConfigParameter("expand-extents", true)) or
|
|
1394 |
(parent.type == prog.temp_table or
|
|
1395 |
parent.type == prog.work_table)
|
|
1396 |
<action on="true">useExpandedExtent = true</action>
|
|
1397 |
</rule>
|
|
1398 |
|
| 1389 |
1399 |
<rule>peers = create('java.util.ArrayList')</rule>
|
| 1390 |
1400 |
<action>extentVal = this.getAnnotation('extent')</action>
|
| 1391 |
1401 |
<rule>extentVal != null
|
| ... | ... | |
| 1498 |
1508 |
</rule>
|
| 1499 |
1509 |
</rule>
|
| 1500 |
1510 |
|
| 1501 |
|
<!-- check for column collision -->
|
| 1502 |
|
<rule>columns.contains(tmpName)
|
| 1503 |
|
<rule>sqlColumn == null
|
| 1504 |
|
<action>nextColSuf = execLib("getUniqueSuffix", nextColSuf, tmpName, columns)</action>
|
| 1505 |
|
<action>tmpName = sprintf("%s%d", tmpName, nextColSuf)</action>
|
| 1506 |
|
<action on="false">
|
| 1507 |
|
printfln("WARNING: Column collision because of hint: %s", sqlColumn)
|
| 1508 |
|
</action>
|
|
1511 |
<rule>extentVal != null and extentVal > 0 and useExpandedExtent
|
|
1512 |
<variable name="newTmpName" type="java.lang.String" />
|
|
1513 |
|
|
1514 |
<rule>extIndex = #(long) 0</rule>
|
|
1515 |
<while>extentVal >= extIndex
|
|
1516 |
<rule>extIndex = extIndex + 1</rule>
|
|
1517 |
<rule>newTmpName = sprintf("%s_%d", tmpName, extIndex)</rule>
|
|
1518 |
<rule>columns.contains(newTmpName)
|
|
1519 |
<action>nextColSuf = execLib("getUniqueSuffix", nextColSuf, tmpName, columns)</action>
|
|
1520 |
<action>tmpName = sprintf("%s%d", tmpName, nextColSuf)</action>
|
|
1521 |
<rule>newTmpName = sprintf("%s_%d", tmpName, extIndex)</rule>
|
|
1522 |
</rule>
|
|
1523 |
<rule>columns.add(newTmpName)</rule>
|
|
1524 |
</while>
|
|
1525 |
|
|
1526 |
<rule on="false">columns.contains(tmpName)
|
|
1527 |
<rule>sqlColumn == null
|
|
1528 |
<action>nextColSuf = execLib("getUniqueSuffix", nextColSuf, tmpName, columns)</action>
|
|
1529 |
<action>tmpName = sprintf("%s%d", tmpName, nextColSuf)</action>
|
|
1530 |
<action on="false">
|
|
1531 |
printfln("WARNING: Column collision because of hint: %s", sqlColumn)
|
|
1532 |
</action>
|
|
1533 |
</rule>
|
| 1509 |
1534 |
</rule>
|
| 1510 |
1535 |
</rule>
|
| 1511 |
|
|
| 1512 |
1536 |
<action>columns.add(tmpName)</action>
|
| 1513 |
1537 |
|
| 1514 |
1538 |
<!-- escape field name if hinted -->
|