- Changed patch for rhbz#1075889 to upstream version
  Related: #1075889
This commit is contained in:
Jan Staněk 2014-04-29 11:09:31 +02:00
parent 388d96395c
commit bf31177687
4 changed files with 51 additions and 33 deletions

2
.gitignore vendored
View File

@ -46,3 +46,5 @@
/sqlite-doc-3080400.zip
/sqlite-src-3080402.zip
/sqlite-doc-3080402.zip
/sqlite-src-3080403.zip
/sqlite-doc-3080403.zip

View File

@ -1,2 +1,2 @@
1ea0453f79a60214bf15cad78f7dbb10 sqlite-src-3080402.zip
a01373caab678ba5a5b12aa39a536ea0 sqlite-doc-3080402.zip
34cd453499e4b4564560accf24a9a70e sqlite-src-3080403.zip
22e623b68930d0e30ab82614a6ae832b sqlite-doc-3080403.zip

View File

@ -1,30 +1,41 @@
Revert part of the upstream commit dca1945aeb3fb005, since it causes nautilus to crash
Upstream fix for the issue that caused nautilus to crash.
RHBZ: #1075889
Reported to sqlite-users@sqlite.org on 14/04/25
diff -up sqlite-src-3080402/src/where.c.bug1075889 sqlite-src-3080402/src/where.c
--- sqlite-src-3080402/src/where.c.bug1075889 2014-04-25 10:16:15.977722490 +0200
+++ sqlite-src-3080402/src/where.c 2014-04-25 10:18:12.600728656 +0200
@@ -5532,6 +5529,22 @@ WhereInfo *sqlite3WhereBegin(
goto whereBeginError;
}
--- src/where.c
+++ src/where.c
@@ -4855,18 +4855,10 @@
** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
** automatically order-distinct.
*/
+ /* If the ORDER BY (or GROUP BY) clause contains references to general
+ ** expressions, then we won't be able to satisfy it using indices, so
+ ** go ahead and disable it now.
+ */
+ if( pOrderBy && (wctrlFlags & WHERE_WANT_DISTINCT)!=0 ){
+ for(ii=0; ii<pOrderBy->nExpr; ii++){
+ Expr *pExpr = sqlite3ExprSkipCollate(pOrderBy->a[ii].pExpr);
+ if( pExpr->op!=TK_COLUMN ){
+ pWInfo->pOrderBy = pOrderBy = 0;
+ break;
+ }else if( pExpr->iColumn<0 ){
+ break;
+ }
assert( pOrderBy!=0 );
-
- /* Sortability of virtual tables is determined by the xBestIndex method
- ** of the virtual table itself */
- if( pLast->wsFlags & WHERE_VIRTUALTABLE ){
- testcase( nLoop>0 ); /* True when outer loops are one-row and match
- ** no ORDER BY terms */
- return pLast->u.vtab.isOrdered;
- }
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0;
nOrderBy = pOrderBy->nExpr;
testcase( nOrderBy==BMS-1 );
if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */
@@ -4875,11 +4867,14 @@
orderDistinctMask = 0;
ready = 0;
for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
if( iLoop>0 ) ready |= pLoop->maskSelf;
pLoop = iLoop<nLoop ? pPath->aLoop[iLoop] : pLast;
- assert( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 );
+ if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
+ if( pLoop->u.vtab.isOrdered ) obSat = obDone;
+ break;
+ }
+ }
+
if( wctrlFlags & WHERE_WANT_DISTINCT ){
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
/* The DISTINCT marking is pointless. Ignore it. */
iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
/* Mark off any ORDER BY term X that is a column in the table of
** the current loop for which there is term in the WHERE
** clause of the form X IS NULL or X=? that reference only outer

View File

@ -3,14 +3,14 @@
%bcond_with static
%bcond_without check
%define realver 3080402
%define docver 3080402
%define rpmver 3.8.4.2
%define realver 3080403
%define docver 3080403
%define rpmver 3.8.4.3
Summary: Library that implements an embeddable SQL database engine
Name: sqlite
Version: %{rpmver}
Release: 3%{?dist}
Release: 1%{?dist}
License: Public Domain
Group: Applications/Databases
URL: http://www.sqlite.org/
@ -114,7 +114,7 @@ This package contains the analysis program for %{name}.
%patch3 -p1 -b .pagecache-overflow-test
%patch4 -p1 -b .no-malloc-usable-size
%patch5 -p1 -b .nonprecise-percentile-test
%patch6 -p1 -b .bug1075889
%patch6 -b .bug1075889
# Remove cgi-script erroneously included in sqlite-doc-3070500
rm -f %{name}-doc-%{realver}/search
@ -206,6 +206,11 @@ make test
%endif
%changelog
* Tue Apr 29 2014 Jan Stanek <jstanek@redhat.com> - 3.8.4.3-1
- Update to version 3.8.4.3 (http://www.sqlite.org/releaselog/3_8_4_3.html)
- Changed patch for rhbz#1075889 to upstream version
Related: #1075889
* Fri Apr 25 2014 Honza Horak <hhorak@redhat.com> - 3.8.4.2-3
- Revert part of the upstream commit dca1945aeb3fb005, since it causes
nautilus to crash