Comment 25 for bug 782292

Revision history for this message
In , Ferry Toth (ftoth) wrote :

I just tried a little LO Basic code, to help me understand how all this
postgres driver code is supposed to work internally.

There seems to be a problem with the privileges, but
setting IgnoreDriverPrivileges on the driver doesn't seem to work. When a resultset is created it seems to have the wrong privileges.

I have the sources here and they do build, but I have no clue which sources changed from 3.2.1 to 3.3.2. Which sources files should I look at?

Ferry

Note: table TestTable is empty

This is the code:
Sub Main
   dbcontext = createunoservice("com.sun.star.sdb.DatabaseContext")
   dbsource = dbcontext.getByName("Exalon Office")

'putting a watch here on dbsource.Settings.IgnoreDriverPrivileges shows
this == TRUE
'on OO3.2.1 this is by default, on LO3.3.2 this is manual by setting in
the XCU file as you suggested

   dbsource.settings.EscapeDateTime = false ' old hack donated by FS

' test starts here
   RowSet = createUnoService("com.sun.star.sdb.RowSet")
    RowSet.DataSourceName = "Exalon Office"
    RowSet.CommandType = com.sun.star.sdb.CommandType.TABLE
    RowSet.Command = "public.TestTable"
    ResultSetType= com.sun.star.sdbc.ResultSetType.SCROLL_INSENSITIVE

ResultSetConcurrency=com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE
    RowSet.execute()
    RowSet.moveToInsertRow()

'on OO3.2.1 this command completes
'on LO3.3.2 this command fails with and com.sun.star.sdbc.SQLException
' Message: privilege INSERT is not available
'inspecting Rowset.Privileges shows
' on OO3.2.1 == 511
'on LO3.3.2 == 1
'the Rowset.Privileges is RO, so I can not change it

End Sub