Index: src/build.c ================================================================== --- src/build.c +++ src/build.c @@ -1772,11 +1772,11 @@ /* Make sure every column of the PRIMARY KEY is NOT NULL. (Except, ** do not enforce this for imposter tables.) */ if( !db->init.imposterTable ){ for(i=0; iaCol[pPk->aiColumn[i]].notNull = 1; + pTab->aCol[pPk->aiColumn[i]].notNull = OE_Abort; } pPk->uniqNotNull = 1; } /* The root page of the PRIMARY KEY is the table root page */ Index: src/shell.c ================================================================== --- src/shell.c +++ src/shell.c @@ -380,11 +380,11 @@ char *z; if( iotrace==0 ) return; va_start(ap, zFormat); z = sqlite3_vmprintf(zFormat, ap); va_end(ap); - utf8_printf(iotrace, "%s", z); + fprintf(iotrace, "%s", z); sqlite3_free(z); } #endif Index: src/sqliteInt.h ================================================================== --- src/sqliteInt.h +++ src/sqliteInt.h @@ -2738,10 +2738,11 @@ int nTab; /* Number of previously allocated VDBE cursors */ int nMem; /* Number of memory cells used so far */ int nSet; /* Number of sets used so far */ int nOnce; /* Number of OP_Once instructions so far */ int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */ + int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */ int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */ int ckBase; /* Base register of data during check constraints */ int iSelfTab; /* Table of an index whose exprs are being coded */ int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ int iCacheCnt; /* Counter used to generate aColCache[].lru values */ @@ -2973,13 +2974,13 @@ */ struct StrAccum { sqlite3 *db; /* Optional database for lookaside. Can be NULL */ char *zBase; /* A base allocation. Not from malloc. */ char *zText; /* The string collected so far */ - int nChar; /* Length of the string so far */ - int nAlloc; /* Amount of space allocated in zText */ - int mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */ + u32 nChar; /* Length of the string so far */ + u32 nAlloc; /* Amount of space allocated in zText */ + u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */ u8 accError; /* STRACCUM_NOMEM or STRACCUM_TOOBIG */ u8 bMalloced; /* zText points to allocated space */ }; #define STRACCUM_NOMEM 1 #define STRACCUM_TOOBIG 2 Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -2532,11 +2532,11 @@ ){ rc = SQLITE_CORRUPT_BKPT; goto op_column_error; } }else{ - VVA_ONLY( t = 0; ) /* Only needed by assert() statements */ + t = 0; } /* If after trying to extract new entries from the header, nHdrParsed is ** still not up to p2, that means that the record has fewer than p2 ** columns. So the result will be either the default value or a NULL. @@ -3410,11 +3410,11 @@ open_cursor_set_hints: assert( OPFLAG_BULKCSR==BTREE_BULKLOAD ); assert( OPFLAG_SEEKEQ==BTREE_SEEK_EQ ); testcase( pOp->p5 & OPFLAG_BULKCSR ); -#ifdef SQLITE_ENABLE_CURSOR_HINT +#ifdef SQLITE_ENABLE_CURSOR_HINTS testcase( pOp->p2 & OPFLAG_SEEKEQ ); #endif sqlite3BtreeCursorHintFlags(pCur->uc.pCursor, (pOp->p5 & (OPFLAG_BULKCSR|OPFLAG_SEEKEQ))); break; Index: src/vdbeaux.c ================================================================== --- src/vdbeaux.c +++ src/vdbeaux.c @@ -33,10 +33,11 @@ p->magic = VDBE_MAGIC_INIT; p->pParse = pParse; assert( pParse->aLabel==0 ); assert( pParse->nLabel==0 ); assert( pParse->nOpAlloc==0 ); + assert( pParse->szOpAlloc==0 ); return p; } /* ** Change the error string stored in Vdbe.zErrMsg @@ -123,11 +124,12 @@ assert( nOp<=(1024/sizeof(Op)) ); assert( nNew>=(p->nOpAlloc+nOp) ); pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op)); if( pNew ){ - p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op); + p->szOpAlloc = sqlite3DbMallocSize(p->db, pNew); + p->nOpAlloc = p->szOpAlloc/sizeof(Op); v->aOp = pNew; } return (pNew ? SQLITE_OK : SQLITE_NOMEM); } @@ -1848,13 +1850,12 @@ nMem += nCursor; /* Allocate space for memory registers, SQL variables, VDBE cursors and ** an array to marshal SQL function arguments in. */ - zCsr = (u8*)&p->aOp[p->nOp]; /* Memory avaliable for allocation */ - assert( pParse->nOpAlloc*sizeof(Op) <= 0x7fffff00 ); - nFree = (pParse->nOpAlloc - p->nOp)*sizeof(p->aOp[0]); /* Available space */ + zCsr = ((u8*)p->aOp) + ROUND8(sizeof(Op)*p->nOp); /* Available space */ + nFree = pParse->szOpAlloc - ROUND8(sizeof(Op)*p->nOp); /* Size of zCsr */ resolveP2Values(p, &nArg); p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); if( pParse->explain && nMem<10 ){ nMem = 10; Index: test/analyzeF.test ================================================================== --- test/analyzeF.test +++ test/analyzeF.test @@ -104,11 +104,11 @@ do_catchsql_test 4.1 { SELECT * FROM t1 WHERE x = error('error one') AND y = 4; } {1 {error one}} do_catchsql_test 4.2 { - SELECT * FROM t1 WHERE x = zeroblob(2000000000) AND y = 4; + SELECT * FROM t1 WHERE x = zeroblob(2200000000) AND y = 4; } {1 {string or blob too big}} sqlite3_limit db SQLITE_LIMIT_LENGTH 1000000 proc dstr {} { return [string repeat x 1100000] } db func dstr -deterministic dstr @@ -120,8 +120,5 @@ SELECT * FROM t1 WHERE x = test_zeroblob(1100000) AND y = 4; } {1 {string or blob too big}} finish_test - - - Index: test/conflict2.test ================================================================== --- test/conflict2.test +++ test/conflict2.test @@ -287,15 +287,15 @@ # Update: Since temporary table files are now opened lazily, and none # of the following tests use large quantities of data, t3 is always 0. # foreach {i conf1 cmd t0 t1 t2 t3 t4} { 1 {} UPDATE 1 {6 7 8 9} 1 0 1 - 2 REPLACE UPDATE 0 {7 6 9} 1 0 0 - 3 IGNORE UPDATE 0 {6 7 3 9} 1 0 0 - 4 FAIL UPDATE 1 {6 7 3 4} 1 0 0 + 2 REPLACE UPDATE 0 {7 6 9} 1 0 1 + 3 IGNORE UPDATE 0 {6 7 3 9} 1 0 1 + 4 FAIL UPDATE 1 {6 7 3 4} 1 0 1 5 ABORT UPDATE 1 {1 2 3 4} 1 0 1 - 6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 0 + 6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 1 7 REPLACE {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1 9 FAIL {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 10 ABORT {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1 11 ROLLBACK {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 Index: test/cursorhint.test ================================================================== --- test/cursorhint.test +++ test/cursorhint.test @@ -44,14 +44,14 @@ } # Run EXPLAIN on $sql. Return a list of P5 values for all $opcode # opcodes that contain regexp $comment in their comment # -proc p5_of_opcode {db opcode comment sql} { +proc p5_of_opcode {db opcode sql} { set res {} $db eval "EXPLAIN $sql" x { - if {$x(opcode)==$opcode && [regexp $comment $x(comment)]} { + if {$x(opcode)==$opcode} { lappend res $x(p5) } } return $res } @@ -64,11 +64,11 @@ p4_of_opcode db CursorHint { SELECT * FROM t1 CROSS JOIN t2 WHERE a=x } } {{EQ(r[1],c0)}} do_test 1.2 { - p5_of_opcode db OpenRead . { + p5_of_opcode db OpenRead { SELECT * FROM t1 CROSS JOIN t2 WHERE a=x } } {00 00} # Do the same test the other way around. @@ -77,11 +77,11 @@ p4_of_opcode db CursorHint { SELECT * FROM t2 CROSS JOIN t1 WHERE a=x } } {{EQ(c0,r[1])}} do_test 2.2 { - p5_of_opcode db OpenRead . { + p5_of_opcode db OpenRead { SELECT * FROM t2 CROSS JOIN t1 WHERE a=x } } {00 00} # Various expressions captured by CursorHint @@ -112,11 +112,11 @@ p4_of_opcode db CursorHint { SELECT * FROM t1 WHERE b>11 ORDER BY b DESC; } } {GT(c0,11)} do_test 4.2 { - p5_of_opcode db OpenRead . { + p5_of_opcode db OpenRead { SELECT * FROM t1 WHERE b>11; } } {02 00} do_test 4.3asc { p4_of_opcode db CursorHint { @@ -127,11 +127,11 @@ p4_of_opcode db CursorHint { SELECT c FROM t1 WHERE b<11 ORDER BY b DESC; } } {} do_test 4.4 { - p5_of_opcode db OpenRead . { + p5_of_opcode db OpenRead { SELECT c FROM t1 WHERE b<11; } } {00} do_test 4.5asc { Index: test/releasetest.tcl ================================================================== --- test/releasetest.tcl +++ test/releasetest.tcl @@ -84,10 +84,12 @@ "Update-Delete-Limit" { -O2 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 -DSQLITE_ENABLE_STMT_SCANSTATUS + -DSQLITE_LIKE_DOESNT_MATCH_BLOBS + -DSQLITE_ENABLE_CURSOR_HINTS --enable-json1 } "Check-Symbols" { -DSQLITE_MEMDEBUG=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 @@ -828,12 +830,12 @@ *=* { lappend ::EXTRACONFIG [lindex $argv $i] } default { - PUTSERR stderr "" - PUTSERR stderr [string trim $::USAGE_MESSAGE] + PUTSERR "" + PUTSERR [string trim $::USAGE_MESSAGE] exit -1 } } } @@ -943,14 +945,16 @@ set elapsetime [expr {[clock seconds]-$STARTTIME}] set hr [expr {$elapsetime/3600}] set min [expr {($elapsetime/60)%60}] set sec [expr {$elapsetime%60}] set etime [format (%02d:%02d:%02d) $hr $min $sec] + if {$::JOBS>1} {append etime " $::JOBS cores"} + if {[catch {exec hostname} HNAME]==0} {append etime " on $HNAME"} PUTS [string repeat * 79] incr ::NERRCASE $::NERR PUTS "$::NERRCASE failures out of $::NTESTCASE tests in $etime" if {$::SQLITE_VERSION ne ""} { PUTS "SQLite $::SQLITE_VERSION" } } main $argv Index: test/vtabH.test ================================================================== --- test/vtabH.test +++ test/vtabH.test @@ -140,22 +140,24 @@ } else { return [glob -nocomplain $pattern] } } - # Read the first 5 entries from the root directory. + # Read the first 5 entries from the root directory. Except, ignore + # files that contain the "$" character in their names as these are + # special files on some Windows platforms. # set res [list] foreach p [lrange [list_root_files] 0 4] { if {$::tcl_platform(platform) eq "windows"} { - lappend res $p + if {![regexp {\$} $p]} {lappend res $p} } else { lappend res "/$p" } } do_execsql_test 3.1 { - SELECT path FROM fstree LIMIT 5; + SELECT path FROM fstree WHERE path NOT GLOB '*$*' LIMIT 5; } $res # Read all entries in the current directory. # proc contents {pattern} { Index: test/without_rowid5.test ================================================================== --- test/without_rowid5.test +++ test/without_rowid5.test @@ -130,13 +130,17 @@ do_execsql_test without_rowid5-5.1 { CREATE TABLE ipk(key INTEGER PRIMARY KEY, val TEXT) WITHOUT ROWID; INSERT INTO ipk VALUES('rival','bonus'); -- ok to insert non-integer key SELECT * FROM ipk; } {rival bonus} -do_catchsql_test without_rowid5-5.2 { +do_catchsql_test without_rowid5-5.2a { + BEGIN; INSERT INTO ipk VALUES(NULL,'sample'); -- no automatic generation of keys } {1 {NOT NULL constraint failed: ipk.key}} +do_execsql_test without_rowid5-5.2b { + ROLLBACK; +} {} # EVIDENCE-OF: R-33142-02092 AUTOINCREMENT does not work on WITHOUT # ROWID tables. # # EVIDENCE-OF: R-53084-07740 An error is raised if the "AUTOINCREMENT"