Zeos 7 Alpha and Delphi 2009 Support - Official Thread

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

nilton_zl
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 03.09.2009, 12:31

Post by nilton_zl »

Dear Mrs,

I found a bug in the Zeos version 7X when I use it with Delphi 2009 and PostgreSQL version 8.3.6.

The component Zquery return all field read only when I use upper case to write the queries. Example:

Zquery.sql.text := 'SELECT * FROM FOO';

This sentence return all field with property read only = True.

But the sentence:

Zquery.sql.text := 'SELECT * FROM foo';

This sentence return all field with property read only = False.

Observation:

1.
When Zquery return all fields with property read only = True and I reconfigure it to False, I don't get post the Zquery, because return error "catastrophic failure".

2.
I have only one table foo, and it isn't temporary table.

Do Anybody knows why happen this?

Adenilton Batista da Silva.
Index Informática LTDA.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

This may have something to do with the TZAbstractResultSetMetadata.LoadColumns procedure that doesn't manage to match the resultset columns to the metadata that can be retrieved from the database. There may be a lower:uppercase problem introduced by D2009.
When a resultset field can't be mapped to a database column, the field is marked as readonly.

I would really appreciate when you managed to debug this issue. I think the 2 most interesting places for debugging are TZGenericStatementAnalyser.FillFieldRefs (at the Selectschema.Addfield lines) and TZAbstractResultSetMetadata.LoadColumns stepping into the LoadColumn lines.

Mark
Image
fabiano.salles
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 18.09.2009, 18:12
Location: Brazil
Contact:

Post by fabiano.salles »

Hi guys,

I'm quite new to the forum (it's my first post) but I found a little bug with Delphi2009 + Firebird 2.0 protocol. The bug occur when calling TZTable.Post or TZQuery.Post in dsEdit state without real changes in data.

If you do

Code: Select all

  ZTable.Open;
  ZTable.Edit;
  ZTable.Post;

a SQL error code -104 Token Unknow araise.

I'm usgin the last revision (689) form the svn and I'm doing some debugging in TZAbstractCachedResultSet.PostUpdates but, since the ZEOS code is new to me, my progress are slow.

Some guess or workaround is known?

Thanks!
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

No idea... what's the exact query sent to the server? Tried to use a TZSQLMonitor to low hat's sent to the server exactly?

Mark
Image
pjrobin
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 30.09.2009, 09:14

Exception by "post" method

Post by pjrobin »

Hello,

I'm using the last SVN-Zeos source code + Patch for Delphi 2010, connectiong to a MySQL database v5.1

I got some problem after inserting a record in a table: somewhere in the "post"-call, the function TZGenericCachedResolver.FormInsertStatement will be called. The SQL statement it produces was wrong: the column name list in the variable temp1 was wrong. The sub procedure "append()" build this list. The original code was:

procedure Append(const app: String);
begin
if Length(Temp1) < l1 + length(app) then
SetLength(Temp1, 2 * (length(app) + l1));
Move(app[1], Temp1[l1+1], length(app));
Inc(l1, length(app));
end;


I replaced it thru :
procedure Append(const app: String);
begin
temp1 := temp1 + app;
end;


I'm everything but an expert so this probably makes for the most of you no sense... but it works :)

PJ
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi PJ, it's an optimisation trick we recently introduced, but which isn't correct for D2009 as the size of a Char is 2 bytes instead of one. (See http://zeos.firmos.at/viewtopic.php?t=2482) For D2009 Length returns only half of the number of bytes to copy.
Seems like changing

Code: Select all

    Move(app[1], Temp1[l1+1], SizeOf(Char)); 
into

Code: Select all

    Move(app[1], Temp1[l1+1], length(app)*SizeOf(Char)); 
Solves this problem. Can you test this?

Mark
Image
pjrobin
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 30.09.2009, 09:14

Post by pjrobin »

Hi mdaems,

The fix works, thanks a lot!

PJ
pjrobin
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 30.09.2009, 09:14

Illegal caracters....

Post by pjrobin »

Hi,

New problem:
Trying to post a string value in a record. Should be
[20.02%, tset:-20.0°C, tcur.:-13.9°C] but I get
[20.02%, tset:-20.0°C, tcur.:-13.9°C]

Using:
Delphi 2010
MySQL 5.1
latest SVN snapshot

Fieldtype is varchar utf_unicode_ci

Anyone?

PJ
manz
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 02.06.2008, 03:58
Location: Cilegon
Contact:

Post by manz »

Hi All ...

Great thanks to MDaems that has been good tutoring me to trace :prog: about the previous error for BLOB (JPG, PNG) in MySQL.

Thats already solved and can be use at SVN 711. Even though this may not an ideal solution.

In my site, not only MySQLStatement.pas has been changed from UTF8String into AnsiString, all MySQL related code for this things has been changed.

Once again ... :thanks: Mark


BR
:mrgreen:
Man'z
kadavris
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 10.03.2010, 19:10

Post by kadavris »

It's probably weird to post it here, but I cannot use the betas as we do a commercial software dev, but today I've dl-ed last 6.6.6-stable and fixed it quickly for use with firebird, although I saw some errors falling off postgress code first, but we do not need it and I've just commented it out then.
This is roughly the same set of fixes I've used to compile 6.6.5-stable.
There is no big deal stuff, but it compiles on d2009 smoothly. At least for me ;)
Hope it will help someone still sitting with 6 branch.

