Page 1 of 2

TIBCConnection.DatabaseInfo faulty results with Unicode

Posted: Tue 09 Feb 2010 12:53
by upscene
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

Posted: Wed 10 Feb 2010 13:15
by Plash
Please provide all information for reproducing the problem: property that returns a wrong result, query and script for creating database objects.

Posted: Wed 10 Feb 2010 15:38
by upscene
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?

Posted: Fri 12 Feb 2010 13:45
by Challenger
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?

Posted: Mon 22 Feb 2010 10:46
by upscene
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.

Posted: Wed 24 Feb 2010 09:28
by upscene
Anything?

Posted: Thu 25 Feb 2010 08:26
by Dimon
We still can not reproduce the problem. Please specify the IBDAC version you are using and property that returns a wrong result.

Posted: Thu 25 Feb 2010 08:38
by upscene
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.

Posted: Wed 03 Mar 2010 15:01
by upscene
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?

Posted: Thu 04 Mar 2010 10:50
by Dimon
Unfortunately we could not reproduce the problem.
Please send me sample database objects you are using and Delphi code to get DatabaseInfo.

Posted: Thu 04 Mar 2010 12:33
by upscene
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?

Posted: Tue 09 Mar 2010 08:03
by upscene
Any news?

Posted: Wed 10 Mar 2010 10:59
by Challenger
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).

Posted: Wed 10 Mar 2010 11:21
by upscene
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.

Posted: Tue 16 Mar 2010 15:19
by upscene
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?