1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-24 22:22:08 +03:00

Fix a bug in the left outer join logic. (CVS 758)

FossilOrigin-Name: 6c0f44bd6374010f7a4a091e585eb36e0665f96f
This commit is contained in:
drh
2002-09-30 12:36:26 +00:00
parent 294fb92b50
commit c8f8b632c3
4 changed files with 27 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Fix\san\suninitialized\svariable\sthat\scould\scause\sproblems\swhen\scomparing\r\ntwo\sNULLs.\s(CVS\s757)
D 2002-09-30T01:31:22
C Fix\sa\sbug\sin\sthe\sleft\souter\sjoin\slogic.\s(CVS\s758)
D 2002-09-30T12:36:26
F Makefile.in d6c9a85c2a5e696843201d090dcf8bf2f8716f2a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -54,7 +54,7 @@ F src/update.c 881e4c8e7c786545da4fd2d95da19252b2e31137
F src/util.c cd28b33c6849c9722ab72758b7b86989bc64fa27
F src/vdbe.c ac4ccc17d965e5754144cfec493093cf4272c126
F src/vdbe.h b7584044223104ba7896a7f87b66daebdd6022ba
F src/where.c 53959c9d94adaf93b409271815e26eafa6ddd515
F src/where.c 8ff2acfcb9bb15a057512bd6207b259feed57a2c
F test/all.test efd958d048c70a3247997c482f0b33561f7759f0
F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578
F test/btree.test 10e75aec120ecefc0edc4c912a0980a43db1b6c2
@ -73,7 +73,7 @@ F test/insert.test a122afb86911e77c181d912348866a5b1a61eeab
F test/insert2.test c288375a64dad3295044714f0dfed4a193cf067f
F test/intpkey.test f3620158fd7963af1306b01047277f10ae91a30b
F test/ioerr.test 57d9bffaca18b34f9e976f786eadc2591d6efc6a
F test/join.test 90a620f2a2d015e5139d5a4cde0eeb4cf62523bf
F test/join.test 05d2cd1af855e3720e0465668d2923b228d29556
F test/limit.test 9f26f874bc765df5b3f5c92d26d1b12eac6d4cf9
F test/lock.test 388a3a10962d2d571c0c1821cc35bf069ee73473
F test/main.test c66b564554b770ee7fdbf6a66c0cd90329bc2c85
@ -149,7 +149,7 @@ F www/speed.tcl a20a792738475b68756ea7a19321600f23d1d803
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P 59ba43449a53fb32e2dd4259285af8b4206c298a
R d79b2721fab09e8fee709d7d8b7736bc
P 015425001813971f6d4c97c18d64c7f14fa1955f
R 958c29732ae80c7acd4bb4c9f1286758
U drh
Z 7449bf236d3644b4386fd46c627627ae
Z 500e5882699f5a41ba2a1838914ec9af

View File

@ -1 +1 @@
015425001813971f6d4c97c18d64c7f14fa1955f
6c0f44bd6374010f7a4a091e585eb36e0665f96f

View File

@ -13,7 +13,7 @@
** the WHERE clause of SQL statements. Also found here are subroutines
** to generate VDBE code to evaluate expressions.
**
** $Id: where.c,v 1.64 2002/08/28 03:01:01 drh Exp $
** $Id: where.c,v 1.65 2002/09/30 12:36:26 drh Exp $
*/
#include "sqliteInt.h"
@ -425,6 +425,7 @@ WhereInfo *sqliteWhereBegin(
** form ROWID<expr or ROWID<=expr set iDirectLt[i] to the term index.
** For terms like ROWID>expr or ROWID>=expr set iDirectGt[i].
*/
pWInfo->a[i].iCur = -1;
iDirectEq[i] = -1;
iDirectLt[i] = -1;
iDirectGt[i] = -1;
@ -577,8 +578,6 @@ WhereInfo *sqliteWhereBegin(
if( pBestIdx ){
pWInfo->a[i].iCur = pParse->nTab++;
pWInfo->peakNTab = pParse->nTab;
}else{
pWInfo->a[i].iCur = -1;
}
}

View File

@ -12,7 +12,7 @@
#
# This file implements tests for joins, including outer joins.
#
# $Id: join.test,v 1.5 2002/07/31 19:50:28 drh Exp $
# $Id: join.test,v 1.6 2002/09/30 12:36:26 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -283,5 +283,21 @@ do_test join-4.10 {
}
} {}
do_test join-5.1 {
execsql {
BEGIN;
create table centros (id integer primary key, centro);
INSERT INTO centros VALUES(1,'xxx');
create table usuarios (id integer primary key, nombre, apellidos,
idcentro integer);
INSERT INTO usuarios VALUES(1,'a','aa',1);
INSERT INTO usuarios VALUES(2,'b','bb',1);
INSERT INTO usuarios VALUES(3,'c','cc',NULL);
create index idcentro on usuarios (idcentro);
END;
select usuarios.id, usuarios.nombre, centros.centro from
usuarios left outer join centros on usuarios.idcentro = centros.id;
}
} {1 a xxx 2 b xxx 3 c {}}
finish_test