001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055 delimiter /
056
057
058
059
060
061
062 drop procedure if exists HLT_BOOT_SETUP /
063 create procedure HLT_BOOT_SETUP ()
064 begin
065
066 create temporary table if not exists TMP_PAR (
067 ID int(10) not null,
068 constraint ID_PK primary key (ID)
069 );
070 truncate table TMP_PAR;
071
072 create temporary table if not exists TMP_COMP (
073 ID int(10) not null,
074 constraint ID_PK primary key (ID)
075 );
076 truncate table TMP_COMP;
077
078 create temporary table if not exists TMP_FORCE_DLL (
079 NAME varchar(50) not null,
080 constraint NAME_PK primary key (NAME)
081 );
082 truncate table TMP_FORCE_DLL;
083 end;
084 /
085
086
087 drop procedure if exists HLT_SHUTDOWN_SETUP /
088 create procedure HLT_SHUTDOWN_SETUP ()
089 begin
090 drop table if exists TMP_PAR;
091 drop table if exists TMP_COMP;
092 drop table if exists TMP_FORCE_DLL;
093 end;
094 /
095
096
097
098
099
100
101
102
103 drop function if exists HLT_INSERT_PARAMETER /
104 create function HLT_INSERT_PARAMETER (NAME varchar(50),
105 OP varchar(30),
106 VALUE varchar(40000)) returns int(10)
107 begin
108 declare RETVAL int(10) default NULL;
109
110 select HPA_ID into RETVAL from HLT_PARAMETER where
111 binary HPA_NAME = NAME and HPA_OP = OP and HPA_VALUE = VALUE;
112
113 if RETVAL is null then
114 insert into HLT_PARAMETER
115 (HPA_NAME, HPA_OP, HPA_VALUE) values (NAME, OP, VALUE);
116 select HPA_ID into RETVAL from HLT_PARAMETER where
117 binary HPA_NAME = NAME and HPA_OP = OP and HPA_VALUE = VALUE;
118 end if;
119 insert into TMP_PAR (ID) values (RETVAL);
120 return(RETVAL);
121 end;
122 /
123
124
125 drop procedure if exists HLT_RESET_PARAMETER /
126 create procedure HLT_RESET_PARAMETER ()
127 begin
128 delete from TMP_PAR;
129 end;
130 /
131
132
133
134 drop function if exists HLT_SEEK_CP2PA /
135 create function HLT_SEEK_CP2PA (COMP_ID int(10),
136 PAR_ID int(10)) returns int(1)
137 begin
138 declare TEST int(10);
139 select max(HLT_CP_TO_PA.HCP2PA_ID) into TEST
140 from HLT_CP_TO_PA where COMP_ID = HLT_CP_TO_PA.HCP2PA_COMPONENT_ID and
141 HLT_CP_TO_PA.HCP2PA_PARAMETER_ID = PAR_ID;
142 if TEST is not null then
143 return(1);
144 end if;
145 return(0);
146 end;
147 /
148
149
150 drop function if exists HLT_COUNT_CP2PA /
151 create function HLT_COUNT_CP2PA (COMP_ID int(10)) returns int(10)
152 begin
153 declare TEST int(10);
154 select count(HLT_CP_TO_PA.HCP2PA_ID) into TEST
155 from HLT_CP_TO_PA where COMP_ID = HLT_CP_TO_PA.HCP2PA_COMPONENT_ID;
156 return(TEST);
157 end;
158 /
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178 drop function if exists HLT_INSERT_COMPONENT /
179 create function HLT_INSERT_COMPONENT (NAME varchar(150),
180 ALIAS varchar(150),
181 TOPALG int(1)) returns int(10)
182 begin
183 declare TEST int(10) DEFAULT 0;
184 declare NPAR int(10);
185 declare COMP_ID int(10);
186 declare PAR_ID int(10);
187 declare VERSION decimal(11,5);
188
189 select count(TMP_PAR.ID) into NPAR from TMP_PAR;
190
191
192 select max(HLT_COMPONENT.HCP_ID) into COMP_ID from HLT_COMPONENT
193 where HLT_COMPONENT.HCP_NAME = NAME and
194 HLT_COMPONENT.HCP_ALIAS = ALIAS and
195 HLT_COMPONENT.HCP_TOPALG = TOPALG;
196 while COMP_ID is not null do
197
198 select 0 into TEST;
199 select min(TMP_PAR.ID) into PAR_ID from TMP_PAR;
200 while PAR_ID is not null do
201 select TEST + HLT_SEEK_CP2PA(COMP_ID,PAR_ID) into TEST;
202 select min(TMP_PAR.ID) into PAR_ID from TMP_PAR
203 where TMP_PAR.ID > PAR_ID;
204 end while;
205
206 if TEST = NPAR and HLT_COUNT_CP2PA(COMP_ID) = NPAR then
207 delete from TMP_PAR;
208 insert into TMP_COMP (ID) values (COMP_ID);
209 return COMP_ID;
210 end if;
211
212 select max(HLT_COMPONENT.HCP_ID) into COMP_ID from HLT_COMPONENT
213 where HLT_COMPONENT.HCP_NAME = NAME and
214 HLT_COMPONENT.HCP_ALIAS = ALIAS and
215 HLT_COMPONENT.HCP_TOPALG = TOPALG and
216 HLT_COMPONENT.HCP_ID < COMP_ID;
217 end while;
218
219
220
221
222
223 select max(HLT_COMPONENT.HCP_VERSION) into VERSION from HLT_COMPONENT
224 where HLT_COMPONENT.HCP_NAME = NAME and
225 HLT_COMPONENT.HCP_ALIAS = ALIAS;
226 select if(VERSION is null, 1.0, floor(VERSION) + 1.0) into VERSION;
227 insert into HLT_COMPONENT
228 (HCP_NAME, HCP_VERSION, HCP_ALIAS, HCP_TOPALG) values
229 (NAME, VERSION, ALIAS, TOPALG);
230 select max(HCP_ID) into COMP_ID from HLT_COMPONENT where
231 HCP_VERSION = VERSION and HCP_ALIAS = ALIAS;
232
233
234 select min(TMP_PAR.ID) into PAR_ID from TMP_PAR;
235 while PAR_ID is not null do
236 insert into HLT_CP_TO_PA (HCP2PA_COMPONENT_ID, HCP2PA_PARAMETER_ID)
237 values (COMP_ID, PAR_ID);
238 select min(TMP_PAR.ID) into PAR_ID from TMP_PAR
239 where TMP_PAR.ID > PAR_ID;
240 end while;
241
242
243 delete from TMP_PAR;
244 insert into TMP_COMP (ID) values (COMP_ID);
245 return(COMP_ID);
246 end;
247 /
248
249
250 drop procedure if exists HLT_RESET_COMPONENT /
251 create procedure HLT_RESET_COMPONENT ()
252 begin
253 delete from TMP_COMP;
254 end;
255 /
256
257
258
259 drop procedure if exists HLT_NEW_FORCE_DLL /
260 create procedure HLT_NEW_FORCE_DLL (in NAME varchar(50))
261 begin
262 declare RETVAL int(10);
263 insert into TMP_FORCE_DLL (NAME) values (NAME);
264 end;
265 /
266
267
268 drop procedure if exists HLT_RESET_FORCE_DLL /
269 create procedure HLT_RESET_FORCE_DLL ()
270 begin
271 delete from TMP_FORCE_DLL;
272 end;
273 /
274
275
276
277 drop function if exists HLT_SEEK_ST2CP /
278 create function HLT_SEEK_ST2CP (SETUP_ID int(10),
279 COMP_ID int(10)) returns int(1)
280 begin
281 declare TEST int(10);
282 select max(HLT_ST_TO_CP.HST2CP_ID) into TEST
283 from HLT_ST_TO_CP where COMP_ID = HLT_ST_TO_CP.HST2CP_COMPONENT_ID and
284 HLT_ST_TO_CP.HST2CP_SETUP_ID = SETUP_ID;
285 if TEST is not null then
286 return(1);
287 end if;
288 return(0);
289 end;
290 /
291
292
293 drop function if exists HLT_COUNT_ST2CP /
294 create function HLT_COUNT_ST2CP (SETUP_ID int(10)) returns int(10)
295 begin
296 declare TEST int(10);
297 select count(HLT_ST_TO_CP.HST2CP_ID) into TEST
298 from HLT_ST_TO_CP where HLT_ST_TO_CP.HST2CP_SETUP_ID = SETUP_ID;
299 return(TEST);
300 end;
301 /
302
303
304
305 drop function if exists HLT_SEEK_ST2FD /
306 create function HLT_SEEK_ST2FD (SETUP_ID int(10),
307 FDLL varchar(50)) returns int(1)
308 begin
309 declare TEST int(10);
310 select max(HLT_FORCE_DLL.HFD_ID) into TEST
311 from HLT_FORCE_DLL where FDLL = HLT_FORCE_DLL.HFD_DLL_NAME and
312 SETUP_ID = HLT_FORCE_DLL.HFD_SETUP_ID;
313 if TEST is not null then
314 return(1);
315 end if;
316 return(0);
317 end;
318 /
319
320
321 drop function if exists HLT_COUNT_ST2FD /
322 create function HLT_COUNT_ST2FD (SETUP_ID int(10)) returns int(10)
323 begin
324 declare TEST int(10);
325 select count(HLT_FORCE_DLL.HFD_ID) into TEST
326 from HLT_FORCE_DLL where SETUP_ID = HLT_FORCE_DLL.HFD_SETUP_ID;
327 return(TEST);
328 end;
329 /
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361 drop function if exists HLT_INSERT_SETUP /
362 create function HLT_INSERT_SETUP (NAME varchar(50)) returns int(10)
363 begin
364 declare TEST_COMP int(20) DEFAULT 0;
365 declare TEST_FDLL int(20) DEFAULT 0;
366 declare NCOMP int(10);
367 declare NFDLL int(10);
368 declare SETUP_ID int(10);
369 declare COMP_ID int(10);
370 declare FDLL varchar(50);
371 declare VERSION decimal(11,5);
372
373 select count(TMP_COMP.ID) into NCOMP from TMP_COMP;
374 select count(TMP_FORCE_DLL.NAME) into NFDLL from TMP_FORCE_DLL;
375
376
377
378 select max(HLT_SETUP.HST_ID) into SETUP_ID from HLT_SETUP
379 where HLT_SETUP.HST_NAME = NAME;
380 while SETUP_ID is not null do
381
382 select 0 into TEST_COMP;
383 select min(TMP_COMP.ID) into COMP_ID from TMP_COMP;
384 while COMP_ID is not null do
385 select TEST_COMP + HLT_SEEK_ST2CP(SETUP_ID,COMP_ID) into TEST_COMP;
386 select min(TMP_COMP.ID) into COMP_ID from TMP_COMP
387 where TMP_COMP.ID > COMP_ID;
388 end while;
389
390 select 0 into TEST_FDLL;
391 select min(TMP_FORCE_DLL.NAME) into FDLL from TMP_FORCE_DLL;
392 while FDLL is not null do
393 select TEST_FDLL + HLT_SEEK_ST2FD(SETUP_ID,FDLL) into TEST_FDLL;
394 select min(TMP_FORCE_DLL.NAME) into FDLL from TMP_FORCE_DLL
395 where TMP_FORCE_DLL.NAME > FDLL;
396 end while;
397
398
399
400 if NCOMP = TEST_COMP and
401 NFDLL = TEST_FDLL and
402 NCOMP = HLT_COUNT_ST2CP(SETUP_ID) and
403 NFDLL = HLT_COUNT_ST2FD(SETUP_ID) then
404 delete from TMP_COMP;
405 delete from TMP_FORCE_DLL;
406 return SETUP_ID;
407 end if;
408
409
410 select max(HLT_SETUP.HST_ID) into SETUP_ID from HLT_SETUP
411 where HLT_SETUP.HST_NAME = NAME and
412 HLT_SETUP.HST_ID < SETUP_ID;
413 end while;
414
415
416
417
418
419 select max(HLT_SETUP.HST_VERSION) into VERSION from HLT_SETUP
420 where HLT_SETUP.HST_NAME = NAME;
421 select if(VERSION is null, 1.0, floor(VERSION) + 1.0) into VERSION;
422 insert into HLT_SETUP (HST_NAME, HST_VERSION) values (NAME, VERSION);
423 select max(HST_ID) into SETUP_ID from HLT_SETUP where
424 HST_VERSION = VERSION and HST_NAME = NAME;
425
426
427 select min(TMP_COMP.ID) into COMP_ID from TMP_COMP;
428 while COMP_ID is not null do
429 insert into HLT_ST_TO_CP (HST2CP_SETUP_ID, HST2CP_COMPONENT_ID)
430 values (SETUP_ID, COMP_ID);
431 select min(TMP_COMP.ID) into COMP_ID from TMP_COMP
432 where TMP_COMP.ID > COMP_ID;
433 end while;
434
435
436
437 select min(TMP_FORCE_DLL.NAME) into FDLL from TMP_FORCE_DLL;
438 while FDLL is not null do
439 insert into HLT_FORCE_DLL (HFD_DLL_NAME, HFD_SETUP_ID) values
440 (FDLL, SETUP_ID);
441 select min(TMP_FORCE_DLL.NAME) into FDLL from TMP_FORCE_DLL
442 where TMP_FORCE_DLL.NAME > FDLL;
443 end while;
444
445
446
447
448 delete from TMP_COMP;
449 delete from TMP_FORCE_DLL;
450 return(SETUP_ID);
451 end;
452 /
453
454
455
456
457
458
459 drop procedure if exists HLT_BOOT_RELEASE /
460 create procedure HLT_BOOT_RELEASE ()
461 begin
462
463 create temporary table if not exists TMP_PROP (
464 ID int(10) not null,
465 constraint ID_PK primary key (ID)
466 );
467 truncate table TMP_PROP;
468
469 create temporary table if not exists TMP_SOURCE (
470 ID int(10) not null,
471 constraint ID_PK primary key (ID)
472 );
473 truncate table TMP_SOURCE;
474
475 create temporary table if not exists TMP_DLL (
476 ID int(10) not null,
477 constraint ID_PK primary key (ID)
478 );
479 truncate table TMP_DLL;
480
481 end;
482 /
483
484
485 drop procedure if exists HLT_SHUTDOWN_RELEASE /
486 create procedure HLT_SHUTDOWN_RELEASE ()
487 begin
488 drop table if exists TMP_PROP;
489 drop table if exists TMP_SOURCE;
490 drop table if exists TMP_DLL;
491 end;
492 /
493
494
495
496
497
498
499
500
501 drop function if exists HLT_INSERT_PROPERTY /
502 create function HLT_INSERT_PROPERTY (NAME varchar(50),
503 PROP_TYPE varchar(50),
504 VALUE varchar(4000)) returns int(10)
505 begin
506 declare RETVAL int(10) default NULL;
507 declare VERSION decimal(11,5);
508
509 select HPY_ID into RETVAL from HLT_PROPERTY where
510 binary HPY_NAME = NAME and HPY_TYPE = PROP_TYPE and HPY_VALUE = VALUE;
511
512 if RETVAL is null then
513 insert into HLT_PROPERTY
514 (HPY_NAME, HPY_TYPE, HPY_VALUE) values (NAME, PROP_TYPE, VALUE);
515 select max(HPY_ID) into RETVAL from HLT_PROPERTY where
516 binary HPY_NAME = NAME and HPY_TYPE = PROP_TYPE and HPY_VALUE = VALUE;
517 end if;
518 insert into TMP_PROP (ID) values (RETVAL);
519 return(RETVAL);
520 end;
521 /
522
523
524 drop procedure if exists HLT_RESET_PROPERTY /
525 create procedure HLT_RESET_PROPERTY ()
526 begin
527 delete from TMP_PROP;
528 end;
529 /
530
531
532
533 drop function if exists HLT_SEEK_SO2PY /
534 create function HLT_SEEK_SO2PY (SOURCE_ID int(10),
535 PROPERTY_ID int(10)) returns int(1)
536 begin
537 declare TEST int(10);
538 select max(HLT_SO_TO_PY.HSO2PY_ID) into TEST
539 from HLT_SO_TO_PY where SOURCE_ID = HLT_SO_TO_PY.HSO2PY_SOURCE_ID and
540 HLT_SO_TO_PY.HSO2PY_PROPERTY_ID = PROPERTY_ID;
541 if TEST is not null then
542 return(1);
543 end if;
544 return(0);
545 end;
546 /
547
548
549 drop function if exists HLT_COUNT_SO2PY /
550 create function HLT_COUNT_SO2PY (SOURCE_ID int(10)) returns int(10)
551 begin
552 declare TEST int(10);
553 select count(HLT_SO_TO_PY.HSO2PY_ID) into TEST
554 from HLT_SO_TO_PY where SOURCE_ID = HLT_SO_TO_PY.HSO2PY_SOURCE_ID;
555 return(TEST);
556 end;
557 /
558
559
560
561
562
563
564 drop function if exists HLT_INSERT_SOURCE /
565 create function HLT_INSERT_SOURCE (NAME varchar(50),
566 GAUDI_TYPE varchar(50)) returns int(10)
567 begin
568 declare TEST int(10) DEFAULT 0;
569 declare NPROP int(10);
570 declare SOURCE_ID int(10);
571 declare PROP_ID int(10);
572
573 select count(TMP_PROP.ID) into NPROP from TMP_PROP;
574
575
576 select max(HLT_SOURCE.HSO_ID) into SOURCE_ID from HLT_SOURCE
577 where HLT_SOURCE.HSO_NAME = NAME and
578 HLT_SOURCE.HSO_GAUDI_TYPE = GAUDI_TYPE;
579 while SOURCE_ID is not null do
580
581 select 0 into TEST;
582 select min(TMP_PROP.ID) into PROP_ID from TMP_PROP;
583 while PROP_ID is not null do
584 select TEST + HLT_SEEK_SO2PY(SOURCE_ID,PROP_ID) into TEST;
585 select min(TMP_PROP.ID) into PROP_ID from TMP_PROP
586 where TMP_PROP.ID > PROP_ID;
587 end while;
588
589 if TEST = NPROP and HLT_COUNT_SO2PY(SOURCE_ID) = NPROP then
590 delete from TMP_PROP;
591 insert into TMP_SOURCE (ID) values (SOURCE_ID);
592 return SOURCE_ID;
593 end if;
594
595 select max(HLT_SOURCE.HSO_ID) into SOURCE_ID from HLT_SOURCE
596 where HLT_SOURCE.HSO_NAME = NAME and
597 HLT_SOURCE.HSO_GAUDI_TYPE = GAUDI_TYPE and
598 HLT_SOURCE.HSO_ID < SOURCE_ID;
599 end while;
600
601
602
603
604
605 insert into HLT_SOURCE (HSO_NAME, HSO_GAUDI_TYPE) values (NAME, GAUDI_TYPE);
606 select max(HSO_ID) into SOURCE_ID from HLT_SOURCE where
607 HSO_NAME = NAME and HSO_GAUDI_TYPE = GAUDI_TYPE;
608
609
610 select min(TMP_PROP.ID) into PROP_ID from TMP_PROP;
611 while PROP_ID is not null do
612 insert into HLT_SO_TO_PY (HSO2PY_SOURCE_ID, HSO2PY_PROPERTY_ID)
613 values (SOURCE_ID, PROP_ID);
614 select min(TMP_PROP.ID) into PROP_ID from TMP_PROP
615 where TMP_PROP.ID > PROP_ID;
616 end while;
617
618
619 delete from TMP_PROP;
620 insert into TMP_SOURCE (ID) values (SOURCE_ID);
621 return(SOURCE_ID);
622 end;
623 /
624
625
626 drop procedure if exists HLT_RESET_SOURCE /
627 create procedure HLT_RESET_SOURCE ()
628 begin
629 delete from TMP_SOURCE;
630 end;
631 /
632
633
634
635 drop function if exists HLT_SEEK_SO2DL /
636 create function HLT_SEEK_SO2DL (DLL_ID int(10),
637 SOURCE_ID int(10)) returns int(1)
638 begin
639 declare TEST int(10);
640 select max(HLT_SO_TO_DL.HSO2DL_ID) into TEST
641 from HLT_SO_TO_DL where DLL_ID = HLT_SO_TO_DL.HSO2DL_DLL_ID and
642 HLT_SO_TO_DL.HSO2DL_SOURCE_ID = SOURCE_ID;
643 if TEST is not null then
644 return(1);
645 end if;
646 return(0);
647 end;
648 /
649
650
651 drop function if exists HLT_COUNT_SO2DL /
652 create function HLT_COUNT_SO2DL (DLL_ID int(10)) returns int(10)
653 begin
654 declare TEST int(10);
655 select count(HLT_SO_TO_DL.HSO2DL_ID) into TEST
656 from HLT_SO_TO_DL where DLL_ID = HLT_SO_TO_DL.HSO2DL_DLL_ID;
657 return(TEST);
658 end;
659 /
660
661
662
663
664
665
666 drop function if exists HLT_INSERT_DLL /
667 create function HLT_INSERT_DLL (NAME varchar(50),
668 PACKAGE varchar(50),
669 CMT_VERSION varchar(60)) returns int(10)
670 begin
671 declare TEST int(10) DEFAULT 0;
672 declare NSOURCE int(10);
673 declare DLL_ID int(10);
674 declare SOURCE_ID int(10);
675
676 select count(TMP_SOURCE.ID) into NSOURCE from TMP_SOURCE;
677
678
679 select HLT_DLL.HDL_ID into DLL_ID from HLT_DLL where
680 HDL_NAME = NAME and HDL_PACKAGE = PACKAGE and HDL_CMT_VERSION = CMT_VERSION;
681 if DLL_ID is not null then
682
683 select 0 into TEST;
684 select min(TMP_SOURCE.ID) into SOURCE_ID from TMP_SOURCE;
685 while SOURCE_ID is not null do
686 select TEST + HLT_SEEK_SO2DL(DLL_ID,SOURCE_ID) into TEST;
687 select min(TMP_SOURCE.ID) into SOURCE_ID from TMP_SOURCE
688 where TMP_SOURCE.ID > SOURCE_ID;
689 end while;
690
691 if TEST = NSOURCE and HLT_COUNT_SO2DL(DLL_ID) = NSOURCE then
692 delete from TMP_SOURCE;
693 insert into TMP_DLL (ID) values (DLL_ID);
694 return DLL_ID;
695 end if;
696 end if;
697
698
699
700
701
702 insert into HLT_DLL (HDL_NAME, HDL_PACKAGE, HDL_CMT_VERSION)
703 values (NAME, PACKAGE, CMT_VERSION);
704 select HDL_ID into DLL_ID from HLT_DLL where
705 HDL_NAME = NAME and HDL_PACKAGE = PACKAGE and HDL_CMT_VERSION = CMT_VERSION;
706
707
708 select min(TMP_SOURCE.ID) into SOURCE_ID from TMP_SOURCE;
709 while SOURCE_ID is not null do
710 insert into HLT_SO_TO_DL (HSO2DL_DLL_ID, HSO2DL_SOURCE_ID)
711 values (DLL_ID, SOURCE_ID);
712 select min(TMP_SOURCE.ID) into SOURCE_ID from TMP_SOURCE
713 where TMP_SOURCE.ID > SOURCE_ID;
714 end while;
715
716
717 delete from TMP_SOURCE;
718 insert into TMP_DLL (ID) values (DLL_ID);
719 return(DLL_ID);
720 end;
721 /
722
723
724 drop procedure if exists HLT_RESET_DLL /
725 create procedure HLT_RESET_DLL ()
726 begin
727 delete from TMP_DLL;
728 end;
729 /
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764 drop function if exists HLT_INSERT_RELEASE /
765 create function HLT_INSERT_RELEASE (NAME varchar(50),
766 VERSION varchar(50)) returns int(10)
767 begin
768 declare TEST int(10) DEFAULT 0;
769 declare NDLL int(10);
770 declare RELEASE_ID int(10);
771 declare DLL_ID int(10);
772
773 select count(TMP_DLL.ID) into NDLL from TMP_DLL;
774
775
776 select HLT_RELEASE.HRE_ID into RELEASE_ID from HLT_RELEASE
777 where HLT_RELEASE.HRE_NAME = NAME and HLT_RELEASE.HRE_VERSION = VERSION;
778
779 if RELEASE_ID is not null then
780
781 select 0 into TEST;
782 select min(TMP_DLL.ID) into DLL_ID from TMP_DLL;
783 while DLL_ID is not null do
784 select TEST + HLT_SEEK_RE2DL(RELEASE_ID,DLL_ID) into TEST;
785 select min(TMP_DLL.ID) into DLL_ID from TMP_DLL
786 where TMP_DLL.ID > DLL_ID;
787 end while;
788
789 if TEST = NDLL and HLT_COUNT_RE2DL(RELEASE_ID) = NDLL then
790 delete from TMP_DLL;
791 return RELEASE_ID;
792 end if;
793 end if;
794
795
796
797
798
799 insert into HLT_RELEASE (HRE_NAME, HRE_VERSION) values (NAME, VERSION);
800 select HRE_ID into RELEASE_ID from HLT_RELEASE where
801 HRE_NAME = NAME and HRE_VERSION = VERSION;
802
803
804
805
806
807
808
809
810
811
812
813 delete from TMP_DLL;
814 return(RELEASE_ID);
815 end;
816 /
817
818
819
820
821
822
823
824
825
826
827
828
829 drop procedure if exists PRUNE_FORCE_DLL /
830 create procedure PRUNE_FORCE_DLL (IN NAME varchar(50),
831 IN VERSION varchar(50))
832 begin
833 declare DLL_NAME varchar(50);
834 declare REMOVE int(1) default 0;
835 declare DONE int(1) default 0;
836 declare DLL cursor for select HLT_DLL.HDL_NAME
837 from TMP_COMP, HLT_COMPONENT, HLT_SOURCE, HLT_SO_TO_DL, HLT_DLL
838 where TMP_COMP.ID = HLT_COMPONENT.HCP_ID and
839 HLT_COMPONENT.HCP_NAME = HLT_SOURCE.HSO_NAME and
840 HLT_SOURCE.HSO_ID = HLT_SO_TO_DL.HSO2DL_SOURCE_ID and
841 HLT_SO_TO_DL.HSO2DL_DLL_ID = HLT_DLL.HDL_ID;
842 declare continue handler for sqlstate '02000' set DONE = 1;
843
844 open DLL;
845 repeat
846 fetch DLL into DLL_NAME;
847 select count(TMP_FORCE_DLL.NAME) into REMOVE from TMP_FORCE_DLL
848 where TMP_FORCE_DLL.NAME = DLL_NAME;
849 if REMOVE > 0 then
850 delete from TMP_FORCE_DLL where TMP_FORCE_DLL.NAME = DLL_NAME;
851 end if;
852 until DONE = 1 end repeat;
853 close DLL;
854
855 end;
856 /
857
858
859 delimiter ;
860
861
862
863
864
865
866 create or replace view HLT_CP_TO_PA_VIEW (HCP_ID, HPA_ID, HPA_NAME, HPA_VALUE,
867 HPA_OP)
868 as
869 select HLT_CP_TO_PA.HCP2PA_COMPONENT_ID,
870 HLT_PARAMETER.HPA_ID,
871 HLT_PARAMETER.HPA_NAME,
872 HLT_PARAMETER.HPA_VALUE,
873 HLT_PARAMETER.HPA_OP
874 from HLT_CP_TO_PA, HLT_PARAMETER
875 where HLT_CP_TO_PA.HCP2PA_PARAMETER_ID = HLT_PARAMETER.HPA_ID;
876
877
878 create or replace view HLT_SO_TO_PY_VIEW (HSO_ID, HPY_ID, HPY_NAME, HPY_VALUE,
879 HPY_TYPE)
880 as
881 select HLT_SO_TO_PY.HSO2PY_SOURCE_ID,
882 HLT_PROPERTY.HPY_ID,
883 HLT_PROPERTY.HPY_NAME,
884 HLT_PROPERTY.HPY_VALUE,
885 HLT_PROPERTY.HPY_TYPE
886 from HLT_SO_TO_PY, HLT_PROPERTY
887 where HLT_SO_TO_PY.HSO2PY_PROPERTY_ID = HLT_PROPERTY.HPY_ID;
888
889
890
891 create or replace view HLT_MK_TO_SETUP_VIEW (HMT_ID, HST_ID)
892 as
893 select HLT_MASTER_TABLE.HMT_ID, HLT_SETUP.HST_ID
894 from HLT_MASTER_TABLE,
895 HLT_TRIGGER_MENU,
896 HLT_TM_TO_TC,
897 HLT_TRIGGER_CHAIN,
898 HLT_TC_TO_TS,
899 HLT_TRIGGER_SIGNATURE,
900 HLT_TS_TO_TE,
901 HLT_TE_TO_CP,
902 HLT_SETUP
903 where HLT_MASTER_TABLE.HMT_TRIGGER_MENU_ID is not null and
904 HLT_MASTER_TABLE.HMT_TRIGGER_MENU_ID = HLT_TRIGGER_MENU.HTM_ID and
905 HLT_TRIGGER_MENU.HTM_ID = HLT_TM_TO_TC.HTM2TC_TRIGGER_MENU_ID and
906 HLT_TM_TO_TC.HTM2TC_TRIGGER_CHAIN_ID = HLT_TRIGGER_CHAIN.HTC_ID and
907 HLT_TRIGGER_CHAIN.HTC_SETUP_ID = HLT_SETUP.HST_ID;
Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
This page was automatically generated by the
LXR engine.
|
|