UnQL

Check-in [b854a47a54]
Login

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

Overview
Comment:Rename TABLE to DATASET.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b854a47a544ba48fb8938e86d163310f83f735d9
User & Date: drh 2011-06-21 17:31:52
Context
2011-06-21
17:42
Fix an uninitialized structure that was causing segfaults. check-in: dc86933067 user: drh tags: trunk
17:31
Rename TABLE to DATASET. check-in: b854a47a54 user: drh tags: trunk
17:10
Begin adding code to perform queries. Compiles and links, but probably does not work. This is code from a few days ago that I am just now coming back to work on again. check-in: fb25f79d0f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/parse.y.

410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

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

///////////////////// The CREATE TABLE statement ////////////////////////////
//
cmd(A) ::= CREATE TABLE ifnotexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_CREATETABLE;
    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 TABLE /////////////////////////////////////
//
cmd(A) ::= DROP TABLE ifexists(B) tabname(N). {
  Command *pNew = xjd1PoolMalloc(p->pPool, sizeof(*pNew));
  if( pNew ){
    pNew->eCmdType = TK_DROPTABLE;
    pNew->u.crtab.ifExists = B;
    pNew->u.crtab.name = N;
  }
  A = pNew;
}
%type ifexists {int}
ifexists(A) ::= IF EXISTS.  {A = 1;}







|

|


|










|

|


|







410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

///////////////////// 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;}

Changes to src/stmt.c.

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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_CREATETABLE: {
      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_DROPTABLE: {
      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);







|







 







|







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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);

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
  0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40   /* f8..ff    ........ */
};

/**********************************************************************
** The following code is automatically generated
** by ../tool/mkkeywordhash.c
*/
/* Hash score: 51 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 271 bytes of keywords in 189 bytes */
  /*   BEGINSERTABLEACHAVINGROUPDATESCAPEXCEPTRUEXISTSELECTFALSEALL       */
  /*   IKEASCENDINGLOBETWEENOTCOLLATECOMMITCREATEDELETEDESCENDING         */
  /*   FLATTENULLIMITIFROMINTERSECTINTOFFSETORDEROLLBACKUNIONVALUE        */
  /*   WHEREBYDROP                                                        */
  static const char zText[188] = {
    'B','E','G','I','N','S','E','R','T','A','B','L','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','R','U','E','X','I','S','T','S','E','L','E','C','T','F','A',
    'L','S','E','A','L','L','I','K','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','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','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','D','R','O','P',
  };
  static const unsigned char aHash[80] = {
       0,  44,  42,  15,  45,  21,  43,   1,   0,   6,   3,  11,   0,
       7,   9,   0,   0,  40,   0,   5,  33,  30,  24,   0,   0,   0,
       0,  34,   0,   0,   0,  19,   0,   0,   0,  38,   0,   0,  13,
       0,   0,   0,   0,  41,   0,   0,   0,   0,   0,   0,   0,   0,
      23,  25,  37,  22,   4,  32,   0,   0,  29,  36,  17,  39,   0,
      35,  14,   0,   0,   0,   0,   0,  31,  26,   0,   0,   0,  27,
      20,  12,
  };
  static const unsigned char aNext[45] = {
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  10,   0,   0,
       0,   0,   0,   0,   0,   0,   2,   0,   0,   0,   0,   0,   0,
       8,   0,   0,   0,  18,   0,   0,  16,   0,   0,   0,   0,  28,
       0,   0,   0,   0,   0,   0,
  };
  static const unsigned char aLen[45] = {
       5,   6,   5,   4,   6,   5,   6,   6,   6,   4,   6,   2,   6,
       5,   3,   4,   3,   9,   2,   4,   7,   3,   7,   6,   6,   6,
       4,  10,   2,   7,   4,   5,   2,   4,   9,   4,   6,   3,   5,
       8,   5,   5,   5,   2,   4,
  };
  static const unsigned short int aOffset[45] = {
       0,   3,   8,  12,  15,  20,  23,  28,  33,  38,  41,  43,  46,
      52,  57,  59,  63,  63,  63,  71,  74,  80,  83,  90,  96, 102,
     108, 108, 115, 118, 124, 127, 132, 133, 137, 146, 149, 152, 155,
     159, 167, 172, 177, 182, 184,
  };
  static const unsigned char aCode[45] = {
    TK_BEGIN,      TK_INSERT,     TK_TABLE,      TK_FLATTENOP,  TK_HAVING,     
    TK_GROUP,      TK_UPDATE,     TK_ESCAPE,     TK_EXCEPT,     TK_TRUE,       
    TK_EXISTS,     TK_IS,         TK_SELECT,     TK_FALSE,      TK_ALL,        
    TK_LIKEOP,     TK_ASCENDING,  TK_ASCENDING,  TK_AS,         TK_LIKEOP,     
    TK_BETWEEN,    TK_NOT,        TK_COLLATE,    TK_COMMIT,     TK_CREATE,     
    TK_DELETE,     TK_DESCENDING, TK_DESCENDING, TK_IN,         TK_FLATTENOP,  
    TK_NULL,       TK_LIMIT,      TK_IF,         TK_FROM,       TK_INTERSECT,  
    TK_INTO,       TK_OFFSET,     TK_SET,        TK_ORDER,      TK_ROLLBACK,   
    TK_UNION,      TK_VALUE,      TK_WHERE,      TK_BY,         TK_DROP,       
  };
  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;
}







