Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/layout/tables/crashtests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 231 B image not shown  

Quelle  dml118.cob   Sprache: Cobol

 

       IDENTIFICATION java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
       PROGRAM-ID.  DML118.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER.  xyz.
       DATA DIVISION.
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "DML118.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1994/6/2 EMBEDDED COBOL LANGUAGE                            
      * NIST SQL VALIDATION TEST SUITE V6.0                          
      *  DISCLAIMER:                                                  
      *  This program was written by employees of NIST to test SQL    
      *  implementations for conformance to the SQL standards.        
      *  NIST assumes no responsibility for any party's use of        
      *  this program.
      *                                                              
      * DML118.PCO                                                    
      * WRITTEN BY:  David W. Flater                                 
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests FIPS feature 19.                          
      * This is the dynamic version of DML117.PC.                    
      *                                                              
      * REFERENCES                                                   
      *   FIPS PUB 127-2 14.1 Transitional SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************



           EXEC SQL BEGIN DECLARE SECTION END-EXEC
01  SQLCODE PIC (9 COMP
       01  SQLSTATE PIC  X(5)DISPLAY""
       01  uid PIC  X(18).
       01  uidx              EXEC SQL FROM  END-EXEC
GN LEADING.
       01  int2 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  dstmt PIC  X(50).
       01  longst                'SELECT()FROM AUDIT_RECORDS'|
                              SAVED_LUSER_IDNULL
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 SIGN LEADING .
       01  ALPNUM-TABLE VALUE IS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
              PIC  36 .
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
      *date_time declaration 
       01  TO-DAY PIC 9(6).
       01java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PLAYSIGNLEADINGSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

       01  SQL-COD PIC             SQLPREPARE   longstEND-EXEC

       PROCEDURE DIVISION.
       P0.

             MOVE "FLATERjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             CALL "AUTHID" USING uid
             MOVE "not logged in, not" TO uidx
EXEC   
             MOVE SQLCODE TO SQL-COD
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
             if (DISPLAY "C11815"
               DISPLAYEXECSQLOPENC11815
      -    "  MOVE   
            STOP RUN
             END-IF
             MOVE 0 TODISPLAY   

             DISPLAY
           COMPUTE=-
             DISPLAY
           "59-byte ID"
             DISPLAY              FC11815INTO:int1
      *date_time print 
            FROMDATE
           ACCEPT THE-TIME FROM TIME
           DISPLAY "Date run YYMMDD:               SQLCODE TO 

      ******************** BEGIN TEST0646 *******************
                          DISPLAY ishould 0 valueis 

             DISPLAY "                  TEST0646 "
             java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      -    " (dynamic)"
            DISPLAY References:"
             DISPLAY "    FIPS PUB 127-2 14.1 Transitional SQL features
      -    " 16, 19"
             DISPLAY "    11.8               EXEC SQL CLOSE C11815 END-EXEC
             DISPLAY "    11.4  LR.2.b"
              "  - -- --         -  --- "

             COMPUTE SQLCODE = -1
             MOVE "xxxxx" TOPERFORMjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *Simulate a tiny OS with hard quotas (ick!) 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL              EXEC SQL DELETE CONCATBUF END-EXEC
               CREATE LUSERS(        |
               '  PRIMARY KEY (LUSER_ID),'    ||
    ||
               '  LUSER_ID     INT,'          ||
               '  FILE_QUOTA   INT,'          ||
                              DELETE FROM '|
 >= 0AND|
               '    (FILE_QUOTA IS NULL OR FILE_QUOTA                 
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SELECTZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "COMMIT             MOVESQLCODE TOSQL-COD
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY 
             EXEC SQL  DISPLAY"EXECUTE IMMEDIATE longst"
             MOVESQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  ""

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE           PERFORM CHCKOK
           PERFORM CHCKOK
             DISPLAY  " "

      *When you delete a user, all his/her files are also deleted 

             EXEC  EXECSQLDELETE FROM  END-EXEC
              SQLCODE SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
             EXEC SQLINSERT  CONCATBUFVALUES (
                   ||
               '  FOREIGN KEY (LUSER_ID) REFERENCES LUSERS ON DELETE
             CASCADE, ||
               '  PRIMARY KEY (FILE_NAME, LUSER_ID),'                   
                   ||
               '  FILE_NAME     CHAR (8) NOT                '  FILE_NAME     CHAR (8) NOT NULL
                   |
               '  LUSER_ID     INT NOT NULL,'                           
                   ||
               '  LUSER_DATA   CHAR (30))'
               ) END-EXEC
                          MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst="", longst """

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXEC
             MOVE             MOVESQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             SQLCODE  
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'CREATE TABLE
                     ||
               '  ACTION_KEY       INT PRIMARY KEY,'                    
                     ||
                            "  USING :;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
                     ||
               '  CHECK (LUSER_ACTION = ''INSERT'' OR LUSER_ACTION =
             ''ACCVIO''' ||
SER_ACTION='D')'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  "              COMPUTE int1 = -1

             DISPLAY "COMMIT WORK;"
             EXEC SQL              DISPLAY "FETCH  INTO :nt1;"
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *This table ostensibly separates UID's that have been valid at s
      *time in history from those that have always been invalid.      

             DISPLAY "dstmt=""CREATE TABLE ALL_USER_IDS (LUSER_ID INT
      -    " UNIQUE)"""
             MOVE "CREATE TABLE ALL_USER_IDS             DISPLAY "int1  be 0; itsvalue is " int1
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
              SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

             DISPLAY "COMMIT WORK;"
             EXEC SQL              DISPLAY "CLOSE ;"
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *The persistent audit records need to be consistent in the    
      *event that a LUSER_ID is recycled after someone is deleted.  
      *The original LUSER_ID is preserved in SAVED_LUSER_ID in case 
      *it is needed.                                                

             DISPLAY "CREATE TABLE AUDIT_RECORDS ("
             DISPLAY "  FOREIGN KEY (LUSER_ID) REFERENCES LUSERS ON
           DELETESET,
             DISPLAY "  LUSER_ID         INT,"
             DISPLAY "  SAVED_LUSER_ID   INT NOT NULL"
             DISPLAY "    REFERENCES ALL_USER_IDS (LUSER_ID) ON DELETE
      -    " NO ACTION,"
             DISPLAY "  ACTION_KEY       INT DEFAULT 0 NOT NULL"
             DISPLAY "    REFERENCES AUDIT_CODES ON DELETE SET
      -    " DEFAULT;"
             EXEC SQL CREATE TABLE AUDIT_RECORDS (
               FOREIGN KEY (LUSER_ID) REFERENCES LUSERS ON DELETE SET
             NULL,
               LUSER_ID         INT,
               SAVED_LUSER_ID   INT 
               REFERENCES ALL_USER_IDS (LUSER_ID) ON DELETE DISPLAY""
               ACTION_KEY       INT DEFAULT 0 NOT NULL
               REFERENCES AUDIT_CODES ON DELETE SET             COMPUTE int1 = -
              SQLCODETO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

              "COMMIT ;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *Initialize audit codes 

             DISPLAY "dstmt=""INSERT INTO AUDIT_CODES  DISPLAY "int1 should be 8; its valueis " int1
      -    " 'ACCVIO')"""
             if (int1  NOT =8) then
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-CODDISPLAY CLOSEC11816java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

           PERFORM CHCKOK


             DISPLAY "dstmt=""INSERT INTO AUDIT_CODES VALUES (1,
      -    " 'INSERT')"""
             MOVE "INSERT INTO AUDIT_CODES VALUES (1, 'INSERT')      "
             TO              DISPLAY 

             DISPLAY "EXECUTE IMMEDIATE :dstmt;a     *See if that "ON DELETE NO ACTION" did what it was supposed to d
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO AUDIT_CODES VALUES (2,
      """
             MOVE "INSERT INTO AUDIT_CODES VALUES (2, 'DELETE')      "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             DISPLAY  " "

      *Once upon a time, there were three little users. 

             DISPLAY "dstmt=""INSERT INTO LUSERS VALUES ('root', 0,
      -    " NULL             MOVE SQLCODE TO SQL-COD
             MOVE "INSERT INTO java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             TOdstmt

             DISPLAY "EXECUTE java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO LUSERS VALUES ('BIFF', 1, 0,
      -    " 0)"""
             MOVE "INSERTINTOLUSERS VALUES ('BIFF', 1, 0, 0)       "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL IMMEDIATE :stmtEND-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
                           ""

             DISPLAY "             if (NORMSQ   ""   NORMSQ    =   SQLSTATE)
      -    " 1)"""
             ERTINTO LUSERSVALUES(Kibo,2, 1,1)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQLjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE SQLCODE TO SQL-COD

            CHCKOK
             DISPLAY  " "

DISPLAY"="INSERTINTO  VALUES ()""java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
             MOVE "INSERT INTO ALL_USER_IDS VALUES (0)               "
             TO dstmt

                          DISPLAY "
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO ALL_USER_IDS VALUES (1)"""
             MOVE "NSERT INTO ALL_USER_IDS VALUES (1)               "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             CODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO ALL_USER_IDS VALUES (2)"""
             MOVE SSQL EXECUTE :dstmt END-EXEC
             TO dstmtMOVE   SQL-COD

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           
             DISPLAY  " "

      *Root hated Kibo only slightly less than BIFF 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
               SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'INSERT              DISPLAY  ""
 0
               ) END-EXEC
            SQLCODE 
             
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 27

             DISPLAY "longst=""", longst              "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21

             DISPLAY "EXECUTE IMMEDIATE :longst;"
                          EXEC SQL : 
             MOVE MOVE SQLCODE

           
             " "

             EXEC           PERFORMCHCKOK
             MOVE SQLCODE TO SQL-COD
             EXEC  DISPLAYCOMMIT java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 30
               INSERT INTOLUSER_DATAVALUES('''|java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
                 , 'Kibo   space''java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
               ) END-EXEC
             
             EXEC SQL SELECT ZZ INTO :           PERFORMCHCKOK
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY" IMMEDIATE :ongst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXEC
              java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 63

           PERFORMMOVESQLCODETOSQL-COD
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
      -    " 1)"""
             MOVE "INSERT INTO AUDIT_RECORDS VALUES (0, 0, 1)        "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
                : 
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

PERFORM
      -    " 1)"""DISPLAYFC11816 int1"
INSERTINTOjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             
                           SQL  END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *One day, Kibo created a file. 

DISPLAYdstmt"INSERT INTO"""TABLELUSER_DATA"
              D  CASCADEjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
MOVEjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC  "
             MOVE SQLCODE

           PERFORM CHCKOK
             DISPLAY  " "

      *Jealous BIFF (no quota) decided to hack Kibo's account 

             MOVE 0 TO int1
           .
        P199.

             DISPLAY "dstmt=""INSERT INTO AUDIT_RECORDS VALUES (1, 1,
      ""
             MOVE "INSERT INTO              DISPLAY  ""
             TO dstmt

             DISPLAY "EXECUTE MOVE "DROP TABLE LUSERS                         
             EXEC java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = int1 + 1
            if njava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 37
               GO TO java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             END-IF

      *Finally he succeeded and overwrote Kibo's file with garbage 

 AUDIT_RECORDS(2java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      -    " 0)"""
              java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             TO dstmt

java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 48
             EXEC SQL                *java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 72
             MOVE SQLCODEDISPLAY"

           DISPLAY"OMMITWORK;
             DISPLAY  " "

             DISPLAYDISPLAY   "
      -    " 2)"""
             java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
              dstmt

DISPLAYEXECUTE'ail,PCO')END-EXEC
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC


           PERFORM COMPUTE = errcnt              EXECUTEIMMEDIATEstmtEND-EXEC
               ""

             DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      -    " 1)"""
             MOVEEXEC  
MOVEjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL 
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             DISPLAY SQLCODEshould0itsvalueis" 
             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
               'INSERT INTOEXEC EXECUTEIMMEDIATE: java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 29
    2,'I   PASSW0RD!!'java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC             " SQLSTATE.
             MOVE SQLCODE TO SQL-COD

             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
               " 

      *This angered root, who instantly disbursed group punishment... 

             DISPLAY "dstmt=""DELETE FROM LUSERS WHERE NAAM <> 'root'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                         SQLSTATE EXECUTE:tmt
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
  DISPLAY" "

             DISPLAY "dstmt=""SELECT              0 TOjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25
             MOVE 
           END-PERFORM java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

             DISPLAY DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
             EXEC SQL PREPARE S11811 FROM :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11811 CURSOR FOR S11811;
             EXEC SQL DECLARE               
             DISPLAY  " "

             DISPLAY "OPEN C11811; PERFORM VARYING norm2 " "
             EXEC if NORMSQXnorm1  =             SQLCODE 
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
               " "

             COMPUTE              MOVE "ROP           END-PERFORM
             DISPLAY "FETCH C11811 INTO :int1;"
             EXEC SQL   dstmt
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
           PERFORM CHCKOK
             DISPLAY int1shouldbe2value", int1
             if (int1  NOT               SQLCODE TO 
               MOVE 0               " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             END-IF

              "              END-IF
             EXEC SQL CLOSE C11811 END-EXEC
             MOVE SQLCODE TO SQL-COD

                   *(class = 01).  These equate to successful completion java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "dstmt=""SELECT COUNTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE "SELECT COUNT(*) FROM LUSERS               
-"TO java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

             DISPLAY "PREPARE S11812 FROM :dstmt                           
             EXEC SQL PREPARE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             EXECINSERTINTO.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

           PERFORM CHCKOK  
             COMPUTE +java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

             DISPLAY "DECLARE C11812 CURSOR FOR S11812;"DISPLAY"=======================java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             EXEC COMMITWORKEND-EXEC
             DISPLAY  ""

                   ******************** END TEST0646 ********************
             EXEC SQL OPEN C11812 END-EXEC
             
           PERFORM CHCKOK      *    ****  Procedures for PERFORM statements
             DISPLAY  " "

             COMPUTE       .
              F C11812 int1"
             EXEC SQL FETCH C11812 INTO :int1 END-EXEC
 SQLCODE 
           PERFORM CHCKOK
             DISPLAY "int1 should be 1              S       NOT="" 
             if (             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11812;"
             EXEC SQL CLOSE C11812 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "      *subclasses with 000.  This replacement equates valid     
             MOVE "SELECT COUNT(*) FROM AUDIT_RECORDS      *expected by the test case; otherwise the test will fail. 
      -    "        " TO dstmt

             DISPLAY "PREPARE S11813 FROM :dstmt 
             EXEC PREPARE  FROM :stmt
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
                   *subclass begins in position 3 of char array NORMSQ 

              PERFORM  norm2  14BY >java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
             EXEC SQL DECLARE C11813 CURSOR               ""  NORMSQX(norm1
             DISPLAY  " "

             DISPLAY "OPEN C11813;"
             EXEC SQL OPEN C11813 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11813 INTO :int1;END-IF
             EXEC SQL FETCH
MOVE  java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PERFORMCHCKOK
             DISPLAY "int1 should be 12; its value is ", int1
             if (int1  NOT =  12)            if (NORMSQX(norm1)  =  ALPN) then
               MOVE0TOflag
             END-IF

             DISPLAY           END-IF
             EXEC SQL CLOSE C11813 END-EXEC
             MOVE SQLCODE TO SQL-COD
           MOVE 5 norm1
      *examining position 5 of char array NORMSQ 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
              SQLCODE SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUESMOVE 0 TOjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39
               'SELECT COUNT(*) FROM AUDIT_RECORDS' ||
               '  WHERE LUSER_ID IS NULL'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 0
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst="           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

             DISPLAY "PREPARE S11814 FROM :longst;"
             EXEC SQL PREPARE S11814 FROM :longst END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11814 CURSOR FOR S11814;"
             EXEC SQL DECLARE C11814 CURSOR FOR S11814 END-EXEC
             DISPLAY  " "

             DISPLAY "OPEN C11814;"
             EXEC SQL OPEN C11814 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11814 INTO :int1;"
             EXEC SQL FETCH C11814 INTO :int1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 10; its value is ", int1
             if (int1  NOT =  10) then
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11814;"
             EXEC SQL CLOSE C11814 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'SELECT COUNT(*) FROM AUDIT_RECORDS' ||
               '  WHERE SAVED_LUSER_ID IS NULL'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "PREPARE S11815 FROM :longst;"
             EXEC SQL PREPARE S11815 FROM :longst END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11815 CURSOR FOR S11815;"
             EXEC SQL DECLARE C11815 CURSOR FOR S11815 END-EXEC
             DISPLAY  " "

             DISPLAY "OPEN C11815;"
             EXEC SQL OPEN C11815 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11815 INTO :int1;"
             EXEC SQL FETCH C11815 INTO :int1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 0; its value is ", int1
             if (int1  NOT =  0) then
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11815;"
             EXEC SQL CLOSE C11815 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *...and disabled deletes just for good measure. 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'DELETE FROM AUDIT_CODES' ||
               ' WHERE LUSER_ACTION = ''DELETE'''
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'SELECT COUNT(*) FROM AUDIT_RECORDS' ||
               '  WHERE ACTION_KEY = ?'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "PREPARE S11816 FROM :longst;"
             EXEC SQL PREPARE S11816 FROM :longst END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11816 CURSOR FOR S11816;"
             EXEC SQL DECLARE C11816 CURSOR FOR S11816 END-EXEC
             DISPLAY  " "

             MOVE 2 TO int2
             DISPLAY "int2 = 2;"
             DISPLAY "OPEN C11816 USING :int2;"
             EXEC SQL OPEN C11816 USING :int2 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11816 INTO :int1;"
             EXEC SQL FETCH C11816 INTO :int1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 0; its value is ", int1
             if (int1  NOT =  0) then
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11816;"
             EXEC SQL CLOSE C11816 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             MOVE 0 TO int2
             DISPLAY "int2 = 0;"
             DISPLAY "OPEN C11816 USING :int2;"
             EXEC SQL OPEN C11816 USING :int2 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11816 INTO :int1;"
             EXEC SQL FETCH C11816 INTO :int1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 8; its value is ", int1
             if (int1  NOT =  8) then
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11816;"
             EXEC SQL CLOSE C11816 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *See if that "ON DELETE NO ACTION" did what it was supposed to d
      *It should _not_ allow us to create dangling references.        

             DISPLAY "dstmt=""DELETE FROM ALL_USER_IDS"""
             MOVE "DELETE FROM ALL_USER_IDS                          "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "SQLCODE should be < 0; its value is ", SQL-COD
             if (SQLCODE  NOT <  0) then
               MOVE 0 TO flag
             END-IF
             DISPLAY "SQLSTATE should be 23000; its value is ", SQLSTATE
           PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (NORMSQ  NOT  =   "23000") then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ   =   "23000"  AND  NORMSQ  NOT  =   SQLSTATE)
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE AUDIT_RECORDS CASCADE"""
             MOVE "DROP TABLE AUDIT_RECORDS CASCADE                  "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE ALL_USER_IDS CASCADE"""
             MOVE "DROP TABLE ALL_USER_IDS CASCADE                   "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE AUDIT_CODES CASCADE"""
             MOVE "DROP TABLE AUDIT_CODES CASCADE                    "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE LUSER_DATA CASCADE"""
             MOVE "DROP TABLE LUSER_DATA CASCADE                     "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE LUSERS CASCADE"""
             MOVE "DROP TABLE LUSERS CASCADE                         "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             if ( flag  =  1 ) then
               DISPLAY "                *** pass *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES('0646','pass','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY "       dml118.pco  *** fail *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES('0646','fail','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
             END-IF

             DISPLAY "==============================================="

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
      ******************** END TEST0646 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
             DISPLAY "SQLCODE should be 0; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE NOT =  0  OR   NORMSQ NOT = "00000") then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             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

           MOVE 3 TO norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYING norm2 FROM 14 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           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   =   SQLSTATE) then
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           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 (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1") then
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.