00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/memory/sql_alloc.h>
00024 #include <drizzled/sql_string.h>
00025
00026
00027 namespace drizzled {
00028
00032 class CopyField :public memory::SqlAlloc
00033 {
00038 typedef void Copy_func(CopyField*);
00039 Copy_func *get_copy_func(Field *to, Field *from);
00040
00041 public:
00042 unsigned char *from_ptr;
00043 unsigned char *to_ptr;
00044 unsigned char *from_null_ptr;
00045 unsigned char *to_null_ptr;
00046 bool *null_row;
00047 uint32_t from_bit;
00048 uint32_t to_bit;
00049 uint32_t from_length;
00050 uint32_t to_length;
00051 Field *from_field;
00052 Field *to_field;
00053 String tmp;
00054
00055 CopyField() :
00056 from_ptr(0),
00057 to_ptr(0),
00058 from_null_ptr(0),
00059 to_null_ptr(0),
00060 null_row(0),
00061 from_bit(0),
00062 to_bit(0),
00063 from_length(0),
00064 to_length(0),
00065 from_field(0),
00066 to_field(0)
00067 {}
00068
00069 ~CopyField()
00070 {}
00071
00072 void set(Field *to,Field *from,bool save);
00073 void set(unsigned char *to,Field *from);
00074 void (*do_copy)(CopyField *);
00075 void (*do_copy2)(CopyField *);
00076 };
00077
00078 }
00079