UnQL

Check-in [1db9558acf]
Login

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

Overview
Comment:Change DATASET to COLLECTION.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1db9558acfe8591ecf0b545039294cfcd36e86fd
User & Date: drh 2011-06-29 17:53:10
Context
2011-06-29
19:02
Change the parse tree to use zero-terminated strings rather than Token objects. check-in: 365b149fa1 user: drh tags: trunk
17:53
Change DATASET to COLLECTION. check-in: 1db9558acf user: drh tags: trunk
2011-06-28
15:15
Got all test cases passing again. check-in: 423cc63722 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/parse.y.

481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516

///////////////////// TRANSACTIONS ////////////////////////////
//
cmd ::= BEGIN ID.
cmd ::= ROLLBACK ID.
cmd ::= COMMIT ID.

///////////////////// The CREATE DATASET statement ////////////////////////////
//
cmd(A) ::= CREATE DATASET ifnotexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_CREATEDATASET;
    pNew->u.crtab.ifExists = B;
    pNew->u.crtab.name = N;
  }
  A = pNew;
}
%type ifnotexists {int}
ifnotexists(A) ::= .                    {A = 0;}
ifnotexists(A) ::= IF NOT EXISTS.       {A = 1;}
tabname(A) ::= ID(X).                   {A = X;}

////////////////////////// The DROP DATASET //////////////////////////////////
//
cmd(A) ::= DROP DATASET ifexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_DROPDATASET;
    pNew->u.crtab.ifExists = B;
    pNew->u.crtab.name = N;
  }
  A = pNew;
}
%type ifexists {int}
ifexists(A) ::= IF EXISTS.  {A = 1;}







|

|


|










|

|


|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516

///////////////////// TRANSACTIONS ////////////////////////////
//
cmd ::= BEGIN ID.
cmd ::= ROLLBACK ID.
cmd ::= COMMIT ID.

///////////////////// The CREATE COLLECTION statement ////////////////////////
//
cmd(A) ::= CREATE COLLECTION ifnotexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_CREATECOLLECTION;
    pNew->u.crtab.ifExists = B;
    pNew->u.crtab.name = N;
  }
  A = pNew;
}
%type ifnotexists {int}
ifnotexists(A) ::= .                    {A = 0;}
ifnotexists(A) ::= IF NOT EXISTS.       {A = 1;}
tabname(A) ::= ID(X).                   {A = X;}

////////////////////////// The DROP COLLECTION ///////////////////////////////
//
cmd(A) ::= DROP COLLECTION ifexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_DROPCOLLECTION;
    pNew->u.crtab.ifExists = B;
    pNew->u.crtab.name = N;
  }
  A = pNew;
}
%type ifexists {int}
ifexists(A) ::= IF EXISTS.  {A = 1;}

