Recent

Author Topic: Only one first row is returned (Lazarus + Firebird + Oracle)  (Read 2458 times)

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Only one first row is returned (Lazarus + Firebird + Oracle)
« on: December 20, 2018, 11:39:42 pm »
Hello!
I have been working with Lazarus trunk 2.1 on Debian testing and on Windows 10
plus Zeoslib 7.2.1-rc1 and Firebird 3.0 and Oracle
Recently I updated to Zeoslib 7.2.4-stable.
After this some queries on Lazarus return only one first row.
I went back to 7.2.3-rc and the same, only first row is returned.
The same query on Zeoslib 7.2.1-rc1 or under Flamerobin returns all rows.
Where can be the problem? Is it a bug?
Any suggestions, please?
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Only one first row is returned (Lazarus + Firebird + Oracle)
« Reply #1 on: December 24, 2018, 12:02:22 pm »
Do you have Booleans stored as 0 and -1?
If so then look if the new one stores them as 1.


I had that problem once
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Only one first row is returned (Lazarus + Firebird + Oracle)
« Reply #2 on: December 24, 2018, 12:48:41 pm »
Indeed, but this Boolean issue should be fixed in trunk.
« Last Edit: December 24, 2018, 01:02:18 pm by Thaddy »
Specialize a type, not a var.

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Only one first row is returned (Lazarus + Firebird + Oracle)
« Reply #3 on: December 24, 2018, 07:09:29 pm »
I experienced this with some query couple of days ago, and worked around it by redisigning the query.
I don't think I can reproduce the original query, but I am quite sure I didn't have any boolean fields at all.

I think it is a Zeos bug. Please report it in their bugtracker or in their forum.
I don't have time now, but if noone reports it, I will see tomorrow if I can make an example and report it there.

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Only one first row is returned (Lazarus + Firebird + Oracle)
« Reply #4 on: December 27, 2018, 01:26:23 pm »
Then use in ALL your queries where you use boolean the function ABS.


You get something like
Code: [Select]
SELECT * FROM Some_Table WHERE ABS(MyBoolen) = 1
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Only one first row is returned (Lazarus + Firebird + Oracle)
« Reply #5 on: December 27, 2018, 03:34:43 pm »
The bug is that a C Bool is not false which is defined as any value except false ( = 0 ) and a Pascal Boolean (all types) were defined as either  0 or 1. This has been corrected. There is now a correct Bool type to interface with C code in trunk. This was an FPC bug ( for a relatively short - some months, a year - period only) and not a Zeos bug. Maybe Zeos needs to switch to the new Bool type, though.
A SQL query with not false instead of true should always work, though. But  FPC booleans (pascal booleans) are not suited for interfacing with C code as most database engines are written in C. The Bool type now adheres to that, as was also previously the case. It was a rather serious regression that made me at some point very angry. (Actually real anger, not grumpy, I seldom have such strong negative vibes... :o to paraphrase my fellow tank commander from Kelly's heroes. (odd ball))
« Last Edit: December 27, 2018, 04:26:28 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018