/ Check-in [ce36b647]
Login

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

Overview
Comment:Make sure the error message handler is able to deal with NULL expression spans. Ticket #3508. (CVS 5949)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ce36b6474a62f0a5b8d82968ca9a171f7143ae31
User & Date: drh 2008-11-22 18:28:51
Context
2008-11-22
19:50
fix the compile warnings on OS/2 (CVS 5950) check-in: b7d0ec83 user: pweilbacher tags: trunk
18:28
Make sure the error message handler is able to deal with NULL expression spans. Ticket #3508. (CVS 5949) check-in: ce36b647 user: drh tags: trunk
2008-11-21
23:35
Fix testfixture linking problem by marking unix-only symbol as such. (CVS 5944) check-in: 2ca8b822 user: pweilbacher tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/printf.c.

     1      1   /*
     2      2   ** The "printf" code that follows dates from the 1980's.  It is in
     3      3   ** the public domain.  The original comments are included here for
     4      4   ** completeness.  They are very out-of-date but might be useful as
     5      5   ** an historical reference.  Most of the "enhancements" have been backed
     6      6   ** out so that the functionality is now the same as standard printf().
     7      7   **
     8         -** $Id: printf.c,v 1.96 2008/11/20 18:20:28 drh Exp $
            8  +** $Id: printf.c,v 1.97 2008/11/22 18:28:51 drh Exp $
     9      9   **
    10     10   **************************************************************************
    11     11   **
    12     12   ** The following modules is an enhanced replacement for the "printf" subroutines
    13     13   ** found in the standard C library.  The following enhancements are
    14     14   ** supported:
    15     15   **
................................................................................
   721    721   void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){
   722    722     if( p->tooBig | p->mallocFailed ){
   723    723       return;
   724    724     }
   725    725     if( N<0 ){
   726    726       N = strlen(z);
   727    727     }
   728         -  if( N==0 ){
          728  +  if( N==0 || z==0 ){
   729    729       return;
   730    730     }
   731    731     if( p->nChar+N >= p->nAlloc ){
   732    732       char *zNew;
   733    733       if( !p->useMalloc ){
   734    734         p->tooBig = 1;
   735    735         N = p->nAlloc - p->nChar - 1;

Added test/tkt3508.test.

            1  +# 2008 November 22
            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. 
           12  +#
           13  +# $Id: tkt3508.test,v 1.1 2008/11/22 18:28:51 drh Exp $
           14  +
           15  +set testdir [file dirname $argv0]
           16  +source $testdir/tester.tcl
           17  +
           18  +do_test tkt3508-1.1 {
           19  +  execsql {
           20  +    CREATE TABLE modificationsTmp (
           21  +      SUBSTRATE_HPRD_ID VARCHAR(80),
           22  +      SUBSTRATE_GENE_SYMBOL VARCHAR(80),
           23  +      SUBSTRATE_ISOFORM_ID VARCHAR(80),
           24  +      SUBSTRATE_REFSEQ_ID VARCHAR(80),
           25  +      SITE INTEGER,
           26  +      RESIDUE VARCHAR(80),
           27  +      ENZYME_NAME VARCHAR(80),
           28  +      ENZYME_HPRD_ID VARCHAR(80),
           29  +      MODIFICATION_TYPE VARCHAR(80),
           30  +      EXPERIMENT_TYPE VARCHAR(80),
           31  +      REFERENCE_ID VARCHAR(80)
           32  +    );
           33  +    select SUBSTRATE_HPRD_ID, count(substrate_refseq_id) as c
           34  +      from modificationsTmp where c > 1 group by SUBSTRATE_HPRD_ID;
           35  +  }
           36  +} {}
           37  +
           38  +finish_test