Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch no-rowid-in-cte Excluding Merge-Ins
This is equivalent to a diff from 62a5b3633a to 0055df0445
2015-05-27
| ||
15:10 | Disallow the use of "rowid" in CTEs - it has never worked correctly and it makes no sense, so we might as well make it an explicit error. Also: add the PRAGMA cell_size_check=ON command. (check-in: 19e2cebc12 user: drh tags: trunk) | |
14:21 | A different approach to preventing buffer overreads when comparing a vector of values with a corrupt index record that spans at least one overflow page. (Closed-Leaf check-in: 7e9e1b6123 user: dan tags: avoid-buffer-overread) | |
13:06 | CTEs have never had working rowids. So disallow the use of the "rowid" column within CTEs. (Closed-Leaf check-in: 0055df0445 user: drh tags: no-rowid-in-cte) | |
03:46 | Add the "PRAGMA cell_size_check=ON" command. (Closed-Leaf check-in: 2ead43f074 user: drh tags: cell-size-check-pragma) | |
2015-05-26
| ||
20:31 | Avoid a buffer overread when comparing against a corrupt record that spans at least one overflow page. (check-in: 62a5b3633a user: dan tags: trunk) | |
20:07 | Avoid branching on an uninitalized variable when comparing SQL values with the undefined serial types 10 and 11 (which only appear in corrupt databases). (check-in: b4a45d3b78 user: dan tags: trunk) | |
Changes to src/build.c.
︙ | |||
1840 1841 1842 1843 1844 1845 1846 | 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 | - + | sqlite3ErrorMsg(pParse, "AUTOINCREMENT not allowed on WITHOUT ROWID tables"); return; } if( (p->tabFlags & TF_HasPrimaryKey)==0 ){ sqlite3ErrorMsg(pParse, "PRIMARY KEY missing on table %s", p->zName); }else{ |
︙ |
Changes to src/parse.y.
︙ | |||
162 163 164 165 166 167 168 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + | sqlite3EndTable(pParse,0,0,0,S); sqlite3SelectDelete(pParse->db, S); } %type table_options {u8} table_options(A) ::= . {A = 0;} table_options(A) ::= WITHOUT nm(X). { if( X.n==5 && sqlite3_strnicmp(X.z,"rowid",5)==0 ){ |
︙ |
Changes to src/resolve.c.
︙ | |||
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - + | if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ if( iCol==pTab->iPKey ){ iCol = -1; } break; } } |
︙ | |||
384 385 386 387 388 389 390 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | - + | } #endif /* !defined(SQLITE_OMIT_TRIGGER) */ /* ** Perhaps the name is a reference to the ROWID */ if( cnt==0 && cntTab==1 && pMatch && sqlite3IsRowid(zCol) |
︙ |
Changes to src/select.c.
︙ | |||
3987 3988 3989 3990 3991 3992 3993 | 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 | - + | assert( pFrom->pTab==0 ); pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table)); if( pTab==0 ) return WRC_Abort; pTab->nRef = 1; pTab->zName = sqlite3DbStrDup(db, pCte->zName); pTab->iPKey = -1; pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) ); |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
1630 1631 1632 1633 1634 1635 1636 | 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | - - + + + + | ** special handling during INSERT processing. */ #define TF_Readonly 0x01 /* Read-only system table */ #define TF_Ephemeral 0x02 /* An ephemeral table */ #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ #define TF_Virtual 0x10 /* Is a virtual table */ |
︙ |
Changes to test/with1.test.
︙ | |||
844 845 846 847 848 849 850 851 852 | 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | + + + + + + + + + | } {1 {table c has 1 values for 2 columns}} # 2015-04-12 # do_execsql_test 14.1 { WITH x AS (SELECT * FROM t) SELECT 0 EXCEPT SELECT 0 ORDER BY 1 COLLATE binary; } {} # 2015-05-27: Do not allow rowid usage within a CTE # do_catchsql_test 15.1 { WITH RECURSIVE d(x) AS (VALUES(1) UNION ALL SELECT rowid+1 FROM d WHERE rowid<10) SELECT x FROM d; } {1 {no such column: rowid}} finish_test |
Changes to test/without_rowid1.test.
︙ | |||
304 305 306 307 308 309 310 311 312 313 | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | + + + + + + + + + + + + + + + + + + + | VACUUM; PRAGMA integrity_check; SELECT name FROM sqlite_master WHERE tbl_name = 't48'; } { ok t48 sqlite_autoindex_t48_2 } # 2015-05-28: CHECK constraints can refer to the rowid in a # rowid table, but not in a WITHOUT ROWID table. # do_execsql_test 7.1 { CREATE TABLE t70a( a INT CHECK( rowid!=33 ), b TEXT PRIMARY KEY ); INSERT INTO t70a(a,b) VALUES(99,'hello'); } {} do_catchsql_test 7.2 { INSERT INTO t70a(rowid,a,b) VALUES(33,99,'xyzzy'); } {1 {CHECK constraint failed: t70a}} do_catchsql_test 7.3 { CREATE TABLE t70b( a INT CHECK( rowid!=33 ), b TEXT PRIMARY KEY ) WITHOUT ROWID; } {1 {no such column: rowid}} finish_test |