Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix for ticket #1582 (Double delete of invalid LIMIT clause Expr* applied to a UNION ALL query). (CVS 2861) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5dec3a392ba3c249bbca899c12e99c26 |
User & Date: | danielk1977 2006-01-05 14:22:34.000 |
Context
2006-01-05
| ||
15:50 | Move TCL interface for sqlite3_release_memory() and sqlite3_soft_heap_limit() out of tclsqlite.c and into test1.c. Update the TCL interface documention to describe the "exists" method. (CVS 2862) (check-in: 98194a45cc user: drh tags: trunk) | |
14:22 | Fix for ticket #1582 (Double delete of invalid LIMIT clause Expr* applied to a UNION ALL query). (CVS 2861) (check-in: 5dec3a392b user: danielk1977 tags: trunk) | |
13:48 | Disable automatic invocation of sqlite3_release_memory() when a malloc() fails in those cases where the global mutex is held. (CVS 2860) (check-in: 6fdbb8b771 user: danielk1977 tags: trunk) | |
Changes
Changes to src/select.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 C code routines that are called by the parser ** to handle SELECT statements 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 C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** ** $Id: select.c,v 1.285 2006/01/05 14:22:34 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** Allocate a new Select structure and return a pointer to that ** structure. |
︙ | ︙ | |||
1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 | case TK_ALL: { if( pOrderBy==0 ){ int addr = 0; assert( !pPrior->pLimit ); pPrior->pLimit = p->pLimit; pPrior->pOffset = p->pOffset; rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0, aff); if( rc ){ goto multi_select_end; } p->pPrior = 0; p->iLimit = pPrior->iLimit; p->iOffset = pPrior->iOffset; | > > < < | 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 | case TK_ALL: { if( pOrderBy==0 ){ int addr = 0; assert( !pPrior->pLimit ); pPrior->pLimit = p->pLimit; pPrior->pOffset = p->pOffset; rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0, aff); p->pLimit = 0; p->pOffset = 0; if( rc ){ goto multi_select_end; } p->pPrior = 0; p->iLimit = pPrior->iLimit; p->iOffset = pPrior->iOffset; if( p->iLimit>=0 ){ addr = sqlite3VdbeAddOp(v, OP_IfMemZero, p->iLimit, 0); VdbeComment((v, "# Jump ahead if LIMIT reached")); } rc = sqlite3Select(pParse, p, eDest, iParm, 0, 0, 0, aff); p->pPrior = pPrior; if( rc ){ |
︙ | ︙ |
Changes to test/misc5.test.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for miscellanous features that were # left out of other test files. # | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for miscellanous features that were # left out of other test files. # # $Id: misc5.test,v 1.8 2006/01/05 14:22:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build records using the MakeRecord opcode such that the size of the # header is at the transition point in the size of a varint. # |
︙ | ︙ | |||
498 499 500 501 502 503 504 | do_test misc5-5.3 { execsql {SELECT 3.e0 } } 3.0 do_test misc5-5.4 { execsql {SELECT .4e+1} } 4.0 | > > | > > > > > > > > > > > > > > > > > > > > > > > > > | 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | do_test misc5-5.3 { execsql {SELECT 3.e0 } } 3.0 do_test misc5-5.4 { execsql {SELECT .4e+1} } 4.0 # Ticket #1582. Ensure that an unknown table in a LIMIT clause applied to # a UNION ALL query causes an error, not a crash. # db close file delete -force test.db sqlite3 db test.db ifcapable subquery { do_test misc5-6.1 { catchsql { SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_master LIMIT (SELECT count(*) FROM blah); } } {1 {no such table: blah}} do_test misc5-6.2 { execsql { CREATE TABLE logs(msg TEXT, timestamp INTEGER, dbtime TEXT); } catchsql { SELECT * FROM logs WHERE logs.id >= (SELECT head FROM logs_base) UNION ALL SELECT * FROM logs LIMIT (SELECT lmt FROM logs_base) ; } } {1 {no such column: logs.id}} } finish_test |