DatabaseProcApplicationCreatedLinks
sybsystemprocssp_commit_xact  14 déc. 14Defects Propagation Dependencies

1     
2     create or replace procedure sp_commit_xact
3         @commid int,
4         @password varchar(30) = NULL
5     AS
6     
7     
8         if @@trancount = 0
9         begin
10            set transaction isolation level 1
11            set chained off
12        end
13    
14    
15        if exists (select *
16                from sybsystemdb.dbo.spt_committab
17                where commid = @commid
18                    and password = @password)
19        begin
20            /*
21            **  If status is aborted, return a 1 to indicate a failure.
22            */
23            if exists (select *
24                    from sybsystemdb.dbo.spt_committab
25                    where commid = @commid
26                        and status = 'a')
27            begin
28                select 1
29                return (1)
30            end
31    
32            /*  Mark the xact as committed. */
33            UPDATE sybsystemdb.dbo.spt_committab
34            SET status = 'c', lastchange = getdate()
35            WHERE commid = @commid
36            select 0
37            return (0)
38        end
39        else
40        begin
41            /* Error so return 1 */
42            /*
43            ** 17380, "Commit service xact id doesn't exist."
44            */
45            raiserror 17380
46            select 1
47            return (1)
48        end
49    


exec sp_procxmode 'sp_commit_xact', 'AnyMode'
go

Grant Execute on sp_commit_xact to public
go
RESULT SETS
sp_commit_xact_rset_003
sp_commit_xact_rset_002
sp_commit_xact_rset_001

DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_commit_xact  
 MNER 3 No Error Check should check @@error after update 33
 MUCO 3 Useless Code Useless Brackets 29
 MUCO 3 Useless Code Useless Brackets 37
 MUCO 3 Useless Code Useless Brackets 47
 QCRS 3 Conditional Result Set 28
 QCRS 3 Conditional Result Set 36
 QCRS 3 Conditional Result Set 46
 QISO 3 Set isolation level 10
 QNAM 3 Select expression has no name 1 28
 QNAM 3 Select expression has no name 0 36
 QNAM 3 Select expression has no name 1 46
 MRST 2 Result Set Marker 28
 MRST 2 Result Set Marker 36
 MRST 2 Result Set Marker 46
 MSUB 2 Subquery Marker 15
 MSUB 2 Subquery Marker 23
 MTR1 2 Metrics: Comments Ratio Comments: 16% 2
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 4 = 6dec - 4exi + 2 2
 MTR3 2 Metrics: Query Complexity Complexity: 25 2

DEPENDENCIES
PROCS AND TABLES USED
writes table sybsystemprocs..sp_commit_xact_rset_003 
writes table sybsystemprocs..sp_commit_xact_rset_002 
writes table sybsystemprocs..sp_commit_xact_rset_001 
read_writes table sybsystemdb..spt_committab (1)