Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - dbsany.f06
There are 10 other files named dbsany.f06 in the archive. Click here to see a list.
;
; VERSION 5A COMMENT
;
;	This edit supersedes edit 544.  If edit 544 is not installed,
;	remove the lines
;
;		.ASSOCIATED +544
;		.REMOVE 544
;
;	from the .FIX file.
;
;
; SYMPTOM
;
;	Corrupt line-headers may cause severe damage to database.
;
;
;                       **********
; DIAGNOSIS
;
;	DBCS does not check the line-headers for consistency
;	once the headers have been created.  Such a check at
;	each retrieval is desirable to maintain integrity of
;	the database.
;
;                       **********
; CURE
;
;	Install edit 601 (replacing edit 544) to check the
;	consistency of line-headers on each record retrieval.
;	Three things are checked:
;	    1) record type ID (TID) must be acceptable;
;	    2) record length must match length declared by user;
;	    3) record must fit in data area on DB page.
;
;	This code is skipped in DBMEND processing.
;
;	This edit includes a check to prevent attempting
;	to check records not declared in sub-schema.
;
;	If anything looks bad, this edit forces a status code of
;	XX56 to notify the user of inconsistent data.
;
;
; Note ***** This edit applies to DBMS10 + DBMS20 V5A, and to COBOL
;		and to FORTRAN
;
; The recommended filename for this edit is 601.FIX.    The lines
; .EDIT thru .ENDE should be typed into that file.
;
;	Apply this edit to DBSANY.REL **********
;
;
; The edit can be inserted using the following commands:
;
; For a COBOL-68 DBMS system ...
;
;  .R MAKLIB
;  *DBSANY.601=DBSANY.REL,601.FIX/F
;  *LIBOL.601=LIBOL.REL/M:DBKIO,DBSANY.601/R:DBKIO
;  *LIBOL.601=LIBOL.601/INDEX
;
;  .R LINK
;  *LIBSHR,LIBOL.601/SEARCH/GO
;  .SAVE LIBO12
;
; For a COBOL-74 DBMS system ...
;
;  .R MAKLIB
;  *DBSANY.601=DBSANY.REL,601.FIX/F
;  *C74LIB.601=C74LIB.REL/M:DBKIO,DBSANY.601/R:DBKIO
;  *C74LIB.601=C74LIB.601/INDEX
;
;  .R LINK
;  *C74SHR,C74LIB.601/SEARCH/GO
;
;  .SAVE C74O12
;
; For a FORTRAN DBMS system ...
;
;  .R MAKLIB
;  *DBSANY.601=DBSANY.REL,601.FIX/F
;  *FORLIB.601=FORLIB.REL/M:DBKIO,DBSANY.601/R:DBKIO
;  *FORLIB.601=FORLIB.601/INDEX
;
;  .R LINK
;  *FORLIB.601/INCLUDE:FOROTS,FORLIB.601/S/G
;
;  .SAVE FOROTS
;
;
; The patched files should be renamed to .REL to be used as the base for
;	any future edits.
;
;
;**********************************************************************
;
;
.EDIT 601
.NAME RL
.MODULE DBKIO
.ASSOCIATED +544
.REMOVE 544
.INSERT GET.RE,AFTER,<PUSHJ P,GET.ONL>
 
;+
;   The following two lines of code test whether there is a record
;   list defined to the sub-schema invoked by the run-unit. For
;   DBMEND there is not, and in fact the symbol RECLIST is not
;   defined to DBMEND. If RECLIST(SS) is equal to 0, there is no
;   record list for the sub-schema. DBMEND uses a skeletal sub-set
;   of the improper sub-schema for its processing.
;-
 
	SKIPN	R0,127(SS)	; 127=RECLIS -- Valid record list?
	JRST	%601A7+1	; No -- bypass edit 601
 
