~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/int32.cc

  • Committer: Mark Atwood
  • Date: 2011-06-22 05:48:25 UTC
  • mfrom: (2318.6.17 refactor12)
  • Revision ID: me@mark.atwood.name-20110622054825-mf8nxjs9dxcpvcfe
bzr merge lp:~olafvdspek/drizzle/refactor12

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
using namespace std;
33
33
 
34
 
namespace drizzled
35
 
{
36
 
 
37
 
namespace field
38
 
{
 
34
namespace drizzled {
 
35
namespace field {
39
36
 
40
37
/****************************************************************************
41
38
 ** Int32
43
40
 
44
41
  int Int32::store(const char *from,uint32_t len, const charset_info_st * const cs)
45
42
  {
46
 
    long store_tmp;
47
 
    int error;
 
43
    ASSERT_COLUMN_MARKED_FOR_WRITE;
48
44
    int64_t rnd;
49
 
 
50
 
    ASSERT_COLUMN_MARKED_FOR_WRITE;
51
 
 
52
 
    error= get_int(cs, from, len, &rnd, UINT32_MAX, INT32_MIN, INT32_MAX);
53
 
    store_tmp= (long) rnd;
 
45
    int error= get_int(cs, from, len, &rnd, UINT32_MAX, INT32_MIN, INT32_MAX);
 
46
    long store_tmp= (long) rnd;
54
47
    longstore(ptr, store_tmp);
55
 
 
56
48
    return error;
57
49
  }
58
50
 
192
184
  }
193
185
 
194
186
 
195
 
  void Int32::sql_type(String &res) const
196
 
  {
197
 
    const charset_info_st * const cs=res.charset();
198
 
    res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), "int"));
199
 
  }
200
 
 
201
187
  unsigned char *Int32::pack(unsigned char* to, const unsigned char *from, uint32_t, bool)
202
188
  {
203
189
    int32_t val;