Bug #29200 falcon tree doesn't compile on 32-bit box
Submitted: 19 Jun 2007 8:44 Modified: 2 Jul 2007 4:48
Reporter: Sergey Vojtovich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version: OS:Linux (FC 6)
Assigned to: CPU Architecture:Any

[19 Jun 2007 8:44] Sergey Vojtovich
Description:
Compiler issues following errors:
BigInt.cpp:498: error: integer constant is too large for ‘long’ type
BigInt.cpp:499: error: integer constant is too large for ‘long’ type
BigInt.cpp:565: error: integer constant is too large for ‘long’ type
BigInt.cpp:566: error: integer constant is too large for ‘long’ type
BigInt.cpp:609: error: integer constant is too large for ‘long’ type
BigInt.cpp:614: error: integer constant is too large for ‘long’ type
BigInt.cpp:622: error: integer constant is too large for ‘long’ type
BigInt.cpp:622: error: integer constant is too large for ‘long’ type
BigInt.cpp:626: error: integer constant is too large for ‘long’ type

How to repeat:
BUILD/compile-pentium-debug-falcon.

Suggested fix:
===== storage/falcon/BigInt.cpp 1.12 vs edited =====
--- 1.12/storage/falcon/BigInt.cpp      2007-06-19 07:02:12 +05:00
+++ edited/storage/falcon/BigInt.cpp    2007-06-19 12:42:15 +05:00
@@ -30,7 +30,7 @@ static const char THIS_FILE[]=__FILE__;
 #endif

 #define MPBASE 32
-#define B 0x100000000 // Number base (MPBASE bits)
+#define B 0x100000000ull // Number base (MPBASE bits)

 static BigInt* powerTable[maxPowerOfTen];
 static bool powerTableInit;
@@ -491,12 +491,12 @@ int BigInt::nlz(uint64 x)

    if (x == 0) return(64);
    n = 0;
-   if (x <= 0x00000000FFFFFFFF) {n = n + 32; x = x << 32;}
-   if (x <= 0x0000FFFFFFFFFFFF) {n = n + 16; x = x << 16;}
-   if (x <= 0x00FFFFFFFFFFFFFF) {n = n + 8;  x = x << 8;}
-   if (x <= 0x0FFFFFFFFFFFFFFF) {n = n + 4;  x = x << 4;}
-   if (x <= 0x3FFFFFFFFFFFFFFF) {n = n + 2;  x = x << 2;}
-   if (x <= 0x7FFFFFFFFFFFFFFF) {n = n + 1;}
+   if (x <= 0x00000000FFFFFFFFull) {n = n + 32; x = x << 32;}
+   if (x <= 0x0000FFFFFFFFFFFFull) {n = n + 16; x = x << 16;}
+   if (x <= 0x00FFFFFFFFFFFFFFull) {n = n + 8;  x = x << 8;}
+   if (x <= 0x0FFFFFFFFFFFFFFFull) {n = n + 4;  x = x << 4;}
+   if (x <= 0x3FFFFFFFFFFFFFFFull) {n = n + 2;  x = x << 2;}
+   if (x <= 0x7FFFFFFFFFFFFFFFull) {n = n + 1;}
    return n;
 }
[19 Jun 2007 15:58] MySQL Verification Team
I was not able to repeat, looks like the suggestion fix was already applied.
[20 Jun 2007 4:04] Hakan Küçükyılmaz
Fixed with patch from Sergey.
[2 Jul 2007 4:48] MC Brown
Internal/compilation issue only. No entry entry in the changelog required.