sqllogictest
Check-in [6897209ec7]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the hash format to show the number of rows hashed.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6897209ec70159a57e6ce4ec29bcf512fadcb701
User & Date: drh 2008-12-01 20:39:48
Context
2008-12-01
20:41
Fix the select2.test output. check-in: 8d24867c8a user: drh tags: trunk
20:39
Change the hash format to show the number of rows hashed. check-in: 6897209ec7 user: drh tags: trunk
20:33
Add the select2 test. Similar to select1 but adds NULL values and omits the ORDER BY clauses. check-in: 37156697d4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/sqllogictest.c.

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
408
409
410
411
412
413
414

415
416
417
418
419
420
421
...
477
478
479
480
481
482
483


484
485
486
487
488
489
490
...
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
...
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
  int rc;                              /* Result code from subroutine call */
  int nErr = 0;                        /* Number of errors */
  int nCmd = 0;                        /* Number of SQL statements processed */
  int nResult;                         /* Number of query results */
  char **azResult;                     /* Query result vector */
  Script sScript;                      /* Script parsing status */
  FILE *in;                            /* For reading script */
  int hashThreshold = 0;               /* Hash result if this long or longer */
  

  /* Add calls to the registration procedures for new database engine
  ** interfaces here
  */
  registerSqlite();
#ifndef OMIT_ODBC
................................................................................
        fprintf(stderr, "%s:%d: statement error\n",
                zScriptFile, sScript.startLine);
        nErr++;
      }
    }else if( strcmp(sScript.azToken[0],"query")==0 ){
      int k = 0;
      int c;


      /* Verify that the type string consists of one or more characters
      ** from the set "TIR". */
      for(k=0; (c = sScript.azToken[1][k])!=0; k++){
        if( c!='T' && c!='I' && c!='R' ){
          fprintf(stderr, "%s:%d: unknown type character '%c' in type string\n",
                  zScriptFile, sScript.startLine, c);
................................................................................

      /* Hash the results if we are over the hash threshold */
      if( hashThreshold>0 && nResult>hashThreshold ){
        for(i=0; i<nResult; i++){
          md5_add(azResult[i]);
          md5_add("\n");
        }


      }

      if( verifyMode ){
        /* In verify mode, first skip over the ---- line if we are still
        ** pointing at it. */
        if( strcmp(sScript.zLine, "----")==0 ) nextLine(&sScript);

................................................................................
              fprintf(stderr,"%s:%d: wrong result\n", zScriptFile,
                      sScript.nLine);
              nErr++;
              break;
            }
          }
        }else{
          if( strcmp(sScript.zLine, md5_finish())!=0 ){
            fprintf(stderr, "%s:%d: wrong result hash\n",
                    zScriptFile, sScript.nLine);
            nErr++;
          }
        }
      }else{
        /* In completion mode, first make sure we have output an ---- line.
................................................................................
        /* Output the results obtained by running the query
        */
        if( hashThreshold==0 || nResult<=hashThreshold ){
          for(i=0; i<nResult; i++){
            printf("%s\n", azResult[i]);
          }
        }else{
          printf("%s\n", md5_finish());
        }
        printf("\n");

        /* Skip over any existing results.  They will be ignored.
        */
        sScript.copyFlag = 0;
        while( sScript.zLine[0]!=0 && sScript.iCur<sScript.iEnd ){







|







 







>







 







>
>







 







|







 







|







256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
...
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
...
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
...
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
  int rc;                              /* Result code from subroutine call */
  int nErr = 0;                        /* Number of errors */
  int nCmd = 0;                        /* Number of SQL statements processed */
  int nResult;                         /* Number of query results */
  char **azResult;                     /* Query result vector */
  Script sScript;                      /* Script parsing status */
  FILE *in;                            /* For reading script */
  int hashThreshold = 0 ;              /* Hash result if this long or longer */
  

  /* Add calls to the registration procedures for new database engine
  ** interfaces here
  */
  registerSqlite();
#ifndef OMIT_ODBC
................................................................................
        fprintf(stderr, "%s:%d: statement error\n",
                zScriptFile, sScript.startLine);
        nErr++;
      }
    }else if( strcmp(sScript.azToken[0],"query")==0 ){
      int k = 0;
      int c;
      char zHash[100];

      /* Verify that the type string consists of one or more characters
      ** from the set "TIR". */
      for(k=0; (c = sScript.azToken[1][k])!=0; k++){
        if( c!='T' && c!='I' && c!='R' ){
          fprintf(stderr, "%s:%d: unknown type character '%c' in type string\n",
                  zScriptFile, sScript.startLine, c);
................................................................................

      /* Hash the results if we are over the hash threshold */
      if( hashThreshold>0 && nResult>hashThreshold ){
        for(i=0; i<nResult; i++){
          md5_add(azResult[i]);
          md5_add("\n");
        }
        sqlite3_snprintf(sizeof(zHash), zHash,
                         "%d rows hashing to %s", nResult, md5_finish());
      }

      if( verifyMode ){
        /* In verify mode, first skip over the ---- line if we are still
        ** pointing at it. */
        if( strcmp(sScript.zLine, "----")==0 ) nextLine(&sScript);

................................................................................
              fprintf(stderr,"%s:%d: wrong result\n", zScriptFile,
                      sScript.nLine);
              nErr++;
              break;
            }
          }
        }else{
          if( strcmp(sScript.zLine, zHash)!=0 ){
            fprintf(stderr, "%s:%d: wrong result hash\n",
                    zScriptFile, sScript.nLine);
            nErr++;
          }
        }
      }else{
        /* In completion mode, first make sure we have output an ---- line.
................................................................................
        /* Output the results obtained by running the query
        */
        if( hashThreshold==0 || nResult<=hashThreshold ){
          for(i=0; i<nResult; i++){
            printf("%s\n", azResult[i]);
          }
        }else{
          printf("%s\n", zHash);
        }
        printf("\n");

        /* Skip over any existing results.  They will be ignored.
        */
        sScript.copyFlag = 0;
        while( sScript.zLine[0]!=0 && sScript.iCur<sScript.iEnd ){

Changes to test/select2.test.

more than 10,000 changes