~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/my_decimal.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include <drizzled/server_includes.h>
17
17
#include <time.h>
18
 
#include <drizzled/error.h>
 
18
#include <drizzled/drizzled_error_messages.h>
19
19
 
20
20
 
21
21
/**
36
36
  case E_DEC_OK:
37
37
    break;
38
38
  case E_DEC_TRUNCATED:
39
 
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
39
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
40
40
                        ER_WARN_DATA_TRUNCATED, ER(ER_WARN_DATA_TRUNCATED),
41
41
                        "", (long)-1);
42
42
    break;
43
43
  case E_DEC_OVERFLOW:
44
 
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
44
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
45
45
                        ER_TRUNCATED_WRONG_VALUE,
46
46
                        ER(ER_TRUNCATED_WRONG_VALUE),
47
47
                        "DECIMAL", "");
48
48
    break;
49
49
  case E_DEC_DIV_ZERO:
50
 
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
50
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
51
51
                        ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
52
52
    break;
53
53
  case E_DEC_BAD_NUM:
54
 
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
54
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
55
55
                        ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
56
56
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
57
57
                        "decimal", "", "", (long)-1);
234
234
    return;
235
235
  }
236
236
}
 
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)