/ Check-in [dd48a31e]
Login

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

Overview
Comment:Additional comments ono the SQLITE_MIXED_ENDIAN_64BIT_FLOAT issue. (CVS 4029)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dd48a31e671de09f59661b2ba1a20e7b9f09099a
User & Date: drh 2007-05-23 07:20:09
Context
2007-05-23
09:52
Fix a database corrupting bug in the optimistic overflow chain. Exposed by running bigrow.test with auto-vacuum enabled. (CVS 4030) check-in: 10ee2d50 user: danielk1977 tags: trunk
07:20
Additional comments ono the SQLITE_MIXED_ENDIAN_64BIT_FLOAT issue. (CVS 4029) check-in: dd48a31e user: drh tags: trunk
06:31
Make sure zeroblob() works with the concatenation operator. Ticket #2379. (CVS 4028) check-in: 6e19ef75 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779














1780
1781
1782
1783
1784
1785
1786
    static const u8 aSize[] = { 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0 };
    return aSize[serial_type];
  }
}

/*
** If we are on an architecture with mixed-endian floating 
*** points (ex: ARM7) then swap the lower 4 bytes with the 
** upper 4 bytes.  Return the result.
**
** For most (sane) architectures, this is a no-op.














*/
#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
static double floatSwap(double in){
  union {
    double r;
    u32 i[2];
  } u;







|


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
    static const u8 aSize[] = { 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0 };
    return aSize[serial_type];
  }
}

/*
** If we are on an architecture with mixed-endian floating 
** points (ex: ARM7) then swap the lower 4 bytes with the 
** upper 4 bytes.  Return the result.
**
** For most architectures, this is a no-op.
**
** (later):  It is reported to me that the mixed-endian problem
** on ARM7 is an issue with GCC, not with the ARM7 chip.  It seems
** that early versions of GCC stored the two words of a 64-bit
** float in the wrong order.  And that error has been propagated
** ever since.  The blame is not necessarily with GCC, though.
** GCC might have just copying the problem from a prior compiler.
** I am also told that newer versions of GCC that follow a different
** ABI get the byte order right.
**
** Developers using SQLite on an ARM7 should compile and run their
** application using -DSQLITE_DEBUG=1 at least once.  With DEBUG
** enabled, some asserts below will ensure that the byte order of
** floating point values is correct.
*/
#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
static double floatSwap(double in){
  union {
    double r;
    u32 i[2];
  } u;