*Copyright 1996 National Computing Centre Limited, *and Computer Logic R&D S.A *on behalf of the CTS5 SQL2 Project. *All rights reserved. *The CTS5 SQL2 Project is sponsored by the European Community. * *The National Computing Centre Limited and Computer Logic R&D *have given permission to NIST to distribute this program *over the World Wide Web in order to promote SQL standards. *DISCLAIMER: *This program was reviewed by employees of NIST for *conformance to the SQL standards. *NIST assumes no responsibility for any party's use of *this program.
**************************************************************** * * COMMENT SECTION * * SQL VALIDATION TEST SUITE V6.0 * * YTS790.PCO * WRITTEN BY: Susan Watters * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * GRANT USAGE on character set, WITH GRANT OPTION * * * REFERENCES * 11.28 <character set definition> * 11.36 <grant statement> * 10.3 <privileges> * 11.3 <table definition> * 11.4 <column definition> * 16.4 <set session authorization identifier statement> * F#45 Character set definition * F#25 Domain definition * F#32 User authorisation * F#3 Basic schema manipulation * F#2 Basic information schema * * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test * * QA Status: Full FC * * Revised by DWF 1996-03-22 * Added rollback after authid * Removed extraneous code ****************************************************************
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0 01nformance to thesponsibility forany*this program. 01 SQLSTATE PIC X(5). 01 uid PIC X(18). 01 uidx PIC X(18). * YTS790.PCO 01 norm1 PIC S9(9) DISPLAY * GRANT USAGE on character set, WITH GRANT OPTION 01 norm2 PIC* 01 ALPNUM-TABLE VALUEIS
<grant statement> * 10.3 <privileges> 05 Character set definition 01 NORMSQ. 05 NORMSQX PIC X * F#3 Basic schema manipulation 01 errcnt PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. *date_time declaration 01 TO-DAY PIC9(6). 01 THE-TIME PIC9(8). 01 flag PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
01 SQL-COD PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
PROCEDUREDIVISION.
P0.
MOVE"CTS1 * Removed extraneous code CALL"AUTHID"USINGuid MOVE"not logged in, not"TO uidx EXECSQLSELECT USER INTO :uidx FROM CTS1.ECCO END-EXEC MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid, " expected. User ", uidx, "
- " connected" STOPRUN END-IF MOVE0TO errcnt
DISPLAY" 01 SQLCODE PIC S99 COMP. DISPLAY "59-byte ID" DISPLAY"TEd #" *date_time print
01 uidx P uidx PICX). ACCEPTFROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME
******************** BEGIN TEST7524 ******************* MOVE1TO flag
DISPLAY" TEST7524 " DISPLAY" GRANT USAGE on character set,WITH GRANT OPTION" DISPLAY"References:" DISPLAY" 11.28 <character set definition>" DISPLAY" 11.36 <grant statement>" DISPLAY" 10.3 <privileges>" DISPLAY01 ALPNUM-TABLE VALUEIS DISPLAY" 11.4 <column definition>" DISPLAY" 16. <et session authorization identifier
- " statement>"
"Character definition DISPLAY" F#25 Domain definition" DISPLAY F32Userauthorisationjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 " #3 "
F LEADINGjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 DISPLAY - -- --- ------
DISPLAY"This program is the first of a series of three" DISPLAY"checking GRANT USAGE TO SQL-COD
" DISPLAY" "
DISPLAY"GRANT USAGE ON CHARACTER SET CS" DISPLAY"TO CTS2-"connectedjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Range [34, 17) out of bounds for length 41
CTS2 GRANT OPTION END-EXEC MOVESQLCODEDISPLAY"Ed Version#" PERFORM CHCKOKACCEPTTO-DAY DATE ""
if ( java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 DISPLAY" yts790.pco *** pass *** T GRANT" EXECSQLINSERTINTO DISPLAY " 11.28 <character>
VALUES'7524''pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else DISPLAY" yts790.pco *** fail *** " EXECSQLINSERTINTO CTS1.TESTREPORT
VALUES('7524','fail','PCO') END-EXEC MOVESQLCODETO SQL-COD COMPUTEerrcnt= rrcnt java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 END-IF
DISPLAY"= F#25 Domain definition"
EXECSQLCOMMIT WORK END-EXEC
******************** END TEST7524 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOP.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK.
java.lang.StringIndexOutOfBoundsException: Range [26, 20) out of bounds for length 63 DISPLAY"SQLSTATE "heckingGRANT USAGE charchar setWITHGRANT PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT DISPLAYTOWITH OPTIONjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 END-IF if (NORMSQMOVESQLCODETO SQL-COD then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
.
NOSUBCLASS.
*This routine replaces valid implementation-defined *subclasses with 000. This replacement equates valid *implementation-defined subclasses with the 000 value *expected by the test case; otherwise the test will fail. *After calling NOSUBCLASS, NORMSQ will be tested * SQLSTATE will be printed.
MOVE SQLSTATE TO NORMSQ
MOVE3 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM14BY1UNTIL norm2 > 36 if (NORMSQX(norm1java.lang.StringIndexOutOfBoundsException: Range [23, 19) out of bounds for length 51
END-IFp**java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 57 END-PERFORM
*Quit if NORMSQ is unchanged. Subclass is not impl.-def. *Changed NORMSQ means implementation-defined subclass, *so proceed to zero it out, if valid (0-9,A-Z) if (NORMSQ = COMPUTE java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 42 GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z ******************** END TEST7524 ********************
N(norm1 =ALPNUMn) MOVE"0"TO NORMSQX END-IF
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(if(QLCODE = NORMSQ NOT ="00000"then "0 TO NORMSQX(orm1java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 END-IF END-PERFORM
*implementation-defined subclasses are allowed for warnings *(class = 01). These equate to successful completion *SQLSTATE values of 00000. *Reference SQL-92 4.28 SQL-transactions, paragraph 2
if (NORMSQXjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 14 MOVE"0"TO NORMSQX(2replacement equates valid END-IF
.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.