ZeosLib 7 64 bits support
Moderators: gto, EgonHugeist, olehs
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Fabio,
I did test. See the bug report...
Here's the comment on the report I wrote :
Mark
I did test. See the bug report...
Here's the comment on the report I wrote :
I did try to get your changes compiled. But I have very bad news for you. None of the patches was successful.
For ZAbstractRoDataset:
- First change compiles on all compilers I tested.
- Second one doesn't... (Delphi7, didn't test the other compilers)
D:\Data\Delphi\ZEOSTesting\src\component\ZAbstractRODataset.pas(2220) Error: Operator not applicable to this operand type
- Testing suite with only first change : starts spitting 'Bookmark not found' errors.
- No testing suite for Lazarus because the dunit the test suite is based on isn't fpc compatible.
For ZDbcMysqlResultSet:
- Compiles without problems...
- Test suite starts getting "mysql5/mysql-5: Stream sizes are not equal. Binary Stream, expected: <1024> but was: <4>"
- This seems a logical error as the patch you did send implies ignoring the data size returned by mysql. Can you explain what the exact 64-bit-problem was that you wanted to solve with this change? Maybe we can find a better solution.
Mark
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
In ZDbcMysqlResultSet, before patch, I got the exception "Unknown MySQL data type", and after the patch it are working fine. I have debugged and I could see that variable Length becomes with 0 when tries to fetch the data type from resultset. I don't know what's wrong in this lines (LengthPointer NEVER is NULL):
- LengthPointer := FPlainDriver.FetchLengths(FQueryHandle);
- if LengthPointer <> nil then
->> Length := PLongInt(LongInt(LengthPointer) + ColumnIndex * SizeOf(LongInt))^
- else
- Length := 0;
But the content of var Buffer is right. Because of this, I created this patch.
Fabio
- LengthPointer := FPlainDriver.FetchLengths(FQueryHandle);
- if LengthPointer <> nil then
->> Length := PLongInt(LongInt(LengthPointer) + ColumnIndex * SizeOf(LongInt))^
- else
- Length := 0;
But the content of var Buffer is right. Because of this, I created this patch.
Fabio
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
So, depending on the platform all unsigned long fields must be changed to the right longint replacement.
I'm quite a datatype dummy, so I'll ask, is there a pascal type having exactly the same behaviour? (eg. the generic Integer instead of longint?) Then the solution would be to replace the current references to longints in the interface to the 'variable' integer type.
If there's no comparable datatype we could change the way these integers are read by using IFDEFS.
Can you help here?
Mark
I'm quite a datatype dummy, so I'll ask, is there a pascal type having exactly the same behaviour? (eg. the generic Integer instead of longint?) Then the solution would be to replace the current references to longints in the interface to the 'variable' integer type.
If there's no comparable datatype we could change the way these integers are read by using IFDEFS.
Can you help here?
Mark
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
Yes!
FPC Have QWord and Int64 and Delphi only Int64 (maybe I'm wrong).
To test, I created the following integer types in ZCompatibility:
ULong = unsigned long of C (it can be 32 and 64 bits, CPU dependent using FPC CPU64 defines. In delphi it are the LongWord type because delphi is 32 bits only. In FPC it can be LongWord (32) and QWord (64), depend if CPU64 is defined).
ULongLong = unsigned long long of C, used a lot in MySQL. It alway have 64 bits of size. Equivalent of QWord of FPC but don't have a same type in Delphi (I could be wrong!), so I created a type ULongLong = 0..18446744073709551615; in delphi.
Uint = unsigned int in C = LongWord in delphi and FPC. It always have 32 bits of size.
And theirs typed pointers;
PULong = ^ULong;
PULongLong = ^ULongLong;
PUInt = ^UInt;
I'm doing the translation between integer types to new integer types in MySQL. Using the new types, I solved the problem with wrong calculation of size of buffer in GetString.
I changed records to new types too.
All news, I will post here.
Fabio
FPC Have QWord and Int64 and Delphi only Int64 (maybe I'm wrong).
To test, I created the following integer types in ZCompatibility:
ULong = unsigned long of C (it can be 32 and 64 bits, CPU dependent using FPC CPU64 defines. In delphi it are the LongWord type because delphi is 32 bits only. In FPC it can be LongWord (32) and QWord (64), depend if CPU64 is defined).
ULongLong = unsigned long long of C, used a lot in MySQL. It alway have 64 bits of size. Equivalent of QWord of FPC but don't have a same type in Delphi (I could be wrong!), so I created a type ULongLong = 0..18446744073709551615; in delphi.
Uint = unsigned int in C = LongWord in delphi and FPC. It always have 32 bits of size.
And theirs typed pointers;
PULong = ^ULong;
PULongLong = ^ULongLong;
PUInt = ^UInt;
I'm doing the translation between integer types to new integer types in MySQL. Using the new types, I solved the problem with wrong calculation of size of buffer in GetString.
I changed records to new types too.
All news, I will post here.
Fabio
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
Hi!
I have a excelent news! I got ZeosLib working under Linux 64bit (at least with MySQL and Postgres).
I will test the changes in Delphi 7 and 2006 to correct some compiler errors.
The second patch will coming soon...
I found in FPC Platform dependent integers types, I will see if the same types exists in Delphi.
Regards,
Fabio
I have a excelent news! I got ZeosLib working under Linux 64bit (at least with MySQL and Postgres).
I will test the changes in Delphi 7 and 2006 to correct some compiler errors.
The second patch will coming soon...
I found in FPC Platform dependent integers types, I will see if the same types exists in Delphi.
Regards,
Fabio
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact:
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
The patch is in the bug tracker at http://zeosbugs.firmos.at/ .
I applied the patch but got trouble running the test suite on the 32-bit compilers.
Out-of-the-box packages don't exist yet.
Mark
I applied the patch but got trouble running the test suite on the 32-bit compilers.
Out-of-the-box packages don't exist yet.
Mark
-
- Fresh Boarder
- Posts: 22
- Joined: 24.09.2009, 13:25
- Contact:
Hi my friend, i am very dissapointed because i discover yesterday the first class dbo lib zeos have not support for 64 bits.papelhigienico wrote:Hi Mark!
Good news! The exception "Bookmark was not found" has been removed when opening the table (tested in Postgres and MySQL). But when I try to update a field, I got another exception, but I will seek this problem.
And yes, the problem is related with some casting of integer to pointer.
As always , i discover in the hard way. After migrate a complete project from delphi to lazarus, the project compiles fine, but get the infamous error "bookmark not found".
I do a simple test case and neither work.
Using Ubunty 9.04/FPC 2.2.4/Lazarus0.9.29/firebird 2.1, no luck.
Do the same test with sqldb components, work perfect...
I even try your patch papelhigienico (great nick, btw) and dont help.
I mind that one:
// Index := CurrentRows.IndexOf(PPointer(Bookmark)^);
Index := CurrentRows.IndexOf(Bookmark);
And index keep returning zero...
I really hope the way to solve that. Im stuck here. I have a great project using RemObjects/DataAsbtract, and the only problem is the lack of support for 64 bits in ZEOS!
Best Regards.