]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix for bug #3: Allow VIEW as a column name. Also allow COPY. (CVS 507)
authordrh <drh@noemail.net>
Sat, 30 Mar 2002 15:26:50 +0000 (15:26 +0000)
committerdrh <drh@noemail.net>
Sat, 30 Mar 2002 15:26:50 +0000 (15:26 +0000)
FossilOrigin-Name: d2bdc0feeb3a3595850f40ab211df7a3963d6c30

manifest
manifest.uuid
src/parse.y
test/misc1.test

index 4e735cf840c4e6b034d96c8b36759d60e0511ba8..2f1c0d46b092a95a805329db47235f8bc6864856 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Describe\sthe\sdifference\sbetween\sthe\sbinary\sRPMs\sin\sthe\sdownload.html\sfile.\s(CVS\s506)
-D 2002-03-30T14:15:52
+C Fix\sfor\sbug\s#3:\sAllow\sVIEW\sas\sa\scolumn\sname.\s\sAlso\sallow\sCOPY.\s(CVS\s507)
+D 2002-03-30T15:26:51
 F Makefile.in 50f1b3351df109b5774771350d8c1b8d3640130d
 F Makefile.template 89e373b2dad0321df00400fa968dc14b61a03296
 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@@ -35,7 +35,7 @@ F src/os.c 5ab8b6b4590d0c1ab8e96c67996c170e4462e0fc
 F src/os.h 4a361fccfbc4e7609b3e1557f604f94c1e96ad10
 F src/pager.c f136f5ba82c896d500a10b6a2e5caea62abf716b
 F src/pager.h 6fddfddd3b73aa8abc081b973886320e3c614f0e
-F src/parse.y e6f300a355459fb29a71c30246be4cdb6ed5b6a7
+F src/parse.y a0943e2774c7b0cab608640df1126f6c3ae39e90
 F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d
 F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
 F src/select.c 9323800e2937e84b52c198fffc51995d822b1779
@@ -76,7 +76,7 @@ F test/lock.test 19593689260c419efe7ced55b1418653a4b7bcd1
 F test/main.test 1626345b5f630c5398eede500d9354813b76b0fd
 F test/malloc.test 70fdd0812e2a57eb746aaf015350f58bb8eee0b1
 F test/minmax.test fb6ab400271ae1f5bc88617c2882f2f081ea8e6d
-F test/misc1.test 84a3d8e8c47af327fbfa1bca2b29192ae5432240
+F test/misc1.test a03214118429b40ca5548bc1fae0ebd5c34dabe6
 F test/notnull.test b1f3e42fc475b0b5827b27b2e9b562081995ff30
 F test/pager.test b0c0d00cd5dce0ce21f16926956b195c0ab5044c
 F test/pragma.test 0b9675ef1f5ba5b43abfa337744445fc5b01a34a
@@ -131,7 +131,7 @@ F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f
 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279
 F www/tclsqlite.tcl 829b393d1ab187fd7a5e978631b3429318885c49
 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P 57d4c7704794d0a28cbf67be3f90dbf81bf3b05d
-R a7e657944cab421e84233e6c131e8395
+P 8ce9a1fad2d8b20876b0557fa57515e0df74ed05
+R e3e6743fe3cd6441517378726496ed2c
 U drh
-Z 61ccaedd9c5efd48bb2825a1aa5ac5d0
+Z 8268c6d7053c63093cf4628188d6e593
index aaf748c7d53dcc7e5b7f75d81e8171ad22f66d27..431a8671d4fa562bb7f0b14dc2b822c71a6638bc 100644 (file)
@@ -1 +1 @@
-8ce9a1fad2d8b20876b0557fa57515e0df74ed05
\ No newline at end of file
+d2bdc0feeb3a3595850f40ab211df7a3963d6c30
\ No newline at end of file
index 2343d04108c7ac216ac328a8074c2f8837425531..2ef406fde08a16ff9becf33bad417f5d33d7561d 100644 (file)
@@ -14,7 +14,7 @@
 ** the parser.  Lemon will also generate a header file containing
 ** numeric codes for all of the tokens.
 **
