mv sqlite3.h /usr/include
clean:
- rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.*
+ rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.* crashtest
rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out
-C More\stest\scoverage\senhancements.\s(CVS\s2600)
-D 2005-08-19T01:07:16
+C Increased\stest\scoverage\son\strigger.c\sand\sprintf.c.\s(CVS\s2601)
+D 2005-08-19T02:26:27
F Makefile.in b109ddb46a5550d0732dcd6caca01c123f6d5cdd
F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
F ltmain.sh f6b283068efa69f06eb8aa1fe4bddfdbdeb35826
-F main.mk bf8b4a9dbd9233f2371d0322e33e42bde87212b2
+F main.mk c1cf11f7f14085e5686068fb4f67b6c45b677951
F mkdll.sh 5ec23622515d5bf8969404e80cfb5e220ddf0512
F mkopcodec.awk bd46ad001c98dfbab07b1713cb8e692fa0e5415d
F mkopcodeh.awk 7563ad235670e864ead95cf672be3fe081450ae0
F src/parse.y d57cdd2adc0923762b40314f08683c836a2e0c90
F src/pragma.c 69413fbdc0c6aaa493a776ea52c1b3e6cf35dfb2
F src/prepare.c 86f0d8e744b8d956eff6bc40e29049efee017610
-F src/printf.c 772b15c3395fa60bdbf3aaa03d480ecde38bf192
+F src/printf.c cea584c5888688c650d856563aadc4296b5afac7
F src/random.c 90adff4e73a3b249eb4f1fc2a6ff9cf78c7233a4
F src/select.c f441648eb191dcf1e67ae61475ea3b40a0eeb787
F src/shell.c 86c16f0d534aa51cc82cf9f66903d4eb681580e7
F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4
F test/pagesize.test cbc6a312b6f6c0f02619b189985df2a14164b690
F test/pragma.test 95ea907adf68459e1be6f310c9ae94d1d59c465b
-F test/printf.test dc39f7c66db3adfe754b4fc0b97fdd97fa06a9c8
+F test/printf.test 4a91651d4fd5eea999eee82a9bdd0a1b797b9ad9
F test/progress.test 16496001da445e6534afb94562c286708316d82f x
F test/quick.test a94d12658a2b590c1a5be580bef09bbb04c1266b
F test/quote.test c1ca5e18800455f1c882baf5b0274755a3836549
F test/trigger4.test 9615207f3746b1f3965113007869e45a895d2497
F test/trigger5.test 619391a3e9fc194081d22cefd830d811e7badf83
F test/trigger6.test 0e411654f122552da6590f0b4e6f781048a4a9b9
+F test/trigger7.test 0afa870be2ce1b132cdb85b17a4a4ef45aa8cece
F test/types.test f0a98d10c5ecc9865d19dc94486f9873afc6bb6b
F test/types2.test 81dd1897be8ef4b5b73d0006e6076abe40610de3
F test/types3.test 5c63c9cdbafe8fcb73a70a0beb0ecb65b7fa061d
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 2fe0ac4fa4d5911e266979021fa7e413d96c558d
-R 31fa1affa5851be2627a9e42460d8a99
+P 0b6cd5acc0ede3367623f40ccfaa96116e686824
+R e4576da06cab5ef483fe5b761dc368f8
U drh
-Z 767cac511bcfeb21d48a46ba088681f1
+Z f0280623a4012ade3b1bce2760205da0
-0b6cd5acc0ede3367623f40ccfaa96116e686824
\ No newline at end of file
+842a80bd8f18d6fd046604f9a057bcd738234f1f
\ No newline at end of file
realvalue = va_arg(ap,double);
#ifndef etNOFLOATINGPOINT
if( precision<0 ) precision = 6; /* Set default precision */
- if( precision>etBUFSIZE-10 ) precision = etBUFSIZE-10;
+ if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
if( realvalue<0.0 ){
realvalue = -realvalue;
prefix = '-';
}else{
flag_rtz = 0;
}
- /* If exp+precision causes the output to be too big for etFLOAT, then
- ** do etEXP instead
- */
- if( xtype==etFLOAT && exp+precision>=etBUFSIZE-30 ){
- xtype = etEXP;
- }
if( xtype==etEXP ){
e2 = 0;
}else{
if( precision>=0 && precision<length ) length = precision;
break;
case etSQLESCAPE:
- case etSQLESCAPE2:
- {
- int i, j, n, c, isnull;
- int needQuote;
- char *arg = va_arg(ap,char*);
- isnull = arg==0;
- if( isnull ) arg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
- for(i=n=0; (c=arg[i])!=0; i++){
- if( c=='\'' ) n++;
- }
- needQuote = !isnull && xtype==etSQLESCAPE2;
- n += i + 1 + needQuote*2;
- if( n>etBUFSIZE ){
- bufpt = zExtra = sqliteMalloc( n );
- if( bufpt==0 ) return -1;
- }else{
- bufpt = buf;
- }
- j = 0;
- if( needQuote ) bufpt[j++] = '\'';
- for(i=0; (c=arg[i])!=0; i++){
- bufpt[j++] = c;
- if( c=='\'' ) bufpt[j++] = c;
- }
- if( needQuote ) bufpt[j++] = '\'';
- bufpt[j] = 0;
- length = j;
- if( precision>=0 && precision<length ) length = precision;
+ case etSQLESCAPE2: {
+ int i, j, n, c, isnull;
+ int needQuote;
+ char *arg = va_arg(ap,char*);
+ isnull = arg==0;
+ if( isnull ) arg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
+ for(i=n=0; (c=arg[i])!=0; i++){
+ if( c=='\'' ) n++;
+ }
+ needQuote = !isnull && xtype==etSQLESCAPE2;
+ n += i + 1 + needQuote*2;
+ if( n>etBUFSIZE ){
+ bufpt = zExtra = sqliteMalloc( n );
+ if( bufpt==0 ) return -1;
+ }else{
+ bufpt = buf;
}
+ j = 0;
+ if( needQuote ) bufpt[j++] = '\'';
+ for(i=0; (c=arg[i])!=0; i++){
+ bufpt[j++] = c;
+ if( c=='\'' ) bufpt[j++] = c;
+ }
+ if( needQuote ) bufpt[j++] = '\'';
+ bufpt[j] = 0;
+ length = j;
+ if( precision>=0 && precision<length ) length = precision;
break;
+ }
case etTOKEN: {
Token *pToken = va_arg(ap, Token*);
if( pToken && pToken->z ){
# This file implements regression tests for SQLite library. The
# focus of this file is testing the sqlite_*_printf() interface.
#
-# $Id: printf.test,v 1.16 2005/08/13 12:59:16 drh Exp $
+# $Id: printf.test,v 1.17 2005/08/19 02:26:27 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
sqlite3_mprintf_int {%*.*c} 4 1 67
} { C}
do_test printf-9.4 {
+ sqlite3_mprintf_int {%d %d %c} 4 1 67
+} {4 1 C}
+set ten { }
+set fifty $ten$ten$ten$ten$ten
+do_test printf-9.5 {
+ sqlite3_mprintf_int {%d %*c} 1 -201 67
+} "1 C$fifty$fifty$fifty$fifty"
+do_test printf-9.6 {
sqlite3_mprintf_int {%yhello} 0 0 0
} {%}
sqlite3_mprintf_double {%d %d %!.15g} 1 1 1e300
} {1 1 1.0e+300}
+# Additional tests for coverage
+#
+do_test printf-12.1 {
+ sqlite3_mprintf_double {%d %d %.2000g} 1 1 1.0
+} {1 1 1}
finish_test
--- /dev/null
+# 2005 August 18
+#
+# 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.
+#
+# This file implements tests to increase coverage of trigger.c.
+#
+# $Id: trigger7.test,v 1.1 2005/08/19 02:26:27 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+ifcapable {!trigger} {
+ finish_test
+ return
+}
+
+
+# Error messages resulting from qualified trigger names.
+#
+do_test trigger7-1.1 {
+ execsql {
+ CREATE TABLE t1(x, y);
+ }
+ catchsql {
+ CREATE TEMP TRIGGER main.r1 AFTER INSERT ON t1 BEGIN
+ SELECT 'no nothing';
+ END
+ }
+} {1 {temporary trigger may not have qualified name}}
+do_test trigger7-1.2 {
+ catchsql {
+ CREATE TRIGGER not_a_db.r1 AFTER INSERT ON t1 BEGIN
+ SELECT 'no nothing';
+ END
+ }
+} {1 {unknown database not_a_db}}
+
+
+# When the UPDATE OF syntax is used, no code is generated for triggers
+# that do not match the update columns.
+#
+ifcapable explain {
+ do_test trigger7-2.1 {
+ execsql {
+ CREATE TRIGGER r1 AFTER UPDATE OF x ON t1 BEGIN
+ SELECT '___update_t1.x___';
+ END;
+ CREATE TRIGGER r2 AFTER UPDATE OF y ON t1 BEGIN
+ SELECT '___update_t1.y___';
+ END;
+ }
+ set txt [db eval {EXPLAIN UPDATE t1 SET x=5}]
+ string match *___update_t1.x___* $txt
+ } 1
+ do_test trigger7-2.2 {
+ set txt [db eval {EXPLAIN UPDATE t1 SET x=5}]
+ string match *___update_t1.y___* $txt
+ } 0
+ do_test trigger7-2.3 {
+ set txt [db eval {EXPLAIN UPDATE t1 SET y=5}]
+ string match *___update_t1.x___* $txt
+ } 0
+ do_test trigger7-2.4 {
+ set txt [db eval {EXPLAIN UPDATE t1 SET y=5}]
+ string match *___update_t1.y___* $txt
+ } 1
+ do_test trigger7-2.5 {
+ set txt [db eval {EXPLAIN UPDATE t1 SET rowid=5}]
+ string match *___update_t1.x___* $txt
+ } 0
+ do_test trigger7-2.6 {
+ set txt [db eval {EXPLAIN UPDATE t1 SET rowid=5}]
+ string match *___update_t1.x___* $txt
+ } 0
+}
+
+# Test the ability to create many triggers on the same table, then
+# selectively drop those triggers.
+#
+do_test trigger7-3.1 {
+ execsql {
+ CREATE TABLE t2(x,y,z);
+ CREATE TRIGGER t2r1 AFTER INSERT ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r2 BEFORE INSERT ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r3 AFTER UPDATE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r4 BEFORE UPDATE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r5 AFTER DELETE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r6 BEFORE DELETE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r7 AFTER INSERT ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r8 BEFORE INSERT ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r9 AFTER UPDATE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r10 BEFORE UPDATE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r11 AFTER DELETE ON t2 BEGIN SELECT 1; END;
+ CREATE TRIGGER t2r12 BEFORE DELETE ON t2 BEGIN SELECT 1; END;
+ DROP TRIGGER t2r6;
+ }
+} {}
+
+# This test corrupts the database file so it must be the last test
+# in the series.
+#
+do_test trigger7-99.1 {
+ execsql {
+ PRAGMA writable_schema=on;
+ UPDATE sqlite_master SET sql='nonsense';
+ }
+ db close
+ sqlite3 db test.db
+ catchsql {
+ DROP TRIGGER t2r5
+ }
+} {1 {malformed database schema - near "nonsense": syntax error}}
+
+finish_test