~ubuntu-branches/ubuntu/quantal/drizzle/quantal

« back to all changes in this revision

Viewing changes to drizzled/field/int32.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.2.11) (2.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20120619104649-9ij634mxm4x8pp4l
Tags: 1:7.1.36-stable-1ubuntu1
* Merge from Debian unstable. (LP: #987575)
  Remaining changes:
  - Added upstart script.
* debian/drizzle.upstart: dropped logger since upstart logs job
  output now.

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
42
39
 ****************************************************************************/
43
40
 
44
 
  int Int32::store(const char *from,uint32_t len, const CHARSET_INFO * const cs)
 
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
 
145
137
 
146
138
  String *Int32::val_str(String *val_buffer, String *) const
147
139
  {
148
 
    const CHARSET_INFO * const cs= &my_charset_bin;
 
140
    const charset_info_st * const cs= &my_charset_bin;
149
141
    uint32_t length;
150
142
    uint32_t mlength= max(field_length+1,12*cs->mbmaxlen);
151
143
    val_buffer->alloc(mlength);
192
184
  }
193
185
 
194
186
 
195
 
  void Int32::sql_type(String &res) const
196
 
  {
197
 
    const CHARSET_INFO * 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;