Issue 1653 - Error: The table "accounts" is unknown in the database - wrong SQL
Summary: Error: The table "accounts" is unknown in the database - wrong SQL
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-11 10:24 UTC by ntibor
Modified: 2013-08-07 15:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ntibor 2001-09-11 10:24:59 UTC
Our configuration: SuSe Linux 7.1, 2.4.9 kernel, Informix 9.21 UC3, Informix
Connect 2.40 ODBC
The following SQL is used by openoffice to get tablename (see everywhere 1=0!!!):

Last parsed SQL statement :
   select '1', owner, tabname, 'SYSTEM TABLE', '1' from
    core:informix.systables t where t.tabid < 99   and 1 = 0  and t.owner like
    '%' and t.tabname like 'accounts'  union select '2', owner, tabname,
    'TABLE', '2' from core:informix.systables t where t.tabid > 99 and
    t.tabtype = 'T'  and 1 = 0  and t.owner like '%' and t.tabname like
    'accounts'  union select '3', owner, tabname, 'VIEW', '3' from
    core:informix.systables t where t.tabid > 99 and t.tabtype = 'V'  and 1 =
    0  and t.owner like '%' and t.tabname like 'accounts'  union select '4',
    owner, tabname, 'SYNONYM', '4' from core:informix.systables t where
    t.tabid > 99 and t.tabtype = 'S'  and 1 = 0  and t.owner like '%' and
    t.tabname like 'accounts'  order by 4, 1, 2, 3
Comment 1 Frank Schönheit 2001-09-11 16:21:44 UTC
Tibor,

what exactly did you do in OOo to reproduce the behaviour?
What structures do you have in your DB? I.e., which tables are 
existent, which (possibly which kind of) columns do they have?

Please give us as detailed information about the concrete data you 
are accessing and the things you do.

Thanks!
Comment 2 ntibor 2001-09-12 12:12:22 UTC
Hi Frank,

I describe all the steps what I performed:

Tools/Data sources/New Data Source
	General
		Name: ntibor_core
		Database Type: ODBC
		Data Source URL: sdbc:odbc:Inf_dell632_ntibor_core
	ODBC
		User name: ntibor
		Password required: checked
		Driver settings: empty
		Character set: System
		Use catalog for...: unchecked
	Tables
		As I click the 'Table' tab, I see only 'All tables' checked in
		the table list, but no individual tables. And as I see in
		informix 'onstat' utility, this is because wrong sql command 
		is issued by OOo with the '1=0' in it, this sql returns
		nothing of course:

************ onstat's output ***********
onstat> sql 7572
 
Informix Dynamic Server 2000 Version 9.21.UC3     -- On-Line -- Up 7
days 04:18:51 -- 1548748 Kbytes
 
Sess  SQL            Current            Iso Lock       SQL  ISAM F.E.
Id    Stmt type      Database           Lvl Mode       ERR  ERR  Vers
7572  -              ntibor_core        CR  Not Wait   0    0    9.03
 
Last parsed SQL statement :
   select '1', owner, tabname, 'SYSTEM TABLE', '1' from
    ntibor_core:informix.systables t where t.tabid < 99   and 1 = 0 
and
    t.owner like '%' and t.tabname like '%'  union select '2', owner,
tabname,
    'TABLE', '2' from ntibor_core:informix.systables t where t.tabid >
99 and
    t.tabtype = 'T'  and 1 = 1  and 1 = 0  and t.owner like '%' and
t.tabname
    like '%'  union select '3', owner, tabname, 'VIEW', '3' from
    ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype
= 'V'
    and 1 = 1  and 1 = 0  and t.owner like '%' and t.tabname like '%' 
union
    select '4', owner, tabname, 'SYNONYM', '4' from
    ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype
= 'S'
    and 1 = 0  and t.owner like '%' and t.tabname like '%'  order by
4, 1, 2,
    3
onstat>

********* end of onstat's output *********

	Queries
		New Sql
			"select * from accounts"
			Run -- IT WORKS!!! I see the records of the table
			Switch design view on -> OOo's error message and the wrong sql 
reported before appear.

That's all. I guess it should be analyzed why '1=0' is inserted into
the sql command, even if you have not the same environment as me and
you can not reproduce the problem.

Tibor

Note:	I am using the same ODBC data source with StarOffice 5.2
	without any problem.
Comment 3 dirk.grobler 2001-09-12 13:14:09 UTC
Ocke is the responsible engineer
Comment 4 Frank Schönheit 2001-09-12 17:14:22 UTC
usually, the 1 = 0 is use to retrieve information about columns in a 
table (or, for that matter, in the result set of a statement).
It's a common method if retrieving information about the result set 
which do not depend on the actual data: append an "1 = 0" to the 
WHERE clause, and the result set is the same except that it's empty.
Nevertheless, it's strange that this is done when simply accessing 
the tables page in the dialog.
Comment 5 ocke.janssen 2001-11-14 17:04:29 UTC
Hi Tibor,
first sorry for the long delay.
The ODBC driver you are using comes from informix or is it unixODBC?
The sql statement looks a liitle bit strang for me. We never create
this kind of statement, yes it is true that we sometimes create a
statement like 0=1 but only to the columns names without getting a
result. But this statement must be generated by informix, I'm sure
because we write all keywords in capital letters another reason is
that the identifier are not qouted.

regards,
Ocke
Comment 6 ntibor 2001-11-15 08:35:59 UTC
I am using INTERSOLV ODBC:

        INTERSOLV DataDirect Connect ODBC
        UNIX
        Version 3.11
        January 1999

Do you have a better idea?

Tibor                                                     
Comment 7 ocke.janssen 2002-10-16 09:03:53 UTC
Hi Tibor,

did you try the Informix odbc drivers from the site
http://www.informix.com/evaluate ?

