~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/hex_string.cc

  • Committer: Patrick Crews
  • Date: 2011-01-29 14:17:35 UTC
  • mto: (2126.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2127.
  • Revision ID: gleebix@gmail.com-20110129141735-3y2658vt5ur0a33o
Fixes to make test-dbqp

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
66
66
  // following assert is redundant, because fixed=1 assigned in constructor
67
67
  assert(fixed == 1);
68
68
  char *end= (char*) str_value.ptr()+str_value.length(),
69
 
       *ptr= end - min(str_value.length(),(uint32_t)sizeof(int64_t));
 
69
       *ptr= end - min(str_value.length(), sizeof(int64_t));
70
70
 
71
71
  uint64_t value=0;
72
72
  for (; ptr != end ; ptr++)
75
75
}
76
76
 
77
77
 
78
 
my_decimal *Item_hex_string::val_decimal(my_decimal *decimal_value)
 
78
type::Decimal *Item_hex_string::val_decimal(type::Decimal *decimal_value)
79
79
{
80
80
  // following assert is redundant, because fixed=1 assigned in constructor
81
81
  assert(fixed == 1);
82
82
  uint64_t value= (uint64_t)val_int();
83
 
  int2my_decimal(E_DEC_FATAL_ERROR, value, true, decimal_value);
 
83
  int2_class_decimal(E_DEC_FATAL_ERROR, value, true, decimal_value);
84
84
  return (decimal_value);
85
85
}
86
86
 
116
116
void Item_hex_string::print(String *str, enum_query_type)
117
117
{
118
118
  char *end= (char*) str_value.ptr() + str_value.length(),
119
 
       *ptr= end - min(str_value.length(), (uint32_t)sizeof(int64_t));
 
119
       *ptr= end - min(str_value.length(), sizeof(int64_t));
120
120
  str->append("0x");
121
121
  for (; ptr != end ; ptr++)
122
122
  {