TIBCConnection.DatabaseInfo faulty results with Unicode

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

TIBCConnection.DatabaseInfo faulty results with Unicode

Post by upscene » Tue 09 Feb 2010 12:53

Hi,

If you turn ON UseUnicode on TIBCConnection.Options, the DatabaseInfo results are potentially wrong.

I have tested this with Delphi 2009 and Delphi 7 (UseUnicode = False) on both, and they return the same results. Yet, when I use UseUnicode = True on Delphi 2009, I get different results (same for D7, btw).

However, this doesn't happen on all queries! I had a database and query from a customer in order to reproduce this.

Can you check the code? Using UseUnicode = True makes the results faulty.

With regards,

Martijn Tonies
Upscene Productions

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 10 Feb 2010 13:15

Please provide all information for reproducing the problem: property that returns a wrong result, query and script for creating database objects.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 10 Feb 2010 15:38

Plash wrote:Please provide all information for reproducing the problem: property that returns a wrong result, query and script for creating database objects.
I cannot give away a customer database.

Is there anything else you can do?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 12 Feb 2010 13:45

Unfortunately we could not reproduce the problem and continue investigation without your sample.
Maybe you can drop unnecessary database objects, change user data, and send it to us?

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Mon 22 Feb 2010 10:46

Challenger wrote:Unfortunately we could not reproduce the problem and continue investigation without your sample.
Maybe you can drop unnecessary database objects, change user data, and send it to us?
Try databases with more records, it seems to fail on larger numbers of rows.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 24 Feb 2010 09:28

Anything?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 25 Feb 2010 08:26

We still can not reproduce the problem. Please specify the IBDAC version you are using and property that returns a wrong result.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 25 Feb 2010 08:38

Dimon wrote:We still can not reproduce the problem. Please specify the IBDAC version you are using and property that returns a wrong result.
Using the latest IBDac, the properties on Indexed Reads and so on don't return the correct values -> I compared these with IBObjects. Also, given the number of rows in the tables, these values were simply too small.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 03 Mar 2010 15:01

upscene wrote:
Dimon wrote:We still can not reproduce the problem. Please specify the IBDAC version you are using and property that returns a wrong result.
Using the latest IBDac, the properties on Indexed Reads and so on don't return the correct values -> I compared these with IBObjects. Also, given the number of rows in the tables, these values were simply too small.
Any progress on this yet?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 04 Mar 2010 10:50

Unfortunately we could not reproduce the problem.
Please send me sample database objects you are using and Delphi code to get DatabaseInfo.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 04 Mar 2010 12:33

Dimon wrote:Unfortunately we could not reproduce the problem.
Please send me sample database objects you are using and Delphi code to get DatabaseInfo.
With version 3.10.11, UseUnicode doesn't seem to make a difference.

Here's what I found out:

I got a query from a customer which has the following statistics:

Code: Select all

+--------------------------+-----------+-----------+-------------+---------+---------+---------+
|        Table Name        |  Records  |  Indexed  | Non-Indexed | Updates | Deletes | Inserts |
|                          |   Total   |   reads   |    reads    |         |         |         |
+--------------------------+-----------+-----------+-------------+---------+---------+---------+
|   CRM_CLIENT_CLIENT_GROUP|      1717 |    149718 |           0 |       0 |       0 |       0 |
|        CRM_DELIVERY_POINT|      5172 |    138859 |           0 |       0 |       0 |       0 |
|                   PAYMENT|    169100 |    149782 |           0 |       0 |       0 |       0 |
|           STORAGE_ARTICLE|      4075 |    199812 |           0 |       0 |       0 |       0 |
|  STORAGE_CLIENT_SHIPPINGS|     23546 |    138859 |           0 |       0 |       0 |       0 |
|     STORAGE_CLIENT_STORES|      5172 |    138859 |           0 |       0 |       0 |       0 |
|             STORAGE_SHEET|     52366 |     51505 |           0 |       0 |       0 |       0 |
|     STORAGE_SHEET_DETAILS|    205722 |    199830 |           0 |       0 |       0 |       0 |
+--------------------------+-----------+-----------+-------------+---------+---------+---------+
Now, for example, the value for STORAGE_CLIENT_SHIPPINGS says "138859", in hex, this is "21E6B". With IBDac, the value returned is "7787", in hex "1E6B".

I got more values: $24916, in IBDac: $4916 / $30C84, in IBDac: $0C84.

You see the pattern? Shouldn't these be INT32 or INT64 values? It seems you're not fetching enough bytes (only 2!) for the values.

Does this help?

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Tue 09 Mar 2010 08:03

Any news?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 10 Mar 2010 10:59

I have filled table with 1 mln records and created a select statement with cross join. I have executed and fetched this statement and checked the DatabaseInfo.Reads parameter. It gave 130000. The same value I saw in IBConsole. I had the same value in Delphi 7 and Delphi 2009 regardless the Unicode option.
Here is the information from the Info page of the TIBCConnection editor:

Code: Select all

Server Version: WI-V9.0.3.437
Client Version: 9.0
ODS Version: 13.1
Client Library: D:\Program Files\InterBase\bin\gds32.dll
Database SQL Dialect: 3
Can try the same test with IBX components? You can check the length of this parameter in the TIBDatabaseInfo.GetLongDatabaseInfo method (the IBDatabaseInfo unit).

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 10 Mar 2010 11:21

Instead of components, I decided to try with a trial version of IBExpert :wink:

The above statistics come from IBExpert and are the same as my application with IBObjects, but different with IBDac.

This was tested on Firebird (version: WI-V6.3.1.17910 Firebird 2.1), ODS 11.1 database, charset WIN1251, pagesize 8192.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Tue 16 Mar 2010 15:19

Challenger wrote:I have filled table with 1 mln records and created a select statement with cross join. I have executed and fetched this statement and checked the DatabaseInfo.Reads parameter. It gave 130000. The same value I saw in IBConsole. I had the same value in Delphi 7 and Delphi 2009 regardless the Unicode option.
Here is the information from the Info page of the TIBCConnection editor:

Code: Select all

Server Version: WI-V9.0.3.437
Client Version: 9.0
ODS Version: 13.1
Client Library: D:\Program Files\InterBase\bin\gds32.dll
Database SQL Dialect: 3
Can try the same test with IBX components? You can check the length of this parameter in the TIBDatabaseInfo.GetLongDatabaseInfo method (the IBDatabaseInfo unit).
Any news?

Post Reply