From 17d46fc7f11b40ee9498e3302c9d0ae281dfbad8 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 22 Nov 2008 18:28:50 +0000 Subject: [PATCH] Make sure the error message handler is able to deal with NULL expression spans. Ticket #3508. (CVS 5949) FossilOrigin-Name: ce36b6474a62f0a5b8d82968ca9a171f7143ae31 --- manifest | 15 ++++++++------- manifest.uuid | 2 +- src/printf.c | 4 ++-- test/tkt3508.test | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 test/tkt3508.test diff --git a/manifest b/manifest index d080675a2c..3c82e410db 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stestfixture\slinking\sproblem\sby\smarking\sunix-only\ssymbol\sas\ssuch.\s(CVS\s5944) -D 2008-11-21T23:35:03 +C Make\ssure\sthe\serror\smessage\shandler\sis\sable\sto\sdeal\swith\sNULL\sexpression\r\nspans.\sTicket\s#3508.\s(CVS\s5949) +D 2008-11-22T18:28:51 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 0aa7bbe3be6acc4045706e3bb3fd0b8f38f4a3b5 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -147,7 +147,7 @@ F src/pcache.h f20c3e82dd6da622c3fe296170cb1801f9a2d75a F src/pcache1.c 2453a3e925841fdb610f39bba24def8b2ad4a908 F src/pragma.c 539e28c90e782fa909a3b3a6849d18a9eb11a548 F src/prepare.c fcadb25d2ad722d87103517333c825b56b79a770 -F src/printf.c ce86aed93a704938ca4d0344aaa763271842a4b0 +F src/printf.c e29d9475c63e1dbfae005b98da3a60e07b5c1ca5 F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51 F src/resolve.c 4af5391d2b4c1d6c583a6805ac6660181de4545b F src/select.c b296a7b53dd0b2c42ab8b67d969e2c924529008c @@ -581,6 +581,7 @@ F test/tkt3457.test e9ca2b90f0eb1fb8be73a30d29aacb2e3abedeb9 F test/tkt3461.test 5a63e8d8ee5ce00f076b1e2f82aba5480a0f14ed F test/tkt3472.test e689a687631e59c7a47d9438148115fee23b16c3 F test/tkt3493.test 8472b3464e49a27ff7271308eec46154209e667b +F test/tkt3508.test d55e4f0ccb4f60beef800e941d2610fc4d78ce6c F test/tkt35xx.test 53bca895091e968126a858ee7da186f59f328994 F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7 F test/trace.test 951cd0f5f571e7f36bf7bfe04be70f90fb16fb00 @@ -661,7 +662,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P adb0aafaa6b1ea06541f653a2559f099fb1b2795 -R 3c7efc80db23daed6cb5b409b6c656fc -U pweilbacher -Z 758b2b6f231b1dbf0e5a753e423bfba4 +P 2ca8b82247277baf3b81b5111988305ad5f67701 +R fed990be391c6c93b3b644fa007e1c2c +U drh +Z b371c8bbfae57952930a76318664c6e9 diff --git a/manifest.uuid b/manifest.uuid index 5f5a40b9d5..ceb4a5d810 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2ca8b82247277baf3b81b5111988305ad5f67701 \ No newline at end of file +ce36b6474a62f0a5b8d82968ca9a171f7143ae31 \ No newline at end of file diff --git a/src/printf.c b/src/printf.c index 8729f39d81..6798aa7dd2 100644 --- a/src/printf.c +++ b/src/printf.c @@ -5,7 +5,7 @@ ** an historical reference. Most of the "enhancements" have been backed ** out so that the functionality is now the same as standard printf(). ** -** $Id: printf.c,v 1.96 2008/11/20 18:20:28 drh Exp $ +** $Id: printf.c,v 1.97 2008/11/22 18:28:51 drh Exp $ ** ************************************************************************** ** @@ -725,7 +725,7 @@ void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){ if( N<0 ){ N = strlen(z); } - if( N==0 ){ + if( N==0 || z==0 ){ return; } if( p->nChar+N >= p->nAlloc ){ diff --git a/test/tkt3508.test b/test/tkt3508.test new file mode 100644 index 0000000000..60f5f711dd --- /dev/null +++ b/test/tkt3508.test @@ -0,0 +1,38 @@ +# 2008 November 22 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# This file implements regression tests for SQLite library. +# +# $Id: tkt3508.test,v 1.1 2008/11/22 18:28:51 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_test tkt3508-1.1 { + execsql { + CREATE TABLE modificationsTmp ( + SUBSTRATE_HPRD_ID VARCHAR(80), + SUBSTRATE_GENE_SYMBOL VARCHAR(80), + SUBSTRATE_ISOFORM_ID VARCHAR(80), + SUBSTRATE_REFSEQ_ID VARCHAR(80), + SITE INTEGER, + RESIDUE VARCHAR(80), + ENZYME_NAME VARCHAR(80), + ENZYME_HPRD_ID VARCHAR(80), + MODIFICATION_TYPE VARCHAR(80), + EXPERIMENT_TYPE VARCHAR(80), + REFERENCE_ID VARCHAR(80) + ); + select SUBSTRATE_HPRD_ID, count(substrate_refseq_id) as c + from modificationsTmp where c > 1 group by SUBSTRATE_HPRD_ID; + } +} {} + +finish_test