/ Check-in [02e3c88f]
Login

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

Overview
Comment:Ensure that comparison operators do not mess up the MEM_Dyn flag on registers when reverting affinity changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 02e3c88fbf6abdcf3975fb0fb71972b0ab30da30
User & Date: drh 2015-03-31 11:42:23
References
2015-05-20
19:44
Ensure that comparison operators do not mess up the MEM_Dyn flag on registers when reverting affinity changes. Cherrypick of [02e3c88fbf6a]. check-in: 4125477e user: dan tags: branch-3.8.6
Context
2015-05-20
19:44
Ensure that comparison operators do not mess up the MEM_Dyn flag on registers when reverting affinity changes. Cherrypick of [02e3c88fbf6a]. check-in: 4125477e user: dan tags: branch-3.8.6
2015-03-31
13:46
Add the "mptest" target to Makefile.msc check-in: 1e814e0b user: drh tags: trunk
11:42
Ensure that comparison operators do not mess up the MEM_Dyn flag on registers when reverting affinity changes. check-in: 02e3c88f user: drh tags: trunk
2015-03-30
23:43
Prevent a possible infinite loop when trying to DROP a table from a corrupt database. check-in: 395bb3e6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/vdbe.c.

  1916   1916           applyNumericAffinity(pIn3,0);
  1917   1917         }
  1918   1918       }else if( affinity==SQLITE_AFF_TEXT ){
  1919   1919         if( (pIn1->flags & MEM_Str)==0 && (pIn1->flags & (MEM_Int|MEM_Real))!=0 ){
  1920   1920           testcase( pIn1->flags & MEM_Int );
  1921   1921           testcase( pIn1->flags & MEM_Real );
  1922   1922           sqlite3VdbeMemStringify(pIn1, encoding, 1);
         1923  +        testcase( (flags1&MEM_Dyn) != (pIn1->flags&MEM_Dyn) );
         1924  +        flags1 = (pIn1->flags & ~MEM_TypeMask) | (flags1 & MEM_TypeMask);
  1923   1925         }
  1924   1926         if( (pIn3->flags & MEM_Str)==0 && (pIn3->flags & (MEM_Int|MEM_Real))!=0 ){
  1925   1927           testcase( pIn3->flags & MEM_Int );
  1926   1928           testcase( pIn3->flags & MEM_Real );
  1927   1929           sqlite3VdbeMemStringify(pIn3, encoding, 1);
         1930  +        testcase( (flags3&MEM_Dyn) != (pIn3->flags&MEM_Dyn) );
         1931  +        flags3 = (pIn3->flags & ~MEM_TypeMask) | (flags3 & MEM_TypeMask);
  1928   1932         }
  1929   1933       }
  1930   1934       assert( pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0 );
  1931   1935       if( pIn1->flags & MEM_Zero ){
  1932   1936         sqlite3VdbeMemExpandBlob(pIn1);
  1933   1937         flags1 &= ~MEM_Zero;
  1934   1938       }
................................................................................
  1957   1961     }else{
  1958   1962       VdbeBranchTaken(res!=0, (pOp->p5 & SQLITE_NULLEQ)?2:3);
  1959   1963       if( res ){
  1960   1964         pc = pOp->p2-1;
  1961   1965       }
  1962   1966     }
  1963   1967     /* Undo any changes made by applyAffinity() to the input registers. */
         1968  +  assert( (pIn1->flags & MEM_Dyn) == (flags1 & MEM_Dyn) );
  1964   1969     pIn1->flags = flags1;
         1970  +  assert( (pIn3->flags & MEM_Dyn) == (flags3 & MEM_Dyn) );
  1965   1971     pIn3->flags = flags3;
  1966   1972     break;
  1967   1973   }
  1968   1974   
  1969   1975   /* Opcode: Permutation * * * P4 *
  1970   1976   **
  1971   1977   ** Set the permutation used by the OP_Compare operator to be the array