/ Check-in [6e19ef75]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Make sure zeroblob() works with the concatenation operator. Ticket #2379. (CVS 4028)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6e19ef758207cedd6db8b2796ef5d4d688cc0b62
User & Date: drh 2007-05-23 06:31:39
Context
2007-05-23
07:20
Additional comments ono the SQLITE_MIXED_ENDIAN_64BIT_FLOAT issue. (CVS 4029) check-in: dd48a31e user: drh tags: trunk
06:31
Make sure zeroblob() works with the concatenation operator. Ticket #2379. (CVS 4028) check-in: 6e19ef75 user: drh tags: trunk
06:25
Increase the number of repititions in crash.test. (CVS 4027) check-in: f3c3412a user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.622 2007/05/17 16:38:30 danielk1977 Exp $
           46  +** $Id: vdbe.c,v 1.623 2007/05/23 06:31:39 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include <math.h>
    52     52   #include "vdbeInt.h"
    53     53   
................................................................................
  1029   1029     nByte = 0;
  1030   1030     for(i=0; i<nField; i++, pTerm++){
  1031   1031       assert( pOp->p2==0 || (pTerm->flags&MEM_Str) );
  1032   1032       if( pTerm->flags&MEM_Null ){
  1033   1033         nByte = -1;
  1034   1034         break;
  1035   1035       }
         1036  +    ExpandBlob(pTerm);
  1036   1037       Stringify(pTerm, encoding);
  1037   1038       nByte += pTerm->n;
  1038   1039     }
  1039   1040   
  1040   1041     if( nByte<0 ){
  1041   1042       /* If nByte is less than zero, then there is a NULL value on the stack.
  1042   1043       ** In this case just pop the values off the stack (if required) and

Changes to test/zeroblob.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing of the zero-filled blob functionality
    13     13   # including the sqlite3_bind_zeroblob(), sqlite3_result_zeroblob(),
    14     14   # and the built-in zeroblob() SQL function.
    15     15   #
    16         -# $Id: zeroblob.test,v 1.3 2007/05/17 06:44:29 danielk1977 Exp $
           16  +# $Id: zeroblob.test,v 1.4 2007/05/23 06:31:39 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   ifcapable !incrblob {
    22     22     finish_test
    23     23     return
................................................................................
   115    115       SELECT count(DISTINCT a) FROM (
   116    116         SELECT x'00000000000000000000' AS a
   117    117         UNION ALL
   118    118         SELECT zeroblob(10) AS a
   119    119       )
   120    120     }
   121    121   } {1}
          122  +
          123  +# Concatentation works with zeroblob
          124  +#
          125  +do_test zeroblob-4.1 {
          126  +  execsql {
          127  +    SELECT hex(zeroblob(2) || x'61')
          128  +  }
          129  +} {000061}
   122    130     
   123    131   
   124    132   finish_test