SQLite

Check-in [f099d6773a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove references to temporary registers from the compiler column-cache when such registers are released. Fix for #3201. (CVS 5341)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f099d6773a837dbe4ba85a8fda818e2d9466e743
User & Date: danielk1977 2008-07-04 09:15:11.000
References
2009-08-24
00:24 Ticket [efc02f9779] Trigger creation order affects query correctness status still Open with 1 other change (artifact: 9c473ca63f user: drh)
Context
2008-07-04
09:41
Remove redundant code from sqlite3GetTempReg(). (CVS 5342) (check-in: 212d05d38c user: danielk1977 tags: trunk)
09:15
Remove references to temporary registers from the compiler column-cache when such registers are released. Fix for #3201. (CVS 5341) (check-in: f099d6773a user: danielk1977 tags: trunk)
2008-07-03
19:53
fts3 functions for testing scripts. These are a first step towards being able to write test script which verify that fts3 is internally building indices in the expected way. Both new functions are only defined if fts3.c is compiled with SQLITE_TEST defined, as when building testfixture. These functions are not intended to be part of the exposed fts3 API.

dump_terms() generates a TEXT result of all the terms in the index (or a specified segment), sorted and joined with spaces.

dump_doclist() generates a TEXT representation of the doclist associated with a given term in the index (or a specified segment). (CVS 5340) (check-in: a48e3d95f7 user: shess tags: trunk)

Changes
Unified Diff Ignore Whitespace Patch
Changes to src/expr.c.
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 routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.381 2008/06/27 00:52:45 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** Return the 'affinity' of the expression pExpr if any.
**







|







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 routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.382 2008/07/04 09:15:11 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** Return the 'affinity' of the expression pExpr if any.
**
3564
3565
3566
3567
3568
3569
3570

3571
3572
3573
3574
3575
3576
3577
    pParse->aTempReg[i] = pParse->aTempReg[i+1];
  }
  pParse->nTempReg--;
  return r;
}
void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
  if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){

    pParse->aTempReg[pParse->nTempReg++] = iReg;
  }
}

/*
** Allocate or deallocate a block of nReg consecutive registers
*/







>







3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
    pParse->aTempReg[i] = pParse->aTempReg[i+1];
  }
  pParse->nTempReg--;
  return r;
}
void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
  if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
    sqlite3ExprWritableRegister(pParse, iReg, iReg);
    pParse->aTempReg[pParse->nTempReg++] = iReg;
  }
}

/*
** Allocate or deallocate a block of nReg consecutive registers
*/
Added test/tkt3201.test.
























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 2008 July 4
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. 
# Specifically, it tests that bug #3201 has been fixed.
#
# $Id: tkt3201.test,v 1.1 2008/07/04 09:15:11 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

do_test tkt3201-1 {
  execsql {
    CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
    INSERT INTO t1 VALUES(1, 'one');
    INSERT INTO t1 VALUES(2, 'two');
  }
} {}

do_test tkt3201-2 {
  execsql {
    SELECT l.a, r.a FROM t1 AS l, t1 AS r WHERE l.a < r.a;
  }
} {1 2}

do_test tkt3201-3 {
  execsql {
    CREATE TABLE t2(a INTEGER PRIMARY KEY, b TEXT);
    INSERT INTO t2 VALUES(2, 'two');
  }
  execsql {
    SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
  }
} {1 2}

do_test tkt3201-4 {
  execsql {
    DELETE FROM t1 WHERE a = 2;
  }
  execsql {
    SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
  }
} {1 2}

do_test tkt3201-5 {
  execsql {
    DELETE FROM t1 WHERE a = 2;
  }
  execsql {
    SELECT t1.a, t1.b, t2.a, t2.b FROM t1, t2;
  }
} {1 one 2 two}

do_test tkt3201-6 {
  execsql {
    CREATE TABLE t3(c INTEGER PRIMARY KEY, d TEXT);
    INSERT INTO t3 VALUES(2, 'two');
  }
  execsql { SELECT a, b, c, d FROM t1, t3 }
} {1 one 2 two}

do_test tkt3201-7 {
  explain { SELECT a, b, c, d FROM t1, t3 WHERE a < c }
  execsql { SELECT a, b, c, d FROM t1, t3 WHERE a < c }
} {1 one 2 two}

finish_test