Changes to src/stmt.c.

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
int xjd1_stmt_step(xjd1_stmt *pStmt){
  Command *pCmd;
  int rc = XJD1_DONE;
  if( pStmt==0 ) return rc;
  pCmd = pStmt->pCmd;
  if( pCmd==0 ) return rc;
  switch( pCmd->eCmdType ){
    case TK_CREATEDATASET: {
      char *zSql;
      int res;
      char *zErr = 0;
      zSql = sqlite3_mprintf("CREATE TABLE %s \"%!.*w\"(x)",
                 pCmd->u.crtab.ifExists ? "IF NOT EXISTS" : "",
                 pCmd->u.crtab.name.n, pCmd->u.crtab.name.z);
      res = sqlite3_exec(pStmt->pConn->db, zSql, 0, 0, &zErr);
................................................................................
        xjd1Error(pStmt->pConn, XJD1_ERROR, "%s", zErr);
        sqlite3_free(zErr);
        rc = XJD1_ERROR;
      }
      sqlite3_free(zSql);
      break;
    }
    case TK_DROPDATASET: {
      char *zSql;
      int res;
      char *zErr = 0;
      zSql = sqlite3_mprintf("DROP TABLE %s \"%!.*w\"",
                 pCmd->u.crtab.ifExists ? "IF EXISTS" : "",
                 pCmd->u.crtab.name.n, pCmd->u.crtab.name.z);
      res = sqlite3_exec(pStmt->pConn->db, zSql, 0, 0, &zErr);







|







 







|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
int xjd1_stmt_step(xjd1_stmt *pStmt){
  Command *pCmd;
  int rc = XJD1_DONE;
  if( pStmt==0 ) return rc;
  pCmd = pStmt->pCmd;
  if( pCmd==0 ) return rc;
  switch( pCmd->eCmdType ){
    case TK_CREATECOLLECTION: {
      char *zSql;
      int res;
      char *zErr = 0;
      zSql = sqlite3_mprintf("CREATE TABLE %s \"%!.*w\"(x)",
                 pCmd->u.crtab.ifExists ? "IF NOT EXISTS" : "",
                 pCmd->u.crtab.name.n, pCmd->u.crtab.name.z);
      res = sqlite3_exec(pStmt->pConn->db, zSql, 0, 0, &zErr);
................................................................................
        xjd1Error(pStmt->pConn, XJD1_ERROR, "%s", zErr);
        sqlite3_free(zErr);
        rc = XJD1_ERROR;
      }
      sqlite3_free(zSql);
      break;
    }
    case TK_DROPCOLLECTION: {
      char *zSql;
      int res;
      char *zErr = 0;
      zSql = sqlite3_mprintf("DROP TABLE %s \"%!.*w\"",
                 pCmd->u.crtab.ifExists ? "IF EXISTS" : "",
                 pCmd->u.crtab.name.n, pCmd->u.crtab.name.z);
      res = sqlite3_exec(pStmt->pConn->db, zSql, 0, 0, &zErr);

Changes to src/tokenize.c.

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

102
103
104
105
106
107

108
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
  0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40   /* f8..ff    ........ */
};

/**********************************************************************
** The following code is automatically generated
** by ../tool/mkkeywordhash.c
*/
/* Hash score: 56 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 287 bytes of keywords in 198 bytes */
  /*   BEGINSERTRUEACHAVINGROUPDATESCAPEXCEPTFALSELECTALLIKEXISTSAND      */
  /*   ATASETASCENDINGLOBETWEENOTCOLLATECOMMITCREATEDELETEDESCENDING      */
  /*   DROPRAGMAFLATTENULLIMITIFROMINTERSECTINTOFFSETORDEROLLBACK         */
  /*   UNIONVALUEWHEREBY                                                  */
  static const char zText[197] = {
    'B','E','G','I','N','S','E','R','T','R','U','E','A','C','H','A','V','I',
    'N','G','R','O','U','P','D','A','T','E','S','C','A','P','E','X','C','E',
    'P','T','F','A','L','S','E','L','E','C','T','A','L','L','I','K','E','X',
    'I','S','T','S','A','N','D','A','T','A','S','E','T','A','S','C','E','N',
    'D','I','N','G','L','O','B','E','T','W','E','E','N','O','T','C','O','L',

    'L','A','T','E','C','O','M','M','I','T','C','R','E','A','T','E','D','E',
    'L','E','T','E','D','E','S','C','E','N','D','I','N','G','D','R','O','P',
    'R','A','G','M','A','F','L','A','T','T','E','N','U','L','L','I','M','I',
    'T','I','F','R','O','M','I','N','T','E','R','S','E','C','T','I','N','T',
    'O','F','F','S','E','T','O','R','D','E','R','O','L','L','B','A','C','K',
    'U','N','I','O','N','V','A','L','U','E','W','H','E','R','E','B','Y',

  };
  static const unsigned char aHash[79] = {
       0,  48,   0,  29,  22,  15,   0,  46,   0,  12,  32,  47,   0,
       1,   0,   6,   3,  17,   7,   0,   9,   0,  44,   0,   0,   5,
      37,  34,  26,   0,   0,   0,   0,  38,   0,   0,   0,  19,   0,
       0,  18,   0,   0,  11,   0,   0,   0,   0,  45,   0,   0,   0,
       0,   0,   0,   0,   0,  25,  27,  41,  24,  42,  36,   0,  16,
      31,  40,  20,  43,   0,  39,  10,   0,  33,   0,   0,   0,  35,
      28,

  };
  static const unsigned char aNext[48] = {
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   0,   0,  14,   0,   0,   0,   0,   2,   0,   0,   0,   0,
       0,   0,   8,   0,   0,   0,   0,   0,  21,   0,   0,  13,   0,
       0,   0,   4,  30,   0,   0,   0,  23,   0,
  };
  static const unsigned char aLen[48] = {
       5,   6,   4,   4,   6,   5,   6,   6,   6,   5,   6,   3,   4,
       6,   2,   3,   7,   3,   2,   3,   9,   4,   7,   3,   7,   6,
       6,   6,   4,  10,   2,   4,   6,   7,   4,   5,   2,   4,   9,
       4,   6,   2,   5,   8,   5,   5,   5,   2,
  };
  static const unsigned short int aOffset[48] = {
       0,   3,   8,  11,  14,  19,  22,  27,  32,  38,  41,  47,  49,
      52,  54,  58,  60,  64,  67,  67,  67,  75,  78,  84,  87,  94,
     100, 106, 112, 112, 119, 122, 125, 131, 137, 140, 145, 146, 150,
     159, 162, 168, 168, 172, 180, 185, 190, 195,
  };
  static const unsigned char aCode[48] = {
    TK_BEGIN,      TK_INSERT,     TK_TRUE,       TK_FLATTENOP,  TK_HAVING,     
    TK_GROUP,      TK_UPDATE,     TK_ESCAPE,     TK_EXCEPT,     TK_FALSE,      
    TK_SELECT,     TK_ALL,        TK_LIKEOP,     TK_EXISTS,     TK_IS,         
    TK_AND,        TK_DATASET,    TK_SET,        TK_AS,         TK_ASCENDING,  
    TK_ASCENDING,  TK_LIKEOP,     TK_BETWEEN,    TK_NOT,        TK_COLLATE,    
    TK_COMMIT,     TK_CREATE,     TK_DELETE,     TK_DESCENDING, TK_DESCENDING, 
    TK_IN,         TK_DROP,       TK_PRAGMA,     TK_FLATTENOP,  TK_NULL,       
    TK_LIMIT,      TK_IF,         TK_FROM,       TK_INTERSECT,  TK_INTO,       
    TK_OFFSET,     TK_OR,         TK_ORDER,      TK_ROLLBACK,   TK_UNION,      
    TK_VALUE,      TK_WHERE,      TK_BY,         
  };
  int h, i;
  if( n<2 || z[0]<'A' || z[0]>'Z' ) return TK_ID;
  h = (z[0]*4 ^ z[n-1]*3 ^ n) % 79;
  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
    if( aLen[i]==n && memcmp(&zText[aOffset[i]],z,n)==0 ){
      return aCode[i];
    }
  }
  return TK_ID;
}







|

|

|
|

|



|
|
>
|
|
<
|
|
|
>

|
<
|
|
|
|
|
|
>



|
|
|



|
|
|



|
|
|





|
|
|
|
|
|




|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
  0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40   /* f8..ff    ........ */
};

