Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -41,11 +41,11 @@ ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.622 2007/05/17 16:38:30 danielk1977 Exp $ +** $Id: vdbe.c,v 1.623 2007/05/23 06:31:39 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include #include @@ -1031,10 +1031,11 @@ assert( pOp->p2==0 || (pTerm->flags&MEM_Str) ); if( pTerm->flags&MEM_Null ){ nByte = -1; break; } + ExpandBlob(pTerm); Stringify(pTerm, encoding); nByte += pTerm->n; } if( nByte<0 ){ Index: test/zeroblob.test ================================================================== --- test/zeroblob.test +++ test/zeroblob.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing of the zero-filled blob functionality # including the sqlite3_bind_zeroblob(), sqlite3_result_zeroblob(), # and the built-in zeroblob() SQL function. # -# $Id: zeroblob.test,v 1.3 2007/05/17 06:44:29 danielk1977 Exp $ +# $Id: zeroblob.test,v 1.4 2007/05/23 06:31:39 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !incrblob { @@ -117,8 +117,16 @@ UNION ALL SELECT zeroblob(10) AS a ) } } {1} + +# Concatentation works with zeroblob +# +do_test zeroblob-4.1 { + execsql { + SELECT hex(zeroblob(2) || x'61') + } +} {000061} finish_test