mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
When converting literal BLOBs to text using the encoding of the main
database. Ticket #2349. (CVS 3975) FossilOrigin-Name: a57afaff424448ffed8f2344e5eb461f503bfb6e
This commit is contained in:
16
manifest
16
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Simplify\sfailing\scase\sin\sfuzz.test.\s(CVS\s3974)
|
C When\sconverting\sliteral\sBLOBs\sto\stext\susing\sthe\sencoding\sof\sthe\smain\ndatabase.\s\sTicket\s#2349.\s(CVS\s3975)
|
||||||
D 2007-05-10T17:38:57
|
D 2007-05-10T21:14:03
|
||||||
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
|
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
|
||||||
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
||||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||||
@@ -132,7 +132,7 @@ F src/update.c 3359041db390a8f856d67272f299600e2104f350
|
|||||||
F src/utf.c be7c64eed83fa3c01e0c42905e1c311dcd1be704
|
F src/utf.c be7c64eed83fa3c01e0c42905e1c311dcd1be704
|
||||||
F src/util.c 4f6bbcec2b2b1884d652b82c9f8949ede4618d68
|
F src/util.c 4f6bbcec2b2b1884d652b82c9f8949ede4618d68
|
||||||
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
|
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
|
||||||
F src/vdbe.c c0b1cd6c7dc40f836184af1cf041cfcadd61c9a5
|
F src/vdbe.c 308c698ad96a43249e12cb5067a4a823a6dea307
|
||||||
F src/vdbe.h 001c5b257567c1d3de7feb2203aac71d0d7b16a3
|
F src/vdbe.h 001c5b257567c1d3de7feb2203aac71d0d7b16a3
|
||||||
F src/vdbeInt.h bddb7931fc1216fda6f6720e18d2a9b1e0f8fc96
|
F src/vdbeInt.h bddb7931fc1216fda6f6720e18d2a9b1e0f8fc96
|
||||||
F src/vdbeapi.c 3ca7808c67a10b5c20150108b431d520d141e93e
|
F src/vdbeapi.c 3ca7808c67a10b5c20150108b431d520d141e93e
|
||||||
@@ -214,7 +214,7 @@ F test/diskfull.test a91fa95a8729b71fdac4738a49755f70b48c61f3
|
|||||||
F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b
|
F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b
|
||||||
F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52
|
F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52
|
||||||
F test/enc2.test 45710bacfa9df29720bc84c067dfdf8c8ddfb797
|
F test/enc2.test 45710bacfa9df29720bc84c067dfdf8c8ddfb797
|
||||||
F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030
|
F test/enc3.test 9331988b9d72decec96995c90637e87b00d747a5
|
||||||
F test/exclusive.test 5bc520ba366ae3d242420af025ab64d465b04706
|
F test/exclusive.test 5bc520ba366ae3d242420af025ab64d465b04706
|
||||||
F test/exclusive2.test f9738964b01e0bc4d4e5e270e347ca162da51799
|
F test/exclusive2.test f9738964b01e0bc4d4e5e270e347ca162da51799
|
||||||
F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff
|
F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff
|
||||||
@@ -487,7 +487,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
|||||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||||
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
||||||
P 1e8fcb3fbed7beb8bb1370953ecf3d4b9db01ede
|
P a54c74990caf22c0008a7029e24594e83048ffbc
|
||||||
R 3407008af1a21abc526283fbb54db2fc
|
R c84e4f74a574fa506734b720c23aad6b
|
||||||
U danielk1977
|
U drh
|
||||||
Z fd4f103656f235fc374f0f6ff3013b5f
|
Z b06d89c3202832d761b85c19e8382942
|
||||||
|
@@ -1 +1 @@
|
|||||||
a54c74990caf22c0008a7029e24594e83048ffbc
|
a57afaff424448ffed8f2344e5eb461f503bfb6e
|
11
src/vdbe.c
11
src/vdbe.c
@@ -43,7 +43,7 @@
|
|||||||
** in this file for details. If in doubt, do not deviate from existing
|
** in this file for details. If in doubt, do not deviate from existing
|
||||||
** commenting and indentation practices when changing or adding code.
|
** commenting and indentation practices when changing or adding code.
|
||||||
**
|
**
|
||||||
** $Id: vdbe.c,v 1.614 2007/05/10 17:32:48 danielk1977 Exp $
|
** $Id: vdbe.c,v 1.615 2007/05/10 21:14:03 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -334,7 +334,7 @@ void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
|
|||||||
else *zCsr++ = z;
|
else *zCsr++ = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlite3_snprintf(100, zCsr, "]");
|
sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
|
||||||
zCsr += strlen(zCsr);
|
zCsr += strlen(zCsr);
|
||||||
if( f & MEM_Zero ){
|
if( f & MEM_Zero ){
|
||||||
sqlite3_snprintf(100, zCsr,"+%lldz",pMem->u.i);
|
sqlite3_snprintf(100, zCsr,"+%lldz",pMem->u.i);
|
||||||
@@ -835,6 +835,7 @@ case OP_Blob: {
|
|||||||
pTos++;
|
pTos++;
|
||||||
assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
|
assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
|
||||||
sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0);
|
sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0);
|
||||||
|
pTos->enc = encoding;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif /* SQLITE_OMIT_BLOB_LITERAL */
|
#endif /* SQLITE_OMIT_BLOB_LITERAL */
|
||||||
@@ -918,7 +919,7 @@ case OP_Pull: { /* no-push */
|
|||||||
Deephemeralize(pTos);
|
Deephemeralize(pTos);
|
||||||
for(i=0; i<pOp->p1; i++, pFrom++){
|
for(i=0; i<pOp->p1; i++, pFrom++){
|
||||||
Deephemeralize(&pFrom[1]);
|
Deephemeralize(&pFrom[1]);
|
||||||
assert( (pFrom[1].flags & MEM_Ephem)==0 );
|
assert( (pFrom->flags & MEM_Ephem)==0 );
|
||||||
*pFrom = pFrom[1];
|
*pFrom = pFrom[1];
|
||||||
if( pFrom->flags & MEM_Short ){
|
if( pFrom->flags & MEM_Short ){
|
||||||
assert( pFrom->flags & (MEM_Str|MEM_Blob) );
|
assert( pFrom->flags & (MEM_Str|MEM_Blob) );
|
||||||
@@ -2275,9 +2276,6 @@ case OP_MakeRecord: {
|
|||||||
if( pRec->flags&MEM_Null ){
|
if( pRec->flags&MEM_Null ){
|
||||||
containsNull = 1;
|
containsNull = 1;
|
||||||
}
|
}
|
||||||
if( pRec->flags&MEM_Zero && pRec->n>0 ){
|
|
||||||
sqlite3VdbeMemExpandBlob(pRec);
|
|
||||||
}
|
|
||||||
serial_type = sqlite3VdbeSerialType(pRec, file_format);
|
serial_type = sqlite3VdbeSerialType(pRec, file_format);
|
||||||
len = sqlite3VdbeSerialTypeLen(serial_type);
|
len = sqlite3VdbeSerialTypeLen(serial_type);
|
||||||
nData += len;
|
nData += len;
|
||||||
@@ -2285,6 +2283,7 @@ case OP_MakeRecord: {
|
|||||||
if( pRec->flags & MEM_Zero ){
|
if( pRec->flags & MEM_Zero ){
|
||||||
/* Only pure zero-filled BLOBs can be input to this Opcode.
|
/* Only pure zero-filled BLOBs can be input to this Opcode.
|
||||||
** We do not allow blobs with a prefix and a zero-filled tail. */
|
** We do not allow blobs with a prefix and a zero-filled tail. */
|
||||||
|
assert( pRec->n==0 );
|
||||||
nZero += pRec->u.i;
|
nZero += pRec->u.i;
|
||||||
}else if( len ){
|
}else if( len ){
|
||||||
nZero = 0;
|
nZero = 0;
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
# The focus of this file is testing of the proper handling of conversions
|
# The focus of this file is testing of the proper handling of conversions
|
||||||
# to the native text representation.
|
# to the native text representation.
|
||||||
#
|
#
|
||||||
# $Id: enc3.test,v 1.5 2006/01/12 19:42:41 drh Exp $
|
# $Id: enc3.test,v 1.6 2007/05/10 21:14:03 drh Exp $
|
||||||
|
|
||||||
set testdir [file dirname $argv0]
|
set testdir [file dirname $argv0]
|
||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
@@ -65,6 +65,16 @@ ifcapable {bloblit && utf16} {
|
|||||||
SELECT CAST(a AS text) FROM t2 WHERE a LIKE 'abc%';
|
SELECT CAST(a AS text) FROM t2 WHERE a LIKE 'abc%';
|
||||||
}
|
}
|
||||||
} {abcde}
|
} {abcde}
|
||||||
|
do_test enc3-2.3 {
|
||||||
|
execsql {
|
||||||
|
SELECT CAST(x'61006200630064006500' AS text);
|
||||||
|
}
|
||||||
|
} {abcde}
|
||||||
|
do_test enc3-2.4 {
|
||||||
|
execsql {
|
||||||
|
SELECT rowid FROM t2 WHERE a LIKE x'610062002500';
|
||||||
|
}
|
||||||
|
} {1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user