/ Check-in [a2135ad1]
Login

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

Overview
Comment:Update the OP_Move opcode to shift the pScopyFrom pointer of aliases when compiled with SQLITE_DEBUG. Ticket [d63523637517386191].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a2135ad13049c170b33315a949b1544e6a136183
User & Date: drh 2011-08-03 16:40:15
References
2015-04-28
12:44
Shift the Mem.pScopyFrom pointer in the correct direction in OP_Move. Fix for a defective check-in [a2135ad13049] and ticket [d6352363751]. Debugging code only - does not affect normal operation. check-in: add4e043 user: drh tags: trunk
Context
2011-08-03
22:06
Merge the winopen-retry-logic branch into trunk. The biggest change here is to test scripts, which should now use such as copy_file and delete_file from tester.tcl rather than the raw file commands of TCL. check-in: b90c28be user: drh tags: trunk
21:46
Merge the latest trunk changes into the sessions branch. check-in: c5709036 user: drh tags: sessions
16:40
Update the OP_Move opcode to shift the pScopyFrom pointer of aliases when compiled with SQLITE_DEBUG. Ticket [d63523637517386191]. check-in: a2135ad1 user: drh tags: trunk
2011-08-02
20:14
Exclude the 8_3_names.test script from the inmemory_journal permutation. check-in: 78fc94c8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1023   1023       assert( pOut<=&aMem[p->nMem] );
  1024   1024       assert( pIn1<=&aMem[p->nMem] );
  1025   1025       assert( memIsValid(pIn1) );
  1026   1026       memAboutToChange(p, pOut);
  1027   1027       zMalloc = pOut->zMalloc;
  1028   1028       pOut->zMalloc = 0;
  1029   1029       sqlite3VdbeMemMove(pOut, pIn1);
         1030  +#ifdef SQLITE_DEBUG
         1031  +    if( pOut->pScopyFrom>=&aMem[p1] && pOut->pScopyFrom<&aMem[p1+pOp->p3] ){
         1032  +      pOut->pScopyFrom += p1 - pOp->p2;
         1033  +    }
         1034  +#endif
  1030   1035       pIn1->zMalloc = zMalloc;
  1031   1036       REGISTER_TRACE(p2++, pOut);
  1032   1037       pIn1++;
  1033   1038       pOut++;
  1034   1039     }
  1035   1040     break;
  1036   1041   }

Added test/tkt-d635236375.test.

            1  +# 2011 August 3
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.  The
           12  +# focus of this file is testing that bug [d63523637517386191d634e]
           13  +# has been fixed.
           14  +#
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +
           19  +set ::testprefix tkt-d635236375
           20  +
           21  +do_test 1.0 {
           22  +  execsql {
           23  +    CREATE TABLE t1(id1 INTEGER PRIMARY KEY);
           24  +    INSERT INTO t1 VALUES(9999);
           25  +    CREATE TABLE t2(id2 INTEGER PRIMARY KEY);
           26  +    INSERT INTO t2 VALUES(12345);
           27  +    INSERT INTO t2 VALUES(54321);
           28  +    SELECT DISTINCT id1 AS x, id1 AS y FROM t1, t2;
           29  +  }
           30  +} {9999 9999}
           31  +do_test 1.1 {
           32  +  execsql {
           33  +    SELECT count(*) FROM t1, t2 GROUP BY id1, id1;
           34  +  }
           35  +} {2}
           36  +
           37  +
           38  +finish_test