|

|
|
|


|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|


|
|
|
|


|
|
|



|
|
|
|


|
|
|
|
|
|
|
|




|







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
  0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40   /* f8..ff    ........ */
};

/**********************************************************************
** The following code is automatically generated
** by ../tool/mkkeywordhash.c
*/
/* Hash score: 52 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 273 bytes of keywords in 191 bytes */
  /*   BEGINSERTRUEACHAVINGROUPDATESCAPEXCEPTFALSELECTALLIKEXISTS         */
  /*   ASCENDINGLOBETWEENOTCOLLATECOMMITCREATEDATASETDELETEDESCENDING     */
  /*   FLATTENULLIMITIFROMINTERSECTINTOFFSETORDEROLLBACKUNIONVALUE        */
  /*   WHEREBYDROP                                                        */
  static const char zText[190] = {
    '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','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','A','T','A','S','E','T','D','E','L','E',
    'T','E','D','E','S','C','E','N','D','I','N','G','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','D','R','O','P',
  };
  static const unsigned char aHash[79] = {
       0,  44,   0,  28,  19,  15,   0,  42,   0,  12,  45,  43,   0,
       1,   0,   6,   3,  25,   7,   0,   9,   0,  40,   0,   0,   5,
      34,  31,  23,   0,   0,   0,   0,  35,   0,   0,   0,  18,   0,
       0,  26,   0,   0,  11,   0,   0,   0,   0,  41,   0,   0,   0,
       0,   0,   0,   0,   0,  22,  24,  38,  21,   4,  33,   0,   0,
      30,  37,  16,  39,   0,  36,  10,   0,   0,   0,   0,   0,  32,
      27,
  };
  static const unsigned char aNext[45] = {
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   0,   0,   0,   0,   2,   0,   0,   0,   0,   0,  14,   0,
       0,   8,   0,   0,   0,  17,   0,   0,  13,   0,   0,   0,  29,
       0,   0,   0,  20,   0,   0,
  };
  static const unsigned char aLen[45] = {
       5,   6,   4,   4,   6,   5,   6,   6,   6,   5,   6,   3,   4,
       6,   2,   3,   9,   2,   4,   7,   3,   7,   6,   6,   7,   3,
       6,   4,  10,   2,   7,   4,   5,   2,   4,   9,   4,   6,   5,
       8,   5,   5,   5,   2,   4,
  };
  static const unsigned short int aOffset[45] = {
       0,   3,   8,  11,  14,  19,  22,  27,  32,  38,  41,  47,  49,
      52,  54,  58,  58,  58,  66,  69,  75,  78,  85,  91,  97, 101,
     104, 110, 110, 117, 120, 126, 129, 134, 135, 139, 148, 151, 157,
     161, 169, 174, 179, 184, 186,
  };
  static const unsigned char aCode[45] = {
    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_ASCENDING,  TK_ASCENDING,  TK_AS,         TK_LIKEOP,     TK_BETWEEN,    
    TK_NOT,        TK_COLLATE,    TK_COMMIT,     TK_CREATE,     TK_DATASET,    
    TK_SET,        TK_DELETE,     TK_DESCENDING, TK_DESCENDING, TK_IN,         
    TK_FLATTENOP,  TK_NULL,       TK_LIMIT,      TK_IF,         TK_FROM,       
    TK_INTERSECT,  TK_INTO,       TK_OFFSET,     TK_ORDER,      TK_ROLLBACK,   
    TK_UNION,      TK_VALUE,      TK_WHERE,      TK_BY,         TK_DROP,       
  };
  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;
}

