~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Brian Aker
  • Date: 2009-12-30 02:36:33 UTC
  • mfrom: (1253.2.5 out-of-tree)
  • Revision ID: brian@gaz-20091230023633-lwnumq83u8h2y56q
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
*****************************************************************************/
34
34
 
35
35
String::String()
36
 
  : Ptr(0),
 
36
  : Ptr(NULL),
37
37
    str_length(0),
38
38
    Alloced_length(0),
39
 
    alloced(0),
 
39
    alloced(false),
40
40
    str_charset(&my_charset_bin)
41
41
{ }
42
42
 
 
43
 
43
44
String::String(uint32_t length_arg)
44
 
  : Ptr(0),
 
45
  : Ptr(NULL),
45
46
    str_length(0),
46
47
    Alloced_length(0),
47
 
    alloced(0),
 
48
    alloced(false),
48
49
    str_charset(&my_charset_bin)
49
50
{
50
51
  (void) real_alloc(length_arg);
51
52
}
52
53
 
53
54
String::String(const char *str, const CHARSET_INFO * const cs)
54
 
  : Ptr(const_cast<char*>(str)),
 
55
  : Ptr(const_cast<char *>(str)),
55
56
    str_length(static_cast<uint32_t>(strlen(str))),
56
57
    Alloced_length(0),
57
 
    alloced(0),
 
58
    alloced(false),
58
59
    str_charset(cs)
59
60
{ }
60
61
 
 
62
 
61
63
String::String(const char *str, uint32_t len, const CHARSET_INFO * const cs)
62
 
  : Ptr(const_cast<char*>(str)),
 
64
  : Ptr(const_cast<char *>(str)),
63
65
    str_length(len),
64
66
    Alloced_length(0),
65
 
    alloced(0),
 
67
    alloced(false),
66
68
    str_charset(cs)
67
69
{ }
68
70
 
69
 
String::String(char *str,uint32_t len, const CHARSET_INFO * const cs)
 
71
 
 
72
String::String(char *str, uint32_t len, const CHARSET_INFO * const cs)
70
73
  : Ptr(str),
71
74
    str_length(len),
72
75
    Alloced_length(len),
73
 
    alloced(0),
 
76
    alloced(false),
74
77
    str_charset(cs)
75
78
{ }
76
79
 
 
80
 
77
81
String::String(const String &str)
78
82
  : Ptr(str.Ptr),
79
83
    str_length(str.str_length),
80
84
    Alloced_length(str.Alloced_length),
81
 
    alloced(0),
 
85
    alloced(false),
82
86
    str_charset(str.str_charset)
83
87
{ }
84
88
 
 
89
 
85
90
void *String::operator new(size_t size, memory::Root *mem_root)
86
91
{
87
92
  return alloc_root(mem_root, static_cast<uint32_t>(size));