TZParam -> Unsupported variant type

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

TZParam -> Unsupported variant type

Post by aehimself »

Hello,

I sent a couple of AV fixes and a TZParam -> Unsupported variant type error on GitHub.

Code: Select all

Var
 x, y: TZParam;
Begin
 // ofc create them I'm just lazy...
 x.AsUInt64 := 54;
 y.Value := x.Value; // Exception is raised here
End;
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZParam -> Unsupported variant type

Post by marsupilami »

I applied the patch to trunk / master. Thank you :)
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

Re: TZParam -> Unsupported variant type

Post by aehimself »

Hm, I see that the patch broke FPC builds. Since the original IFDEF never executed I guess noone noticed...

I guess we need to change the

Code: Select all

    {$IF Declared(varUInt64)}
    varUInt64:    SetAsUInt64(TVarData(Value).VUInt64);
    {$IFEND}
block to

Code: Select all

    {$IF Declared(varUInt64)}
          {$IFDEF FPC}
          varqword: Statement.SetULong(Index, TVarData(V).vword64);
          {$ELSE}
          varUInt64: Statement.SetULong(Index, TVarData(V).VUInt64);
          {$ENDIF}
    {$IFEND}
?

I cannot test as I have no FPC installed, but UInt64 handling is like this in the unit everywhere else.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZParam -> Unsupported variant type

Post by marsupilami »

Hmm - I chose a slightly different approach. But anybody who wants to can change it.

Maybe you should install Lazarus on one of your machines? Even if only on a Raspberry PI or something like that? I just found out about xrdp which makes it easy to use a linux machine via RDP. So no additional software is required on Windows PCs :)
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

Re: TZParam -> Unsupported variant type

Post by aehimself »

Unfortunately I do not have a RPi, it would be a perfect candidate to test compile Zeos on. Most probably I'll install an underpowered VM on my ESXi if I still have space on the SSD...
Or I can have a look at WSL...

Idk, but it does not change the fact that yes, I should make a Lazarus on Linux at home :)

Btw, thanks for the fix, Jan!
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZParam -> Unsupported variant type

Post by miab3 »

Hi,

Zeos8 svn 7378 compiles and runs on:
- Lazarus 2.0.0 - Raspberry Pi OS,
- Lazarus 2.0.12 - Win64,
- Delphi 10.3.3 - Win32/64,Android32/64.

Michał
Post Reply