Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix for ticket #100: Correctly handle ON and USING clauses of JOINs within a VIEW. (CVS 679) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
93710f7ed7e1baa6acbf4bc32982e046 |
User & Date: | drh 2002-07-16 02:05:44.000 |
Context
2002-07-16
| ||
17:22 | Fix for ticket #105: Fix the UPDATE command so that it works properly with indexed tables when there is a subquery in the WHERE clause. Add tests to verify correct operation. (CVS 680) (check-in: bbca16f88d user: drh tags: trunk) | |
02:05 | Fix for ticket #100: Correctly handle ON and USING clauses of JOINs within a VIEW. (CVS 679) (check-in: 93710f7ed7 user: drh tags: trunk) | |
2002-07-15
| ||
20:58 | Fix a syntax error in the tclsqlite.c file. (CVS 678) (check-in: 47997d7f3a user: drh tags: trunk) | |
Changes
Changes to src/expr.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** ** $Id: expr.c,v 1.78 2002/07/16 02:05:44 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** Construct a new expression node and return a pointer to it. Memory ** for this node is obtained from sqliteMalloc(). The calling function |
︙ | ︙ | |||
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | } void sqliteExprListMoveStrings(ExprList *pList, int offset){ int i; if( pList==0 ) return; for(i=0; i<pList->nExpr; i++){ sqliteExprMoveStrings(pList->a[i].pExpr, offset); } } void sqliteSelectMoveStrings(Select *pSelect, int offset){ if( pSelect==0 ) return; sqliteExprListMoveStrings(pSelect->pEList, offset); sqliteExprMoveStrings(pSelect->pWhere, offset); sqliteExprListMoveStrings(pSelect->pGroupBy, offset); sqliteExprMoveStrings(pSelect->pHaving, offset); sqliteExprListMoveStrings(pSelect->pOrderBy, offset); sqliteSelectMoveStrings(pSelect->pPrior, offset); } | > > > > > > > > > | 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 | } void sqliteExprListMoveStrings(ExprList *pList, int offset){ int i; if( pList==0 ) return; for(i=0; i<pList->nExpr; i++){ sqliteExprMoveStrings(pList->a[i].pExpr, offset); } } static void sqliteSrcListMoveStrings(SrcList *pSrc, int offset){ int i; if( pSrc==0 ) return; for(i=0; i<pSrc->nSrc; i++){ sqliteSelectMoveStrings(pSrc->a[i].pSelect, offset); sqliteExprMoveStrings(pSrc->a[i].pOn, offset); } } void sqliteSelectMoveStrings(Select *pSelect, int offset){ if( pSelect==0 ) return; sqliteExprListMoveStrings(pSelect->pEList, offset); sqliteSrcListMoveStrings(pSelect->pSrc, offset); sqliteExprMoveStrings(pSelect->pWhere, offset); sqliteExprListMoveStrings(pSelect->pGroupBy, offset); sqliteExprMoveStrings(pSelect->pHaving, offset); sqliteExprListMoveStrings(pSelect->pOrderBy, offset); sqliteSelectMoveStrings(pSelect->pPrior, offset); } |
︙ | ︙ |
Changes to test/view.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2002 February 26 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing VIEW statements. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2002 February 26 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing VIEW statements. # # $Id: view.test,v 1.8 2002/07/16 02:05:45 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test view-1.0 { execsql { CREATE TABLE t1(a,b,c); INSERT INTO t1 VALUES(1,2,3); |
︙ | ︙ | |||
209 210 211 212 213 214 215 | } {7 8 9 10 27} do_test view-6.2 { execsql { SELECT max(x), max(a), max(b), max(c), max(a+b+c) FROM v2; } } {11 12 13 14 39} | > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | } {7 8 9 10 27} do_test view-6.2 { execsql { SELECT max(x), max(a), max(b), max(c), max(a+b+c) FROM v2; } } {11 12 13 14 39} do_test view-7.1 { execsql { CREATE TABLE test1(id integer primary key, a); CREATE TABLE test2(id integer, b); INSERT INTO test1 VALUES(1,2); INSERT INTO test2 VALUES(1,3); CREATE VIEW test AS SELECT test1.id, a, b FROM test1 JOIN test2 ON test2.id=test1.id; SELECT * FROM test; } } {1 2 3} do_test view-7.2 { db close sqlite db test.db execsql { SELECT * FROM test; } } {1 2 3} do_test view-7.3 { execsql { DROP VIEW test; CREATE VIEW test AS SELECT test1.id, a, b FROM test1 JOIN test2 USING(id); SELECT * FROM test; } } {1 2 3} do_test view-7.4 { db close sqlite db test.db execsql { SELECT * FROM test; } } {1 2 3} do_test view-7.5 { execsql { DROP VIEW test; CREATE VIEW test AS SELECT test1.id, a, b FROM test1 NATURAL JOIN test2; SELECT * FROM test; } } {1 2 3} do_test view-7.6 { db close sqlite db test.db execsql { SELECT * FROM test; } } {1 2 3} finish_test |