~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/my_decimal.cc

  • Committer: Mark Atwood
  • Date: 2009-01-05 04:37:22 UTC
  • mto: (758.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: me@mark.atwood.name-20090105043722-03l4mzcxi4yjjjih
replace sql_print_error etc with errmsg_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include <drizzled/server_includes.h>
 
17
#include <drizzled/current_session.h>
17
18
#include <time.h>
18
 
#include <drizzled/drizzled_error_messages.h>
 
19
#include <drizzled/error.h>
19
20
 
20
21
 
21
22
/**
36
37
  case E_DEC_OK:
37
38
    break;
38
39
  case E_DEC_TRUNCATED:
39
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
40
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
40
41
                        ER_WARN_DATA_TRUNCATED, ER(ER_WARN_DATA_TRUNCATED),
41
42
                        "", (long)-1);
42
43
    break;
43
44
  case E_DEC_OVERFLOW:
44
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
45
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
45
46
                        ER_TRUNCATED_WRONG_VALUE,
46
47
                        ER(ER_TRUNCATED_WRONG_VALUE),
47
48
                        "DECIMAL", "");
48
49
    break;
49
50
  case E_DEC_DIV_ZERO:
50
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
51
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
51
52
                        ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
52
53
    break;
53
54
  case E_DEC_BAD_NUM:
54
 
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
55
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
55
56
                        ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
56
57
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
57
58
                        "decimal", "", "", (long)-1);
234
235
    return;
235
236
  }
236
237
}
237
 
 
238
 
 
239
 
/* routines for debugging print */
240
 
#define DIG_PER_DEC1 9
241
 
#define ROUND_UP(X)  (((X)+DIG_PER_DEC1-1)/DIG_PER_DEC1)