Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Report an error when trying to resolve column name "rowid" in a WITHOUT ROWID table. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | omit-rowid |
Files: | files | file ages | folders |
SHA1: |
36bcc9cb885523fba2f3b0d152de9e08 |
User & Date: | drh 2013-10-23 17:39:41.217 |
Context
2013-10-23
| ||
22:23 | Construct secondary indices on WITHOUT ROWID tables. (check-in: 2c028ddc85 user: drh tags: omit-rowid) | |
17:39 | Report an error when trying to resolve column name "rowid" in a WITHOUT ROWID table. (check-in: 36bcc9cb88 user: drh tags: omit-rowid) | |
16:03 | Get VACUUM and the xfer optimization working with WITHOUT ROWID. (check-in: 579815fff1 user: drh tags: omit-rowid) | |
Changes
Changes to src/resolve.c.
︙ | |||
222 223 224 225 226 227 228 | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | - + + + | int cntTab = 0; /* Number of matching table names */ int nSubquery = 0; /* How many levels of subquery */ sqlite3 *db = pParse->db; /* The database connection */ struct SrcList_item *pItem; /* Use for looping over pSrcList items */ struct SrcList_item *pMatch = 0; /* The matching pSrcList item */ NameContext *pTopNC = pNC; /* First namecontext in the list */ Schema *pSchema = 0; /* Schema of the expression */ |
︙ | |||
263 264 265 266 267 268 269 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - - - | /* Start at the inner-most context and move outward until a match is found */ while( pNC && cnt==0 ){ ExprList *pEList; SrcList *pSrcList = pNC->pSrcList; if( pSrcList ){ for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){ |
︙ | |||
325 326 327 328 329 330 331 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - + - | } } /* if( pSrcList ) */ #ifndef SQLITE_OMIT_TRIGGER /* If we have not already resolved the name, then maybe ** it is a new.* or old.* trigger argument reference */ |
︙ | |||
350 351 352 353 354 355 356 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | - + | if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ if( iCol==pTab->iPKey ){ iCol = -1; } break; } } |
︙ | |||
377 378 379 380 381 382 383 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | + - + | } } #endif /* !defined(SQLITE_OMIT_TRIGGER) */ /* ** Perhaps the name is a reference to the ROWID */ assert( pTab!=0 || cntTab==0 ); |
︙ |
Changes to test/tableopts.test.
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + + + + + + + + + + + + + + + | } {1 {unknown table option: unknown2}} do_execsql_test tableopt-2.1 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a,b)) WITHOUT rowid; INSERT INTO t1 VALUES(1,2,3),(2,3,4); SELECT c FROM t1 WHERE a IN (1,2) ORDER BY b; } {3 4} do_test tableopt-2.1.1 { catchsql { SELECT rowid, * FROM t1; } } {1 {no such column: rowid}} do_test tableopt-2.1.2 { catchsql { SELECT _rowid_, * FROM t1; } } {1 {no such column: _rowid_}} do_test tableopt-2.1.3 { catchsql { SELECT oid, * FROM t1; } } {1 {no such column: oid}} do_execsql_test tableopt-2.2 { VACUUM; SELECT c FROM t1 WHERE a IN (1,2) ORDER BY b; } {3 4} do_test tableopt-2.3 { sqlite3 db2 test.db db2 eval {SELECT c FROM t1 WHERE a IN (1,2) ORDER BY b;} |
︙ |