DatabaseProcApplicationCreatedLinks
sybsystemprocssyb_aux_colbit  31 Aug 14Defects Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */
3     
4     create procedure syb_aux_colbit(
5         @col_pos smallint,
6         @columns varbinary(133),
7         @result tinyint output)
8     as
9     
10        declare @which_byte tinyint
11        declare @bit_offset tinyint
12        declare @bitmap_byte tinyint
13    
14        /*
15        ** check to see if the bit 0 is 1. If it is, then the privilege is 
16        ** available on all columns 
17        */
18    
19        if (@columns = 0x01)
20        begin
21            select @result = 1
22            return
23        end
24    
25        select @result = 0
26        select @which_byte = (@col_pos) / 8
27        select @bit_offset = @col_pos - @which_byte * 8
28    
29    
30    
31        /* get the byte of the bit map we are interested in */
32        select @bitmap_byte = convert(tinyint, substring(@columns, @which_byte + 1, 1))
33    
34        if (@bit_offset = 0)
35            select @result = @bitmap_byte & 0x01
36        else if (@bit_offset = 1)
37            select @result = @bitmap_byte & 0x02
38        else if (@bit_offset = 2)
39            select @result = @bitmap_byte & 0x04
40        else if (@bit_offset = 3)
41            select @result = @bitmap_byte & 0x08
42        else if (@bit_offset = 4)
43            select @result = @bitmap_byte & 0x10
44        else if (@bit_offset = 5)
45            select @result = @bitmap_byte & 0x20
46        else if (@bit_offset = 6)
47            select @result = @bitmap_byte & 0x40
48        else if (@bit_offset = 7)
49            select @result = @bitmap_byte & 0x80
50    
51    


exec sp_procxmode 'syb_aux_colbit', 'AnyMode'
go

Grant Execute on syb_aux_colbit to public
go
DEFECTS
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 19
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 35
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 37
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 39
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 41
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 43
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 45
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 47
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 49
 MGTP 3 Grant to public sybsystemprocs..syb_aux_colbit  
 MUCO 3 Useless Code Useless Brackets in create proc 4
 MUCO 3 Useless Code Useless Brackets 19
 MUCO 3 Useless Code Useless Brackets 34
 MUCO 3 Useless Code Useless Brackets 36
 MUCO 3 Useless Code Useless Brackets 38
 MUCO 3 Useless Code Useless Brackets 40
 MUCO 3 Useless Code Useless Brackets 42
 MUCO 3 Useless Code Useless Brackets 44
 MUCO 3 Useless Code Useless Brackets 46
 MUCO 3 Useless Code Useless Brackets 48
 MTR1 2 Metrics: Comments Ratio Comments: 15% 4
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 9 = 9dec - 2exi + 2 4
 MTR3 2 Metrics: Query Complexity Complexity: 36 4

DEPENDENCIES
CALLERS
called by proc sybsystemprocs..syb_aux_printprivs  
   called by proc sybsystemprocs..sp_oledb_computeprivs  
      called by proc sybsystemprocs..sp_oledb_gettableprivileges  
      called by proc sybsystemprocs..sp_oledb_getcolumnprivileges  
   called by proc sybsystemprocs..sp_odbc_computeprivs  
      called by proc sybsystemprocs..sp_odbc_gettableprivileges  
      called by proc sybsystemprocs..sp_odbc_getcolumnprivileges  
   called by proc sybsystemprocs..sp_jdbc_computeprivs  
      called by proc sybsystemprocs..sp_jdbc_gettableprivileges  
   called by proc sybsystemprocs..sp_ijdbc_aux_computeprivs  
   called by proc sybsystemprocs..sp_jdbc_getcolumnprivileges  
   called by proc sybsystemprocs..sp_aux_computeprivs  
      called by proc sybsystemprocs..sp_column_privileges  
      called by proc sybsystemprocs..sp_table_privileges