SQLite4
Check-in [860695f9be]
Not logged in

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

Overview
Comment:Remove OP_Int64 and OP_Real. OP_Num is now used instead.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sqlite4-num
Files: files | file ages | folders
SHA1: 860695f9be77e7658f41f3fa95d84dd0daf24d49
User & Date: dan 2013-05-31 19:34:06
Context
2013-05-31
19:37
Merge sqlite4-num branch with trunk. check-in: 7b0d1cf7f4 user: dan tags: trunk
19:34
Remove OP_Int64 and OP_Real. OP_Num is now used instead. Leaf check-in: 860695f9be user: dan tags: sqlite4-num
19:19
Remove uses of type 'double' from the vdbe. check-in: e018823162 user: dan tags: sqlite4-num
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  1908   1908       if( p ){
  1909   1909         *p = sqlite4_num_from_text(z, -1, 0, 0);
  1910   1910         assert( p->sign==0 );
  1911   1911         assert( negateFlag==0 || negateFlag==1 );
  1912   1912         p->sign = negateFlag;
  1913   1913         sqlite4VdbeAddOp4(v, OP_Num, 0, iMem, 0, (const char *)p, P4_NUM);
  1914   1914       }
  1915         -#if 0
  1916         -    double value;
  1917         -    char *zV;
  1918         -    sqlite4AtoF(z, &value, sqlite4Strlen30(z), SQLITE4_UTF8);
  1919         -    assert( !sqlite4IsNaN(value) ); /* The new AtoF never returns NaN */
  1920         -    if( negateFlag ) value = -value;
  1921         -    zV = dup8bytes(v, (char*)&value);
  1922         -    sqlite4VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL);
  1923         -#endif
  1924   1915     }
  1925   1916   }
  1926   1917   #endif
  1927   1918   
  1928   1919   
  1929   1920   /*
  1930   1921   ** Generate an instruction that will put the integer describe by
................................................................................
  1947   1938       assert( z!=0 );
  1948   1939   
  1949   1940       p = (sqlite4_num *)sqlite4DbMallocRaw(pParse->db, sizeof(sqlite4_num));
  1950   1941       if( p ){
  1951   1942         *p = sqlite4_num_from_text(z, -1, (negFlag ? SQLITE4_NEGATIVE : 0), 0);
  1952   1943         sqlite4VdbeAddOp4(v, OP_Num, p->e==0, iMem, 0, (const char *)p, P4_NUM);
  1953   1944       }
  1954         -
  1955         -#if 0
  1956         -    c = sqlite4Atoi64(z, &value, sqlite4Strlen30(z), SQLITE4_UTF8);
  1957         -    if( c==0 || (c==2 && negFlag) ){
  1958         -      char *zV;
  1959         -      if( negFlag ){ value = c==2 ? SMALLEST_INT64 : -value; }
  1960         -      zV = dup8bytes(v, (char*)&value);
  1961         -      sqlite4VdbeAddOp4(v, OP_Int64, 0, iMem, 0, zV, P4_INT64);
  1962         -    }else{
  1963         -#ifdef SQLITE4_OMIT_FLOATING_POINT
  1964         -      sqlite4ErrorMsg(pParse, "oversized integer: %s%s", negFlag ? "-" : "", z);
  1965         -#else
  1966         -      codeReal(v, z, negFlag, iMem);
  1967         -#endif
  1968         -    }
  1969         -#endif
  1970   1945     }
  1971   1946   }
  1972   1947   
  1973   1948   /*
  1974   1949   ** Clear a cache entry.
  1975   1950   */
  1976   1951   static void cacheEntryClear(Parse *pParse, ParseYColCache *p){

Changes to src/pragma.c.

    43     43   
    44     44   /*
    45     45   ** Generate code to return a single integer value.
    46     46   */
    47     47   static void returnSingleInt(Parse *pParse, const char *zLabel, i64 value){
    48     48     Vdbe *v = sqlite4GetVdbe(pParse);
    49     49     int mem = ++pParse->nMem;
    50         -  i64 *pI64 = sqlite4DbMallocRaw(pParse->db, sizeof(value));
    51         -  if( pI64 ){
    52         -    memcpy(pI64, &value, sizeof(value));
           50  +  sqlite4_num *pNum;
           51  +
           52  +  pNum = sqlite4DbMallocRaw(pParse->db, sizeof(value));
           53  +  if( pNum ){
           54  +    *pNum = sqlite4_num_from_int64(value);
    53     55     }
    54         -  sqlite4VdbeAddOp4(v, OP_Int64, 0, mem, 0, (char*)pI64, P4_INT64);
           56  +  sqlite4VdbeAddOp4(v, OP_Num, 1, mem, 0, (char *)pNum, P4_NUM);
    55     57     sqlite4VdbeSetNumCols(v, 1);
    56     58     sqlite4VdbeSetColName(v, 0, COLNAME_NAME, zLabel, SQLITE4_STATIC);
    57     59     sqlite4VdbeAddOp2(v, OP_ResultRow, mem, 1);
    58     60   }
    59     61   
    60     62   #ifndef SQLITE4_OMIT_FLAG_PRAGMAS
    61     63   /*

Changes to src/vdbe.c.

   846    846   ** The 32-bit integer value P1 is written into register P2.
   847    847   */
   848    848   case OP_Integer: {         /* out2-prerelease */
   849    849     pOut->u.num = sqlite4_num_from_int64((i64)pOp->p1);
   850    850     break;
   851    851   }
   852    852   
   853         -/* Opcode: Int64 * P2 * P4 *
   854         -**
   855         -** P4 is a pointer to a 64-bit integer value.
   856         -** Write that value into register P2.
   857         -*/
   858         -case OP_Int64: {           /* out2-prerelease */
   859         -  assert( pOp->p4.pI64!=0 );
   860         -  pOut->u.num = sqlite4_num_from_int64(*pOp->p4.pI64);
   861         -  break;
   862         -}
   863         -
   864         -#ifndef SQLITE4_OMIT_FLOATING_POINT
   865         -/* Opcode: Real * P2 * P4 *
   866         -**
   867         -** P4 is a pointer to a 64-bit floating point value.
   868         -** Write that value into register P2.
   869         -*/
   870         -case OP_Real: {            /* same as TK_FLOAT, out2-prerelease */
   871         -  pOut->flags = MEM_Real;
   872         -  assert( !sqlite4IsNaN(*pOp->p4.pReal) );
   873         -  pOut->u.num = sqlite4_num_from_double(*pOp->p4.pReal);
   874         -  break;
   875         -}
   876         -#endif
   877         -
   878    853   /* Opcode: Num P1 P2 * P4 *
   879    854   **
   880    855   ** P4 is a pointer to an sqlite4_num value. Write that value into 
   881    856   ** register P2. Set the register flags to MEM_Int if P1 is non-zero,
   882    857   ** or MEM_Real otherwise.
   883    858   */
   884    859   case OP_Num: {            /* out2-prerelease */