Recent

Author Topic: (FIXED)after update Lararus 2.0.10 TQuery.FieldByName (UUID-FIELD) messing up  (Read 509 times)

ebizz

  • New member
  • *
  • Posts: 5
Hi Everyone!

After Update from 2.0.8 to 2.0.10 TQuery Function FieldByName is not working anymore, I get back totally wrong values sometimes. (UUID as String, instead I receive parts of the value from the call before).

Reinstalled 2.0.8 everything is fine again. Does anyone else have this problem? So far only looked into it under Linux. How to report this bug? Is it a free Pascal bug or a lazarus problem?

« Last Edit: July 15, 2020, 02:43:48 pm by ebizz »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3807
  • I like bugs.
I don't think it is a Lazarus issue. This is the list of changes between 2.0.8 and 2.0.10 :
 https://wiki.freepascal.org/Lazarus_2.0_fixes_branch#Fixes_for_2.0.10_.28merged.29
No DB component related changes.
So the problem may be in FPC 3.2.
It is also possible the update failed. Did you remove all remains of FPC 3.0.4? Try uninstalling everything (Lazarus + FPC) and then installing again.
Mostly Lazarus trunk on Manjaro Linux.

TRon

  • Sr. Member
  • ****
  • Posts: 406
According to this thread some things did change with FreePascal 3.2, although it is also reported that this was not mentioned anywhere (of course the svn log would show it).

Have you tried recreating your database, if only for testing if this occurs only between different versions of Free Pascal ?


ebizz

  • New member
  • *
  • Posts: 5
I setup a clean/empty XUbuntu without any old 3.0.4 and just installed Lazarus 2.0.10, same problem. It seems to be only UUID related, all other fields are handled well. Using TQuery.Fields[0].AsString results in the same mess, by the way.


PS: man, who invented the second verification stuff....

TRon

  • Sr. Member
  • ****
  • Posts: 406
@ebizz:
How do you store those guids in your table ?

A simple test with FreePascal generating some GUID's, converting them to string, then storing and retrieving them from a SQLite table seem to work as intended for me (Debian Linux 32-bit)

ebizz

  • New member
  • *
  • Posts: 5
Postgres Default UUID Field:

fieldnametest UUID DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY

Just ported a little of the code to a console app under lazarus, same error on windows32 and linux, newly installed machine. All other None-UUID fields are handled correctly.
giving up for today....


ebizz

  • New member
  • *
  • Posts: 5
The problem is the UUID, casting the SQL Field to for example varchar everything works fine. As soon it is supposed to be a UUID it goes nirvana.

Working:

   SQLString := 'SELECT contact_uuid::varchar FROM contact;';

Not working:
   
   SQLString := 'SELECT contact_uuid::uuid FROM contact;';


.....
   SQLQuery.SQL.Text := SQLString;
   SQLQuery.Open();
 
   while not SQLQuery.EOF do
   begin
     Writeln(IntToStr(i) + ' - ' + SQLQuery.Fields[0].AsString);   
   ......

Same on linux as on windows. Someone from the fpc-database team must have messed up the UUID support for postgresql. Anyone know where to report this bug?

TRon

  • Sr. Member
  • ****
  • Posts: 406
Anyone know where to report this bug?
Bugs can be reported in the bugtracker http://bugs.freepascal.org/set_project.php?project_id=6

Because you were able to reproduce in a simple console program and afaik, it should be filed under FPC.

ebizz

  • New member
  • *
  • Posts: 5
It was a FPC Bug, got to put it into the bugtracker yesterday and today it was already fixed... The fix is pushed as of FPC Revision 45791 (3.2.x) from today :-)
Thanks everyone giving help and comments.

 8-)

 

TinyPortal © 2005-2018