From: drh Date: Sun, 5 Feb 2006 18:55:20 +0000 (+0000) Subject: Detect circularly defined views and issue an error message. Ticket #1658. (CVS 3055) X-Git-Tag: version-3.6.10~3112 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb8de2dc072e6ef329c6a7c70fb1557d8821c709;p=thirdparty%2Fsqlite.git Detect circularly defined views and issue an error message. Ticket #1658. (CVS 3055) FossilOrigin-Name: f5341529d0cdbd63ce4c33606858158b6093969a --- diff --git a/manifest b/manifest index 0313f5bbbf..ac1d039e36 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Typecast\sto\ssilence\s(incorrect)\scompiler\swarning.\s(CVS\s3054) -D 2006-02-01T14:39:54 +C Detect\scircularly\sdefined\sviews\sand\sissue\san\serror\smessage.\s\sTicket\s#1658.\s(CVS\s3055) +D 2006-02-05T18:55:20 F Makefile.in 5d8dff443383918b700e495de42ec65bc1c8865b F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -36,7 +36,7 @@ F src/attach.c d73a3505de3fb9e373d0a158978116c4212031d0 F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2 F src/btree.c f45f57e6cbd3b3db947cdd699db64e5215d20b2a F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184 -F src/build.c feaa61e769d7887ffeaa060d746638c7b3e994ef +F src/build.c d959aa9c2ab9c79d3d872ce91ef719698658210c F src/callback.c 1bf497306c32229114f826707054df7ebe10abf2 F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675 F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e @@ -274,7 +274,7 @@ F test/utf16.test f9c13f4e2b48c42d0bfc96647d82fdf7bc11fc55 F test/vacuum.test 37f998b841cb335397c26d9bbc3457182af2565f F test/vacuum2.test 5aea8c88a65cb29f7d175296e7c819c6158d838c F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102 -F test/view.test 354bd0ceb363e88da8ce98fb47e18550d7594b13 +F test/view.test 7606d16559f8d5830f209185b9ce8d754be288d2 F test/where.test ee7c9a6659b07e1ee61177f6e7ff71565ee2c9df F test/where2.test fde821b9cb8e20d53ccd2e71482b063c5b1e222a F test/where3.test 6356013ce1c8ddc22a65c880dfff2b2c985634cb @@ -350,7 +350,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 3861377bd93453161dfe78a8c1d7a9f919108c8f -R 78a86cbfd57b747b084835fa422857b1 +P 3a04fc45ccc31f2009be812a9c9057844cf4ae3b +R 968f57515475ab9a4a37d0ebf71134f3 U drh -Z 9d78210638014b4103d9be21859c7794 +Z a1def34602e0d016ada75d168beb6d52 diff --git a/manifest.uuid b/manifest.uuid index 15f9aff1ec..d529bea34e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3a04fc45ccc31f2009be812a9c9057844cf4ae3b \ No newline at end of file +f5341529d0cdbd63ce4c33606858158b6093969a \ No newline at end of file diff --git a/src/build.c b/src/build.c index a25381250f..9caf713e7f 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.383 2006/01/24 12:09:19 danielk1977 Exp $ +** $Id: build.c,v 1.384 2006/02/05 18:55:20 drh Exp $ */ #include "sqliteInt.h" #include @@ -1662,12 +1662,10 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ ** Actually, this error is caught previously and so the following test ** should always fail. But we will leave it in place just to be safe. */ -#if 0 if( pTable->nCol<0 ){ sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName); return 1; } -#endif assert( pTable->nCol>=0 ); /* If we get this far, it means we need to compute the table names. diff --git a/test/view.test b/test/view.test index 1b73aed167..f6ddb2202b 100644 --- a/test/view.test +++ b/test/view.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing VIEW statements. # -# $Id: view.test,v 1.28 2006/01/14 08:02:29 danielk1977 Exp $ +# $Id: view.test,v 1.29 2006/02/05 18:55:21 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -459,4 +459,13 @@ do_test view-13.1 { } } {1 {view v13 cannot reference objects in database two}} +# Ticket #1658 +# +do_test view-14.1 { + catchsql { + CREATE TEMP VIEW t1 AS SELECT a,b FROM t1; + SELECT * FROM temp.t1; + } +} {1 {view t1 is circularly defined}} + finish_test