src/cats/sql.c
static int db_max_connections_handler(void *ctx, int num_fields, char **row) 
{ 
   struct max_connections_context *context; 
   uint32_t index; 
 
   context = (struct max_connections_context *)ctx; 
   switch (context->db->bdb_get_type_index()) { 
   case SQL_TYPE_MYSQL: 
      index = 1; 
   default: 
      index = 0; 
   } 
 
   if (row[index]) { 
      context->nr_connections = str_to_int64(row[index]); 
   } else { 
      Dmsg0(800, "int_handler finds zero\n"); 
      context->nr_connections = 0; 
   } 
   return 0; 
}
/* 
 * Called here to retrieve max_connections from db 
 */
Called here to retrieve max_connections from db
Called here to retrieve max_connections from db
static int db_max_connections_handler(void *ctx, int num_fields, char **row) 
{ 
   struct max_connections_context *context; 
   uint32_t index; 
   context = (struct max_connections_context *)ctx; 
   switch (context->db->bdb_get_type_index()) { 
   case SQL_TYPE_MYSQL: 
      index = 1; 
   default: 
      index = 0; 
   } 
   if (row[index]) { 
      context->nr_connections = str_to_int64(row[index]); 
   } else { 
      Dmsg0(800, "int_handler finds zero\n"); 
      context->nr_connections = 0; 
   } 
   return 0; 
}
static int db_max_connections_handler ( void * ctx , int num_fields , char * * row ) { struct max_connections_context * context ; uint32_t index ; context = ( struct max_connections_context * ) ctx ; switch ( context -> db -> bdb_get_type_index ( ) ) { case SQL_TYPE_MYSQL : index = 1 ; default : index = 0 ; } if ( row [ index ] ) { context -> nr_connections = str_to_int64 ( row [ index ] ) ; } else { Dmsg0 ( 800 , " \n " ) ; context -> nr_connections = 0 ; } return 0 ; }
Called here to retrieve max_connections from db
Called here to retrieve max_connections from db