Documentation Source Text

Check-in [208918a3f1]
Login

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

Overview
Comment:Documentation changes for 3.6.2
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 208918a3f13e85b575fbe9e8bb4b7a52c2ecb74d
User & Date: drh 2008-09-02 13:34:45
Context
2008-09-02
21:34
Add the threadsafe.html document and related documentation changes. check-in: 44c2594627 user: drh tags: trunk
13:34
Documentation changes for 3.6.2 check-in: 208918a3f1 user: drh tags: trunk
2008-08-12
18:10
Updates to the LIKE and GLOB documentation. CVSTrac ticket #3290. check-in: ec08a46c8b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/changes.in.

36
37
38
39
40
41
42






43
44
45
46
47
48
49
      <a href="http://www.sqlite.org/cvstrac/timeline">
      http://www.sqlite.org/cvstrac/timeline</a>.</p>
    }
    hd_close_aux
    hd_enable_main 1
  }
}







chng {2008 Aug 6 (3.6.1)} {
<li>Added the [lookaside memory allocator] for a speed improvement in excess
    of 15% on some workloads.  (Your mileage may vary.)</li>
<li>Added the [SQLITE_CONFIG_LOOKASIDE] verb to [sqlite3_config()] to control
    the default lookaside configuration.</li>
<li>Added verbs [SQLITE_STATUS_PAGECACHE_SIZE] and







>
>
>
>
>
>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
      <a href="http://www.sqlite.org/cvstrac/timeline">
      http://www.sqlite.org/cvstrac/timeline</a>.</p>
    }
    hd_close_aux
    hd_enable_main 1
  }
}

chng {2008 Aug 30 (3.6.2)} {
<li>Split the pager subsystem into separate pager and pcache subsystems.</li>
<li>Factor out indentifier resolution procedures into separate files.</li>
<li>Bug fixes</li>
}

