Bug 45834 - PgSQL: if no SELECT privilege on table at startup, auto increment field zero in new data
Summary: PgSQL: if no SELECT privilege on table at startup, auto increment field zero ...
Status: NEEDINFO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Database (show other bugs)
Version: 3.5.0 release
Hardware: All All
: low minor
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 05:31 UTC by Lionel Elie Mamane
Modified: 2015-01-03 17:38 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Lionel Elie Mamane 2012-02-09 05:31:28 UTC
+++ This bug was initially created as a clone of Bug #45345 +++

Open a database connection to a PostgreSQL server through PostgreSQL-SDBC driver. (That is, open the .odb file and click on "Tables" to make the connection.) Answer password prompt if any.

Choose a table:

 - the user does not have "SELECT" privilege on
 - Primary key is a SERIAL column (autoincrement)

Then (with psql or another interface) grant the SELECT (and INSERT if not already there) privilege and then open the table in LibO. Insert data, not filling in the autoincrement column. That column appears as "0" until you refresh the data.

Close table. Take menu "view / refresh table", then the problem disappears.


So, for example ("=>" is the psql prompt):

1) psql -U user1
2) => CREATE TABLE foo (...)
3) start LibO
4) connect to database with libO as user2 (after opening corresponding odb
file, click on "Tables"; you see the list of tables)
5) => GRANT SELECT, INSERT ON foo TO user2
6) LibO: open table foo
7) LibO: insert data
8) Indeed, ID column shows 0
9) close table
10) view/refresh tables
11) open table foo
12) insert data
13) no problem


Also:

1) psql -U user1
2) => CREATE TABLE foo (...)
3) => GRANT SELECT, INSERT ON foo TO user2
4) start LibO
5) connect to database with libO as user2 (after opening corresponding odb
file, click on "Tables"; you see the list of tables)
6) LibO: open table foo
7) LibO: insert data
8) no problem



Because this bug happens only in *very* specific circumstances and is easily
worked around, I set it to low priority and minor severity.
Comment 1 Beluga 2014-11-06 12:05:19 UTC
This was set as NEW by the reporter. Because of the exotic reproduction environment requirement, I'm setting as NEEDINFO and taking the opportunity to ask, if the problem still exists in later versions?
Comment 2 Alex Thurgood 2015-01-03 17:38:16 UTC
Adding self to CC if not already on


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.