Column names bug

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
TomekC
Posts: 8
Joined: Mon 20 Aug 2012 11:36
Location: Poland

Column names bug

Post by TomekC » Thu 06 Sep 2012 06:37

Hi.
In a query like this:

Code: Select all

  LiteQuery1.SQL.Clear;
  LiteQuery1.SQL.Add('SELECT `id`, `id5` FROM testtable WHERE `id5` = 10');
  LiteQuery1.SQL.Add('UNION ALL');
  LiteQuery1.SQL.Add('SELECT `id`, `id5` FROM testtable WHERE `id5` = 9');
  LiteQuery1.SQL.Add('ORDER BY `id`');
  LiteQuery1.Execute;
  if not LiteQuery1.Eof then
    LiteQuery1.FieldByName('id').AsInteger;
the last line produces an error, because column names in returned dataset are named: `id` `id5` instead of just: id id5.
The query has to contain "UNION ALL" and "ORDER BY" to reproduce this error.

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Column names bug

Post by ZEuS » Thu 06 Sep 2012 11:49

It seems that the problem is due to specificity of SQLite, not to LiteDAC.
We have reproduced the same result when executing the SQL-statement with UNION ALL and ORDER BY with several third-party database utilities.
For now, please try to avoid using such SQL-statements.

Post Reply