Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-07

Possible TQuery or resource reader problem, all (unix) targets

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

I've got a problem that appears to have got into the Lazarus IDE etc. at some point after 36903. It affects all targets I've tested so far, i.e. SPARC/Solaris, SPARC/Linux, PPC/Linux and x86/Linux; I left x86 till last on the basis that it was likely to be limited to a combination that was tested less frequently with the result that I've been delayed by building on slower systems. I'd rather not try testing Windows, and any results might not be valid since I don't have current versions.

The project includes a form with a number of database components. One of the TQuerys has a significant amount of SQL text ** (PostgreSQL dialect), including a number of references to a single parameter (tz). Looked at on 36903 or earlier, the TQuery has a single parameter (correctly called tz) while on trunk (circa 37961) a spurious parameter called 00'::interval is inserted before tz: I think that this is probably part of the SQL text, mis-parsed. The project compiles, but 'll try to distill this to a minimal project and Mantis it, unless anybody realises they've been working in this area and can contribute a quick fix for testing.

** Including a couple of subselects of the form
to_char(datetime + coalesce(
(SELECT utc_offset FROM pg_timezone_names WHERE name = :tz), '00:00'::interval
), 'YYYY-MM-DD HH24:MI') AS datetime_str,

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 27 lines
I've got a problem that appears to have got into the Lazarus IDE etc. at some point after 36903. It affects all targets I've tested so far, i.e. SPARC/Solaris, SPARC/Linux, PPC/Linux and x86/Linux; I left x86 till last on the basis that it was likely to be limited to a combination that was tested less frequently with the result that I've been delayed by building on slower systems. I'd rather not try testing Windows, and any results might not be valid since I don't have current versions. The project includes a form with a number of database components. One of the TQuerys has a significant amount of SQL text ** (PostgreSQL dialect), including a number of references to a single parameter (tz). Looked at on 36903 or earlier, the TQuery has a single parameter (correctly called tz) while on trunk (circa 37961) a spurious parameter called 00'::interval is inserted before tz: I think that this is probably part of the SQL text, mis-parsed. The project compiles, but fails at runtime. I'll try to distill this to a minimal project and Mantis it, unless anybody realises they've been working in this area and can contribute a quick fix for testing. ** Including a couple of subselects of the form to_char(datetime + coalesce( (SELECT utc_offset FROM pg_timezone_names WHERE name = :tz), '00:00'::interval ), 'YYYY-MM-DD HH24:MI') AS datetime_str,

Mantised as 22463. It's something to do with parsing a non-trivial query, so far I'm not able to duplicate it with a one-liner.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

John Landmesser
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 33 lines
Mark Morgan Lloyd wrote: > I've got a problem that appears to have got into the Lazarus IDE etc. > at some point after 36903. It affects all targets I've tested so far, > i.e. SPARC/Solaris, SPARC/Linux, PPC/Linux and x86/Linux; I left x86 > till last on the basis that it was likely to be limited to a > combination that was tested less frequently with the result that I've > been delayed by building on slower systems. I'd rather not try > testing Windows, and any results might not be valid since I don't > have current versions. > > The project includes a form with a number of database components. One > of the TQuerys has a significant amount of SQL text ** (PostgreSQL > dialect), including a number of references to a single parameter > (tz). Looked at on 36903 or earlier, the TQuery has a single > parameter (correctly called tz) while on trunk (circa 37961) a > spurious parameter called 00'::interval is inserted before tz: I > think that this is probably part of the SQL text, mis-parsed. The > project compiles, but fails at runtime. > > I'll try to distill this to a minimal project and Mantis it, unless > anybody realises they've been working in this area and can contribute > a quick fix for testing. > > ** Including a couple of subselects of the form > to_char(datetime + coalesce( > (SELECT utc_offset FROM pg_timezone_names WHERE name = :tz), > '00:00'::interval > ), 'YYYY-MM-DD HH24:MI') AS datetime_str, > Mantised as 22463. It's something to do with parsing a non-trivial query, so far I'm not able to duplicate it with a one-liner.

Just an idea:

some days ago i had a problem with a parameter sitting at the end of a line, followed directly by CRLF ( -> component StrHolder , Delphi 5 Windows)

Solution was to put a space after the parameter:
":parameter SPACE(!!) CRLF".

A problem with word boundries ?!

That simple space fixed it!

Second try:
change you SQL to a oneliner.
Query.SQL.Text := part1 + part2 + ...

Reply by email

Mark Morgan Lloyd
to John Landmesser: Just an idea: some days ago i had a problem with a parameter sitting at the end of a…
John Landmesser wrote 21 lines
> Mantised as 22463. It's something to do with parsing a non-trivial > query, so far I'm not able to duplicate it with a one-liner. > Just an idea: some days ago i had a problem with a parameter sitting at the end of a line, followed directly by CRLF ( -> component StrHolder , Delphi 5 Windows) Solution was to put a space after the parameter: ":parameter SPACE(!!) CRLF". A problem with word boundries ?! That simple space fixed it! Second try: change you SQL to a oneliner. Query.SQL.Text := part1 + part2 + ...

No change if I edit it in situ. (OK, so there is a change: it's even more difficult to maintain :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email