~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/uuid.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include <config.h>
 
22
#include "config.h"
23
23
 
24
24
#include <algorithm>
25
25
 
26
26
#include <uuid/uuid.h>
27
27
 
28
 
#include <drizzled/field/uuid.h>
 
28
#include "drizzled/field/uuid.h"
29
29
 
30
 
#include <drizzled/error.h>
31
 
#include <drizzled/internal/my_sys.h>
32
 
#include <drizzled/session.h>
33
 
#include <drizzled/table.h>
 
30
#include "drizzled/error.h"
 
31
#include "drizzled/internal/my_sys.h"
 
32
#include "drizzled/session.h"
 
33
#include "drizzled/table.h"
34
34
 
35
35
namespace drizzled
36
36
{
56
56
  return memcmp(a, b, sizeof(uuid_t));
57
57
}
58
58
 
59
 
int Uuid::store(const char *from, uint32_t length, const charset_info_st * const )
 
59
int Uuid::store(const char *from, uint32_t length, const CHARSET_INFO * const )
60
60
{
61
61
  ASSERT_COLUMN_MARKED_FOR_WRITE;
62
62
  type::Uuid uu;
103
103
  res.set_ascii(STRING_WITH_LEN("uuid"));
104
104
}
105
105
 
106
 
double Uuid::val_real() const
 
106
double Uuid::val_real()
107
107
{
108
108
  ASSERT_COLUMN_MARKED_FOR_READ;
109
109
  my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR));
110
110
  return 0;
111
111
}
112
112
 
113
 
int64_t Uuid::val_int() const
 
113
int64_t Uuid::val_int()
114
114
{
115
115
  ASSERT_COLUMN_MARKED_FOR_READ;
116
116
  my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR));
133
133
}
134
134
#endif
135
135
 
136
 
String *Uuid::val_str(String *val_buffer, String *) const
 
136
String *Uuid::val_str(String *val_buffer, String *)
137
137
{
138
 
  const charset_info_st * const cs= &my_charset_bin;
 
138
  const CHARSET_INFO * const cs= &my_charset_bin;
139
139
  uint32_t mlength= (type::Uuid::DISPLAY_BUFFER_LENGTH) * cs->mbmaxlen;
140
140
  type::Uuid uu;
141
141
 
158
158
  memcpy(to, ptr, length_arg);
159
159
}
160
160
 
161
 
bool Uuid::get_date(type::Time &ltime, uint32_t ) const
 
161
bool Uuid::get_date(type::Time &ltime, uint32_t )
162
162
{
163
163
  type::Uuid uu;
164
164
 
181
181
  return true;
182
182
}
183
183
 
184
 
bool Uuid::get_time(type::Time &ltime) const
 
184
bool Uuid::get_time(type::Time &ltime)
185
185
{
186
186
  return get_date(ltime, 0);
187
187
}