;+
;   The following code is a spot check for GET.REC which will test
;   for an acceptable TID for the current record just retrieved
;   and for an offset and length which falls in the data area of
;   the current data base page. Also it checks the record length
;   in the line-header against the declared user record length
;   in the in-core data base.
;-
 
	PUSH	P,R0	; Get 4 ACs
	PUSH	P,R1
	PUSH	P,PAG
	PUSH	P,LIN
 	;
       	; Load TID of current record
	;
	LDB	R0,[POINT LH$TID,LH.TID+0(LINHDR),LH%TID]
	;
	; Test for acceptable TID
	;
	CAIL	R0,1		; TID GTR 0?
	CAMLE	R0,TIDHIG(SS)	; TID LEQ high user TID?
	PUSHJ	P,XC.DAT##	; Bad TID
	CAIG	R0,3		; TID GTR internally defined TIDs
	JRST	%601A0		; No -- OK
	CAIGE	R0,SYSTID	; TID not LSS SYSTEM TID?
	PUSHJ	P,XC.DAT##	; Bad TID
%601A0:	MOVEM	R0,PAG		; Save aside current TID
 
	;+
        ;   Test offset and length to make sure that they
        ;   point within the data area on the page and that
        ;   the length in the line-hdr conforms to the declared
        ;   length in the in-core record block.
	;-
 
	;
	; Load offset of current record
	;
	LDB	R0,[POINT LH$OFF,LH.OFF(LINHDR),LH%OFF]
	HRRZ	R1,AB.CALC(AREABLK)	; Get no of CALC chains on page
	ADDI	R1,2		; For page hdr -- now points at first data word
	CAMGE	R0,R1		; Offset points into page's data area?
	PUSHJ	P,XC.DAT##	; No -- bad offset
	HRRZ	R1,1(PAGHDR)	; Get first free word on page
	PUSH	P,AREABLK	; Get another AC
	;
	; Now test against declared length
	;
	; LDB	AREABLK,[POINT LH$RSIZ,LH.RSIZ+0(LINHDR),LH%RSIZ]
	LDB	AREABLK,[POINT 12,0(LINHDR),11]	; LOAD RECORD'S LENGTH
	CAIGE	PAG,SYSTID	; Is this a user-defined record?
	JRST	%601A2		; No
	HRRZ	LIN,127(SS)	; Get in-core record block (127 = RECLIST)
	SUBI	LIN,SYSTID	;
	ADD	LIN,PAG		;
	HRRZ	PAG,0(LIN)	; Get record block, if in sub-schema
	JUMPN	PAG,%601A1	; Is record in sub-schema?
	POP 	P,AREABLK	;    No -- return AC
	JRST 	%601A6		;    No more testing
%601A1:	HRRZ	LIN,1(PAG)	; Get its declared total length (1 = RB.TSIZ)
	CAME	AREABLK,LIN	; Line-hdr len = declared len?
	PUSHJ	P,XC.DAT##	; No -- bad
	JRST	%601A5		; Yes -- ok
%601A2:	CAIE	PAG,1		; Area status rec? (Note: 1 = TID.ASR)
	JRST	%601A3		; No
	CAIE	AREABLK,2	; Length = 2?
	PUSHJ	P,XC.DAT##	; No -- bad
	JRST	%601A5		; Yes -- OK
%601A3:	CAIE	PAG,2		; Index record? (Note: 2 = TID.XB)
	JRST	%601A4		; No -- must be buoy
	CAILE	AREABLK,170	; LEQ max Index Block size? (Note 170 =MAX.XB)
	PUSHJ	P,XC.DAT##	; No -- bad
	JRST	%601A5		; Yes -- ok
%601A4:	CAIE	AREABLK,TID.XL	; Correct buoy length?
	PUSHJ	P,XC.DAT##	; No -- bad
	;
	; Does record fit on the data area of the page?
	;
%601A5:	ADD	R0,AREABLK	; Add length to record's offset
	POP	P,AREABLK	; Give back last AC
	CAMLE	R0,R1		; Does record fit in high end of data area?
	PUSHJ	P,XC.DAT##	; No -- bad offset + length
%601A6:	POP	P,LIN		; Passed spot checks -- give back ACs
	POP	P,PAG
	POP	P,R1
