~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/short.cc

  • Committer: Brian Aker
  • Date: 2008-08-07 16:29:49 UTC
  • mfrom: (264.1.20 codestyle)
  • Revision ID: brian@tangent.org-20080807162949-7o8eyjgdn8ms3n1a
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#pragma implementation                          // gcc: Class implementation
23
23
#endif
24
24
 
 
25
#include <drizzled/server_includes.h>
25
26
#include <drizzled/field/short.h>
26
27
 
27
28
/****************************************************************************
28
29
 Field type short int (2 byte)
29
30
****************************************************************************/
30
31
 
31
 
int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
 
32
int Field_short::store(const char *from,uint len, const CHARSET_INFO * const cs)
32
33
{
33
34
  int store_tmp;
34
35
  int error;
181
182
String *Field_short::val_str(String *val_buffer,
182
183
                             String *val_ptr __attribute__((unused)))
183
184
{
184
 
  CHARSET_INFO *cs= &my_charset_bin;
 
185
  const CHARSET_INFO * const cs= &my_charset_bin;
185
186
  uint length;
186
187
  uint mlength=max(field_length+1,7*cs->mbmaxlen);
187
188
  val_buffer->alloc(mlength);
257
258
 
258
259
void Field_short::sql_type(String &res) const
259
260
{
260
 
  CHARSET_INFO *cs=res.charset();
 
261
  const CHARSET_INFO * const cs= res.charset();
261
262
  res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), "smallint"));
262
263
  add_unsigned(res);
263
264
}