-** @(#) $Id: parse.y,v 1.58 2002/03/24 13:13:29 drh Exp $
+** @(#) $Id: parse.y,v 1.59 2002/03/30 15:26:51 drh Exp $
 */
 %token_prefix TK_
 %token_type {Token}
@@ -97,24 +97,26 @@ columnid ::= ids(X).                {sqliteAddColumn(pParse,&X);}
 // an abbreviation of "description").
 //
 %type id {Token}
-id(A) ::= DESC(X).       {A = X;}
+id(A) ::= ABORT(X).      {A = X;}
 id(A) ::= ASC(X).        {A = X;}
-id(A) ::= DELIMITERS(X). {A = X;}
-id(A) ::= EXPLAIN(X).    {A = X;}
-id(A) ::= VACUUM(X).     {A = X;}
 id(A) ::= BEGIN(X).      {A = X;}
-id(A) ::= END(X).        {A = X;}
-id(A) ::= PRAGMA(X).     {A = X;}
 id(A) ::= CLUSTER(X).    {A = X;}
+id(A) ::= CONFLICT(X).   {A = X;}
+id(A) ::= COPY(X).       {A = X;}
+id(A) ::= DELIMITERS(X). {A = X;}
+id(A) ::= DESC(X).       {A = X;}
+id(A) ::= END(X).        {A = X;}
+id(A) ::= EXPLAIN(X).    {A = X;}
+id(A) ::= FAIL(X).       {A = X;}
 id(A) ::= ID(X).         {A = X;}
-id(A) ::= TEMP(X).       {A = X;}
-id(A) ::= OFFSET(X).     {A = X;}
-id(A) ::= KEY(X).        {A = X;}
-id(A) ::= ABORT(X).      {A = X;}
 id(A) ::= IGNORE(X).     {A = X;}
+id(A) ::= KEY(X).        {A = X;}
+id(A) ::= OFFSET(X).     {A = X;}
+id(A) ::= PRAGMA(X).     {A = X;}
 id(A) ::= REPLACE(X).    {A = X;}
-id(A) ::= FAIL(X).       {A = X;}
-id(A) ::= CONFLICT(X).   {A = X;}
+id(A) ::= TEMP(X).       {A = X;}
+id(A) ::= VACUUM(X).     {A = X;}
+id(A) ::= VIEW(X).       {A = X;}
 
 // And "ids" is an identifer-or-string.
 //
index 8f058f2c66cc0460628efbac689f75d54fabefdd..7f28102a8403f127a8954530e09f23a9515c4b6c 100644 (file)
@@ -13,7 +13,7 @@
 # This file implements tests for miscellanous features that were
 # left out of other test files.
 #
-# $Id: misc1.test,v 1.4 2002/03/13 18:54:08 drh Exp $
+# $Id: misc1.test,v 1.5 2002/03/30 15:26:52 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -152,4 +152,39 @@ do_test misc1-5.2 {
   }
 } {1 2 3 4}
 
+# Certain keywords (especially non-standard keywords like "REPLACE") can
+# also be used as identifiers.  The way this works in the parser is that
+# the parser first detects a syntax error, the error handling routine
+# sees that the special keyword caused the error, then replaces the keyword
+# with "ID" and tries again.
+#
+# Check the operation of this logic.
+#
+do_test misc1-6.1 {
+  catchsql {
+    CREATE TABLE t4(
+      abort, asc, begin, cluster, conflict, copy, delimiters, desc, end,
+      explain, fail, ignore, key, offset, pragma, replace, temp,
+      vacuum, view
+    );
+  }
+} {0 {}}
+do_test misc1-6.2 {
+  catchsql {
+    INSERT INTO t4
+       VALUES(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);
+  }
+} {0 {}}
+do_test misc1-6.3 {
+  execsql {
+    SELECT * FROM t4
+  }
+} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19}
+do_test misc1-6.4 {
+  execsql {
+    SELECT abort+asc,max(key,pragma,temp) FROM t4
+  }
+} {3 17}
+     
+
 finish_test