]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Test coverage a few extra lines in where.c. (CVS 3756)
authordanielk1977 <danielk1977@noemail.net>
Fri, 30 Mar 2007 09:13:13 +0000 (09:13 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Fri, 30 Mar 2007 09:13:13 +0000 (09:13 +0000)
FossilOrigin-Name: ea49ddf64aa6073b8018dc2faaf199704d359412

manifest
manifest.uuid
src/where.c
test/misc7.test

index 394eece0281e3295b17b6ceb8e51152a3ea9e514..6618d1bcc8b386f075609f044711b1dc7db1a942 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Extra\stest\scases\sto\simprove\scoverage\sof\smain.c.\s(CVS\s3755)
-D 2007-03-30T07:10:51
+C Test\scoverage\sa\sfew\sextra\slines\sin\swhere.c.\s(CVS\s3756)
+D 2007-03-30T09:13:14
 F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -131,7 +131,7 @@ F src/vdbeaux.c 2cf328d44683f1d6b537809536873b1999be6f20
 F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f
 F src/vdbemem.c 58a8be2231b0b13e2e77098debe173e79d22f791
 F src/vtab.c 7fbda947e28cbe7adb3ba752a76ca9ef29936750
-F src/where.c df68bcbb07add015358a91b8412e2ea19dffdbc6
+F src/where.c b5f8e2a0b0758b631c236aef3c7ed9c3b197eae8
 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/all.test 60267b055e82de4fb8b841eabb014bc2f836a4eb
@@ -274,7 +274,7 @@ F test/misc3.test 7bd937e2c62bcc6be71939faf068d506467b1e03
 F test/misc4.test b043a05dea037cca5989f3ae09552fa16119bc80
 F test/misc5.test c7d2d2a5a20dc37d3605a8067f0df5af2240122e
 F test/misc6.test 3de55ec5cadf466ada587173faa5d6a4790a8bb7
-F test/misc7.test ac433b389f5b3ffadc3cdcb370a3cd25450aeb40
+F test/misc7.test 2d0af4730e2bdb5a77c5f9e4c64d7eb6d4bc0d76
 F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
 F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82
 F test/null.test 9503e1f63e959544c006d9f01709c5b5eab67d54
@@ -447,7 +447,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 8d0073c0e8408558dae39f789ac3fa2622b52365
-R 7ca43c6504a732741e356d1f89f80cf3
+P 19fc3d78962d225d42372b9298be5921ec1fc8a1
+R e306459b52b12a97b4adb0ba7151b039
 U danielk1977
-Z f78f3efcdc29e953179129897cb3e69b
+Z d6fdddc3faf743b9b05dd67e7d66af67
index bc9ce68070d0f09adac363f95f2a6b0cfaf94b0a..f9b9b68de647bd5d8bc2621a766035c701e2a404 100644 (file)
@@ -1 +1 @@
-19fc3d78962d225d42372b9298be5921ec1fc8a1
\ No newline at end of file
+ea49ddf64aa6073b8018dc2faaf199704d359412
\ No newline at end of file
index 8dffe625c8f4628d869e54a1ffd0a772d4678c58..8265eb7c94e926c02aaed7c02853228e116f27d2 100644 (file)
@@ -16,7 +16,7 @@
 ** so is applicable.  Because this module is responsible for selecting
 ** indices, you might also think of this module as the "query optimizer".
 **
-** $Id: where.c,v 1.242 2007/03/28 14:30:09 drh Exp $
+** $Id: where.c,v 1.243 2007/03/30 09:13:14 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -523,6 +523,10 @@ static int isLikeOrGlob(
   }
   pColl = pLeft->pColl;
   if( pColl==0 ){
+    /* TODO: Coverage testing doesn't get this case. Is it actually possible
+    ** for an expression of type TK_COLUMN to not have an assigned collation 
+    ** sequence at this point?
+    */
     pColl = db->pDfltColl;
   }
   if( (pColl->type!=SQLITE_COLL_BINARY || noCase) &&
@@ -1292,13 +1296,19 @@ static double bestVirtualIndex(
   ** xBestIndex.
   */
 
-  /* The module name must be defined */
+  /* The module name must be defined. Also, by this point there must
+  ** be a pointer to an sqlite3_vtab structure. Otherwise
+  ** sqlite3ViewGetColumnNames() would have picked up the error. 
+  */
   assert( pTab->azModuleArg && pTab->azModuleArg[0] );
+  assert( pTab->pVtab );
+#if 0
   if( pTab->pVtab==0 ){
     sqlite3ErrorMsg(pParse, "undefined module %s for table %s",
         pTab->azModuleArg[0], pTab->zName);
     return 0.0;
   }
+#endif
 
   /* Set the aConstraint[].usable fields and initialize all 
   ** output variables to zero.
index 7304511a12a74ebd2a10efcac48f2242843a97be..3b9832e4890c0a60fc07500c6699ece0faf6fbbb 100644 (file)
@@ -10,7 +10,7 @@
 #***********************************************************************
 # This file implements regression tests for SQLite library.
 #
-# $Id: misc7.test,v 1.3 2007/03/30 07:10:52 danielk1977 Exp $
+# $Id: misc7.test,v 1.4 2007/03/30 09:13:14 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -128,7 +128,7 @@ db2 close
 # Test that nothing goes horribly wrong when attaching a database
 # after the omit_readlock pragma has been exercised.
 #
-do_test misc7-7 {
+do_test misc7-7.1 {
   file delete -force test2.db
   file delete -force test2.db-journal
   execsql {
@@ -138,6 +138,11 @@ do_test misc7-7 {
     SELECT name FROM aux.sqlite_master;
   }
 } {hello}
+do_test misc7-7.2 {
+  execsql {
+    DETACH aux;
+  }
+} {}
 
 # Test malloc failure whilst installing a foriegn key.
 #
@@ -147,7 +152,26 @@ ifcapable utf16 {
   } {out of memory}
 }
 
+do_test misc7-9 {
+  execsql {
+    SELECT * 
+    FROM (SELECT name+1 AS one FROM sqlite_master LIMIT 1 OFFSET 1) 
+    WHERE one LIKE 'hello%';
+  }
+} {}
 
+#--------------------------------------------------------------------
+# Improve reported coverage by running some debugging code:
+#
+ifcapable vtab {
+  do_test misc7-10 {
+    register_echo_module [sqlite3_connection_pointer db]
+    set sqlite_where_trace 1
+    execsql {
+      CREATE VIRTUAL TABLE t1 USING echo(abc);
+      SELECT a FROM t1 WHERE a = 1 ORDER BY b;
+    }
+  } {1}
+}
 
 finish_test
-