sqllogictest

Check-in [d1697d2d5f]
Login

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

Overview
Comment:Changed default hash threshold to 8. Added command line option -ht NUM that overrides any hash threshold in the test script (useful for debugging differences between DB engines).
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d1697d2d5f23a9b533fd0d816d11a0ba2a4e1488
User & Date: shaneh 2008-12-02 15:19:12.000
Context
2008-12-02
15:20
Consistent capitalization on error messages. check-in: 7edbc9e250 user: shaneh tags: trunk
15:19
Changed default hash threshold to 8. Added command line option -ht NUM that overrides any hash threshold in the test script (useful for debugging differences between DB engines). check-in: d1697d2d5f user: shaneh tags: trunk
15:16
Modified ODBC interface to check zType length on xQuery to be consistent with SQLite interface. check-in: d3d496700a user: shaneh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/sqllogictest.c.
35
36
37
38
39
40
41


42
43
44
45
46
47
48
#include <unistd.h>
#endif
#include <string.h>

#include "slt_sqlite.c"
#include "slt_odbc3.c"



/*
** An array of registered database engines
*/
static int nEngine = 0;
static const DbEngine **apEngine = 0;

/*







>
>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <unistd.h>
#endif
#include <string.h>

#include "slt_sqlite.c"
#include "slt_odbc3.c"

#define DEFAULT_HASH_THRESHOLD 8

/*
** An array of registered database engines
*/
static int nEngine = 0;
static const DbEngine **apEngine = 0;

/*
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

/*
** Print a usage comment and die
*/
static void usage(const char *argv0){
#if 0  /* Obsolete code */
  fprintf(stderr,
    "Usage: %s [-verify] [-engine DBENGINE] [-connection STR] script\n",
    argv0);
#else
  fprintf(stderr,
    "Usage: %s [-verify] [-odbc STR] script\n",
    argv0);
#endif
  exit(1);
}

/*
** A structure to keep track of the state of scanning the input script.







|



|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*
** Print a usage comment and die
*/
static void usage(const char *argv0){
#if 0  /* Obsolete code */
  fprintf(stderr,
    "Usage: %s [-verify] [-engine DBENGINE] [-connection STR] [-ht NUM] script\n",
    argv0);
#else
  fprintf(stderr,
    "Usage: %s [-verify] [-odbc STR] [-ht NUM] script\n",
    argv0);
#endif
  exit(1);
}

/*
** A structure to keep track of the state of scanning the input script.
316
317
318
319
320
321
322
323
324

325
326
327
328
329
330
331
  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
  registerODBC3();







|
|
>







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
  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 = DEFAULT_HASH_THRESHOLD;  /* Hash result if this long or longer */
  int bHt = 0;                         /* Non-zero if a hash threshold option was */
                                       /* given on the command line. */

  /* Add calls to the registration procedures for new database engine
  ** interfaces here
  */
  registerSqlite();
#ifndef OMIT_ODBC
  registerODBC3();
355
356
357
358
359
360
361



362
363
364
365
366
367
368
      zDbEngine = argv[++i];
    }else if( strncmp(argv[i], "-connection",n)==0 ){
      zConnection = argv[++i];
#endif
    }else if( strncmp(argv[i], "-odbc",n)==0 ){
      zDbEngine = "ODBC3";
      zConnection = argv[++i];



    }else if( zScriptFile==0 ){
      zScriptFile = argv[i];
    }else{
      fprintf(stderr, "%s: unknown argument: %s\n", argv[0], argv[i]);
      usage(argv[0]);
    }
  }







>
>
>







358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
      zDbEngine = argv[++i];
    }else if( strncmp(argv[i], "-connection",n)==0 ){
      zConnection = argv[++i];
#endif
    }else if( strncmp(argv[i], "-odbc",n)==0 ){
      zDbEngine = "ODBC3";
      zConnection = argv[++i];
    }else if( strncmp(argv[i], "-ht",n)==0 ){
      hashThreshold = atoi(argv[++i]);
      bHt = -1;
    }else if( zScriptFile==0 ){
      zScriptFile = argv[i];
    }else{
      fprintf(stderr, "%s: unknown argument: %s\n", argv[0], argv[i]);
      usage(argv[0]);
    }
  }
615
616
617
618
619
620
621



622

623

624
625
626
627
628
629
630
    }else if( strcmp(sScript.azToken[0],"hash-threshold")==0 ){
      /* Set the maximum number of result values that will be accepted
      ** for a query.  If the number of result values exceeds this number,
      ** then an MD5 hash is computed of all values, and the resulting hash
      ** is the only result.
      **
      ** If the threshold is 0, then hashing is never used.



      */

      hashThreshold = atoi(sScript.azToken[1]);

    }else if( strcmp(sScript.azToken[0],"halt")==0 ){
      /* Used for debugging.  Stop reading the test script and shut down.
      ** A "halt" record can be inserted in the middle of a test script in
      ** to run the script up to a particular point that is giving a
      ** faulty result, then terminate at that point for analysis.
      */
      fprintf(stderr, "%s:%d: halt\n", zScriptFile, sScript.startLine);







>
>
>

>
|
>







621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
    }else if( strcmp(sScript.azToken[0],"hash-threshold")==0 ){
      /* Set the maximum number of result values that will be accepted
      ** for a query.  If the number of result values exceeds this number,
      ** then an MD5 hash is computed of all values, and the resulting hash
      ** is the only result.
      **
      ** If the threshold is 0, then hashing is never used.
      **
      ** If a threshold was specified on the command line, ignore 
      ** any specifed in the script.
      */
      if( !bHt ){
        hashThreshold = atoi(sScript.azToken[1]);
      }
    }else if( strcmp(sScript.azToken[0],"halt")==0 ){
      /* Used for debugging.  Stop reading the test script and shut down.
      ** A "halt" record can be inserted in the middle of a test script in
      ** to run the script up to a particular point that is giving a
      ** faulty result, then terminate at that point for analysis.
      */
      fprintf(stderr, "%s:%d: halt\n", zScriptFile, sScript.startLine);