Changes to src/trace.c.

1
2
3
4
5
6
7
8
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
** Copyright (c) 2011 D. Richard Hipp
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the Simplified BSD License (also
** known as the "2-Clause License" or "FreeBSD License".)
**
** This program is distributed in the hope that it will be useful,
................................................................................
  { 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_TABLE,            "TK_TABLE"           },
  { 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_VALUE,            "TK_VALUE"           },
  /* 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_CREATETABLE,      "TK_CREATETABLE"     },
  { TK_DROPTABLE,        "TK_DROPTABLE"       },
};

/*
** 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_CREATETABLE: {
      xjd1StringAppendF(pOut, "%*sCreate-Table: \"%.*s\" if-not-exists=%d\n",
         indent, "", pCmd->u.crtab.name.n, pCmd->u.crtab.name.z,
         pCmd->u.crtab.ifExists);
      break;
    }
    case TK_DROPTABLE: {
      xjd1StringAppendF(pOut, "%*sDrop-Table: \"%.*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",
         indent, "", pCmd->u.ins.name.n, pCmd->u.ins.name.z);
|







 







|







 







|
|







 







|
|




|
|







1
2
3
4
5
6
7
8
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*tab
** Copyright (c) 2011 D. Richard Hipp
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the Simplified BSD License (also
** known as the "2-Clause License" or "FreeBSD License".)
**
** This program is distributed in the hope that it will be useful,
................................................................................
  { 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_VALUE,            "TK_VALUE"           },
  /* 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",
         indent, "", pCmd->u.ins.name.n, pCmd->u.ins.name.z);

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

/* 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_CREATETABLE  103
#define TK_DROPTABLE    104

typedef unsigned char u8;
typedef struct Command Command;
typedef struct DataSrc DataSrc;
typedef struct Expr Expr;
typedef struct ExprItem ExprItem;
typedef struct ExprList ExprList;







|
|
|
|
|
|
|







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

/* 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

typedef unsigned char u8;
typedef struct Command Command;
typedef struct DataSrc DataSrc;
typedef struct Expr Expr;
typedef struct ExprItem ExprItem;
typedef struct ExprList ExprList;

Changes to tool/mkkeywordhash.c.

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  { "LIMIT",        "TK_LIMIT",     },
  { "OFFSET",       "TK_OFFSET",    },
  { "WHERE",        "TK_WHERE",     },
  { "BEGIN",        "TK_BEGIN",     },
  { "ROLLBACK",     "TK_ROLLBACK",  },
  { "COMMIT",       "TK_COMMIT",    },
  { "CREATE",       "TK_CREATE",    },
  { "TABLE",        "TK_TABLE",     },
  { "IF",           "TK_IF",        },
  { "EXISTS",       "TK_EXISTS",    },
  { "DROP",         "TK_DROP",      },
  { "DELETE",       "TK_DELETE",    },
  { "UPDATE",       "TK_UPDATE",    },
  { "SET",          "TK_SET",       },
  { "INSERT",       "TK_INSERT",    },







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  { "LIMIT",        "TK_LIMIT",     },
  { "OFFSET",       "TK_OFFSET",    },
  { "WHERE",        "TK_WHERE",     },
  { "BEGIN",        "TK_BEGIN",     },
  { "ROLLBACK",     "TK_ROLLBACK",  },
  { "COMMIT",       "TK_COMMIT",    },
  { "CREATE",       "TK_CREATE",    },
  { "DATASET",      "TK_DATASET",   },
  { "IF",           "TK_IF",        },
  { "EXISTS",       "TK_EXISTS",    },
  { "DROP",         "TK_DROP",      },
  { "DELETE",       "TK_DELETE",    },
  { "UPDATE",       "TK_UPDATE",    },
  { "SET",          "TK_SET",       },
  { "INSERT",       "TK_INSERT",    },