/ Check-in [f22e3887]
Login

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

Overview
Comment:Do not reuse function parameters in subsequent expressions since the function call might have triggered a text encoding change. Fix for ticket [2ea2425d34be].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f22e388727f0ba0f187cdee51ff8ba17a5d50b8a
User & Date: drh 2009-09-03 01:18:01
References
2009-09-03
01:26 Fixed ticket [2ea2425d]: Assertion fault: Text encoding mismatch on value comparison plus 3 other changes artifact: f0bfe8a8 user: drh
Context
2009-09-07
17:32
Fix a bug where a condition was incorrectly being compiled out when SQLITE_OMIT_VIRTUALTABLE was defined. check-in: 1958db44 user: dan tags: trunk
2009-09-03
16:23
Add the "unix-wfl" VFS that does whole-file locking in order to help NFS do better cache coherency. check-in: 2aeab80e user: drh tags: trunk
01:18
Do not reuse function parameters in subsequent expressions since the function call might have triggered a text encoding change. Fix for ticket [2ea2425d34be]. check-in: f22e3887 user: drh tags: trunk
2009-09-02
19:04
Documentation updates for the version info #defines and C interfaces. check-in: 69055e9b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

2367
2368
2369
2370
2371
2372
2373

2374

2375
2376
2377
2378
2379
2380
2381
      pDef = sqlite3FindFunction(db, zId, nId, nFarg, enc, 0);
      if( pDef==0 ){
        sqlite3ErrorMsg(pParse, "unknown function: %.*s()", nId, zId);
        break;
      }
      if( pFarg ){
        r1 = sqlite3GetTempRange(pParse, nFarg);

        sqlite3ExprCodeExprList(pParse, pFarg, r1, 1);

      }else{
        r1 = 0;
      }
#ifndef SQLITE_OMIT_VIRTUALTABLE
      /* Possibly overload the function if the first argument is
      ** a virtual table column.
      **







>

>







2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
      pDef = sqlite3FindFunction(db, zId, nId, nFarg, enc, 0);
      if( pDef==0 ){
        sqlite3ErrorMsg(pParse, "unknown function: %.*s()", nId, zId);
        break;
      }
      if( pFarg ){
        r1 = sqlite3GetTempRange(pParse, nFarg);
        sqlite3ExprCachePush(pParse);     /* Ticket 2ea2425d34be */
        sqlite3ExprCodeExprList(pParse, pFarg, r1, 1);
        sqlite3ExprCachePop(pParse, 1);   /* Ticket 2ea2425d34be */
      }else{
        r1 = 0;
      }
#ifndef SQLITE_OMIT_VIRTUALTABLE
      /* Possibly overload the function if the first argument is
      ** a virtual table column.
      **

Added test/tkt-2ea2425d34.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
# 2009 September 2
#
# 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.
#
# This file implements tests to verify that ticket [2ea2425d34be] has been
# fixed.  
#

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

do_test tkt-2ea24-1.1 {
  db eval {
    PRAGMA encoding=UTF16;
    CREATE TABLE t1(a,b);
    INSERT INTO t1 VALUES(1,'abc');
    INSERT INTO t1 VALUES(2,'def');
    INSERT INTO t1 VALUES(3,'ghi');
    SELECT a FROM t1 WHERE length(b)<10 AND b<>'def' ORDER BY a;
  }
} {1 3}

finish_test