Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Modify the sqlite3VdbeMemCompare() routine so that it does not modify any Mem.z values. Ticket #3376. (CVS 5706) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
2d4505510032bf903a9c5d582edda442 |
User & Date: | danielk1977 2008-09-16 12:06:08.000 |
References
2010-10-15
| ||
14:45 | Cherry-pick the change at [2d4505510032bf9] into the 3.6.1 branch. (check-in: ecb1419e4b user: drh tags: branch-3.6.1) | |
Context
2008-09-16
| ||
14:38 | If the xAccess() call used by "PRAGMA temp_store_directory = /new/path/" to determine if the supplied directory is writable returns an error, assume the directory is not writable. (CVS 5707) (check-in: e8418588f2 user: danielk1977 tags: trunk) | |
12:06 | Modify the sqlite3VdbeMemCompare() routine so that it does not modify any Mem.z values. Ticket #3376. (CVS 5706) (check-in: 2d45055100 user: danielk1977 tags: trunk) | |
11:58 | Add test case for ticket #3376. (CVS 5705) (check-in: c64260579d user: drh tags: trunk) | |
Changes
Changes to src/vdbemem.c.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** ** This file contains code use to manipulate "Mem" structure. A "Mem" ** stores a single value in the VDBE. Mem is an opaque structure visible ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** ** This file contains code use to manipulate "Mem" structure. A "Mem" ** stores a single value in the VDBE. Mem is an opaque structure visible ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value ** ** $Id: vdbemem.c,v 1.123 2008/09/16 12:06:08 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> #include "vdbeInt.h" /* ** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*) |
︙ | ︙ | |||
734 735 736 737 738 739 740 | if( pColl ){ if( pMem1->enc==pColl->enc ){ /* The strings are already in the correct encoding. Call the ** comparison function directly */ return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z); }else{ | < > | | > > > | | < | | < < < | | | 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | if( pColl ){ if( pMem1->enc==pColl->enc ){ /* The strings are already in the correct encoding. Call the ** comparison function directly */ return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z); }else{ const void *v1, *v2; int n1, n2; Mem c1; Mem c2; memset(&c1, 0, sizeof(c1)); memset(&c2, 0, sizeof(c2)); sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem); sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem); v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc); n1 = v1==0 ? 0 : c1.n; v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc); n2 = v2==0 ? 0 : c2.n; rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2); sqlite3VdbeMemRelease(&c1); sqlite3VdbeMemRelease(&c2); return rc; } } /* If a NULL pointer was passed as the collate function, fall through ** to the blob case and use memcmp(). */ } |
︙ | ︙ |