1 /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License, version 2.0,
5    as published by the Free Software Foundation.
6 
7    This program is also distributed with certain software (including
8    but not limited to OpenSSL) that is licensed under separate terms,
9    as designated in a particular file or component or in included license
10    documentation.  The authors of MySQL hereby grant you an additional
11    permission to link the program and your derivative works with the
12    separately licensed software that they have included with MySQL.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License, version 2.0, for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software Foundation,
21    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
22 
23 
24 /* Procedures (functions with changes output of select) */
25 
26 #include "sql_priv.h"
27 #include "procedure.h"
28 #include "sql_analyse.h"			// Includes procedure
29 
val_decimal(my_decimal * decimal_value)30 my_decimal *Item_proc_string::val_decimal(my_decimal *decimal_value)
31 {
32   if (null_value)
33     return 0;
34   string2my_decimal(E_DEC_FATAL_ERROR, &str_value, decimal_value);
35   return (decimal_value);
36 }
37 
38 
val_decimal(my_decimal * decimal_value)39 my_decimal *Item_proc_int::val_decimal(my_decimal *decimal_value)
40 {
41   if (null_value)
42     return 0;
43   int2my_decimal(E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_value);
44   return (decimal_value);
45 }
46 
47