Bug #12089 `order` as a field name prevents OpenOffice from reading table structure
Submitted: 21 Jul 2005 20:06 Modified: 7 Aug 2005 10:32
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.11-2 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[21 Jul 2005 20:06] [ name withheld ]
Description:
See OpenOffice.org Issue#41939
http://www.openoffice.org/issues/show_bug.cgi?id=41939

The problem exists only when using the ODBC connector.  When using JDBC everything works fine.  It's possible the problem lies in unixODBC itself, but I have no way of verifying that.

How to repeat:
Create a table with `order` as one of it's field names.
View the table using OpenOffice.org through a MySQL/ODBC connection -
   table is read-only and table structure is inaccesible.
[23 Jul 2005 9:33] Vasily Kishkin
I tested on Windows. ODBC works right. Probably it's a problem of unixODBC. I'll test it on Linux.
[2 Aug 2005 6:41] Aleksey Kishkin
Hi. When i test it with openoffice I saw that (as you mentioned) I couldn't edit table with 'order' field. But if I use standard unixODBC tool 'isql', all operations was executed correctly. So I don't expect odbc driver is broken. Could you try isql on your tables? (I want to be sure that odbc driver works similar on mine and your computers).

sh-3.00# isql test
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> show tables;
+-----------------------------------------------------------------+
| Tables_in_test                                                  |
+-----------------------------------------------------------------+
| tblbug                                                          |
+-----------------------------------------------------------------+
SQLRowCount returns 1
1 rows fetched
SQL> select * from tblbug;
+------------+------------+---------------------------------------------------+
| ID         | uid        | order |
+------------+------------+---------------------------------------------------+
+------------+------------+---------------------------------------------------+
SQLRowCount returns 0
SQL> insert into tblbug values (1,1,'ww');
SQLRowCount returns 1
SQL> select * from tblbug;
+------------+------------+---------------------------------------------------+
| ID         | uid        | order |
+------------+------------+---------------------------------------------------+
| 1          | 1          | ww |
+------------+------------+---------------------------------------------------+
SQLRowCount returns 1
1 rows fetched

SQL> update `tblbug` set `order`='test12' where ID=1;
SQLRowCount returns 1

SQL> select * from tblbug;
+------------+------------+---------------------------------------------------+
| ID         | uid        | order |
+------------+------------+---------------------------------------------------+
| 1          | 1          | test12 |
+------------+------------+---------------------------------------------------+
SQLRowCount returns 1
1 rows fetched
SQL>
[2 Aug 2005 16:35] [ name withheld ]
I tried isql as well and it seems to work fine.  The issue has something to do with the way openoffice interacts with the odbc libraries, it's hard to tell exactly where it lies.  As I understand it openoffice cannot get the table description properly because this keyword is in it.  The reason we thought it might be a problem in the connector/odbc is described in the openoffice bug I linked to.
[3 Aug 2005 6:55] Ocke Janssen
Hi,

the problem seems to be the SQLColumns call when the name is "order" and a catlog was set. When the catalog is empty all works quite well.

Here is the link for the OpenOffice.org issue
http://www.openoffice.org/issues/show_bug.cgi?id=41939

Best regards,

Ocke
[7 Aug 2005 10:32] Vasily Kishkin
Probably it's openoffice bug, MyODBC works correct on both Windows and Linux.