Code: Select all

diff -a -r ZEOSDBO-6.6.6-stable/src/Zeos.inc 666/src/Zeos.inc
127a128,132
> {$IFDEF VER200} // AP: HACK
>   {$DEFINE VER180}
>   {$DEFINE VER200BELOW}
> {$ENDIF}
> 
diff -a -r ZEOSDBO-6.6.6-stable/src/component/ZAbstractDataset.pas 666/src/component/ZAbstractDataset.pas
444c444
<   BM:TBookMarkStr;
---
>   BM:TBookMark; // AP: TBookMarkStr possible is deprecated in d2009 or earlier
diff -a -r ZEOSDBO-6.6.6-stable/src/component/ZAbstractRODataset.pas 666/src/component/ZAbstractRODataset.pas
71a72,76
>   (*{$IFDEF VER170BELOW}
>   TRecordBuffer = PChar; // AP: possible workaround for delphi2009 ancestors
>   {$ENDIF}
>   *)
> 
285c290
<     function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean):
---
>     function GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: Boolean):
289,290c294,295
<     function AllocRecordBuffer: PChar; override;
<     procedure FreeRecordBuffer(var Buffer: PChar); override;
---
>     function AllocRecordBuffer: TRecordBuffer; override;
>     procedure FreeRecordBuffer(var Buffer: TRecordBuffer); override;
299c304
<     procedure ClearCalcFields(Buffer: PChar); override;
---
>     procedure ClearCalcFields(Buffer: TRecordBuffer); override;
306c311
<     procedure InternalInitRecord(Buffer: PChar); override;
---
>     procedure InternalInitRecord(Buffer: TRecordBuffer); override;
310c315
<     procedure InternalSetToRecord(Buffer: PChar); override;
---
>     procedure InternalSetToRecord(Buffer: TRecordBuffer); override;
312,315c317,320
<     procedure GetBookmarkData(Buffer: PChar; Data: Pointer); override;
<     function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag; override;
<     procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag); override;
<     procedure SetBookmarkData(Buffer: PChar; Data: Pointer); override;
---
>     procedure GetBookmarkData(Buffer: TRecordBuffer; Data: Pointer); override;
>     function GetBookmarkFlag(Buffer: TRecordBuffer): TBookmarkFlag; override;
>     procedure SetBookmarkFlag(Buffer: TRecordBuffer; Value: TBookmarkFlag); override;
>     procedure SetBookmarkData(Buffer: TRecordBuffer; Data: Pointer); override;
397c402
<     function Translate(Src, Dest: PChar; ToOem: Boolean): Integer; override;
---
>     function Translate(Src, Dest: PAnsiChar; ToOem: Boolean): Integer; override;
1064c1069
< function TZAbstractRODataset.GetRecord(Buffer: PChar; GetMode: TGetMode;
---
> function TZAbstractRODataset.GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode;
1395c1400
< function TZAbstractRODataset.AllocRecordBuffer: PChar;
---
> function TZAbstractRODataset.AllocRecordBuffer: TRecordBuffer;
1397c1402
<   Result := PChar(RowAccessor.Alloc);
---
>   Result := Pointer(RowAccessor.Alloc);
1404c1409
< procedure TZAbstractRODataset.FreeRecordBuffer(var Buffer: PChar);
---
> procedure TZAbstractRODataset.FreeRecordBuffer(var Buffer: TRecordBuffer);
1670c1675
<     FreeRecordBuffer(PChar(FOldRowBuffer));
---
>     FreeRecordBuffer(TRecordBuffer(FOldRowBuffer));
1673c1678
<     FreeRecordBuffer(PChar(FNewRowBuffer));
---
>     FreeRecordBuffer(TRecordBuffer(FNewRowBuffer));
2033c2038
< procedure TZAbstractRODataset.InternalSetToRecord(Buffer: PChar);
---
> procedure TZAbstractRODataset.InternalSetToRecord(Buffer: TRecordBuffer);
2110c2115
< function TZAbstractRODataset.GetBookmarkFlag(Buffer: PChar): TBookmarkFlag;
---
> function TZAbstractRODataset.GetBookmarkFlag(Buffer: TRecordBuffer): TBookmarkFlag;
2120c2125
< procedure TZAbstractRODataset.SetBookmarkFlag(Buffer: PChar;
---
> procedure TZAbstractRODataset.SetBookmarkFlag(Buffer: TRecordBuffer;
2131c2136
< procedure TZAbstractRODataset.GetBookmarkData(Buffer: PChar; Data: Pointer);
---
> procedure TZAbstractRODataset.GetBookmarkData(Buffer: TRecordBuffer; Data: Pointer);
2141c2146
< procedure TZAbstractRODataset.SetBookmarkData(Buffer: PChar; Data: Pointer);
---
> procedure TZAbstractRODataset.SetBookmarkData(Buffer: TRecordBuffer; Data: Pointer);
2190c2195
< procedure TZAbstractRODataset.InternalInitRecord(Buffer: PChar);
---
> procedure TZAbstractRODataset.InternalInitRecord(Buffer: TRecordBuffer);
2456c2461
<         GetCalcFields(PChar(SearchRowBuffer));
---
>         GetCalcFields(TRecordBuffer(SearchRowBuffer));
2471c2476
<         FreeRecordBuffer(PChar(SearchRowBuffer));
---
>         FreeRecordBuffer(TRecordBuffer(SearchRowBuffer));
2565c2570
<     GetCalcFields(PChar(SearchRowBuffer));
---
>     GetCalcFields(TRecordBuffer(SearchRowBuffer));
2569c2574
<     FreeRecordBuffer(PChar(SearchRowBuffer));
---
>     FreeRecordBuffer(TRecordBuffer(SearchRowBuffer));
2604c2609
< function TZAbstractRODataset.Translate(Src, Dest: PChar; ToOem: Boolean): Integer;
---
> function TZAbstractRODataset.Translate(Src, Dest: PAnsiChar; ToOem: Boolean): Integer;
2613,2614c2618,2619
<         CharToOem(Src, Dest)
<       else OemToChar(Src, Dest);
---
>         CharToOemA(Src, Dest)
>       else OemToCharA(Src, Dest);
2779c2784
<   GetCalcFields(PChar(FSortRowBuffer1));
---
>   GetCalcFields(TRecordBuffer(FSortRowBuffer1));
2788c2793
<   GetCalcFields(PChar(FSortRowBuffer2));
---
>   GetCalcFields(TRecordBuffer(FSortRowBuffer2));
3127c3132,3136
<     ftFixedWideChar,ftWideMemo,ftOraTimeStamp,ftOraInterval);
---
>     ftFixedWideChar,ftWideMemo,ftOraTimeStamp,ftOraInterval
>     {$IFDEF VER200}
>     ,ftLongWord, ftShortint, ftByte, ftExtended, ftConnection, ftParams, ftStream
>     {$ENDIF}
>     );
3157c3166
< procedure TZAbstractRODataset.ClearCalcFields(Buffer: PChar);
---
> procedure TZAbstractRODataset.ClearCalcFields(Buffer: TRecordBuffer);
diff -a -r ZEOSDBO-6.6.6-stable/src/dbc/ZDbcInterbase6.pas 666/src/dbc/ZDbcInterbase6.pas
703c703
<                            IBLocalBufferLength, Buffer);
---
>                            IBLocalBufferLength, Pointer(@Buffer));
diff -a -r ZEOSDBO-6.6.6-stable/src/dbc/ZDbcResultSet.pas 666/src/dbc/ZDbcResultSet.pas
2877c2877
<       TempString[I + 1] := Chr(Value[I]);
---
>       TempString[I + 1] := AnsiChar(Chr(Value[I]));
btw. thanks for the good work, people!
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Why do you think this solution is more stable than 7.0? :gruebel:

