DatabaseProcApplicationCreatedLinks
sybsystemprocssp_aux_get_qpgroup  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3     
4     /*
5     ** Messages for "sp_aux_get_qpgroup"
6     **
7     ** Warning : there are %1! query plans groups in this database that are named '%2!'. Using the group with ID %3!.
8     */
9     
10    /*
11    ** sp_aux_get_qpgroup encapsulates the SYSATTRIBUTES AP GID 
12    ** lookup by AP group name. 
13    */
14    
15    create or replace procedure sp_aux_get_qpgroup
16        @name varchar(30),
17        @id int out
18    as
19        declare
20            @class int,
21            @attribute int,
22            @object_type char(2),
23    
24            @rows int
25    
26        /* get the SARGs */
27        exec sp_aux_sargs_qpgroup @class out, @attribute out, @object_type out
28    
29        select @id = object from sysattributes
30            holdlock
31        where class = @class
32            and attribute = @attribute
33            and object_type = @object_type
34            and object_cinfo = @name
35    
36        select @rows = @@rowcount
37    
38        if @rows > 1
39        begin
40            /* 18659, "Warning : there are %1! query plans groups in this database that are named '%2!'. Using the group with ID %3!." */
41            raiserror 18659, @rows, @name, @id
42        end
43    
44        return 0
45    

DEFECTS
 MINU 4 Unique Index with nullable columns sybsystemprocs..sysattributes sybsystemprocs..sysattributes
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 31
 QTYP 4 Comparison type mismatch smallint = int 31
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 32
 QTYP 4 Comparison type mismatch smallint = int 32
 MGTP 3 Grant to public sybsystemprocs..sysattributes  
 MNER 3 No Error Check should check return value of exec 27
 QAFM 3 Var Assignment from potentially many rows 29
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object_type, object_cinfo, attribute, class}
31
 MTR1 2 Metrics: Comments Ratio Comments: 42% 15
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 6 = 5dec - 1exi + 2 15
 MTR3 2 Metrics: Query Complexity Complexity: 14 15

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_aux_sargs_qpgroup  
reads table sybsystemprocs..sysattributes  

CALLERS
called by proc sybsystemprocs..sp_export_qpgroup  
called by proc sybsystemprocs..sp_add_qpgroup  
   called by proc sybsystemprocs..sp_import_qpgroup  
called by proc sybsystemprocs..sp_drop_qpgroup  
called by proc sybsystemprocs..sp_drop_all_qplans  
called by proc sybsystemprocs..sp_rename_qpgroup  
called by proc sybsystemprocs..sp_cmp_all_qplans  
called by proc sybsystemprocs..sp_find_qplan  
called by proc sybsystemprocs..sp_copy_qplan  
   called by proc sybsystemprocs..sp_copy_all_qplans  
called by proc sybsystemprocs..sp_copy_all_qplans  
called by proc sybsystemprocs..sp_help_qpgroup  
called by proc sybsystemprocs..sp_import_qpgroup