user with read_only right on some table can block others from updating this
table
---------------------------------------------------------------------------------
Key: CORE-3736
URL: http://tracker.firebirdsql.org/browse/CORE-3736
Project: Firebird Core
Issue Type: Bug
Reporter: Pavel Zotov
SESSION #1 // sysdba
[firebird@firebirdG empbuild]$ isql employee.fdb
Database: employee.fdb
SQL> create user usrxxx password '123'; commit;
SQL> create table supermain(id int, f01 int); commit;
SQL> insert into supermain values(1,100);
SQL> insert into supermain values(2,200);
SQL> insert into supermain values(3,300);
SQL> commit;
SQL> create role readmain;
SQL> commit;
SQL> grant select on supermain to readmain;
SQL> commit;
SQL> grant readmain to usrxxx;
SQL> commit;
SESSION #2 // user USRXXX, role with read_only right
[firebird@firebirdG empbuild]$ isql employee.fdb -user usrxxx -pas 123 -role
readmain
Database: employee.fdb, User: usrxxx, Role: READMAIN
SQL> update supermain set f01=1;
Statement failed, SQLSTATE = 28000
no permission for update/write access to TABLE SUPERMAIN
SQL> rollback;
SQL> select * from supermain for update with lock; -- <<<<<<<<<<<<<<<<< passed!
why ? <<<<<<<<<<<<
ID F01
============ ============
1 100
2 200
3 300
SESSION #1 // sysdba
SQL> set transaction read committed no record_version no wait;
SQL> select * from supermain;
ID F01
============ ============
Statement failed, SQLSTATE = 40001
lock conflict on no wait transaction
-deadlock
SQL> rollback;
SQL> set transaction read committed no wait;
SQL> update supermain set f01=-f01 order by id rows 1;
Statement failed, SQLSTATE = 40001
lock conflict on no wait transaction
-deadlock
SQL> rollback;
SQL> set transaction read committed no wait;
SQL> delete from supermain;
Statement failed, SQLSTATE = 40001
lock conflict on no wait transaction
-deadlock
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel