~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#define DRIZZLED_ITEM_H
24
24
 
25
25
#include <drizzled/dtcollation.h>
26
 
#include <drizzled/global_charset_info.h>
27
 
#include <drizzled/item_result.h>
28
 
#include <drizzled/memory/sql_alloc.h>
 
26
#include <drizzled/type/time.h>
 
27
#include <drizzled/type/decimal.h>
29
28
#include <drizzled/sql_list.h>
30
 
#include <drizzled/sql_string.h>
 
29
#include "drizzled/memory/sql_alloc.h"
 
30
#include <drizzled/table.h>
 
31
#include "drizzled/item_result.h"
31
32
 
32
 
#include <drizzled/visibility.h>
 
33
#include "drizzled/visibility.h"
33
34
 
34
35
namespace drizzled
35
36
{
36
37
 
37
 
class Field;
 
38
class TableList;
 
39
class Item_field;
 
40
class Name_resolution_context;
 
41
class Select_Lex;
38
42
class Item_equal;
39
 
class Item_field;
40
 
class Item_ident;
 
43
class user_var_entry;
 
44
class Item_sum;
41
45
class Item_in_subselect;
42
 
class Item_sum;
43
 
class Select_Lex;
44
46
class SendField;
45
 
class Table;
46
 
class user_var_entry;
 
47
class Field;
47
48
 
48
 
namespace plugin { class Client; }
49
 
namespace type { class Time; }
50
 
namespace type { class Decimal; }
 
49
namespace plugin
 
50
{
 
51
class Client;
 
52
}
51
53
 
52
54
/**
53
55
  Dummy error processor used by default by Name_resolution_context.
791
793
    return (tmp > UINT32_MAX) ? (uint32_t) UINT32_MAX : (uint32_t) tmp;
792
794
  } 
793
795
 
794
 
  uint32_t max_char_length() const;
795
 
 
796
 
  void fix_length_and_charset(uint32_t max_char_length_arg, CHARSET_INFO *cs);
797
 
  void fix_char_length(uint32_t max_char_length_arg);
798
 
  void fix_char_length_uint64_t(uint64_t max_char_length_arg);
799
 
  void fix_length_and_charset_datetime(uint32_t max_char_length_arg);
800
 
 
 
796
  uint32_t max_char_length() const
 
797
  {
 
798
    return max_length / collation.collation->mbmaxlen;
 
799
  }
 
800
 
 
801
  void fix_length_and_charset(uint32_t max_char_length_arg, CHARSET_INFO *cs)
 
802
  { 
 
803
    max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
 
804
    collation.collation= cs;
 
805
  }
 
806
 
 
807
  void fix_char_length(uint32_t max_char_length_arg)
 
808
  { 
 
809
    max_length= char_to_byte_length_safe(max_char_length_arg,
 
810
                                         collation.collation->mbmaxlen);
 
811
  }
 
812
 
 
813
  void fix_char_length_uint64_t(uint64_t max_char_length_arg)
 
814
  { 
 
815
    uint64_t max_result_length= max_char_length_arg *
 
816
      collation.collation->mbmaxlen;
 
817
 
 
818
    if (max_result_length >= MAX_BLOB_WIDTH)
 
819
    { 
 
820
      max_length= MAX_BLOB_WIDTH;
 
821
      maybe_null= false;
 
822
    }
 
823
    else
 
824
    {
 
825
      max_length= max_result_length;
 
826
    }
 
827
  }
 
828
 
 
829
  void fix_length_and_charset_datetime(uint32_t max_char_length_arg)
 
830
  { 
 
831
    collation.set(&my_charset_bin);
 
832
    fix_char_length(max_char_length_arg);
 
833
  }
801
834
protected:
802
835
  Session &getSession()
803
836
  {