Floating point values are serialized in big-endian byte order. (CVS 1431)
FossilOrigin-Name: acb65297b69c531813287166175fa7864c900fe6
This commit is contained in:
parent
7f0f12e3ab
commit
1483e14cf7
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Remove\sthe\sOP_SetFound\sopcode\sand\sits\scousins.\s(CVS\s1430)
|
||||
D 2004-05-21T13:39:50
|
||||
C Floating\spoint\svalues\sare\sserialized\sin\sbig-endian\sbyte\sorder.\s(CVS\s1431)
|
||||
D 2004-05-21T21:12:42
|
||||
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
|
||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||
@ -67,7 +67,7 @@ F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
||||
F src/vdbe.c 2944326a99869c71698f634d6ace9e9be56d9180
|
||||
F src/vdbe.h 391d5642a83af686f35c228fcd36cb4456d68f44
|
||||
F src/vdbeInt.h 8ed2272e97bef20c5302c3b2cb4f900e8b5e2642
|
||||
F src/vdbeaux.c 0a0de6f6097125960b02a3c8625fa896cbc61271
|
||||
F src/vdbeaux.c 2dd437063e9a0769ce453f7ce94407934f56e2f8
|
||||
F src/where.c efe5d25fe18cd7381722457898cd863e84097a0c
|
||||
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
|
||||
F test/attach.test cb9b884344e6cfa5e165965d5b1adea679a24c83
|
||||
@ -195,7 +195,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
|
||||
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
||||
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
||||
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
||||
P 550a53b3f28ddb288bcb6c21849ca83b0a20bde4
|
||||
R a27328b840ad5ac31f67deb6b635b74b
|
||||
P 5524075ec02102446f8d153e068546f763d4bf7a
|
||||
R 3fab4945c0e9af6644985641add2812d
|
||||
U drh
|
||||
Z 678137ddf4cdf9bac7e4b018c69ba9fb
|
||||
Z 8a832721c126d5ef16d065c0fc0b260b
|
||||
|
@ -1 +1 @@
|
||||
5524075ec02102446f8d153e068546f763d4bf7a
|
||||
acb65297b69c531813287166175fa7864c900fe6
|
@ -1426,23 +1426,21 @@ int sqlite3VdbeSerialPut(unsigned char *buf, const Mem *pMem){
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Integer */
|
||||
if( serial_type<5 ){
|
||||
i64 i = pMem->i;
|
||||
len = sqlite3VdbeSerialTypeLen(serial_type);
|
||||
while( len-- ){
|
||||
buf[len] = (i&0xFF);
|
||||
i = i >> 8;
|
||||
/* Integer and Real */
|
||||
if( serial_type<=5 ){
|
||||
u64 v;
|
||||
int i;
|
||||
if( serial_type==5 ){
|
||||
v = *(u64*)&pMem->r;
|
||||
}else{
|
||||
v = *(u64*)&pMem->i;
|
||||
}
|
||||
return sqlite3VdbeSerialTypeLen(serial_type);
|
||||
}
|
||||
|
||||
/* Float */
|
||||
if( serial_type==5 ){
|
||||
/* TODO: byte ordering? */
|
||||
assert( sizeof(double)==8 );
|
||||
memcpy(buf, &pMem->r, 8);
|
||||
return 8;
|
||||
len = i = sqlite3VdbeSerialTypeLen(serial_type);
|
||||
while( i-- ){
|
||||
buf[i] = (v&0xFF);
|
||||
v >>= 8;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/* String or blob */
|
||||
@ -1471,35 +1469,28 @@ int sqlite3VdbeSerialGet(const unsigned char *buf, u64 serial_type, Mem *pMem){
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Integer */
|
||||
if( serial_type<5 ){
|
||||
i64 i = 0;
|
||||
/* Integer and Real */
|
||||
if( serial_type<=5 ){
|
||||
u64 v = 0;
|
||||
int n;
|
||||
len = sqlite3VdbeSerialTypeLen(serial_type);
|
||||
|
||||
if( buf[0]&0x80 ){
|
||||
for(n=0; n<(8-len); n++){
|
||||
i = (i<<8)+0xFF;
|
||||
}
|
||||
v = -1;
|
||||
}
|
||||
for(n=0; n<len; n++){
|
||||
i = i << 8;
|
||||
i = i + buf[n];
|
||||
v = (v<<8) | buf[n];
|
||||
}
|
||||
pMem->flags = MEM_Int;
|
||||
pMem->i = i;
|
||||
return sqlite3VdbeSerialTypeLen(serial_type);
|
||||
if( serial_type==5 ){
|
||||
pMem->flags = MEM_Real;
|
||||
pMem->r = *(double*)&v;
|
||||
}else{
|
||||
pMem->flags = MEM_Int;
|
||||
pMem->i = *(int*)&v;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/* Float */
|
||||
if( serial_type==5 ){
|
||||
/* TODO: byte ordering? */
|
||||
assert( sizeof(double)==8 );
|
||||
memcpy(&pMem->r, buf, 8);
|
||||
pMem->flags = MEM_Real;
|
||||
return 8;
|
||||
}
|
||||
|
||||
/* String or blob */
|
||||
assert( serial_type>=12 );
|
||||
len = sqlite3VdbeSerialTypeLen(serial_type);
|
||||
@ -1883,6 +1874,3 @@ int sqlite3VdbeIdxKeyCompare(
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user