~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
Remove uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
  the following variables/structures
100
100
*/
101
101
static MEM_ROOT plugin_mem_root;
102
 
static uint global_variables_dynamic_size= 0;
 
102
static uint32_t global_variables_dynamic_size= 0;
103
103
static HASH bookmark_hash;
104
104
 
105
105
 
126
126
*/
127
127
struct st_bookmark
128
128
{
129
 
  uint name_len;
 
129
  uint32_t name_len;
130
130
  int offset;
131
 
  uint version;
 
131
  uint32_t version;
132
132
  char key[1];
133
133
};
134
134
 
199
199
 
200
200
 
201
201
/* declared in set_var.cc */
202
 
extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error);
 
202
extern sys_var *intern_find_sys_var(const char *str, uint32_t length, bool no_error);
203
203
extern bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
204
204
                                 const char *name, int64_t val);
205
205
 
263
263
 
264
264
static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl)
265
265
{
266
 
  uint i;
 
266
  uint32_t i;
267
267
  struct st_plugin_dl *tmp;
268
268
  for (i= 0; i < plugin_dl_array.elements; i++)
269
269
  {
279
279
 
280
280
static st_plugin_dl *plugin_dl_insert_or_reuse(struct st_plugin_dl *plugin_dl)
281
281
{
282
 
  uint i;
 
282
  uint32_t i;
283
283
  struct st_plugin_dl *tmp;
284
284
  for (i= 0; i < plugin_dl_array.elements; i++)
285
285
  {
310
310
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
311
311
{
312
312
  char dlpath[FN_REFLEN];
313
 
  uint plugin_dir_len, dummy_errors, dlpathlen;
 
313
  uint32_t plugin_dir_len, dummy_errors, dlpathlen;
314
314
  struct st_plugin_dl *tmp, plugin_dl;
315
315
  void *sym;
316
316
  plugin_dir_len= strlen(opt_plugin_dir);
403
403
 
404
404
static void plugin_dl_del(const LEX_STRING *dl)
405
405
{
406
 
  uint i;
 
406
  uint32_t i;
407
407
 
408
408
  for (i= 0; i < plugin_dl_array.elements; i++)
409
409
  {
429
429
 
430
430
static struct st_plugin_int *plugin_find_internal(const LEX_STRING *name, int type)
431
431
{
432
 
  uint i;
 
432
  uint32_t i;
433
433
  if (! initialized)
434
434
    return(0);
435
435
 
529
529
 
530
530
static st_plugin_int *plugin_insert_or_reuse(struct st_plugin_int *plugin)
531
531
{
532
 
  uint i;
 
532
  uint32_t i;
533
533
  struct st_plugin_int *tmp;
534
534
  for (i= 0; i < plugin_array.elements; i++)
535
535
  {
575
575
  /* Find plugin by name */
576
576
  for (plugin= tmp.plugin_dl->plugins; plugin->name; plugin++)
577
577
  {
578
 
    uint name_len= strlen(plugin->name);
 
578
    uint32_t name_len= strlen(plugin->name);
579
579
    if (plugin->type >= 0 && plugin->type < DRIZZLE_MAX_PLUGIN_TYPE_NUM &&
580
580
        ! my_strnncoll(system_charset_info,
581
581
                       (const unsigned char *)name->str, name->length,
682
682
 
683
683
static void reap_plugins(void)
684
684
{
685
 
  uint count, idx;
 
685
  uint32_t count, idx;
686
686
  struct st_plugin_int *plugin, **reap, **list;
687
687
 
688
688
  if (!reap_needed)
762
762
}
763
763
 
764
764
 
765
 
void plugin_unlock_list(THD *thd, plugin_ref *list, uint count)
 
765
void plugin_unlock_list(THD *thd, plugin_ref *list, uint32_t count)
766
766
{
767
767
  LEX *lex= thd ? thd->lex : 0;
768
768
  assert(list);
870
870
*/
871
871
int plugin_init(int *argc, char **argv, int flags)
872
872
{
873
 
  uint i;
 
873
  uint32_t i;
874
874
  struct st_mysql_plugin **builtins;
875
875
  struct st_mysql_plugin *plugin;
876
876
  struct st_plugin_int tmp, *plugin_ptr, **reap;
1101
1101
 
1102
1102
void plugin_shutdown(void)
1103
1103
{
1104
 
  uint i, count= plugin_array.elements, free_slots= 0;
 
1104
  uint32_t i, count= plugin_array.elements, free_slots= 0;
1105
1105
  struct st_plugin_int **plugins, *plugin;
1106
1106
  struct st_plugin_dl **dl;
1107
1107
 
1225
1225
 
1226
1226
 
1227
1227
bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
1228
 
                       int type, uint state_mask, void *arg)
 
1228
                       int type, uint32_t state_mask, void *arg)
1229
1229
{
1230
 
  uint idx, total;
 
1230
  uint32_t idx, total;
1231
1231
  struct st_plugin_int *plugin, **plugins;
1232
1232
  int version=plugin_array_version;
1233
1233
 
1264
1264
  {
1265
1265
    if (unlikely(version != plugin_array_version))
1266
1266
    {
1267
 
      for (uint i=idx; i < total; i++)
 
1267
      for (uint32_t i=idx; i < total; i++)
1268
1268
        if (plugins[i] && plugins[i]->state & state_mask)
1269
1269
          plugins[i]=0;
1270
1270
    }
1373
1373
  plugin_opt_set_limits(&options, var);
1374
1374
 
1375
1375
  if (var->flags & PLUGIN_VAR_UNSIGNED)
1376
 
    *(uint *)save= (uint) getopt_ull_limit_value((uint64_t) tmp, &options,
 
1376
    *(uint32_t *)save= (uint) getopt_ull_limit_value((uint64_t) tmp, &options,
1377
1377
                                                   &fixed);
1378
1378
  else
1379
1379
    *(int *)save= (int) getopt_ll_limit_value(tmp, &options, &fixed);
1493
1493
  const char *strvalue= "NULL", *str;
1494
1494
  TYPELIB *typelib;
1495
1495
  uint64_t result;
1496
 
  uint error_len;
 
1496
  uint32_t error_len;
1497
1497
  bool not_used;
1498
1498
  int length;
1499
1499
 
1586
1586
****************************************************************************/
1587
1587
 
1588
1588
 
1589
 
sys_var *find_sys_var(THD *thd, const char *str, uint length)
 
1589
sys_var *find_sys_var(THD *thd, const char *str, uint32_t length)
1590
1590
{
1591
1591
  sys_var *var;
1592
1592
  sys_var_pluginvar *pi= NULL;
1629
1629
static st_bookmark *find_bookmark(const char *plugin, const char *name, int flags)
1630
1630
{
1631
1631
  st_bookmark *result= NULL;
1632
 
  uint namelen, length, pluginlen= 0;
 
1632
  uint32_t namelen, length, pluginlen= 0;
1633
1633
  char *varname, *p;
1634
1634
 
1635
1635
  if (!(flags & PLUGIN_VAR_THDLOCAL))
1669
1669
static st_bookmark *register_var(const char *plugin, const char *name,
1670
1670
                                 int flags)
1671
1671
{
1672
 
  uint length= strlen(plugin) + strlen(name) + 3, size= 0, offset, new_size;
 
1672
  uint32_t length= strlen(plugin) + strlen(name) + 3, size= 0, offset, new_size;
1673
1673
  st_bookmark *result;
1674
1674
  char *varname, *p;
1675
1675
 
1785
1785
  if (!thd->variables.dynamic_variables_ptr ||
1786
1786
      (uint)offset > thd->variables.dynamic_variables_head)
1787
1787
  {
1788
 
    uint idx;
 
1788
    uint32_t idx;
1789
1789
 
1790
1790
    rw_rdlock(&LOCK_system_variables_hash);
1791
1791
 
1931
1931
  sys_var_pluginvar *pivar;
1932
1932
  sys_var *var;
1933
1933
  int flags;
1934
 
  uint idx;
 
1934
  uint32_t idx;
1935
1935
 
1936
1936
  rw_rdlock(&LOCK_system_variables_hash);
1937
1937
  for (idx= 0; idx < bookmark_hash.records; idx++)
1966
1966
 
1967
1967
void plugin_thdvar_cleanup(THD *thd)
1968
1968
{
1969
 
  uint idx;
 
1969
  uint32_t idx;
1970
1970
  plugin_ref *list;
1971
1971
 
1972
1972
  unlock_variables(thd, &thd->variables);
2103
2103
    String str(buffer, sizeof(buffer), system_charset_info);
2104
2104
    TYPELIB *typelib= plugin_var_typelib();
2105
2105
    uint64_t mask= 1, value= *(uint64_t*) result;
2106
 
    uint i;
 
2106
    uint32_t i;
2107
2107
 
2108
2108
    str.length(0);
2109
2109
    for (i= 0; i < typelib->count; i++, mask<<=1)
2356
2356
                             my_option *options, bool can_disable)
2357
2357
{
2358
2358
  const char *plugin_name= tmp->plugin->name;
2359
 
  uint namelen= strlen(plugin_name), optnamelen;
2360
 
  uint buffer_length= namelen * 4 + (can_disable ? 75 : 10);
 
2359
  uint32_t namelen= strlen(plugin_name), optnamelen;
 
2360
  uint32_t buffer_length= namelen * 4 + (can_disable ? 75 : 10);
2361
2361
  char *name= (char*) alloc_root(mem_root, buffer_length) + 1;
2362
2362
  char *optname, *p;
2363
2363
  int index= 0, offset= 0;
2572
2572
  st_mysql_sys_var **opt;
2573
2573
  my_option *opts;
2574
2574
  bool can_disable;
2575
 
  uint count= EXTRA_OPTIONS;
 
2575
  uint32_t count= EXTRA_OPTIONS;
2576
2576
 
2577
2577
  for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2) {};
2578
2578
 
2624
2624
  st_mysql_sys_var *o;
2625
2625
  sys_var *v;
2626
2626
  struct st_bookmark *var;
2627
 
  uint len, count= EXTRA_OPTIONS;
 
2627
  uint32_t len, count= EXTRA_OPTIONS;
2628
2628
  assert(tmp->plugin && tmp->name.str);
2629
2629
 
2630
2630
  for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
2729
2729
}
2730
2730
 
2731
2731
 
2732
 
void my_print_help_inc_plugins(my_option *main_options, uint size)
 
2732
void my_print_help_inc_plugins(my_option *main_options, uint32_t size)
2733
2733
{
2734
2734
  DYNAMIC_ARRAY all_options;
2735
2735
  struct st_plugin_int *p;
2740
2740
  my_init_dynamic_array(&all_options, sizeof(my_option), size, size/4);
2741
2741
 
2742
2742
  if (initialized)
2743
 
    for (uint idx= 0; idx < plugin_array.elements; idx++)
 
2743
    for (uint32_t idx= 0; idx < plugin_array.elements; idx++)
2744
2744
    {
2745
2745
      p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
2746
2746