~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_udf.cc

  • Committer: Stewart Smith
  • Date: 2008-09-25 10:04:06 UTC
  • mto: This revision was merged to the branch mainline in revision 408.
  • Revision ID: stewart@flamingspork.com-20080925100406-hld92f4dr4nuar3a
Move compression functions (compress, uncompress and compressed_length) out into modules and fix test

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
static MEM_ROOT mem;
22
22
static HASH udf_hash;
23
23
 
24
 
extern "C" unsigned char* get_hash_key(const unsigned char *buff, size_t *length,
 
24
extern "C" uchar* get_hash_key(const uchar *buff, size_t *length,
25
25
                               bool not_used __attribute__((unused)))
26
26
{
27
27
  udf_func *udf= (udf_func*) buff;
28
28
  *length= (uint) udf->name.length;
29
 
  return (unsigned char*) udf->name.str;
 
29
  return (uchar*) udf->name.str;
30
30
}
31
31
 
32
32
 
51
51
}
52
52
 
53
53
/* This is only called if using_udf_functions != 0 */
54
 
udf_func *find_udf(const char *name, uint32_t length)
 
54
udf_func *find_udf(const char *name, uint length)
55
55
{
56
56
  udf_func *udf;
57
57
 
59
59
    return NULL;
60
60
 
61
61
  udf= (udf_func*) hash_search(&udf_hash,
62
 
                               (unsigned char*) name,
 
62
                               (uchar*) name,
63
63
                               length ? length : (uint) strlen(name));
64
64
 
65
65
  return (udf);
67
67
 
68
68
static bool add_udf(udf_func *udf)
69
69
{
70
 
  if (my_hash_insert(&udf_hash, (unsigned char*) udf))
 
70
  if (my_hash_insert(&udf_hash, (uchar*) udf))
71
71
    return false;
72
72
 
73
73
  using_udf_functions= 1;
114
114
    (void)plugin->plugin->deinit(udff);
115
115
 
116
116
  if (udff)
117
 
    free(udff);
 
117
    my_free(udff, MYF(0));
118
118
 
119
119
  return 0;
120
120
}