SET COUNT ON: issuing UPDATE on view which was created WITH CHECK OPTION 
produces wrong number of affected rows (doubled ?)
---------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4870
                 URL: http://tracker.firebirdsql.org/browse/CORE-4870
             Project: Firebird Core
          Issue Type: Bug
          Components: ISQL
    Affects Versions: 3.0 Beta 2, 2.5.4, 3.0 RC 1
            Reporter: Pavel Zotov


DDL:
####

C:\MIX\firebird\QA\fbt-repo\tmp>isql /3333:e30
Database:  /3333:e30
SQL> recreate table test(id int, x int); commit;
SQL> recreate sequence g1; commit;
SQL> recreate sequence g2; commit;
SQL> insert into test select gen_id(g1, 1), gen_id(g2,1)*10 from rdb$types rows 
10; commit;
SQL> select * from test;

          ID            X
============ ============
           1           10
           2           20
           3           30
. . .
          10          100

SQL> commit;

TEST.
#####

First, create view WITHOUT check option in order to compare further results:

SQL> recreate view v_test as select * from test where mod(id, 3)=0; 
SQL> commit;

SQL> set count on;

SQL> update test set x=-x where id=3;
Records affected: 1
SQL> update v_test set x=-x where id=3;
Records affected: 1 -- OK

Second, change definition of VIEW by adding 'with check option' clause and 
repeat:

SQL> recreate view v_test as select * from test where mod(id, 3)=0 with check 
option; 
SQL> commit;
SQL> update test set x=-x where id=3;
Records affected: 1
SQL> update v_test set x=-x where id=3;
Records affected: 2 -- <<<<<<<<<<<<<<<<<<<<<<< ?? <<<<<<<<<<<<<<<

-PS. No such effect for DELETE statement.

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

        

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to