If you're prepared to allow this in your 'commercial software dev', I see no reason why you shouldn't use 7.0. Even more : trouble you may encounter in 7.0 may get fixed for D2009+ compilers.

But... feel free to do as you like most.

Mark
Image
Betalord
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 01.04.2010, 23:19

Post by Betalord »

I have the following problem with ZeosLib 700 alpha and Delphi 2010:

Everything compiles fine, but when I try to install it, error pops up:

"This application has failed to start because ZDbc140.bpl was not found. Re-installing the application may fix this problem. "

And immediately after that another one:

"Can't load package
F:\delphi_components\ZEOSDBO-7.0.0-alpha\packages\delphi14\build\ZComponentDesign140.bpl.
The specified module could not be found."

I just freshly installed D2010, I have no other delphi on this computer. Any ideas? I am new at Delphi 2010 (only used D7 before).
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

At the moment lastest svn version does not compile on D2010 and D2009.
Both have the same problem. They are finding for a solution.

Please download an older svn version in order to work with that components
Betalord
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 01.04.2010, 23:19

Post by Betalord »

I don't use the latest svn, I use 700 Alpha (downloadable package from the main site).
pcoenen
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 02.04.2010, 12:24
Location: Limburg
Contact:

Post by pcoenen »

I installed Zeos yesterday in Delphi 2010. After compiling I got the same error when I tried to install the components. I moved the BPL files from the Zeos build directory into the default BPL directory of Delphi.
After that it installed the components without any warning.
In theory, there is no difference between theory and practice. But, in practice, there is.
Locked