Full Unicode/Ansi-Support in /testing branch
Moderators: gto, EgonHugeist, olehs
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
@miab3,
Concerning the DXE. My trail-time was running out, sorry... I would like to have one to test the modifications, but it's a little bit to expensive right now.
@Serg77,
its always a pleasure to help. Thank you for the comming tutorial.
King regards,
Michael
Oh i'm not perfect just trying to help. Whats wrong? We had strange problems to access the Blobs with FPC+Win64. Did you test your changes in this environment too? The FPC wasn't able to read the PByte values, why i don't know.. Can you test this with XE2 64Bit if we really need the PBoolean there?But my version was right and not what you did.
DXE2/32 - WIN32
DXE2/64 - WIN64
Compiling problems? Which issues do you had here? Eventually improve with some {$IFDEF} again?Yes.
No good news. But as far as i know are the packages tested from two users and they where lucky. So i'll compare your changes manually to deside what to do. Or Can you describe the issues more detailed? I mean the "mischmasch" part seems to be international.Yes.
Especially ZComponent.dpk, ZComponentDesign.dpk and all *.dproj with XE(1) and OSX mishmash.
Concerning the DXE. My trail-time was running out, sorry... I would like to have one to test the modifications, but it's a little bit to expensive right now.
@Serg77,
its always a pleasure to help. Thank you for the comming tutorial.
King regards,
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
@Michael,
oh that i don't know. Does your fix run without trouble on W64, W32, OSX?
But the future of Zeos will be decided from our users. Not from me or the other team-members. I'm shure the project-manager want to see a lot of lucky users with my new way. Not only ZDbcCache.pas is different! Nearly all Dbc files a completly changed and Unicode-Save now for PostgreSQL, MySQL, SQLite, Firebird (i hope), Oracle i'm starting right now.
My biggest problem to show this: The most reported bugs are alltime Zeos-Code and not related to \testing-egonhugeist...
Michael
oh that i don't know. Does your fix run without trouble on W64, W32, OSX?
Yes this is right. That's why i added the {$IFDEF FPC} ... {$ELSE} .. {$ENDIF} around.{$IFDEF WIN64} mean the same in fpc and Delphi XE2.
Oh here you've to know more about this. I was a little bit unlucky with the \testing and \trunc branch. To many Unicode-IDE leaks. I did a big-patch an \testing rev. 967 to supress 300 compiler-warnings. But a compiler doesn't warn without a good reason and there are still over 300 left. Also was it impossible to use Ansi-Charactersets with these two branches and a Full-Unicode-IDE. So i decided to do a complete rework and found a way how. Two weeks ago i decided to do all this neccessary String-handling only direcly on the PlainDriver received and sended strings. \testing-egonhugeist is now 100% complier independent. I see no real way for the other two branches to get a stable state, because the bugreports are always the same and i'm sure they'll loop endless. The same issues i see here for new users.Branch testing is different than testing-branch egonhugeist.
Why does the testing branch was defective (nonsense) ZDbcCache.pas file modification?
But the future of Zeos will be decided from our users. Not from me or the other team-members. I'm shure the project-manager want to see a lot of lucky users with my new way. Not only ZDbcCache.pas is different! Nearly all Dbc files a completly changed and Unicode-Save now for PostgreSQL, MySQL, SQLite, Firebird (i hope), Oracle i'm starting right now.
My biggest problem to show this: The most reported bugs are alltime Zeos-Code and not related to \testing-egonhugeist...
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
>oh that i don't know. Does your fix run without trouble on W64, W32, OSX?
My version so your not on Delphi XE2 Win32 and Win64.
>Yes this is right. That's why i added the {$IFDEF FPC} ... {$ELSE} .. {$ENDIF} around
Not everywhere.
>>Why does the testing branch was defective (nonsense) ZDbcCache.pas file modification?
>Oh here you've to know more about this.
Why is the corrected line 204 in file
https://zeoslib.svn.sourceforge.net/svn ... cCache.pas
My version so your not on Delphi XE2 Win32 and Win64.
>Yes this is right. That's why i added the {$IFDEF FPC} ... {$ELSE} .. {$ENDIF} around
Not everywhere.
>>Why does the testing branch was defective (nonsense) ZDbcCache.pas file modification?
>Oh here you've to know more about this.
Why is the corrected line 204 in file
https://zeoslib.svn.sourceforge.net/svn ... cCache.pas
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
miab3,
you are right. I didn't saw this while merging the branches, Patch done..
Michael
Ok, i'll commit these. But can you please attach a cleaned folder? Only the neccesary files?My version so your not on Delphi XE2 Win32 and Win64.
Where are they missing? Help me here..Not everywhere.
Why is the corrected line 204 in file
you are right. I didn't saw this while merging the branches, Patch done..
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
@EgonHugeist
Recent modifications for Delphi XE2 64-bits (mod_z7eh_r1274)
Handle for Delphi in PlainLoader.pas should be of type THandle.
It seems to me that the simplified GetBlobObject, SetBlobObject should work in fpc and Delphi XE2 32/64 bits.
I add a minimal set of dpk.
Compiled unity are stored in respectively:
..packages\delphi16\Win32\Release
..packages\delphi16\Win32\Debug
..packages\delphi16\Win64\Release
..packages\delphi16\Win64\Debug
Michal Abramczyk
Recent modifications for Delphi XE2 64-bits (mod_z7eh_r1274)
Handle for Delphi in PlainLoader.pas should be of type THandle.
It seems to me that the simplified GetBlobObject, SetBlobObject should work in fpc and Delphi XE2 32/64 bits.
I add a minimal set of dpk.
Compiled unity are stored in respectively:
..packages\delphi16\Win32\Release
..packages\delphi16\Win32\Debug
..packages\delphi16\Win64\Release
..packages\delphi16\Win64\Debug
Michal Abramczyk
You do not have the required permissions to view the files attached to this post.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Trank you, Michael.
I'll commit you changes this evening.
Can you check one thing for me? Which type is the THandle of in XE2?
Until XE the THandle is a cardinal. And a cardinal is unsigned which means a const INVALID_HANDLE of -1 should be invalid..
Michael
I'll commit you changes this evening.
Can you check one thing for me? Which type is the THandle of in XE2?
Until XE the THandle is a cardinal. And a cardinal is unsigned which means a const INVALID_HANDLE of -1 should be invalid..
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Uff that is interesting. How do they assign a signed -1 value with an unassigned type? In my mind that could only mean that the Windows used NatveUInt is signed too, or am i terribly wrong here? And what about his typename here? Or i was sleeping at school while having the signed/unsigned lessons.
However it seems our LongWord is a little bit deprecated (LongWord/Cardinal, NativeUInt until/since which Version?). I'll check D2007 too and change this with some directives again. Is that ok for you?
Michael
Edit:
Ok i downloaded your files. Your ZDbcCache-simplification i like. I'll run some test with the compilers i have. If everything is fine i'll Commit your patch. The same with the ZPlainLoader. I'll stike out the tests if everything is done and tell you the new Revision.
However it seems our LongWord is a little bit deprecated (LongWord/Cardinal, NativeUInt until/since which Version?). I'll check D2007 too and change this with some directives again. Is that ok for you?
Michael
Edit:
Ok i downloaded your files. Your ZDbcCache-simplification i like. I'll run some test with the compilers i have. If everything is fine i'll Commit your patch. The same with the ZPlainLoader. I'll stike out the tests if everything is done and tell you the new Revision.
Last edited by EgonHugeist on 14.05.2012, 18:00, edited 3 times in total.
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Michael problem with
is detected. the problem is likely in the parser, which takes the parameter ":not" like ":" and NOT keyword. if it is perceived as a mistake, it would be nice to do the processing and issuance of corresponding exceptions.
Record fields simply solved by direct conversion of strings
with blob fields have not yet figured out. Although there is a question, they are also a simple byte stream, why is there a mistake?
Code: Select all
plg_db->q1->SQL->Add("update trwrk set tr_name=:nam, tr_note=:not, tr_num=:num where tr_code=:cod");
Record fields simply solved by direct conversion of strings
Code: Select all
ParamByName ("par") -> AsString = WideString (Edit1-> Text);
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
@ism and all users,
foldernames changed to Delphi specific names like Delphi2005 or DelphiXE.
@miab3,
all of your changes commited.
Rev. 1278
mrLion,
The blobs are more interesting. But you did no mistake. It is simply a question how this Stream will be written.
Example: You have a DBWideMemo and type some text in. Then the Stream is written as PWideChar.
If you use (ZQuery1.Fields[0] as TBlobStream).Write(Buffer, Length); then i have to find always out what Buffer = void is. Here a PAnsichars valid, PWideChars, Binaries data with #0 or #0#0 inbetween to. That's a big problem because i must send the server well formed characters. On the other hand such stupid exceptions where raised.
Michael
foldernames changed to Delphi specific names like Delphi2005 or DelphiXE.
@miab3,
all of your changes commited.
Rev. 1278
mrLion,
do i understand you right the Param :not is not detected as Param and is used as KeyWord?is detected. the problem is likely in the parser, which takes the parameter ":not" like ":" and NOT keyword. if it is perceived as a mistake, it would be nice to do the processing and issuance of corresponding exceptions.
This i do not understand, Ivan. Why this WideString-Cast? That should not be a problem to use ParamByName()->AsString = Edit1->Text;Record fields simply solved by direct conversion of strings
The blobs are more interesting. But you did no mistake. It is simply a question how this Stream will be written.
Example: You have a DBWideMemo and type some text in. Then the Stream is written as PWideChar.
If you use (ZQuery1.Fields[0] as TBlobStream).Write(Buffer, Length); then i have to find always out what Buffer = void is. Here a PAnsichars valid, PWideChars, Binaries data with #0 or #0#0 inbetween to. That's a big problem because i must send the server well formed characters. On the other hand such stupid exceptions where raised.
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
@EgonHugeist
Sorry but you have to go back to the previous version, or:
{**
Gets a stream from the specified columns.
@param Buffer a row buffer.
@param ColumnIndex an index of the column.
}
function TZRowAccessor.GetBlobObject(Buffer: PZRowBuffer;
ColumnIndex: Integer): IZBlob;
var
BlobPtr: PPointer;
NullPtr: PByte;
begin
BlobPtr := PPointer(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1]);
NullPtr := PByte(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1]]);
if NullPtr^ = 0 then
Result := IZBlob(BlobPtr^)
else
Result := nil;
end;
{**
Sets a blob into the specified columns.
@param Buffer a row buffer.
@param ColumnIndex an index of the column.
@param Value a stream object to be set.
}
procedure TZRowAccessor.SetBlobObject(Buffer: PZRowBuffer; ColumnIndex: Integer;
Value: IZBlob);
var
BlobPtr: PPointer;
NullPtr: PByte;
begin
BlobPtr := PPointer(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1]);
NullPtr := PByte(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1]]);
if NullPtr^ = 0 then
IZBlob(BlobPtr^) := nil
else
BlobPtr^ := nil;
IZBlob(BlobPtr^) := Value;
if Value <> nil then
NullPtr^ := 0
else
NullPtr^ := 1;
end;
because version with only PBoolean does not compile in Lazarus.
Michal Abramczyk
Sorry but you have to go back to the previous version, or:
{**
Gets a stream from the specified columns.
@param Buffer a row buffer.
@param ColumnIndex an index of the column.
}
function TZRowAccessor.GetBlobObject(Buffer: PZRowBuffer;
ColumnIndex: Integer): IZBlob;
var
BlobPtr: PPointer;
NullPtr: PByte;
begin
BlobPtr := PPointer(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1]);
NullPtr := PByte(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1]]);
if NullPtr^ = 0 then
Result := IZBlob(BlobPtr^)
else
Result := nil;
end;
{**
Sets a blob into the specified columns.
@param Buffer a row buffer.
@param ColumnIndex an index of the column.
@param Value a stream object to be set.
}
procedure TZRowAccessor.SetBlobObject(Buffer: PZRowBuffer; ColumnIndex: Integer;
Value: IZBlob);
var
BlobPtr: PPointer;
NullPtr: PByte;
begin
BlobPtr := PPointer(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1]);
NullPtr := PByte(@Buffer.Columns[FColumnOffsets[ColumnIndex - 1]]);
if NullPtr^ = 0 then
IZBlob(BlobPtr^) := nil
else
BlobPtr^ := nil;
IZBlob(BlobPtr^) := Value;
if Value <> nil then
NullPtr^ := 0
else
NullPtr^ := 1;
end;
because version with only PBoolean does not compile in Lazarus.
Michal Abramczyk
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Hmpf the one and only compiler i've not installed yet after my system-crash on friday.
Nope that version we already had before, Michael. But here we had big trouble with the PByte and Win64. The blob null-pointer returned always true and the result where exception on trying to read a unassigned value.
Ok i've changed this patch again for the FPC with True/False instead of 0/1. It's equal simple like your proposal. But is that FPC32 stable now?
Michael
Nope that version we already had before, Michael. But here we had big trouble with the PByte and Win64. The blob null-pointer returned always true and the result where exception on trying to read a unassigned value.
Ok i've changed this patch again for the FPC with True/False instead of 0/1. It's equal simple like your proposal. But is that FPC32 stable now?
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/