[sqlite] Do not use transitive WHERE-clause constraints on LEFT JOINs (#1034714)
Debarshi Ray
rishi at fedoraproject.org
Tue Nov 26 15:53:13 UTC 2013
commit 6ac28fc9c61406532722f3746df13616d40501a1
Author: Debarshi Ray <debarshir at gnome.org>
Date: Tue Nov 26 16:51:45 2013 +0100
Do not use transitive WHERE-clause constraints on LEFT JOINs (#1034714)
...transitive-WHERE-clause-constraints-on-LE.patch | 29 ++++++++++++++++++++
sqlite.spec | 8 +++++-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/0001-Do-not-use-transitive-WHERE-clause-constraints-on-LE.patch b/0001-Do-not-use-transitive-WHERE-clause-constraints-on-LE.patch
new file mode 100644
index 0000000..4b09a4a
--- /dev/null
+++ b/0001-Do-not-use-transitive-WHERE-clause-constraints-on-LE.patch
@@ -0,0 +1,29 @@
+From c098d918e1e19088be9659c409f1a6fa32b0efe6 Mon Sep 17 00:00:00 2001
+From: "D. Richard Hipp" <drh at hwaci.com>
+Date: Mon, 28 Oct 2013 20:15:56 +0000
+Subject: [PATCH] Do not use transitive WHERE-clause constraints on LEFT JOINs.
+ Fix for ticket [c620261b5b5dc].
+
+---
+ src/where.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/where.c b/src/where.c
+index 266dc92..4868a7a 100644
+--- a/src/where.c
++++ b/src/where.c
+@@ -878,7 +878,10 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
+ iColumn = pScan->aEquiv[pScan->iEquiv-1];
+ while( (pWC = pScan->pWC)!=0 ){
+ for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
+- if( pTerm->leftCursor==iCur && pTerm->u.leftColumn==iColumn ){
++ if( pTerm->leftCursor==iCur
++ && pTerm->u.leftColumn==iColumn
++ && (pScan->iEquiv<=2 || !ExprHasProperty(pTerm->pExpr, EP_FromJoin))
++ ){
+ if( (pTerm->eOperator & WO_EQUIV)!=0
+ && pScan->nEquiv<ArraySize(pScan->aEquiv)
+ ){
+--
+1.8.4.2
+
diff --git a/sqlite.spec b/sqlite.spec
index 9ea20d2..e8a8fe5 100644
--- a/sqlite.spec
+++ b/sqlite.spec
@@ -10,7 +10,7 @@
Summary: Library that implements an embeddable SQL database engine
Name: sqlite
Version: %{rpmver}
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Public Domain
Group: Applications/Databases
URL: http://www.sqlite.org/
@@ -32,6 +32,8 @@ Patch4: sqlite-3.7.15-no-malloc-usable-size.patch
Patch5: sqlite-3.7.16-man-missing-options.patch
# Temporary workaround for failed percentile test, see patch for details
Patch6: sqlite-3.8.0-percentile-test.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1034714
+Patch7: 0001-Do-not-use-transitive-WHERE-clause-constraints-on-LE.patch
BuildRequires: ncurses-devel readline-devel glibc-devel
BuildRequires: autoconf
@@ -107,6 +109,7 @@ This package contains the tcl modules for %{name}.
%patch4 -p1 -b .no-malloc-usable-size
%patch5 -p1 -b .man-missing-options
%patch6 -p1 -b .nonprecise-percentile-test
+%patch7 -p1 -b .transitive-where-clause-constraints
# Remove cgi-script erroneously included in sqlite-doc-3070500
rm -f %{name}-doc-%{realver}/search
@@ -197,6 +200,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
+* Tue Nov 26 2013 Debarshi Ray <rishi at fedoraproject.org> - 3.8.1-2
+- Do not use transitive WHERE-clause constraints on LEFT JOINs (#1034714)
+
* Tue Oct 22 2013 Jan Stanek <jstanek at redhat.com> - 3.8.1-1
- Update to 3.8.1 (http://www.sqlite.org/releaselog/3_8_1.html)
More information about the scm-commits
mailing list