~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_udf.cc

Removed dead bits to HA_CREATE_INFO

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
int initialize_udf(st_plugin_int *plugin)
79
79
{
80
 
  udf_func *udff;
 
80
  udf_func *f;
81
81
 
82
82
  if (udf_startup == false)
83
83
  {
84
84
    udf_init();
85
85
    udf_startup= true;
86
86
  }
87
 
          
88
 
  /* allocate the udf_func structure */
89
 
  udff = (udf_func *)my_malloc(sizeof(udf_func), MYF(MY_WME | MY_ZEROFILL));
90
 
  if (udff == NULL) return 1;
91
 
 
92
 
  plugin->data= (void *)udff;
93
87
 
94
88
  if (plugin->plugin->init)
95
89
  {
96
 
    /* todo, if the plugin doesnt have an init, bail out */
97
 
 
98
 
    if (plugin->plugin->init((void *)udff))
 
90
    int r;
 
91
    if ((r= plugin->plugin->init((void *)&f)))
99
92
    {
100
 
      sql_print_error(_("Plugin '%s' init function returned error."),
101
 
                      plugin->name.str);
102
 
      goto err;
 
93
      sql_print_error("Plugin '%s' init function returned error %d.",
 
94
                      plugin->name.str, r);
 
95
      return r;
103
96
    }
104
97
  }
105
 
  
106
 
  add_udf(udff);
 
98
  else
 
99
    return 1;
 
100
 
 
101
  if(!add_udf(f))
 
102
    return 2;
107
103
 
108
104
  return 0;
109
 
err:
110
 
  my_free(udff, MYF(0));
111
 
  return 1;
 
105
 
112
106
}
113
107
 
114
108
int finalize_udf(st_plugin_int *plugin)