/**********************************************************************
** The following code is automatically generated
** by ../tool/mkkeywordhash.c
*/
/* Hash score: 55 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 290 bytes of keywords in 201 bytes */
  /*   BEGINSERTRUEACHAVINGROUPDATESCAPEXCEPTFALSELECTALLIKEXISTSAND      */
  /*   ELETEASCENDINGLOBETWEENOTCOLLATECOLLECTIONULLIMITCOMMITCREATE      */
  /*   DESCENDINGDROPRAGMAFLATTENIFROMINTERSECTINTOFFSETORDEROLLBACK      */
  /*   UNIONVALUEWHEREBY                                                  */
  static const char zText[200] = {
    'B','E','G','I','N','S','E','R','T','R','U','E','A','C','H','A','V','I',
    'N','G','R','O','U','P','D','A','T','E','S','C','A','P','E','X','C','E',
    'P','T','F','A','L','S','E','L','E','C','T','A','L','L','I','K','E','X',
    'I','S','T','S','A','N','D','E','L','E','T','E','A','S','C','E','N','D',
    'I','N','G','L','O','B','E','T','W','E','E','N','O','T','C','O','L','L',
    'A','T','E','C','O','L','L','E','C','T','I','O','N','U','L','L','I','M',
    'I','T','C','O','M','M','I','T','C','R','E','A','T','E','D','E','S','C',
    'E','N','D','I','N','G','D','R','O','P','R','A','G','M','A','F','L','A',

    'T','T','E','N','I','F','R','O','M','I','N','T','E','R','S','E','C','T',
    'I','N','T','O','F','F','S','E','T','O','R','D','E','R','O','L','L','B',
    'A','C','K','U','N','I','O','N','V','A','L','U','E','W','H','E','R','E',
    'B','Y',
  };
  static const unsigned char aHash[80] = {

       0,  48,  46,  12,  33,  22,  47,   1,   0,   6,   0,  14,  25,
       7,   9,   0,   0,  44,   0,   5,  36,  35,  28,   0,   0,   0,
       0,  37,   0,   0,   0,  18,   0,   0,   0,  41,   0,   0,  11,
       0,   0,   0,   0,  45,   0,   0,   0,   0,   0,   0,   0,   0,
      24,  29,  40,  23,  42,  27,   0,  16,  32,  39,  19,  43,   0,
      38,  10,   0,   0,  34,   0,   0,  26,  17,   0,   0,   0,  30,
      21,  15,
  };
  static const unsigned char aNext[48] = {
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
       3,   0,   0,   0,   0,   0,   0,   2,   0,   0,   0,   0,  20,
       0,   0,   0,   8,   0,   0,   0,   0,   0,   0,  13,   0,   0,
       0,   0,   4,  31,   0,   0,   0,   0,   0,
  };
  static const unsigned char aLen[48] = {
       5,   6,   4,   4,   6,   5,   6,   6,   6,   5,   6,   3,   4,
       6,   2,   3,   6,   2,   3,   9,   4,   7,   3,   7,  10,   4,
       5,   6,   6,   4,  10,   2,   4,   6,   7,   2,   4,   9,   4,
       6,   3,   2,   5,   8,   5,   5,   5,   2,
  };
  static const unsigned short int aOffset[48] = {
       0,   3,   8,  11,  14,  19,  22,  27,  32,  38,  41,  47,  49,
      52,  54,  58,  60,  66,  66,  66,  74,  77,  83,  86,  93, 102,
     105, 110, 116, 122, 122, 129, 132, 135, 141, 148, 149, 153, 162,
     165, 168, 171, 171, 175, 183, 188, 193, 198,
  };
  static const unsigned char aCode[48] = {
    TK_BEGIN,      TK_INSERT,     TK_TRUE,       TK_FLATTENOP,  TK_HAVING,     
    TK_GROUP,      TK_UPDATE,     TK_ESCAPE,     TK_EXCEPT,     TK_FALSE,      
    TK_SELECT,     TK_ALL,        TK_LIKEOP,     TK_EXISTS,     TK_IS,         
    TK_AND,        TK_DELETE,     TK_AS,         TK_ASCENDING,  TK_ASCENDING,  
    TK_LIKEOP,     TK_BETWEEN,    TK_NOT,        TK_COLLATE,    TK_COLLECTION, 
    TK_NULL,       TK_LIMIT,      TK_COMMIT,     TK_CREATE,     TK_DESCENDING, 
    TK_DESCENDING, TK_IN,         TK_DROP,       TK_PRAGMA,     TK_FLATTENOP,  
    TK_IF,         TK_FROM,       TK_INTERSECT,  TK_INTO,       TK_OFFSET,     
    TK_SET,        TK_OR,         TK_ORDER,      TK_ROLLBACK,   TK_UNION,      
    TK_VALUE,      TK_WHERE,      TK_BY,         
  };
  int h, i;
  if( n<2 || z[0]<'A' || z[0]>'Z' ) return TK_ID;
  h = (z[0]*4 ^ z[n-1]*3 ^ n) % 80;
  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
    if( aLen[i]==n && memcmp(&zText[aOffset[i]],z,n)==0 ){
      return aCode[i];
    }
  }
  return TK_ID;
}

