00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }