Full Unicode/Ansi-Support in /testing branch

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

Branch testing is different than testing-branch egonhugeist.
Why does the testing branch was defective (nonsense) ZDbcCache.pas file modification?

Michal Abramczyk
Serg77
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 08.05.2012, 00:26
Location: Belgorod

Post by Serg77 »

@Serg77

Lucky now?
Oh yes, the problem that I had (described above) is solved with the help of Michael, thank him for his help and their time. During the day, in the Tutorial will be added to help with loading, updating and installation of Zeos in Russian.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

@miab3,
But my version was right and not what you did.
DXE2/32 - WIN32
DXE2/64 - WIN64
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? :roll:
Yes.
Compiling problems? Which issues do you had here? Eventually improve with some {$IFDEF} again?
Yes.
Especially ZComponent.dpk, ZComponentDesign.dpk and all *.dproj with XE(1) and OSX mishmash.
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. :lol:

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/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

@EgonHugeist
{$IFDEF WIN64} mean the same in fpc and Delphi XE2.

>the packages tested from two users and they where lucky
Do they have tried in Delphi XE2 64-bit compilation and application usage?

Michal Abramczyk
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

@Michael,

oh that i don't know. Does your fix run without trouble on W64, W32, OSX?
{$IFDEF WIN64} mean the same in fpc and Delphi XE2.
Yes this is right. That's why i added the {$IFDEF FPC} ... {$ELSE} .. {$ENDIF} around.
Branch testing is different than testing-branch egonhugeist.
Why does the testing branch was defective (nonsense) ZDbcCache.pas file modification?
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.
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/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

>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
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,
My version so your not on Delphi XE2 Win32 and Win64.
Ok, i'll commit these. But can you please attach a cleaned folder? Only the neccesary files?
Not everywhere.
Where are they missing? Help me here..
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/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

@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
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

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
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/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

@EgonHugeist

In Delphi XE2:

{$IF Defined(POSIX)}
THandle = Cardinal;
{$IFEND}
{$IF Defined(MSWINDOWS)}
THandle = NativeUInt;
{$IFEND}

In Delphi 2006
THandle = LongWord;

Michal Abramczyk
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

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.
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/

Image
mrLion
Senior Boarder
Senior Boarder
Posts: 71
Joined: 20.03.2010, 10:17

Post by mrLion »

Michael problem with

Code: Select all

plg_db->q1->SQL->Add("update trwrk set tr_name=:nam, tr_note=:not, tr_num=:num where tr_code=:cod");
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

Code: Select all

ParamByName ("par") -> AsString = WideString (Edit1-> Text);
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?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

@ism and all users,

foldernames changed to Delphi specific names like Delphi2005 or DelphiXE.

@miab3,
all of your changes commited.

Rev. 1278

mrLion,
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.
do i understand you right the Param :not is not detected as Param and is used as KeyWord?

Record fields simply solved by direct conversion of strings
This i do not understand, Ivan. Why this WideString-Cast? That should not be a problem to use ParamByName()->AsString = Edit1->Text;

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/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

@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
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

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
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/

Image
Locked