/ Check-in [b7fe4f36]
Login

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

Overview
Comment:Merge the fork that resulted from a check-in race.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sqlite_stat4
Files: files | file ages | folders
SHA1: b7fe4f362bdf7b233a7b09eb9ce16d296165f82a
User & Date: drh 2013-08-16 14:51:32
Context
2013-08-16
17:18
In sqlite3Stat4ProbeSetValue() change a local variable name iVar to iBindVar to avoid confusion with iVal, and fix a place where the name was actually confused. check-in: 91733bc4 user: drh tags: sqlite_stat4
14:51
Merge the fork that resulted from a check-in race. check-in: b7fe4f36 user: drh tags: sqlite_stat4
14:49
Fix valueFromExpr() so that it returns SQLITE_NOMEM following an OOM when changing text encodings. Also fix some asserts to accommodate OOM errors. check-in: dc1ccd09 user: drh tags: sqlite_stat4
14:48
Fixes for test code that was not working with utf16 databases. Run the analyze*.test scripts as part of the 'utf16' permutation test. check-in: fe99494d user: dan tags: sqlite_stat4
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_func.c.

   492    492   
   493    493     for(iCurrent=0; pHdr<pEndHdr && iCurrent<=iIdx; iCurrent++){
   494    494       u64 iSerialType;
   495    495       Mem mem;
   496    496   
   497    497       memset(&mem, 0, sizeof(mem));
   498    498       mem.db = db;
   499         -    mem.enc = SQLITE_UTF8;
          499  +    mem.enc = ENC(db);
   500    500       pHdr += sqlite3GetVarint(pHdr, &iSerialType);
   501    501       pBody += sqlite3VdbeSerialGet(pBody, (u32)iSerialType, &mem);
   502    502       sqlite3VdbeMemStoreType(&mem);
   503    503   
   504    504       if( iCurrent==iIdx ){
   505    505         sqlite3_result_value(context, &mem);
   506    506       }
................................................................................
   541    541     while( pHdr<pEndHdr ){
   542    542       Tcl_Obj *pVal = 0;
   543    543       u64 iSerialType;
   544    544       Mem mem;
   545    545   
   546    546       memset(&mem, 0, sizeof(mem));
   547    547       mem.db = db;
   548         -    mem.enc = SQLITE_UTF8;
          548  +    mem.enc = ENC(db);
   549    549       pHdr += sqlite3GetVarint(pHdr, &iSerialType);
   550    550       pBody += sqlite3VdbeSerialGet(pBody, (u32)iSerialType, &mem);
   551    551   
   552    552       sqlite3VdbeMemStoreType(&mem);
   553    553       switch( sqlite3_value_type(&mem) ){
   554    554         case SQLITE_TEXT:
   555    555           pVal = Tcl_NewStringObj((const char*)sqlite3_value_text(&mem), -1);

Changes to test/analyze9.test.

    48     48   } {}
    49     49   
    50     50   
    51     51   do_execsql_test 1.1 {
    52     52     ANALYZE;
    53     53   } {}
    54     54   
    55         -do_execsql_test 1.3 {
           55  +do_execsql_test 1.2 {
    56     56     SELECT tbl,idx,nEq,nLt,nDLt,test_decode(sample) FROM sqlite_stat4;
    57     57   } {
    58     58     t1 i1 {1 1 1} {0 0 0} {0 0 0} {(0) (0) 1}
    59     59     t1 i1 {1 1 1} {1 1 1} {1 1 1} {(1) (1) 2}
    60     60     t1 i1 {1 1 1} {2 2 2} {2 2 2} {(2) (2) 3}
    61     61     t1 i1 {1 1 1} {3 3 3} {3 3 3} {(3) (3) 4}
    62     62     t1 i1 {1 1 1} {4 4 4} {4 4 4} {(4) (4) 5}
    63     63   }
    64     64   
    65         -do_execsql_test 1.2 {
    66         -  SELECT tbl,idx,nEq,nLt,nDLt,s(sample) FROM sqlite_stat4;
    67         -} {
    68         -  t1 i1 {1 1 1} {0 0 0} {0 0 0} ....(0)(0)
    69         -  t1 i1 {1 1 1} {1 1 1} {1 1 1} ....(1)(1).
    70         -  t1 i1 {1 1 1} {2 2 2} {2 2 2} ....(2)(2).
    71         -  t1 i1 {1 1 1} {3 3 3} {3 3 3} ....(3)(3).
    72         -  t1 i1 {1 1 1} {4 4 4} {4 4 4} ....(4)(4).
           65  +if {[permutation] != "utf16"} {
           66  +  do_execsql_test 1.3 {
           67  +    SELECT tbl,idx,nEq,nLt,nDLt,s(sample) FROM sqlite_stat4;
           68  +  } {
           69  +    t1 i1 {1 1 1} {0 0 0} {0 0 0} ....(0)(0)
           70  +    t1 i1 {1 1 1} {1 1 1} {1 1 1} ....(1)(1).
           71  +    t1 i1 {1 1 1} {2 2 2} {2 2 2} ....(2)(2).
           72  +    t1 i1 {1 1 1} {3 3 3} {3 3 3} ....(3)(3).
           73  +    t1 i1 {1 1 1} {4 4 4} {4 4 4} ....(4)(4).
           74  +  }
    73     75   }
    74     76   
    75     77   
    76     78   #-------------------------------------------------------------------------
    77     79   # This is really just to test SQL user function "test_decode".
    78     80   #
    79     81   reset_db
................................................................................
   360    362   do_execsql_test 7.5 {
   361    363     ANALYZE;
   362    364     UPDATE sqlite_stat4 SET nlt = '0 0 0';
   363    365     ANALYZE sqlite_master;
   364    366     SELECT * FROM t1 WHERE a = 5;
   365    367   } {5 5}
   366    368   
          369  +#-------------------------------------------------------------------------
          370  +#
          371  +reset_db
          372  +do_execsql_test 8.1 {
          373  +  CREATE TABLE t1(x TEXT);
          374  +  CREATE INDEX i1 ON t1(x);
          375  +  INSERT INTO t1 VALUES('1');
          376  +  INSERT INTO t1 VALUES('2');
          377  +  INSERT INTO t1 VALUES('3');
          378  +  INSERT INTO t1 VALUES('4');
          379  +  ANALYZE;
          380  +}
          381  +
          382  +breakpoint
          383  +do_execsql_test 8.2 {
          384  +  SELECT * FROM t1 WHERE x = 3;
          385  +} {3}
   367    386   
   368    387   finish_test
   369    388   

Changes to test/permutations.test.

   496    496   #
   497    497   test_suite "utf16" -description {
   498    498     Run tests using UTF-16 databases
   499    499   } -presql {
   500    500     pragma encoding = 'UTF-16'
   501    501   } -files {
   502    502       alter.test alter3.test
          503  +    analyze.test analyze3.test analyze4.test analyze5.test analyze6.test
          504  +    analyze7.test analyze8.test analyze9.test analyzeA.test
   503    505       auth.test bind.test blob.test capi2.test capi3.test collate1.test
   504    506       collate2.test collate3.test collate4.test collate5.test collate6.test
   505    507       conflict.test date.test delete.test expr.test fkey1.test func.test
   506    508       hook.test index.test insert2.test insert.test interrupt.test in.test
   507    509       intpkey.test ioerr.test join2.test join.test lastinsert.test
   508    510       laststmtchanges.test limit.test lock2.test lock.test main.test 
   509    511       memdb.test minmax.test misc1.test misc2.test misc3.test notnull.test