Changeset 9593 for trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
- Timestamp:
- 06/24/10 12:03:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r9592 r9593 500 500 query=" UPDATE "$step"Status " 501 501 # add joins to the influenced tables 502 stepspecialjoin="" 502 503 for influence in $influences 503 504 do 504 # make sure that the right join is done 505 # in case the is a 'Join' given for the 506 # influenced step, this is added 507 # otherwise it is checked whether the executed step 508 # itself needs a 'Join' (i.e. has different primaries) 509 # if yes, the tables are joined with the primaries of the influenced step 510 # else with the primaries of the executed step itself 511 stdjoin=`getjoin $influence` 512 if ! [ "$stdjoin" = "" ] 505 inflprims=( `getprimary $influence` ) 506 # make sure that the correct joins are used 507 # in case the primaries of the step and the influence are 508 # the same, the tables are join with these primaries 509 # otherwise they are joined with the primaries of the influence 510 if [ "`echo ${inflprims[@]}`" == "`echo ${prims[@]}`" ] 513 511 then 514 query=$query" "$stdjoin" " 515 else 516 stdjoin2=`getjoin $step` 517 if [ "$stdjoin2" == "" ] 512 query=$query" LEFT JOIN "$influence"Status USING (${prims[@]}) " 513 else 514 prims2=`getprimary $step | sed -e "s/\ //g"` 515 primstest=`echo ${inflprims[@]} | sed -e "s/\ //g" | sed -e "s/$prims2//g"` 516 if [ "$primstest" == "`echo ${inflprims[@]} | sed -e "s/\ //g"`" ] 518 517 then 519 query=$query" LEFT JOIN "$influence"Status USING("`getprimary $influence`") " 518 if [ "$stepspecialjoin" == "" ] 519 then 520 stepspecialjoin=`getspecialjoin $step` 521 query=$query" "$stepspecialjoin" " 522 fi 523 query=$query" LEFT JOIN "$influence"Status USING (${inflprims[@]}) " 520 524 else 521 query=$query" LEFT JOIN "$influence"Status USING("`getprimary $step`") " 525 infljoin=`getjoin $influence` 526 if [ "$infljoin" = "" ] 527 then 528 query=$query" LEFT JOIN "$influence"Status USING (${prims[@]}) " 529 else 530 query=$query" "$infljoin 531 # warning: this is a workaround 532 # it has to be checked whether it works for all steps 533 stepspecialjoin="not empty" 534 fi 522 535 fi 523 536 fi … … 543 556 s=0 544 557 fi 545 query=$query" " `echo ${prims[0]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}]}'"558 query=$query" "$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}]}'" 546 559 for (( j=1 ; j < ${#prims[@]} ; j++ )) 547 560 do 548 query=$query" AND " `echo ${prims[$j]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}+$j]}' "561 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}+$j]}' " 549 562 done 550 563 # print query
Note:
See TracChangeset
for help on using the changeset viewer.