/ Check-in [0b95b7a8]
Login

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

Overview
Comment:Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Originally proposed as a fix for ticket [a8a0d2996a], but later determined to be incorrect.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tkt-a8a0d2996a
Files: files | file ages | folders
SHA1:0b95b7a8748df19a24491c814462a9f21e43dbda
User & Date: drh 2014-03-24 12:33:23
Original Comment: Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Fix for ticket [a8a0d2996a].
Context
2014-03-24
12:33
Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Originally proposed as a fix for ticket [a8a0d2996a], but later determined to be incorrect. Closed-Leaf check-in: 0b95b7a8 user: drh tags: tkt-a8a0d2996a
11:23
Avoid attempting to mmap memory from an offset that is not a multiple of the system page size on systems with page sizes larger than 32KB. check-in: db7d62c8 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

287
288
289
290
291
292
293




294
295
296
297
298
299
300
  CollSeq *p4;

  p4 = sqlite3BinaryCompareCollSeq(pParse, pLeft, pRight);
  p5 = binaryCompareP5(pLeft, pRight, jumpIfNull);
  addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1,
                           (void*)p4, P4_COLLSEQ);
  sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5);




  return addr;
}

#if SQLITE_MAX_EXPR_DEPTH>0
/*
** Check that argument nHeight is less than or equal to the maximum
** expression depth allowed. If it is not, leave an error message in







>
>
>
>







287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
  CollSeq *p4;

  p4 = sqlite3BinaryCompareCollSeq(pParse, pLeft, pRight);
  p5 = binaryCompareP5(pLeft, pRight, jumpIfNull);
  addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1,
                           (void*)p4, P4_COLLSEQ);
  sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5);
  if( p5!=SQLITE_AFF_NONE ){
    sqlite3ExprCacheAffinityChange(pParse, in1, 1);
    sqlite3ExprCacheAffinityChange(pParse, in2, 1);
  }
  return addr;
}

#if SQLITE_MAX_EXPR_DEPTH>0
/*
** Check that argument nHeight is less than or equal to the maximum
** expression depth allowed. If it is not, leave an error message in

Added test/affinity01.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
# 2014-03-24
#
# 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.
#
#***********************************************************************
# 
# Various tests for register affinity conversions.
#

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

do_execsql_test 1.0 {
  CREATE TABLE t(x);
  INSERT INTO t VALUES('1');
  SELECT typeof(x) FROM t WHERE x=x+0;
} {text}

finish_test