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
00029 class Field;
00030
00034 class CopyField :public memory::SqlAlloc
00035 {
00040 typedef void Copy_func(CopyField*);
00041 Copy_func *get_copy_func(Field *to, Field *from);
00042
00043 public:
00044 unsigned char *from_ptr;
00045 unsigned char *to_ptr;
00046 unsigned char *from_null_ptr;
00047 unsigned char *to_null_ptr;
00048 bool *null_row;
00049 uint32_t from_bit;
00050 uint32_t to_bit;
00051 uint32_t from_length;
00052 uint32_t to_length;
00053 Field *from_field;
00054 Field *to_field;
00055 String tmp;
00056
00057 CopyField() :
00058 from_ptr(0),
00059 to_ptr(0),
00060 from_null_ptr(0),
00061 to_null_ptr(0),
00062 null_row(0),
00063 from_bit(0),
00064 to_bit(0),
00065 from_length(0),
00066 to_length(0),
00067 from_field(0),
00068 to_field(0)
00069 {}
00070
00071 ~CopyField()
00072 {}
00073
00074 void set(Field *to,Field *from,bool save);
00075 void set(unsigned char *to,Field *from);
00076 void (*do_copy)(CopyField *);
00077 void (*do_copy2)(CopyField *);
00078 };
00079
00080 }
00081