%601A7:	POP	P,R0
.ENDI
.ENDE
;***************	END OF DBMS-10 V.5A EDIT 601	*********
;******************** START OF DBMS10-V5A EDIT 603, PART 1 OF 3 *************
;
; [SYMPTOM]
; 
;      Sites  with  edit  557  installed  can  receive  random
; unexpected  SUS (xx62 system in undefined state) exceptions,
; even when all failing transactions are properly  backed  out
; via  a  run-unit  using before images from the journal.  The
; incidence of these occurrances  is  dimished  by  edit  576,
; however  they  will  still  occasionally  happen.   The only
; physical  symptom  is  that  the  journal  JUS  (Journal  in
; undefined  state)  flag  is  set (-1 in word 30 of the first
; journal page).
; 
; [DIAGNOSIS]
; 
;      Edit 557 was designed to prevent simultaneous  updators
; from  continuing to update a data base that had been left in
; a questionable state via an update exception returned to any
; one  of  the  updating  run-units.   It  accomplised this by
; checking for an error flag being on,  and  leaving  the  JUS
; word  on in the journal label page for the other updators to
; detect.  Unfortunately  this  situation  occured  for  every
; update  exception that failed, even though the exception may
; have been recovered by an automatic backup or  a  subsequent
; call  to  JBTRAN.   Edit  576 tried to soften the effect for
; subsequent calls for the run-unit that  initially  left  the
; JUS condition, but did not address the actual problem.
; 
; [CURE]
; 
;      Check the internal SUS flag to determine whether of not
; to leave JUS set when leaving DBCS.  If the exception occurs
; outside a transaction, the automatic rollback will clear the
; SUS state internal to the DML call, and JUS will not be left
; on.  If inside a transaction,  the  data  base  will  remain
; locked  via  the  ENQ  until  the  run-unit  calls JBTRAN to
; backout the transaction, at which point the SUS  state  will
; be  turned  off,  and  JUS will be cleared on DBCS exit.  Of
; course, if there is  no  active  journal  containing  before
; images,  there  is no possibility of rollback, and hence JUS
; (if there is a journal at all) will remain on until  cleared
; via  some external recovery method (usually terminating with
; a DBMEND UNLOAD command).   Also,  if  a  transaction/update
; verb is aborted (via system crash or program abort) JUS will
; remain on until manually cleared.
; 
; This edit removes both edits 557 and 576.
;
;*************** EDIT THE FOLLOWING INTO FILE 603.FIX *********************
.EDIT 603
.NAME EGM
.DATE 25-Mar-83
.MODULE DBJOUR
.REMOVE 557
.INSERT JR.LOUT+6,BEFORE,<SETZM -4(JP)>
	TLNN	X,PSW.SUS	;[603] Retain JUS if bad update still in
.ENDI
.ENDE
;***************************** CAUTION *************************************
;
;		TO AVOID LOSING ANY PREVIOUS PATCHES  BE
;		SURE TO USE THE LATEST PATCHED REL FILES
;		       AS A BASE FOR THIS EDIT.
;THIS PATCH AFFECTS THE FOLLOWING:
;DBMS COMPONENTS:
;	NONE
;
;LANGUAGE INTERFACES:
;	COBOL (LIBOL.REL,LIBO12.EXE,C74LIB.REL,C74O12.EXE)
;	FORTRAN	(FORLIB.REL/FOROT6.EXE or DBMSF.REL/FDBOT7.EXE)
;	------------------ TO INSTALL THIS EDIT ------------------
;
;	.RUN SYS:MAKLIB
;	*DBSANY.REL=DBSANY.REL,603.FIX/F
;	*DBSCOB.REL=DBSCOB.REL,603.F02/F
;	*DBSFOR.REL=DBSFOR.REL,603.F03/F
;	*/EXIT
;	.SUBMIT DBMS10.CTL		;FROM DBMS-10 DISTRIBUTION TAPE
;					;OR PERFORM FORTRAN DBMS INSTALLATION
;
;************************** END OF EDIT 603, PART 1 OF 3 ********************