Changes to src/trace.c.

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  { TK_LIMIT,            "TK_LIMIT"           },
  { TK_OFFSET,           "TK_OFFSET"          },
  { TK_WHERE,            "TK_WHERE"           },
  { TK_BEGIN,            "TK_BEGIN"           },
  { TK_ROLLBACK,         "TK_ROLLBACK"        },
  { TK_COMMIT,           "TK_COMMIT"          },
  { TK_CREATE,           "TK_CREATE"          },
  { TK_DATASET,          "TK_DATASET"         },
  { TK_IF,               "TK_IF"              },
  { TK_EXISTS,           "TK_EXISTS"          },
  { TK_DROP,             "TK_DROP"            },
  { TK_DELETE,           "TK_DELETE"          },
  { TK_UPDATE,           "TK_UPDATE"          },
  { TK_SET,              "TK_SET"             },
  { TK_INSERT,           "TK_INSERT"          },
................................................................................
  { TK_PRAGMA,           "TK_PRAGMA"          },
  /* End paste of parse_txt.h */
  { TK_NOT_LIKEOP,       "TK_NOT_LIKEOP"      },
  { TK_NOT_IS,           "TK_NOT_IS"          },
  { TK_FUNCTION,         "TK_FUNCTION"        },
  { TK_SPACE,            "TK_SPACE"           },
  { TK_ILLEGAL,          "TK_ILLEGAL"         },
  { TK_CREATEDATASET,    "TK_CREATEDATASET"   },
  { TK_DROPDATASET,      "TK_DROPDATASET"     },
};

