Below is the list of changes that have just been committed into a local
5.1-falcon repository of . When does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-19 11:14:01-04:00, jas@rowvwade. +5 -0
Fix bug 26469.
storage/falcon/BigInt.cpp@stripped, 2007-04-19 11:13:53-04:00, jas@rowvwade. +6 -0
Use single method to scale double numbers (table rather
than iteration driven).
storage/falcon/EncodedDataStream.cpp@stripped, 2007-04-19 11:13:53-04:00, jas@rowvwade. +1 -1
Fix encoding error for small scaled numbers.
storage/falcon/MemMgr.cpp@stripped, 2007-04-19 11:13:54-04:00, jas@rowvwade. +1 -1
Fix column order of information schema memory reporting.
storage/falcon/Value.cpp@stripped, 2007-04-19 11:13:54-04:00, jas@rowvwade. +37 -1
Use table rather than iteration to scale double number.
storage/falcon/Value.h@stripped, 2007-04-19 11:13:55-04:00, jas@rowvwade. +6 -4
Made Value::scaleDouble a module static.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jas
# Host: rowvwade.
# Root: D:/MySQL/mysql-5.1-falcon
--- 1.6/storage/falcon/BigInt.cpp 2007-04-19 11:14:24 -04:00
+++ 1.7/storage/falcon/BigInt.cpp 2007-04-19 11:14:24 -04:00
@@ -21,6 +21,7 @@
#include <stdio.h>
#include "Engine.h"
#include "BigInt.h"
+#include "Value.h"
static const int powersOfTen [] = {
1,
@@ -357,10 +358,15 @@
for (int n = length - 1; n >= 0; --n)
d = d * 4294967296. + words[n];
+ if (scale)
+ d = Value::scaleDouble(d, -scale);
+
+ /***
if (scale < 0)
d /= powersOfTen[-scale];
else if (scale > 0)
d *= powersOfTen[scale];
+ ***/
return (neg) ? -d : d;
}
--- 1.8/storage/falcon/EncodedDataStream.cpp 2007-04-19 11:14:24 -04:00
+++ 1.9/storage/falcon/EncodedDataStream.cpp 2007-04-19 11:14:24 -04:00
@@ -172,7 +172,7 @@
if (scale)
{
- stream->putCharacter(edsScaledLen1 + count);
+ stream->putCharacter(edsScaledLen0 + count);
stream->putCharacter(scale);
}
else if (val >= edsIntMin && val <= edsIntMax)
--- 1.16/storage/falcon/MemMgr.cpp 2007-04-19 11:14:24 -04:00
+++ 1.17/storage/falcon/MemMgr.cpp 2007-04-19 11:14:24 -04:00
@@ -1012,8 +1012,8 @@
detailTable->putString(n++, (p) ? p + 1 : client->fileName);
detailTable->putInt(n++, client->line);
detailTable->putInt(n++, client->objectsInUse);
- detailTable->putInt(n++, client->objectsDeleted);
detailTable->putInt(n++, client->spaceInUse);
+ detailTable->putInt(n++, client->objectsDeleted);
detailTable->putInt(n++, client->spaceDeleted);
detailTable->putRecord();
}
--- 1.21/storage/falcon/Value.cpp 2007-04-19 11:14:24 -04:00
+++ 1.22/storage/falcon/Value.cpp 2007-04-19 11:14:24 -04:00
@@ -36,6 +36,19 @@
#define BACKWARDS
+static const double powersOfTen [] = {
+ 1,
+ 10,
+ 100,
+ 1000,
+ 10000,
+ 100000,
+ 1000000,
+ 10000000,
+ 100000000,
+ 1000000000
+ };
+
#ifdef _DEBUG
static char THIS_FILE[]=__FILE__;
#endif
@@ -575,13 +588,17 @@
{
double d = data.dbl;
+ if (scl)
+ d = scaleDouble(d, -scl);
+ /***
if (scl > 0)
for (int n = 0; n < scl; ++n)
d *= 10;
else if (scl < 0)
for (int n = 0; n > scl; --n)
d /= 10;
-
+ ***/
+
if (d > 0)
d += 0.5;
else if (d < 0)
@@ -1622,12 +1639,31 @@
double Value::scaleDouble(double d, int scale)
{
+ int n = scale;
+
+ /***
if (scale > 0)
for (int n = 0; n < scale; ++n)
d /= 10;
else if (scale < 0)
for (int n = 0; n > scale; --n)
d *= 10;
+ ***/
+
+ if (scale > 0)
+ {
+ for (; n > 10; n -= 10)
+ d /= powersOfTen[10];
+
+ d /= powersOfTen[n];
+ }
+ else if (scale < 0)
+ {
+ for (; n < -10; n += 10)
+ d *= powersOfTen[10];
+
+ d *= powersOfTen[-n];
+ }
return d;
}
--- 1.10/storage/falcon/Value.h 2007-04-19 11:14:24 -04:00
+++ 1.11/storage/falcon/Value.h 2007-04-19 11:14:24 -04:00
@@ -88,10 +88,7 @@
int compareClobs (Clob *clob1, Clob *clob2);
bool isNumber();
- double scaleDouble (double d, int scale);
- static double convertToDouble (const char *string);
- static double convertToDouble (const char *string, int length);
- static int64 convertToQuad (const char *string, int length, double& divisor);
+
void multiply (Value *value);
void subtract (Value* value);
int64 reScale (int64 number, int from, int to);
@@ -105,6 +102,11 @@
char* allocString (Type typ, int length);
int64 convertToQuad (double& divisor);
void truncateString(int maxLength);
+
+ static double scaleDouble (double d, int scale);
+ static double convertToDouble (const char *string);
+ static double convertToDouble (const char *string, int length);
+ static int64 convertToQuad (const char *string, int length, double& divisor);
inline void clear()
{
| Thread |
|---|
| • bk commit into 5.1-falcon tree (jas:1.2614) | U-ROWVWADEjas | 19 Apr |