~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_udf.cc

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
  return true;
68
68
}
69
69
 
 
70
static bool remove_udf(Function_builder *udf)
 
71
{
 
72
  return udf_map.erase(udf->get_name());
 
73
}
 
74
 
70
75
int initialize_udf(st_plugin_int *plugin)
71
76
{
72
77
  Function_builder *f;
90
95
  if (!add_udf(f))
91
96
    return 1;
92
97
 
 
98
  plugin->data= f;
93
99
  return 0;
94
100
 
95
101
}
96
102
 
97
103
int finalize_udf(st_plugin_int *plugin)
98
104
{
99
 
  Function_builder *udff = (Function_builder *)plugin->data;
100
 
 
101
 
  /* TODO: Issue warning on failure */
102
 
  if (udff && plugin->plugin->deinit)
103
 
    (void)plugin->plugin->deinit(udff);
104
 
 
105
 
  if (udff)
106
 
    free(udff);
 
105
  Function_builder *udf = static_cast<Function_builder *>(plugin->data);
 
106
 
 
107
  if (udf != NULL)
 
108
  {
 
109
    remove_udf(udf);
 
110
  
 
111
    if (plugin->plugin->deinit)
 
112
    {
 
113
      if (plugin->plugin->deinit((void *)udf))
 
114
      {
 
115
        /* TRANSLATORS: The leading word "udf" is the name
 
116
           of the plugin api, and so should not be translated. */
 
117
        errmsg_printf(ERRMSG_LVL_ERROR, _("udf plugin '%s' deinit() failed"),
 
118
                      plugin->name.str);
 
119
      }
 
120
    }
 
121
 
 
122
  }
107
123
 
108
124
  return 0;
109
125
}