/*
** Return the name of a token.
*/
const char *xjd1TokenName(int code){
  unsigned int i;
................................................................................
  if( pCmd==0 ) return;
  switch( pCmd->eCmdType ){
    case TK_SELECT: {
      xjd1StringAppendF(pOut, "%*sQuery:\n", indent, "");
      xjd1TraceQuery(pOut, indent+3, pCmd->u.q.pQuery);
      break;
    }
    case TK_CREATEDATASET: {
      xjd1StringAppendF(pOut, "%*sCreate-Dataset: \"%.*s\" if-not-exists=%d\n",
         indent, "", pCmd->u.crtab.name.n, pCmd->u.crtab.name.z,
         pCmd->u.crtab.ifExists);
      break;
    }
    case TK_DROPDATASET: {
      xjd1StringAppendF(pOut, "%*sDrop-Dataset: \"%.*s\" if-exists=%d\n",
         indent, "", pCmd->u.crtab.name.n, pCmd->u.crtab.name.z,
         pCmd->u.crtab.ifExists);
      break;
    }
    case TK_INSERT: {
      xjd1StringAppendF(pOut, "%*sInsert: %.*s\n",







|







 







|
|







 







|





|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  { TK_LIMIT,            "TK_LIMIT"           },
  { TK_OFFSET,           "TK_OFFSET"          },
  { TK_WHERE,            "TK_WHERE"           },
  { TK_BEGIN,            "TK_BEGIN"           },
  { TK_ROLLBACK,         "TK_ROLLBACK"        },
  { TK_COMMIT,           "TK_COMMIT"          },
  { TK_CREATE,           "TK_CREATE"          },
  { TK_COLLECTION,       "TK_COLLECTION"      },
  { TK_IF,               "TK_IF"              },
  { TK_EXISTS,           "TK_EXISTS"          },
  { TK_DROP,             "TK_DROP"            },
  { TK_DELETE,           "TK_DELETE"          },
  { TK_UPDATE,           "TK_UPDATE"          },
  { TK_SET,              "TK_SET"             },
  { TK_INSERT,           "TK_INSERT"          },
................................................................................
  { TK_PRAGMA,           "TK_PRAGMA"          },
  /* End paste of parse_txt.h */
  { TK_NOT_LIKEOP,       "TK_NOT_LIKEOP"      },
  { TK_NOT_IS,           "TK_NOT_IS"          },
  { TK_FUNCTION,         "TK_FUNCTION"        },
  { TK_SPACE,            "TK_SPACE"           },
  { TK_ILLEGAL,          "TK_ILLEGAL"         },
  { TK_CREATECOLLECTION, "TK_CREATECOLLECTION"},
  { TK_DROPCOLLECTION,   "TK_DROPCOLLECTION"  },
};

/*
** Return the name of a token.
*/
const char *xjd1TokenName(int code){
  unsigned int i;
................................................................................
  if( pCmd==0 ) return;
  switch( pCmd->eCmdType ){
    case TK_SELECT: {
      xjd1StringAppendF(pOut, "%*sQuery:\n", indent, "");
      xjd1TraceQuery(pOut, indent+3, pCmd->u.q.pQuery);
      break;
    }
    case TK_CREATECOLLECTION: {
      xjd1StringAppendF(pOut, "%*sCreate-Dataset: \"%.*s\" if-not-exists=%d\n",
         indent, "", pCmd->u.crtab.name.n, pCmd->u.crtab.name.z,
         pCmd->u.crtab.ifExists);
      break;
    }
    case TK_DROPCOLLECTION: {
      xjd1StringAppendF(pOut, "%*sDrop-Dataset: \"%.*s\" if-exists=%d\n",
         indent, "", pCmd->u.crtab.name.n, pCmd->u.crtab.name.z,
         pCmd->u.crtab.ifExists);
      break;
    }
    case TK_INSERT: {
      xjd1StringAppendF(pOut, "%*sInsert: %.*s\n",

Changes to src/xjd1Int.h.

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

/* Marker for routines not intended for external use */
#define PRIVATE

/* Additional tokens above and beyond those generated by the parser and
** found in parse.h 
*/
#define TK_NOT_LIKEOP     (TK_LIKEOP+128)
#define TK_NOT_IS         (TK_IS+128)
#define TK_FUNCTION       100
#define TK_SPACE          101
#define TK_ILLEGAL        102
#define TK_CREATEDATASET  103
#define TK_DROPDATASET    104
#define TK_ARRAY          105
#define TK_STRUCT         106
#define TK_JVALUE         107

typedef unsigned char u8;
typedef unsigned short int u16;
typedef struct Command Command;
typedef struct DataSrc DataSrc;
typedef struct Expr Expr;
typedef struct ExprItem ExprItem;







|
|
|
|
|
|
|
|
|
|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

/* Marker for routines not intended for external use */
#define PRIVATE

/* Additional tokens above and beyond those generated by the parser and
** found in parse.h 
*/
#define TK_NOT_LIKEOP        (TK_LIKEOP+128)
#define TK_NOT_IS            (TK_IS+128)
#define TK_FUNCTION          100
#define TK_SPACE             101
#define TK_ILLEGAL           102
#define TK_CREATECOLLECTION  103
#define TK_DROPCOLLECTION    104
#define TK_ARRAY             105
#define TK_STRUCT            106
#define TK_JVALUE            107

typedef unsigned char u8;
typedef unsigned short int u16;
typedef struct Command Command;
typedef struct DataSrc DataSrc;
typedef struct Expr Expr;
typedef struct ExprItem ExprItem;

Changes to test/base01.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
-- Basic sanity checking.
--
.new t1.db
.testcase 100
CREATE DATASET abc;
CREATE DATASET def;
INSERT INTO abc VALUE { name:"abc" };
INSERT INTO def VALUE { name:"def" };
.result

.testcase 110
SELECT FROM abc;
.result {"name":"abc"}




|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
-- Basic sanity checking.
--
.new t1.db
.testcase 100
CREATE COLLECTION abc;
CREATE COLLECTION def;
INSERT INTO abc VALUE { name:"abc" };
INSERT INTO def VALUE { name:"def" };
.result

.testcase 110
SELECT FROM abc;
.result {"name":"abc"}

Changes to tool/mkkeywordhash.c.

62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
77
78
  { "ASCENDING",    "TK_ASCENDING",  },
  { "ASC",          "TK_ASCENDING",  },
  { "AS",           "TK_AS",         },
  { "BEGIN",        "TK_BEGIN",      },
  { "BETWEEN",      "TK_BETWEEN",    },
  { "BY",           "TK_BY",         },
  { "COLLATE",      "TK_COLLATE",    },

  { "COMMIT",       "TK_COMMIT",     },
  { "CREATE",       "TK_CREATE",     },
  { "DATASET",      "TK_DATASET",    },
  { "DELETE",       "TK_DELETE",     },
  { "DESCENDING",   "TK_DESCENDING", },
  { "DESC",         "TK_DESCENDING", },
  { "DROP",         "TK_DROP",       },
  { "EACH",         "TK_FLATTENOP",  },
  { "ESCAPE",       "TK_ESCAPE",     },
  { "EXCEPT",       "TK_EXCEPT",     },







>


<







62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
  { "ASCENDING",    "TK_ASCENDING",  },
  { "ASC",          "TK_ASCENDING",  },
  { "AS",           "TK_AS",         },
  { "BEGIN",        "TK_BEGIN",      },
  { "BETWEEN",      "TK_BETWEEN",    },
  { "BY",           "TK_BY",         },
  { "COLLATE",      "TK_COLLATE",    },
  { "COLLECTION",   "TK_COLLECTION", },
  { "COMMIT",       "TK_COMMIT",     },
  { "CREATE",       "TK_CREATE",     },

  { "DELETE",       "TK_DELETE",     },
  { "DESCENDING",   "TK_DESCENDING", },
  { "DESC",         "TK_DESCENDING", },
  { "DROP",         "TK_DROP",       },
  { "EACH",         "TK_FLATTENOP",  },
  { "ESCAPE",       "TK_ESCAPE",     },
  { "EXCEPT",       "TK_EXCEPT",     },