chng {2008 Aug 6 (3.6.1)} {
<li>Added the [lookaside memory allocator] for a speed improvement in excess
    of 15% on some workloads.  (Your mileage may vary.)</li>
<li>Added the [SQLITE_CONFIG_LOOKASIDE] verb to [sqlite3_config()] to control
    the default lookaside configuration.</li>
<li>Added verbs [SQLITE_STATUS_PAGECACHE_SIZE] and

Changes to pages/index.in.

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

</td>
<td width="20"></td><td bgcolor="#80a796" width="1"></td><td width="20"></td>
<td valign="top">
<h3>Current Status</h3>

<p><ul>
<li><a href="releaselog/3_6_1.html">Version 3.6.1</a>
of SQLite is recommended for all new development.</li>
</ul></p>

<h3>Common Links</h3>

<p><ul>
<li> <a href="features.html">Features</a> </li>







|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

</td>
<td width="20"></td><td bgcolor="#80a796" width="1"></td><td width="20"></td>
<td valign="top">
<h3>Current Status</h3>

<p><ul>
<li><a href="releaselog/3_6_2.html">Version 3.6.2</a>
of SQLite is recommended for all new development.</li>
</ul></p>

<h3>Common Links</h3>

<p><ul>
<li> <a href="features.html">Features</a> </li>

Changes to pages/news.in.

9
10
11
12
13
14
15










16
17
18
19
20
21
22
  hd_puts "<h3>$date - $title</h3>"
  regsub -all "\n( *\n)+" $text "</p>\n\n<p>" txt
  regsub -all {[Tt]icket #(\d+)} $txt \
      {<a href="http://www.sqlite.org/cvstrac/tktview?tn=\1">\0</a>} txt
  hd_resolve "<p>$txt</p>"
  hd_puts "<hr width=\"50%\">"
}











newsitem {2008-Aug-06} {Version 3.6.1} {
  SQLite version 3.6.1 is a stabilization and performance enhancement
  release.  
}

newsitem {2008-July-16} {Version 3.6.0 beta} {







>
>
>
>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  hd_puts "<h3>$date - $title</h3>"
  regsub -all "\n( *\n)+" $text "</p>\n\n<p>" txt
  regsub -all {[Tt]icket #(\d+)} $txt \
      {<a href="http://www.sqlite.org/cvstrac/tktview?tn=\1">\0</a>} txt
  hd_resolve "<p>$txt</p>"
  hd_puts "<hr width=\"50%\">"
}

newsitem {2008-Aug-30} {Version 3.6.2} {
  SQLite version 3.6.2 contains rewrites of the page-cache subsystem and
  the procedures for matching identifiers to table columns in SQL statements.
  These changes are designed to better modularize the code and make it more
  maintainable and reliable moving forward.  Nearly 5000 non-comment lines 
  of core code (about 11.3%) have changed
  from the previous release.  Nevertheless, there should be no
  application-visible changes, other than bug fixes.
}

newsitem {2008-Aug-06} {Version 3.6.1} {
  SQLite version 3.6.1 is a stabilization and performance enhancement
  release.  
}

newsitem {2008-July-16} {Version 3.6.0 beta} {

Changes to pages/support.in.

24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
SQLite:</p>

<ul>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-announce">
sqlite-announce</a> - announcements of new
releases or significant developments.</li>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users">
sqlite-users</a> - general user discussion.</li>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev">
sqlite-dev</a> - developer conversations.</li>

</ul>

<p>
Most users of SQLite will want to join the
<a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-announce">
sqlite-announce</a> list and many will want to join the
<a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users">







|

|
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
SQLite:</p>

<ul>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-announce">
sqlite-announce</a> - announcements of new
releases or significant developments.</li>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users">
sqlite-users</a> - general user discussion; most postings belong here.</li>
<li><a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev">
sqlite-dev</a> - developer conversations; for people who have or aspire to
have write permission on the SQLite CVS repository.</li>
</ul>

<p>
Most users of SQLite will want to join the
<a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-announce">
sqlite-announce</a> list and many will want to join the
<a href="http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users">

Changes to pages/syntax.in.

44
45
46
47
48
49
50




51
52
53
54
55
56
57
..
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
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
...
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
...
516
517
518
519
520
521
522

523
524


525
526
527
528
529
530
531
532
...
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
...
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
...
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
...
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
...
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
...
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
...
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
...
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
...
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
....
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
....
1085
1086
1087
1088
1089
1090
1091






1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
....
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
....
1163
1164
1165
1166
1167
1168
1169






1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
....
1210
1211
1212
1213
1214
1215
1216






1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
....
1327
1328
1329
1330
1331
1332
1333




























1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
....
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
....
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
....
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
....
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
....
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
....
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
....
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
....
1645
1646
1647
1648
1649
1650
1651
1652









1653
automatically, by [sqlite3_step()].  So even though it is reasonable
to think about preparation as being a function of [sqlite3_prepare_v2()]
and its companions and evaluation as being a function of
[sqlite3_step()], the reader should keep in mind that
[sqlite3_step()] might also sometimes do preparations following
schema changes.</p>





<tcl>
syntaxreq {H42000} {} {
  SQLite expects all statements to be terminated by a semicolon.
  If a statement is submitted to SQLite that does not end in a
  semicolon, then a semicolon is added automatically by the tokenizer.
  (See [H41040].)
} {
................................................................................
  robustness in the case where a seldom-used keyword is accidentally
  used as the name of a table or column.
} {
  A token received by the parser shall be converted into an ID token
  if the original token value would have resulted in a syntax error,
  a token value of ID will allow the parse to continue,
  and if the original token value was one of:
  ABORT AFTER ANALYZE ASC ATTACH BEFORE BEGIN CASCADE CAST CONFLICT
  DATABASE DEFERRED DESC DETACH EACH END EXCLUSIVE EXPLAIN FAIL FOR
  IGNORE IMMEDIATE INITIALLY INSTEAD LIKE_KW MATCH PLAN
  QUERY KEY OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW
  TEMP TRIGGER VACUUM VIEW VIRTUAL






















  EXCEPT INTERSECT UNION









  REINDEX RENAME CTIME_KW IF










}
syntaxreq {H420012} {} {
  A second level of fallback allows any token to be converted into
  the token ANY.  The ANY token is used to gather arbitrary delimited
  token sequences, such as used as the arguments to the CREATE VIRTUAL
  TABLE command.
} {
................................................................................
  A token received by the parser shall be converted into an ANY token
  if the original token value would have resulted in a syntax error
  and if a token value of ANY will allow the parse to continue.
}
 
</tcl>







































<h2>1.0 Transaction Control</h2>

<h3>1.1 BEGIN</h3>

<tcl>
syntaxreq {H42010} {} {} {
  The SQLite parser shall accept BEGIN statements
  that conform to the following syntax:
} {
  cmd ::= BEGIN transaction_type transaction_name.
................................................................................
  lock to be obtained for all underlying database files.
}
</tcl>
<p>The <i>transaction_name</i> clause of a BEGIN statement is
provided for syntactic compatibility to other SQL database engines.
The <i>transaction_name</i> clause is silently ignored.</p>

<h3>1.2 COMMIT</h3>

<tcl>
syntaxreq {H42110} {} {} {
  SQLite shall accept the following COMMIT statement syntax:
} {
  cmd ::= COMMIT transaction_name.
  cmd ::= END transaction_name.
................................................................................
The <i>transaction_name</i> clause is silently ignored.</p>

<p>The COMMIT and END statements are aliases for one another and
accomplish exactly the same thing.  One is merely a different way
of expression the other.</p>


<h3>1.3 ROLLBACK</h3>

<tcl>
syntaxreq {H42210} {} {} {
  The SQLite parser shall accept ROLLBACK statements
  that conform to the following syntax:
} {
  cmd ::= ROLLBACK transaction_name.
................................................................................
}
</tcl>
<p>The <i>transaction_name</i> clause of a BEGIN statement is
provided for syntactic compatibility to other SQL database engines.
The <i>transaction_name</i> clause is silently ignored.</p>


<h2>2.0 Data Definition Language (DDL)</h2>

<h3>2.1 CREATE TABLE</h3>

<tcl>
syntaxreq {H42310} {} {} {
  The SQLite parser shall accept CREATE TABLE statements
  that conform to the following syntax:
} {
  cmd ::= CREATE temp TABLE ifnotexists fullname table_definition.
................................................................................
syntaxreq {H42334} {} {} {
  The preparation of a CREATE TABLE statement shall fail with an error if the
  the <i>databasename</i> references a database that is not
  attached to the same [database connection].
}
</tcl>

<h4>2.1.1 CREATE TABLE column definitions</h4>

<tcl>
syntaxdef [list {ordinary CREATE TABLE statement} {CREATE TABLE AS statement}] {
  There are two varieties of CREATE TABLE statements.  The most common form
  specifies the names of all columns in the table together with datatype
  and constraint information.  This first form is called a
  "ordinary CREATE TABLE statement".  The second form of CREATE TABLE
................................................................................
  CHECK constraint that uses a subquery shall fail with an error.
}
syntaxreq {H42517} {} {} {
  The preparation of a CREATE TABLE statement that contains a
  CHECK constraint that uses a parameter shall fail with an error.
}
syntaxreq {H42518} {} {} {

  The preparation of a CREATE TABLE statement that contains a
  CHECK constraint that references any column of a table other than


  the table being created shall fail with an error.
}
syntaxreq {H42521} {} {} {
  The preparation of a CREATE TABLE statement that contains a
  DEFAULT constraint with an non-constant expression
  shall fail with an error.
}
syntaxreq {H42536} {} {
................................................................................
  fkaction ::= RESTRICT.
  initially_deferred_clause ::= .
  initially_deferred_clause ::= INITIALLY DEFERRED.
  initially_deferred_clause ::= INITIALLY IMMEDIATE.
}
</tcl>

<h4>2.1.2 CREATE TABLE AS</h4>

<tcl>
syntaxreq {H42610} {} {
  The CREATE TABLE AS statement generates a new table to hold the
  result set of a SELECT statement.
} {
  The SQLite parser shall accept the following syntax for creating new
................................................................................
  All columns in a table generated by a CREATE TABLE AS statement
  shall have a default collating sequence of BINARY.
}

</tcl>


<h3>2.2 DROP TABLE</h3>

<tcl>
syntaxreq {H42700} {} {} {
  The SQLite parser shall accept DROP TABLE statements
  that conform to the following syntax.
} {
  cmd ::= DROP TABLE ifexists fullname.
................................................................................
}
syntaxreq {H42724} {} {} {
  The preparation of a DROP TABLE statement shall fail with an
  error if <i>fullname</i> is a system table.
}
</tcl>

<h3>2.3 CREATE INDEX</h3>

<tcl>
syntaxreq {H42800} {} {} {
  The SQLite parser shall accept CREATE INDEX statements that 
  conform to the following syntax:
} {
  cmd ::= CREATE unique INDEX ifnotexists fullname ON tablename LP indexlist RP.
................................................................................
syntaxreq {H42842} {} {} {
  The preparation of a CREATE INDEX statement shall fail with an error
  if the <i>tablename</i> refers to a system table.
}

</tcl>

<h3>2.4 DROP INDEX</h3>

<tcl>
syntaxreq {H42900} {} {} {
  The SQLite parser shall accept DROP INDEX statements 
  that conform to the following syntax:
} {
  cmd ::= DROP INDEX ifexists fullname.
................................................................................
syntaxreq {H42916} {} {} {
  The successful evaluation of a DROP INDEX statement shall cause
  the index identified by <i>fullname</i> to be removed from its
  database and discarded.
}
</tcl>

<h3>2.5 CREATE VIEW</h3>

<tcl>
syntaxreq {H43100} {} {} {
  The SQLite parser shall accept CREATE VIEW statements 
  that conform to the following syntax:
} {
  cmd ::= CREATE temp VIEW ifnotexists fullname AS select.
................................................................................
  Each column name in a table generated by a CREATE VIEW
  statement shall have an arbitrary suffix appended to its basename
  if and only if such a suffix is necessary to make the name
  distinct from all preceding column names in the view.
}
</tcl>

<h3>2.6 DROP VIEW</h3>

<tcl>
syntaxreq {H43200} {} {} {
  The SQLite parser shall accept DROP VIEW statements
  that conform to the following syntax:
} {
  cmd ::= DROP VIEW ifexists fullname.
................................................................................
syntaxreq {H43214} {} {} {
  The successful evaluation of a DROP VIEW statement shall cause
  all triggers attached to the view identified by <i>fullname</i>
  to be removed from their database and discarded.
}
</tcl>

<h3>2.7 CREATE TRIGGER</h3>

<tcl>
syntaxreq {H43300} {} {} {
  The SQLite parser shall accept CREATE TRIGGER statements
  that conform to the following syntax:
} {
  cmd ::= CREATE temp TRIGGER ifnotexists fullname trigger trigger_body.
................................................................................
  The preparation of a CREATE TRIGGER statement shall fail with an error
  if the <i>trigger_target</i> is a system table.
}

</tcl>


<h3>2.8 DROP TRIGGER</h3>

<tcl>
syntaxreq {H43500} {} {} {
  The SQLite parser shall accept DROP TRIGGER statements
  that conform to the following syntax:
} {
  cmd ::= DROP TRIGGER ifexists fullname.
................................................................................
syntaxreq {H43514} {} {} {
  The successful evaluation of a DROP TRIGGER statement shall cause
  all triggers attached to the trigger identified by <i>fullname</i>
  to be removed from their database and discarded.
}
</tcl>

<h3>2.9 CREATE VIRTUAL TABLE</h3>

<tcl>
syntaxreq {H43600} {} {} {
  The SQLite parser shall accept CREATE VIRTUAL TABLE statements
  that conform to the following syntax.
} {
  cmd ::= CREATE VIRTUAL TABLE fullname USING name vtab_arg_list.
................................................................................
  vtab_arg_token ::= ANY.
  vtab_arg_token ::= LP anylist RP.
  anylist ::= .
  anylist ::= anylist ANY.
}
</tcl>

<h3>2.10 ALTER TABLE</h3>
<h4>2.11 ALTER TABLE RENAME</h4>

<tcl>
syntaxreq {H43700} {} {} {
  The SQLite parser shall accept ALTER TABLE RENAME statements
  that conform to the following syntax:
} {
  cmd ::= ALTER TABLE fullname RENAME TO name.
}
</tcl>

<h4>2.12 ALTER TABLE ADD COLUMN</h4>

<tcl>
syntaxreq {H43750} {} {} {
  The SQLite parser shall accept ALTER TABLE ADD COLUMN statements
  that conform to the following syntax:
} {
  cmd ::= ALTER TABLE fullname ADD column_keyword column.
  column_keyword ::= .
  column_keyword ::= COLUMNKW.
}
</tcl>

<h2>3.0 Data Manipulation Language (DML)</h2>

<h3>3.1 INSERT</h3>
<tcl>
syntaxreq {H43810} {} {} {
  The SQLite parser shall accept INSERT statements that
  conform to the following syntax:
} {
  cmd ::= insert_cmd INTO fullname columnlist_opt insert_content.
  insert_cmd ::= INSERT.
................................................................................
  change to REPLACE.
}
syntaxreq {H43827} {} {} {
  When the form of an INSERT statement is "INSERT OR <i>algorithm</i>" 
  then the null- and uniqueness-conflict resolution algorithms shall all
  change to <i>algorithm</i>.
}






</tcl>

<h4>3.1.1 INSERT VALUE</h4>
<tcl>
syntaxreq {H43840} {} {} {
  The SQLite parser shall accept INSERT VALUE statements that
  conform to the following syntax:
} {
  insert_content ::= VALUES LP exprlist RP.
}
................................................................................
  error if the <i>columnlist</i> element does not exists and the number of 
  entries in the <i>exprlist</i> is different
  from the number of columns in the table or view identified by
  <i>fullname</i>.
}
</tcl>

<h4>3.1.2 INSERT SELECT</h4>
syntaxreq {H43870} {} {} {
  The SQLite parser shall accept INSERT SELECT statements that
  conform to the following syntax:
} {
  insert_contents ::= select.
}
syntaxreq {H43873} {} {} {
  The preparation of an INSERT SELECT statement shall fail with an
  error if the <i>columnlist</i> element exists and the number of 
  entries in the <i>instcollist</i> is different
  from the number of columns in the result set of <i>select</i>.
}
syntaxreq {H43876} {} {} {
  The preparation of an INSERT VALUE statement shall fail with an
  error if the <i>columnlist</i> element does not exists and the number of 
  columns in the result set of the <i>select</i> is different
  from the number of columns in the table or view identified by
  <i>fullname</i>.
}
</tcl>
<h4>3.1.3 INSERT DEFAULT</h4>
<tcl>
syntaxreq {H43890} {} {} {
  The SQLite parser shall accept INSERT DEFAULT statements that
  conform to the following syntax:
} {
  insert_contents ::= DEFAULT VALUES.
}
</tcl>

<h3>3.2 DELETE</h3>

<tcl>
syntaxreq {H43900} {} {} {
  The SQLite parser shall accept DELETE statements that
  conform to the following syntax:
} {
  cmd ::= DELETE FROM fullname where.
................................................................................
}
syntaxreq {H43907} {} {} {
  The preparation of a DELETE statement shall fail with an error if
  the <i>objectname</i> of the <i>fullname</i> element is "sqlite_master"
  or "sqlite_temp_master" and the database connection is not in
  writeable_schema mode.
}






</tcl>

<h3>3.3 UPDATE</h3>

<tcl>
syntaxreq {H44100} {} {} {
  The SQLite parser shall accept UPDATE statements that
  conform to the following syntax:
} {
  cmd ::= update_cmd fullname SET setlist where.
................................................................................
  be used.
}
syntaxreq {H44127} {} {} {
  When the form of an UPDATE statement is "UPDATE OR <i>algorithm</i>" 
  then the null- and uniqueness-conflict resolution algorithms shall all
  change to <i>algorithm</i>.
}






</tcl>

<h3>3.4 SELECT</h3>

<tcl>
syntaxreq {H45000} {} {} {
  The SQLite parser shall accept SELECT statements that
  conform to the following syntax:
} {
  cmd ::= select.
................................................................................
syntaxreq {H45027} {} {} {
  The preparation of a statement containing a <i>limit</i>
  shall fail with an error if any <i>expr</i> within the <i>limit</i>
  does not evaluate to a compile-time integer.
}
</tcl>





























<h2>4.0 Other Language Elements</h2>

<h3>4.1 VACUUM</h3>

<tcl>
syntaxreq {H44200} {} {} {
  The SQLite parser shall accept VACUUM statements that
  conform to the following syntax:
} {
  cmd ::= VACUUM.
  cmd ::= VACUUM name.
}
</tcl>

<h3>4.2 ANALYZE</h3>

<tcl>
syntaxreq {H44300} {} {} {
  The SQLite parser shall accept ANALYZE statements
  that conform to the following syntax:
} {
  cmd ::= ANALYZE.
................................................................................
  The preparation of an ANALYZE statement
  shall fail with an error if
  the <i>fullname</i> is included and does not evaluate to
  either an individual table name or the name of a database.
}
</tcl>

<h3>4.3 REINDEX</h3>

<tcl>
syntaxreq {H44400} {} {} {
  The SQLite parser shall accept REINDEX statements
  that conform to the following syntax:
} {
  cmd ::= REINDEX.
................................................................................
  shall fail with an error if
  the <i>fullname</i> is included and does not evaluate to
  either an individual table name or the name of a database
  or the name of a collating sequence.	
}
</tcl>

<h3>4.4 PRAGMA</h3>

<tcl>
syntaxreq {H46000} {} {} {
  The SQLite parser shall accept PRAGMA statements
  that conform to the following syntax:
} {
  cmd ::= PRAGMA fullname EQ DELETE.
................................................................................
  the PRAGMA verb.
} {
  The evaluation of a PRAGMA statement with an unknown verb shall
  be a silent no-op.
}
</tcl>

<h3>4.5 ATTACH</h3>

<tcl>
syntaxreq {H44500} {} {
  The SQLite parser shall accept ATTACH statements
  that conform to the following syntax:
} {
  cmd ::= ATTACH database_kw expr AS expr.
................................................................................
syntaxreq {H44509} {} {} {
  The preparation of an ATTACH statement shall fail with an error
  if the second <i>expr</i> evaluates to the name of a database
  that is already attached to the database connection.
}
</tcl>

<h3>4.6 DETACH</h3>

<tcl>
syntaxreq {H44600} {} {} {
  The SQLite parser shall accept DETACH statements
  that conform to the following syntax:
} {
  cmd ::= DETACH database_kw expr.
................................................................................
syntaxreq {H44609} {} {} {
  The preparation of an DETACH statement shall fail with an error
  if the <i>expr</i> does not evaluate to the 
  name of an attached database other than "temp" or "main".
}
</tcl>

<h3>4.7 EXPLAIN</h3>

<tcl>
syntaxreq {H44700} {} {} {
  The SQLite parser shall accept the EXPLAIN keyword as a prefix
  to other valid SQL statements, as shown by the following syntax:
} {
  sql_statement ::= EXPLAIN cmd SEMI.
}
</tcl>

<h3>4.8 EXPLAIN QUERY PLAN</h3>

<tcl>
syntaxreq {H44800} {} {} {
  The SQLite parser shall accept EXPLAIN QUERY PLAY as a prefix
  to other valid SQL statements, as shown by the following syntax:
} {
  sql_statement ::= EXPLAIN QUERY PLAN cmd SEMI.
}
</tcl>

<h2>5.0 Common Language Subelements</h2>

<h3>5.1 Expressions</h3>

<tcl>
syntaxreq {H47000} {} {} {
  The SQLite parser shall accept expressions that
  conform to the following syntax:
} {
  expr ::= BITNOT expr.
  expr ::= CASE case_operand case_exprlist case_else END.
  expr ::= CAST LP expr AS typetoken RP.
  expr ::= EXISTS LP select RP.
  expr ::= function_name LP STAR RP.
  expr ::= function_name LP distinct exprlist RP.
  expr ::= ID.
  expr ::= JOIN_KW.
  expr ::= LP expr RP.
  expr ::= LP select RP.
  expr ::= MINUS expr.
  expr ::= NOT expr.
  expr ::= PLUS expr.
  expr ::= RAISE LP IGNORE RP.
  expr ::= RAISE LP ABORT COMMA name RP.
................................................................................
  expr ::= expr NOT IN LP exprlist RP.
  expr ::= expr NOT IN LP select RP.
  expr ::= expr NOT IN fullname.
  expr ::= expr LIKE_KW expr escape.
  expr ::= expr MATCH expr escape.
  expr ::= expr NOT LIKE_KW expr escape.
  expr ::= expr NOT MATCH expr escape.
  expr ::= databasename DOT tablename DOT columnname.
  expr ::= tablename DOT columnname.
  expr ::= term.
  term ::= CTIME_KW.
  term ::= INTEGER.
  term ::= FLOAT
  term ::= BLOB.
  term ::= NULL.
  term ::= STRING.
................................................................................
  The AND operator shall have precedence over the OR operator.
}
syntaxreq {H47051} {} {} {
  Operators of equal precedence shall group from right to left.
}
</tcl>

<h3>5.2 Functions</h3>
<h4>5.2.1 Core Scalar Functions</h4>
<h4>5.2.2 Date and Time Functions</h4>
<h4>5.2.3 Aggregate Functions</h4>

<h3>5.3 Symbolic Names</h3>

<tcl>
syntaxreq {H49100} {} {} {
  The SQLite parser shall accept names, fullnames, and identifiers
  that conform to the following syntax:
} {
  name ::= ID.
................................................................................
  fullname ::= objectname.
  fullname ::= databasename DOT objectname.
  objectname ::= name.
  databasename ::= name.
  columnname ::= name.
  identifier ::= ID.
  identifier ::= STRING.
}









</tcl>







>
>
>
>







 







|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|







 







|







 







|







 







|

|







 







|







 







>
|
<
>
>
|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|
|










|












|

|







 







>
>
>
>
>
>


|







 







|













|






|









|







 







>
>
>
>
>
>


|







 







>
>
>
>
>
>


|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|











|







 







|







 







|







 







|







 







|







 







|










|










|

|












<
<







 







|
<







 







<
<
<
<
<
|







 








>
>
>
>
>
>
>
>
>

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
..
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
...
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
...
599
600
601
602
603
604
605
606
607

608
609
610
611
612
613
614
615
616
617
...
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
...
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
...
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
...
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
...
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
...
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
...
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
....
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
....
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
....
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
....
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
....
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
....
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
....
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
....
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
....
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
....
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
....
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
....
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
....
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626


1627
1628
1629
1630
1631
1632
1633
....
1666
1667
1668
1669
1670
1671
1672
1673

1674
1675
1676
1677
1678
1679
1680
....
1751
1752
1753
1754
1755
1756
1757





1758
1759
1760
1761
1762
1763
1764
1765
....
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
automatically, by [sqlite3_step()].  So even though it is reasonable
to think about preparation as being a function of [sqlite3_prepare_v2()]
and its companions and evaluation as being a function of
[sqlite3_step()], the reader should keep in mind that
[sqlite3_step()] might also sometimes do preparations following
schema changes.</p>

<h2>1.0 General Requirements</h2>

<h3>1.1 Parser operation</h3>

<tcl>
syntaxreq {H42000} {} {
  SQLite expects all statements to be terminated by a semicolon.
  If a statement is submitted to SQLite that does not end in a
  semicolon, then a semicolon is added automatically by the tokenizer.
  (See [H41040].)
} {
................................................................................
  robustness in the case where a seldom-used keyword is accidentally
  used as the name of a table or column.
} {
  A token received by the parser shall be converted into an ID token
  if the original token value would have resulted in a syntax error,
  a token value of ID will allow the parse to continue,
  and if the original token value was one of:
     ABORT
     AFTER
     ANALYZE
     ASC
     ATTACH
     BEFORE
     BEGIN
     CASCADE
     CAST
     CONFLICT
     CTIME_KW
     DATABASE
     DEFERRED
     DESC
     DETACH
     EACH
     END
     EXCEPT
     EXCLUSIVE
     EXPLAIN
     FAIL
     FOR
     IF
     IGNORE
     IMMEDIATE
     INITIALLY
     INSTEAD
     INTERSECT
     KEY
     LIKE_KW
     MATCH
     OF
     OFFSET
     PLAN
     PRAGMA
     QUERY
     RAISE
     REINDEX
     RENAME
     REPLACE
     RESTRICT
     ROW
     TEMP
     TRIGGER
     UNION
     VACUUM
     VIEW
     VIRTUAL
}
syntaxreq {H420012} {} {
  A second level of fallback allows any token to be converted into
  the token ANY.  The ANY token is used to gather arbitrary delimited
  token sequences, such as used as the arguments to the CREATE VIRTUAL
  TABLE command.
} {
................................................................................
  A token received by the parser shall be converted into an ANY token
  if the original token value would have resulted in a syntax error
  and if a token value of ANY will allow the parse to continue.
}
 
</tcl>

<h3>1.2 Name Contexts</h3>

<p>Expressions in SQL statements often contain identifiers that refer
to columns in tables or views or to columns in the result set of a 
SELECT statement.
The process of determining which column an identifier refers to
is called "name resolution".</p>

<p>Names are resolved with the aid of a "name context".
A name context is a set of tables and views and result set expressions
to which an expression identifier can refer.  A single name context
is a hierarchy of "name context layers".  Subqueries have their own
name context layer (called the "inner layer") that is distinct from the
name context layer (called the "outer layer") associated with the overall 
statement.  In an SQL statement with multiple levels of tested subqueries,
there can be multiple name context layers in the name context.  In
other words, a complete name context is an ordered list of name
context layers.</p>

<p>Within a name context a "source" is a table or view containing columns
that expression names can match against.  Every source has a "canonical
name" which is the name of the table or view as it appears in the schema.
A source might also have an "aliased name" resulting from an AS clause.
The "source name" is the aliased name if it exists, otherwise the source
name is the canonical name.</p>

<p>Each name context layer has a "source set" and a "result set",
either or both of which can be empty.  The source set is an ordered set
of sources.  The result set is an ordered set of expressions with
an optional alias on each expression.  Roughly speaking, a source set
corresponds to the FROM clause of a SELECT statement and the result set
corresponds to the list of expressions that form the result set of the
SELECT statement.</p>

<p>A "empty name context" is a name context comprised of a single
name context layer in which both the source set and the result set are
empty.</p>

<h2>2.0 Transaction Control</h2>

<h3>2.1 BEGIN</h3>

<tcl>
syntaxreq {H42010} {} {} {
  The SQLite parser shall accept BEGIN statements
  that conform to the following syntax:
} {
  cmd ::= BEGIN transaction_type transaction_name.
................................................................................
  lock to be obtained for all underlying database files.
}
</tcl>
<p>The <i>transaction_name</i> clause of a BEGIN statement is
provided for syntactic compatibility to other SQL database engines.
The <i>transaction_name</i> clause is silently ignored.</p>

<h3>2.2 COMMIT</h3>

<tcl>
syntaxreq {H42110} {} {} {
  SQLite shall accept the following COMMIT statement syntax:
} {
  cmd ::= COMMIT transaction_name.
  cmd ::= END transaction_name.
................................................................................
The <i>transaction_name</i> clause is silently ignored.</p>

<p>The COMMIT and END statements are aliases for one another and
accomplish exactly the same thing.  One is merely a different way
of expression the other.</p>


<h3>2.3 ROLLBACK</h3>

<tcl>
syntaxreq {H42210} {} {} {
  The SQLite parser shall accept ROLLBACK statements
  that conform to the following syntax:
} {
  cmd ::= ROLLBACK transaction_name.
................................................................................
}
</tcl>
<p>The <i>transaction_name</i> clause of a BEGIN statement is
provided for syntactic compatibility to other SQL database engines.
The <i>transaction_name</i> clause is silently ignored.</p>


<h2>3.0 Data Definition Language (DDL)</h2>

<h3>3.1 CREATE TABLE</h3>

<tcl>
syntaxreq {H42310} {} {} {
  The SQLite parser shall accept CREATE TABLE statements
  that conform to the following syntax:
} {
  cmd ::= CREATE temp TABLE ifnotexists fullname table_definition.
................................................................................
syntaxreq {H42334} {} {} {
  The preparation of a CREATE TABLE statement shall fail with an error if the
  the <i>databasename</i> references a database that is not
  attached to the same [database connection].
}
</tcl>

<h4>3.1.1 CREATE TABLE column definitions</h4>

<tcl>
syntaxdef [list {ordinary CREATE TABLE statement} {CREATE TABLE AS statement}] {
  There are two varieties of CREATE TABLE statements.  The most common form
  specifies the names of all columns in the table together with datatype
  and constraint information.  This first form is called a
  "ordinary CREATE TABLE statement".  The second form of CREATE TABLE
................................................................................
  CHECK constraint that uses a subquery shall fail with an error.
}
syntaxreq {H42517} {} {} {
  The preparation of a CREATE TABLE statement that contains a
  CHECK constraint that uses a parameter shall fail with an error.
}
syntaxreq {H42518} {} {} {
  Name resolution of the <i>expr</i> with each CHECK constraint of
  a CREATE TABLE statement shall be carried out using a name context

  with an empty result set and a source set holding
  single source element that is the
  table being created.
}
syntaxreq {H42521} {} {} {
  The preparation of a CREATE TABLE statement that contains a
  DEFAULT constraint with an non-constant expression
  shall fail with an error.
}
syntaxreq {H42536} {} {
................................................................................
  fkaction ::= RESTRICT.
  initially_deferred_clause ::= .
  initially_deferred_clause ::= INITIALLY DEFERRED.
  initially_deferred_clause ::= INITIALLY IMMEDIATE.
}
</tcl>

<h4>3.1.2 CREATE TABLE AS</h4>

<tcl>
syntaxreq {H42610} {} {
  The CREATE TABLE AS statement generates a new table to hold the
  result set of a SELECT statement.
} {
  The SQLite parser shall accept the following syntax for creating new
................................................................................
  All columns in a table generated by a CREATE TABLE AS statement
  shall have a default collating sequence of BINARY.
}

</tcl>


<h3>3.2 DROP TABLE</h3>

<tcl>
syntaxreq {H42700} {} {} {
  The SQLite parser shall accept DROP TABLE statements
  that conform to the following syntax.
} {
  cmd ::= DROP TABLE ifexists fullname.
................................................................................
}
syntaxreq {H42724} {} {} {
  The preparation of a DROP TABLE statement shall fail with an
  error if <i>fullname</i> is a system table.
}
</tcl>

<h3>3.3 CREATE INDEX</h3>

<tcl>
syntaxreq {H42800} {} {} {
  The SQLite parser shall accept CREATE INDEX statements that 
  conform to the following syntax:
} {
  cmd ::= CREATE unique INDEX ifnotexists fullname ON tablename LP indexlist RP.
................................................................................
syntaxreq {H42842} {} {} {
  The preparation of a CREATE INDEX statement shall fail with an error
  if the <i>tablename</i> refers to a system table.
}

</tcl>

<h3>3.4 DROP INDEX</h3>

<tcl>
syntaxreq {H42900} {} {} {
  The SQLite parser shall accept DROP INDEX statements 
  that conform to the following syntax:
} {
  cmd ::= DROP INDEX ifexists fullname.
................................................................................
syntaxreq {H42916} {} {} {
  The successful evaluation of a DROP INDEX statement shall cause
  the index identified by <i>fullname</i> to be removed from its
  database and discarded.
}
</tcl>

<h3>3.5 CREATE VIEW</h3>

<tcl>
syntaxreq {H43100} {} {} {
  The SQLite parser shall accept CREATE VIEW statements 
  that conform to the following syntax:
} {
  cmd ::= CREATE temp VIEW ifnotexists fullname AS select.
................................................................................
  Each column name in a table generated by a CREATE VIEW
  statement shall have an arbitrary suffix appended to its basename
  if and only if such a suffix is necessary to make the name
  distinct from all preceding column names in the view.
}
</tcl>

<h3>3.6 DROP VIEW</h3>

<tcl>
syntaxreq {H43200} {} {} {
  The SQLite parser shall accept DROP VIEW statements
  that conform to the following syntax:
} {
  cmd ::= DROP VIEW ifexists fullname.
................................................................................
syntaxreq {H43214} {} {} {
  The successful evaluation of a DROP VIEW statement shall cause
  all triggers attached to the view identified by <i>fullname</i>
  to be removed from their database and discarded.
}
</tcl>

<h3>3.7 CREATE TRIGGER</h3>

<tcl>
syntaxreq {H43300} {} {} {
  The SQLite parser shall accept CREATE TRIGGER statements
  that conform to the following syntax:
} {
  cmd ::= CREATE temp TRIGGER ifnotexists fullname trigger trigger_body.
................................................................................
  The preparation of a CREATE TRIGGER statement shall fail with an error
  if the <i>trigger_target</i> is a system table.
}

</tcl>


<h3>3.8 DROP TRIGGER</h3>

<tcl>
syntaxreq {H43500} {} {} {
  The SQLite parser shall accept DROP TRIGGER statements
  that conform to the following syntax:
} {
  cmd ::= DROP TRIGGER ifexists fullname.
................................................................................
syntaxreq {H43514} {} {} {
  The successful evaluation of a DROP TRIGGER statement shall cause
  all triggers attached to the trigger identified by <i>fullname</i>
  to be removed from their database and discarded.
}
</tcl>

<h3>3.9 CREATE VIRTUAL TABLE</h3>

<tcl>
syntaxreq {H43600} {} {} {
  The SQLite parser shall accept CREATE VIRTUAL TABLE statements
  that conform to the following syntax.
} {
  cmd ::= CREATE VIRTUAL TABLE fullname USING name vtab_arg_list.
................................................................................
  vtab_arg_token ::= ANY.
  vtab_arg_token ::= LP anylist RP.
  anylist ::= .
  anylist ::= anylist ANY.
}
</tcl>

<h3>3.10 ALTER TABLE</h3>
<h4>3.11 ALTER TABLE RENAME</h4>

<tcl>
syntaxreq {H43700} {} {} {
  The SQLite parser shall accept ALTER TABLE RENAME statements
  that conform to the following syntax:
} {
  cmd ::= ALTER TABLE fullname RENAME TO name.
}
</tcl>

<h4>3.12 ALTER TABLE ADD COLUMN</h4>

<tcl>
syntaxreq {H43750} {} {} {
  The SQLite parser shall accept ALTER TABLE ADD COLUMN statements
  that conform to the following syntax:
} {
  cmd ::= ALTER TABLE fullname ADD column_keyword column.
  column_keyword ::= .
  column_keyword ::= COLUMNKW.
}
</tcl>

<h2>4.0 Data Manipulation Language (DML)</h2>

<h3>4.1 INSERT</h3>
<tcl>
syntaxreq {H43810} {} {} {
  The SQLite parser shall accept INSERT statements that
  conform to the following syntax:
} {
  cmd ::= insert_cmd INTO fullname columnlist_opt insert_content.
  insert_cmd ::= INSERT.
................................................................................
  change to REPLACE.
}
syntaxreq {H43827} {} {} {
  When the form of an INSERT statement is "INSERT OR <i>algorithm</i>" 
  then the null- and uniqueness-conflict resolution algorithms shall all
  change to <i>algorithm</i>.
}
syntaxreq {H43831} {} {} {
  Name resolution in the <i>insert_content</i> term of an INSERT statement
  shall be carried out using a name context
  with an empty result set and a source set holding
  single source element that is the <i>fullname</i> table.
}
</tcl>

<h4>4.1.1 INSERT VALUE</h4>
<tcl>
syntaxreq {H43840} {} {} {
  The SQLite parser shall accept INSERT VALUE statements that
  conform to the following syntax:
} {
  insert_content ::= VALUES LP exprlist RP.
}
................................................................................
  error if the <i>columnlist</i> element does not exists and the number of 
  entries in the <i>exprlist</i> is different
  from the number of columns in the table or view identified by
  <i>fullname</i>.
}
</tcl>

<h4>4.1.2 INSERT SELECT</h4>
syntaxreq {H43870} {} {} {
  The SQLite parser shall accept INSERT SELECT statements that
  conform to the following syntax:
} {
  insert_contents ::= select.
}
syntaxreq {H43873} {} {} {
  The preparation of an INSERT SELECT statement shall fail with an
  error if the <i>columnlist</i> element exists and the number of 
  entries in the <i>instcollist</i> is different
  from the number of columns in the result set of <i>select</i>.
}
syntaxreq {H43876} {} {} {
  The preparation of an INSERT SELECT statement shall fail with an
  error if the <i>columnlist</i> element does not exists and the number of 
  columns in the result set of the <i>select</i> is different
  from the number of columns in the table or view identified by
  <i>fullname</i>.
}
</tcl>
<h4>4.1.3 INSERT DEFAULT</h4>
<tcl>
syntaxreq {H43890} {} {} {
  The SQLite parser shall accept INSERT DEFAULT statements that
  conform to the following syntax:
} {
  insert_contents ::= DEFAULT VALUES.
}
</tcl>

<h3>4.2 DELETE</h3>

<tcl>
syntaxreq {H43900} {} {} {
  The SQLite parser shall accept DELETE statements that
  conform to the following syntax:
} {
  cmd ::= DELETE FROM fullname where.
................................................................................
}
syntaxreq {H43907} {} {} {
  The preparation of a DELETE statement shall fail with an error if
  the <i>objectname</i> of the <i>fullname</i> element is "sqlite_master"
  or "sqlite_temp_master" and the database connection is not in
  writeable_schema mode.
}
syntaxreq {H43911} {} {} {
  Name resolution in the <i>where</i> term of a DELETE statement
  shall be carried out using a name context
  with an empty result set and a source set holding
  single source element that is the <i>fullname</i> table.
}
</tcl>

<h3>4.3 UPDATE</h3>

<tcl>
syntaxreq {H44100} {} {} {
  The SQLite parser shall accept UPDATE statements that
  conform to the following syntax:
} {
  cmd ::= update_cmd fullname SET setlist where.
................................................................................
  be used.
}
syntaxreq {H44127} {} {} {
  When the form of an UPDATE statement is "UPDATE OR <i>algorithm</i>" 
  then the null- and uniqueness-conflict resolution algorithms shall all
  change to <i>algorithm</i>.
}
syntaxreq {H44131} {} {} {
  Name resolution in the <i>where</i> term of a DELETE statement
  shall be carried out using a name context
  with an empty result set and a source set holding
  single source element that is the <i>fullname</i> table.
}
</tcl>

<h3>4.4 SELECT</h3>

<tcl>
syntaxreq {H45000} {} {} {
  The SQLite parser shall accept SELECT statements that
  conform to the following syntax:
} {
  cmd ::= select.
................................................................................
syntaxreq {H45027} {} {} {
  The preparation of a statement containing a <i>limit</i>
  shall fail with an error if any <i>expr</i> within the <i>limit</i>
  does not evaluate to a compile-time integer.
}
</tcl>

<h4>4.4.1 Name resolution with SELECT statements</h4>

<tcl>
syntaxreq {H45103} {} {} {
  Name resolution of a top-level SELECT statement shall use an
  empty name context.
}
syntaxreq {H45106} {} {} {
  Name context of a <i>query</i> term shall be
  constructed by adding a new inner name context layer
  to the name context of the construct containing the <i>query</i>
  term.
}
syntaxreq {H45109} {} {} {
  Name resolution of the <i>resultset</i> of a <i>query</i> shall
  use the name context of the <i>query</i> with an empty result
  set and the source set
  configured to the <i>from</i> clause of the query.
}
syntaxreq {H45112} {} {} {
  Name resolution of all child terms of a <i>query</i> other than
  <i>resultset</i> child shall use the name context of the <i>query</i>
  with the result set configured to be the <i>resultset</i> clause of the
  <i>query</i> and with the source set configured to be the
  <i>from</i> clause of the query.
}
</tcl>

<h2>5.0 Other Language Elements</h2>

<h3>5.1 VACUUM</h3>

<tcl>
syntaxreq {H44200} {} {} {
  The SQLite parser shall accept VACUUM statements that
  conform to the following syntax:
} {
  cmd ::= VACUUM.
  cmd ::= VACUUM name.
}
</tcl>

<h3>5.2 ANALYZE</h3>

<tcl>
syntaxreq {H44300} {} {} {
  The SQLite parser shall accept ANALYZE statements
  that conform to the following syntax:
} {
  cmd ::= ANALYZE.
................................................................................
  The preparation of an ANALYZE statement
  shall fail with an error if
  the <i>fullname</i> is included and does not evaluate to
  either an individual table name or the name of a database.
}
</tcl>

<h3>5.3 REINDEX</h3>

<tcl>
syntaxreq {H44400} {} {} {
  The SQLite parser shall accept REINDEX statements
  that conform to the following syntax:
} {
  cmd ::= REINDEX.
................................................................................
  shall fail with an error if
  the <i>fullname</i> is included and does not evaluate to
  either an individual table name or the name of a database
  or the name of a collating sequence.	
}
</tcl>

<h3>5.4 PRAGMA</h3>

<tcl>
syntaxreq {H46000} {} {} {
  The SQLite parser shall accept PRAGMA statements
  that conform to the following syntax:
} {
  cmd ::= PRAGMA fullname EQ DELETE.
................................................................................
  the PRAGMA verb.
} {
  The evaluation of a PRAGMA statement with an unknown verb shall
  be a silent no-op.
}
</tcl>

<h3>5.5 ATTACH</h3>

<tcl>
syntaxreq {H44500} {} {
  The SQLite parser shall accept ATTACH statements
  that conform to the following syntax:
} {
  cmd ::= ATTACH database_kw expr AS expr.
................................................................................
syntaxreq {H44509} {} {} {
  The preparation of an ATTACH statement shall fail with an error
  if the second <i>expr</i> evaluates to the name of a database
  that is already attached to the database connection.
}
</tcl>

<h3>5.6 DETACH</h3>

<tcl>
syntaxreq {H44600} {} {} {
  The SQLite parser shall accept DETACH statements
  that conform to the following syntax:
} {
  cmd ::= DETACH database_kw expr.
................................................................................
syntaxreq {H44609} {} {} {
  The preparation of an DETACH statement shall fail with an error
  if the <i>expr</i> does not evaluate to the 
  name of an attached database other than "temp" or "main".
}
</tcl>

<h3>5.7 EXPLAIN</h3>

<tcl>
syntaxreq {H44700} {} {} {
  The SQLite parser shall accept the EXPLAIN keyword as a prefix
  to other valid SQL statements, as shown by the following syntax:
} {
  sql_statement ::= EXPLAIN cmd SEMI.
}
</tcl>

<h3>5.8 EXPLAIN QUERY PLAN</h3>

<tcl>
syntaxreq {H44800} {} {} {
  The SQLite parser shall accept EXPLAIN QUERY PLAY as a prefix
  to other valid SQL statements, as shown by the following syntax:
} {
  sql_statement ::= EXPLAIN QUERY PLAN cmd SEMI.
}
</tcl>

<h2>6.0 Common Language Subelements</h2>

<h3>6.1 Expressions</h3>

<tcl>
syntaxreq {H47000} {} {} {
  The SQLite parser shall accept expressions that
  conform to the following syntax:
} {
  expr ::= BITNOT expr.
  expr ::= CASE case_operand case_exprlist case_else END.
  expr ::= CAST LP expr AS typetoken RP.
  expr ::= EXISTS LP select RP.
  expr ::= function_name LP STAR RP.
  expr ::= function_name LP distinct exprlist RP.


  expr ::= LP expr RP.
  expr ::= LP select RP.
  expr ::= MINUS expr.
  expr ::= NOT expr.
  expr ::= PLUS expr.
  expr ::= RAISE LP IGNORE RP.
  expr ::= RAISE LP ABORT COMMA name RP.
................................................................................
  expr ::= expr NOT IN LP exprlist RP.
  expr ::= expr NOT IN LP select RP.
  expr ::= expr NOT IN fullname.
  expr ::= expr LIKE_KW expr escape.
  expr ::= expr MATCH expr escape.
  expr ::= expr NOT LIKE_KW expr escape.
  expr ::= expr NOT MATCH expr escape.
  expr ::= rtvalue.

  expr ::= term.
  term ::= CTIME_KW.
  term ::= INTEGER.
  term ::= FLOAT
  term ::= BLOB.
  term ::= NULL.
  term ::= STRING.
................................................................................
  The AND operator shall have precedence over the OR operator.
}
syntaxreq {H47051} {} {} {
  Operators of equal precedence shall group from right to left.
}
</tcl>






<h3>6.2 Symbolic Names</h3>

<tcl>
syntaxreq {H49100} {} {} {
  The SQLite parser shall accept names, fullnames, and identifiers
  that conform to the following syntax:
} {
  name ::= ID.
................................................................................
  fullname ::= objectname.
  fullname ::= databasename DOT objectname.
  objectname ::= name.
  databasename ::= name.
  columnname ::= name.
  identifier ::= ID.
  identifier ::= STRING.
}
syntaxreq {H49103} {} {} {
  The SQLite parser shall accept <i>rtvalue</i> elements of an
  <i>expr</i> that conform to the following syntax:
} {
  rtvalue ::= databasename DOT tablename DOT columnname.
  rtvalue ::= tablename DOT columnname.
  rtvalue ::= ID.
  rtvalue ::= JOIN_KW.
}
</tcl>