~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/uncompressed_length/uncompressed_length.cc

  • Committer: Brian Aker
  • Date: 2009-03-20 18:52:05 UTC
  • mfrom: (950.1.1 mordred)
  • Revision ID: brian@tangent.org-20090320185205-g7o6kq17r25b6odf
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <drizzled/sql_udf.h>
18
18
#include <drizzled/function/math/int.h>
19
19
 
 
20
#include <string>
 
21
 
 
22
using namespace std;
 
23
 
20
24
class Item_func_uncompressed_length : public Item_int_func
21
25
{
22
26
  String value;
49
53
  return uint4korr(res->ptr()) & 0x3FFFFFFF;
50
54
}
51
55
 
52
 
Item_func* create_uncompressed_lengthudf_item(MEM_ROOT* m)
53
 
{
54
 
  return  new (m) Item_func_uncompressed_length();
55
 
}
56
 
 
57
 
static struct udf_func uncompressed_lengthudf = {
58
 
  { C_STRING_WITH_LEN("uncompressed_length") },
59
 
  create_uncompressed_lengthudf_item
60
 
};
 
56
Create_function<Item_func_uncompressed_length>
 
57
  uncompressed_lengthudf(string("uncompressed_length"));
61
58
 
62
59
static int uncompressed_lengthudf_plugin_init(void *p)
63
60
{
64
 
  udf_func **f = (udf_func**) p;
 
61
  Function_builder **f = (Function_builder**) p;
65
62
 
66
63
  *f= &uncompressed_lengthudf;
67
64
 
70
67
 
71
68
static int uncompressed_lengthudf_plugin_deinit(void *p)
72
69
{
73
 
  udf_func *udff = (udf_func *) p;
 
70
  Function_builder *udff = (Function_builder *) p;
74
71
  (void)udff;
75
72
  return 0;
76
73
}