Drizzled Public API Documentation

num1.cc
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #include <config.h>
00021 
00022 #include <cassert>
00023 
00024 #include <drizzled/function/num1.h>
00025 
00026 namespace drizzled
00027 {
00028 
00035 void Item_func_num1::find_num_type()
00036 {
00037   switch (hybrid_type= args[0]->result_type()) {
00038   case INT_RESULT:
00039     unsigned_flag= args[0]->unsigned_flag;
00040     break;
00041 
00042   case STRING_RESULT:
00043   case REAL_RESULT:
00044     hybrid_type= REAL_RESULT;
00045     max_length= float_length(decimals);
00046     break;
00047 
00048   case DECIMAL_RESULT:
00049     break;
00050 
00051   case ROW_RESULT:
00052     assert(0);
00053   }
00054 }
00055 
00056 void Item_func_num1::fix_num_length_and_dec()
00057 {
00058   decimals= args[0]->decimals;
00059   max_length= args[0]->max_length;
00060 }
00061 
00062 
00063 } /* namespace drizzled */