Bug 56243 - Libreoffice Base: Bogus query for MySQL database
Summary: Libreoffice Base: Bogus query for MySQL database
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.6.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 56242
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-21 06:03 UTC by Rolf Leggewie
Modified: 2013-04-15 08:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
excerpt from mysql log (3.29 KB, text/plain)
2012-10-21 06:03 UTC, Rolf Leggewie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Leggewie 2012-10-21 06:03:25 UTC
Created attachment 68858 [details]
excerpt from mysql log

originally reported as - https://bugzilla.novell.com/show_bug.cgi?id=443873

LO produces a bogus query for tables without a primary key.

Steps to reproduce:

1) Load https://bugzilla.novell.com/attachment.cgi?id=251407 into a MySQL server of your choice
2) Create new database and connect to above database
3) optional: enable logging for your MySQL server
4) double click on table accounts which does have a primary key
5) double click on table accounts_ext which does not

Observe the difference between 4 and 5 in that cells in 4 are editable where those from 5 are not.

Find some excerpts from my MySQL log in the attachment.  Pay attention to the bogus "WHERE 0=1" in both cases.
Comment 1 Lionel Elie Mamane 2013-04-15 08:41:36 UTC
1) Yes, LibreOffice cannot open tables that don't have a primary key in read/write mode, only read-only. Write access to tables without primary key is not supported.

2) The queries with "WHERE 0=1" are not bogus, but they are LibreOffice's method of getting information on the structure of the result of the query without fetching any data.