Best regards,
Ocke
Comment 8 ntibor 2002-10-17 12:03:58 UTC
No, I am using InterSolv 3.11 ODBC.
Anyway, there is no such address: http://www.informix.com/evaluate

I do not beleice, that the problem is the driver itself. I tried this
with OpenOffice 1.0. THe reasult is the same. The ODBC connection is
basically OK, I can create a new table from OpenOffice. But the Table
list is empty. The last parsed SQL - as I see in Informix - has
absolutely no sense, it is no wonder, that no tables are seen:

Last parsed SQL statement :
   select '1', owner, tabname, 'SYSTEM TABLE', '1' from
    ntibor_core:informix.systables t where t.tabid < 99 and tabtype in
    ('T','V','S','P')  and 1 = 0  and t.owner like '%' and t.tabname
like '%'
    union select '2', owner, tabname, 'TABLE', '2' from
    ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype
= 'T'
    and 1 = 1  and 1 = 0  and t.owner like '%' and t.tabname like '%'
 union
    select '3', owner, tabname, 'VIEW', '3' from
    ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype
= 'V'
    and 1 = 1  and 1 = 0  and t.owner like '%' and t.tabname like '%'
 union
    select '4', owner, tabname, 'SYNONYM', '4' from
    ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype
= 'S'
    and 1 = 0  and t.owner like '%' and t.tabname like '%'  order by
4, 1, 2,
    3
Comment 9 ocke.janssen 2002-10-17 15:34:21 UTC
I'm a little bit confused about the address. When I hit on it I come
to Informix. !!??

The statement you submitted is not generated by OO. It looks like the
driver you are using generate this to get information about the
tables. The driver possible creates this stamtement when we ask him
for SQLTables which is only a ODBC function call. OO only generates
sometimes statement s which ends with 1=0 but then only one table is
inside the from clause. It seems that Informix uses the same trick to
get information about table columns.

Best regards,
Ocke
Comment 10 ntibor 2002-10-18 13:41:57 UTC
The problem on the WEB site was temporary only. I downloaded the
newest IBM INFORMIX CONNECT 2.80.UC1-1 for INTEL LINUX 2.4 GLIBC2.2.X.

I installed it. I deinstalled the Intersolv ODBC driver and I
installed unixODBC-2.1.1-111 from the SuSe 8.0 distribution.The
situation remains the same. It works with StarOffice 5.2, but the
table list is not shown in OO, therefore I can enter SQL command
manualy only.

Note: I changed the version in the header

BRG

Tibor
Comment 11 ocke.janssen 2002-10-18 13:58:28 UTC
A last thing you could try, is to download the newset versin of
unixODBC. Your version is from Dec.2001. May be they fixed some bugs to.

By the way, which version of OOo your are using?

Kindly,
Ocke
Comment 12 ntibor 2002-10-21 08:30:01 UTC
I have downloaded, compliled and installed unixODBC 2.2.0. Nothing has
been changed. StarOffice works, OO not. I am using OpenOffie 1.0.1.
Comment 13 ocke.janssen 2002-11-01 11:09:25 UTC
The SRX643 should be closest to current state of the art :-)
Comment 14 Frank Schönheit 2002-12-09 11:34:56 UTC
targeting to 1.1 Beta.
Comment 15 ocke.janssen 2002-12-12 10:28:13 UTC
Hi Marc,

please have a look at it. If still occurs in a current release.


Best regards,

Ocke
Comment 16 Unknown 2003-03-21 19:26:29 UTC
I have the same problem when using the Easysoft ODBC-Interbase driver 
on a Windows 2000 PC with OpenOffice 1.0.2:
 
When opening a database (using "View | Data Sources"), and then 
clicking on the little + sign next to the "Tables" entry the list of 
all tables in the database does not appear. 

With the Gemini ODBC-Interbase driver this problem does not occur. 

By the way: this issue appears to be similar to issue 5231
Comment 17 michael.bemmer 2003-05-06 15:50:47 UTC
Too late for beta2, re-targeted to 1.1 RC.
Comment 18 Martin Hollmichel 2003-06-16 16:12:14 UTC
mh->msc: are there any updates for this ?
Comment 19 marc.neumann 2003-07-14 10:58:13 UTC
Hi Tibor,

does this issue still occur in OOo 1.1 RC ?

Bye Marc
Comment 20 ntibor 2003-07-14 12:58:21 UTC
I have found OO 1.1 Beta 2 to download. Where to find OOo 1.1 RC?
By the way OO 1.0.3 have the same problem. Who did set the status of
this issue as 'RESOLVED FIXED' (without any comment)?
Comment 21 ntibor 2003-07-15 13:06:33 UTC
The problem still occurs in OO 1.1 Beta 2. Where to find OO 1.1. RC1?
Comment 22 ntibor 2003-07-15 14:46:57 UTC
Nothing has bess changed until now, the problem still occurs also in
OO 1.1 RC.
ODBC connection OK, SQL commands OK, table creation OK but table list
is not seen.
Note: I have set Version to OOo 1.1 RC in the header.
Comment 23 marc.neumann 2003-07-28 09:42:52 UTC
set target to 2.0, because development for 1.1 is closed.
Comment 24 hans_werner67 2004-02-02 12:52:00 UTC
change subcomponent to 'none'
Comment 25 thorsten.ziehm 2004-08-19 15:46:44 UTC
Because of limited resource for OOo2.0, it was decided to shift this tasks to
the next milestone. If somebody will be found, who can implement this until
OOo2.0, then this tasks will be re-targeted.
Comment 26 Mechtilde 2009-07-17 20:09:17 UTC
works for me with the functinality of the "new base container since version 2.0
Comment 27 Mechtilde 2009-07-17 20:09:54 UTC
.