https://bugs.freedesktop.org/show_bug.cgi?id=45834

             Bug #: 45834
           Summary: PgSQL: if no SELECT privilege on table at startup,
                    auto increment field zero in new data
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO 3.5.0 RC3
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: low
         Component: Database
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
        Depends on: 45345


+++ 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.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to