MySQL  8.0.27
Source Code Documentation
my_decimal.h
Go to the documentation of this file.
1 /* Copyright (c) 2005, 2021, Oracle and/or its affiliates.
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
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef MY_DECIMAL_INCLUDED
24 #define MY_DECIMAL_INCLUDED
25 
26 /**
27  @file
28 
29  It is interface module to fixed precision decimals library.
30 
31  Most functions use 'uint mask' as parameter, if during operation error
32  which fit in this mask is detected then it will be processed automatically
33  here. (errors are E_DEC_* constants, see include/decimal.h)
34 
35  Most function are just inline wrappers around library calls
36 */
37 
38 #include <assert.h>
39 #include <stdlib.h>
40 #include <sys/types.h>
41 #include <algorithm>
42 
43 #include "decimal.h"
44 #include "m_ctype.h"
45 
46 #include "my_inttypes.h"
47 #include "my_macros.h"
48 
49 class String;
50 struct MYSQL_TIME;
51 
52 static constexpr int DECIMAL_LONGLONG_DIGITS{22};
53 
54 /** maximum length of buffer in our big digits (uint32). */
55 static constexpr int DECIMAL_BUFF_LENGTH{9};
56 
57 /** the number of digits that my_decimal can possibly contain */
59 
60 /**
61  maximum guaranteed precision of number in decimal digits (number of our
62  digits * number of decimal digits in one our big digit - number of decimal
63  digits in one our big digit decreased by 1 (because we always put decimal
64  point on the border of our big digits))
65 */
67  8 * 2};
68 
69 /**
70  maximum length of string representation (number of maximum decimal
71  digits + 1 position for sign + 1 position for decimal point, no terminator)
72 */
74 
75 /**
76  maximum size of packet length.
77 */
79 
80 inline int my_decimal_int_part(uint precision, uint decimals) {
81  return precision - ((decimals == DECIMAL_NOT_SPECIFIED) ? 0 : decimals);
82 }
83 
84 /**
85  my_decimal class limits 'decimal_t' type to what we need in MySQL.
86 
87  It contains internally all necessary space needed by the instance so
88  no extra memory is needed. Objects should be moved using copy CTOR
89  or assignment operator, rather than memcpy/memmove.
90 */
91 
92 class my_decimal : public decimal_t {
93 /*
94  Several of the routines in strings/decimal.c have had buffer
95  overrun/underrun problems. These are *not* caught by valgrind.
96  To catch them, we allocate dummy fields around the buffer,
97  and test that their values do not change.
98  */
99 #if !defined(NDEBUG)
100  int foo1;
101 #endif
102 
104 
105 #if !defined(NDEBUG)
106  int foo2;
107  static const int test_value = 123;
108 #endif
109 
110  public:
111  my_decimal(const my_decimal &rhs) : decimal_t(rhs) {
112  rhs.sanity_check();
113 #if !defined(NDEBUG)
114  foo1 = test_value;
115  foo2 = test_value;
116 #endif
117  for (uint i = 0; i < DECIMAL_BUFF_LENGTH; i++) buffer[i] = rhs.buffer[i];
118  buf = buffer;
119  }
120 
122  sanity_check();
123  rhs.sanity_check();
124  if (this == &rhs) return *this;
125  decimal_t::operator=(rhs);
126  for (uint i = 0; i < DECIMAL_BUFF_LENGTH; i++) buffer[i] = rhs.buffer[i];
127  buf = buffer;
128  return *this;
129  }
130 
131  void init() {
132 #if !defined(NDEBUG)
133  foo1 = test_value;
134  foo2 = test_value;
135 #endif
136  /*
137  Do not initialize more of the base class,
138  we want to catch uninitialized use.
139  */
141  buf = buffer;
142  }
143 
144  my_decimal() { init(); }
145 
146 #ifndef NDEBUG
148 #endif // NDEBUG
149 
150  void sanity_check() const {
151  assert(foo1 == test_value);
152  assert(foo2 == test_value);
153  assert(buf == buffer);
154  }
155 
156  bool sign() const { return decimal_t::sign; }
157  void sign(bool s) { decimal_t::sign = s; }
158  uint precision() const { return intg + frac; }
159 
160  /** Swap two my_decimal values */
161  void swap(my_decimal &rhs) { std::swap(*this, rhs); }
162 
163 #ifndef MYSQL_SERVER
164  // Error reporting in server code only.
165  int check_result(uint, int result) const { return result; }
166 #else
167  int check_result(uint, int result) const;
168 #endif
169 };
170 
171 #ifndef NDEBUG
172 void print_decimal(const my_decimal *dec);
173 void print_decimal_buff(const my_decimal *dec, const uchar *ptr, int length);
174 const char *dbug_decimal_as_string(char *buff, const my_decimal *val);
175 #else
176 #define dbug_decimal_as_string(A) NULL
177 #endif
178 
179 bool str_set_decimal(uint mask, const my_decimal *val, String *str,
180  const CHARSET_INFO *cs, uint decimals);
181 
182 extern my_decimal decimal_zero;
183 
184 inline void max_my_decimal(my_decimal *to, int precision, int frac) {
185  assert((precision <= DECIMAL_MAX_PRECISION) && (frac <= DECIMAL_MAX_SCALE));
186  max_decimal(precision, frac, to);
187 }
188 
191 }
192 
194  if (val->check_result(mask, result) & E_DEC_OVERFLOW) {
195  bool sign = val->sign();
196  val->sanity_check();
198  val->sign(sign);
199  }
200  /*
201  Avoid returning negative zero, cfr. decimal_cmp()
202  For result == E_DEC_DIV_ZERO *val has not been assigned.
203  */
204  if (result != E_DEC_DIV_ZERO && val->sign() && decimal_is_zero(val))
205  val->sign(false);
206  return result;
207 }
208 
210  bool unsigned_flag) {
211  /* Precision can't be negative thus ignore unsigned_flag when length is 0. */
212  assert(length || !scale);
213  uint retval =
214  (uint)(length - (scale > 0 ? 1 : 0) - (unsigned_flag || !length ? 0 : 1));
215  return retval;
216 }
217 
219  uint8 scale,
220  bool unsigned_flag) {
221  /*
222  When precision is 0 it means that original length was also 0. Thus
223  unsigned_flag is ignored in this case.
224  */
225  assert(precision || !scale);
226  uint32 retval = (uint32)(precision + (scale > 0 ? 1 : 0) +
227  (unsigned_flag || !precision ? 0 : 1));
228  if (retval == 0) return 1;
229  return retval;
230 }
231 
233  bool unsigned_flag) {
234  /*
235  When precision is 0 it means that original length was also 0. Thus
236  unsigned_flag is ignored in this case.
237  */
238  assert(precision || !scale);
239  precision = std::min(precision, uint(DECIMAL_MAX_PRECISION));
240  return my_decimal_precision_to_length_no_truncation(precision, scale,
241  unsigned_flag);
242 }
243 
244 inline int my_decimal_string_length(const my_decimal *d) {
245  /* length of string representation including terminating '\0' */
246  return decimal_string_size(d);
247 }
248 
249 inline int my_decimal_get_binary_size(uint precision, uint scale) {
250  return decimal_bin_size((int)precision, (int)scale);
251 }
252 
253 inline void my_decimal2decimal(const my_decimal *from, my_decimal *to) {
254  *to = *from;
255 }
256 
257 int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
258  int scale);
259 
260 inline int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d,
261  int prec, int scale) {
262  return d->check_result(mask, bin2decimal(bin, d, prec, scale, false));
263 }
264 
265 /**
266  Decode DECIMAL from binary form
267 
268  @param mask Error mask
269  @param bin Binary string to decode
270  @param d [out] DECIMAL buffer
271  @param prec Precision of stored value
272  @param scale Scale of stored value
273  @param keep_prec Whether to keep stored value's precision
274 
275  @returns
276  conversion error
277 */
278 
279 inline int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d,
280  int prec, int scale, bool keep_prec) {
281  return d->check_result(mask, bin2decimal(bin, d, prec, scale, keep_prec));
282 }
283 
285  /*
286  We need the up-cast here, since my_decimal has sign() member functions,
287  which conflicts with decimal_t::size
288  (and decimal_make_zero is a macro, rather than a funcion).
289  */
290  decimal_make_zero(static_cast<decimal_t *>(d));
291  return 0;
292 }
293 
294 inline bool my_decimal_is_zero(const my_decimal *decimal_value) {
295  return decimal_is_zero(decimal_value);
296 }
297 
298 inline int my_decimal_round(uint mask, const my_decimal *from, int scale,
299  bool truncate, my_decimal *to) {
300  return from->check_result(
301  mask, decimal_round(from, to, scale, (truncate ? TRUNCATE : HALF_UP)));
302 }
303 
304 inline int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to) {
305  return from->check_result(mask, decimal_round(from, to, 0, FLOOR));
306 }
307 
308 inline int my_decimal_ceiling(uint mask, const my_decimal *from,
309  my_decimal *to) {
310  return from->check_result(mask, decimal_round(from, to, 0, CEILING));
311 }
312 
313 int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec,
314  uint fixed_dec, String *str);
315 
316 inline int my_decimal2string(uint mask, const my_decimal *d, String *str) {
317  return my_decimal2string(mask, d, 0, 0, str);
318 }
319 
320 inline int my_decimal2int(uint mask, const my_decimal *d, bool unsigned_flag,
321  longlong *l) {
322  my_decimal rounded;
323  /* decimal_round can return only E_DEC_TRUNCATED */
324  decimal_round(d, &rounded, 0, HALF_UP);
325  return d->check_result(
326  mask, (unsigned_flag ? decimal2ulonglong(&rounded, (ulonglong *)l)
327  : decimal2longlong(&rounded, l)));
328 }
329 
330 inline int my_decimal2double(uint, const my_decimal *d, double *result) {
331  /* No need to call check_result as this will always succeed */
332  return decimal2double(d, result);
333 }
334 
335 inline int my_decimal2lldiv_t(uint mask, const my_decimal *d, lldiv_t *to) {
336  return d->check_result(mask, decimal2lldiv_t(d, to));
337 }
338 
339 inline int str2my_decimal(uint mask, const char *str, my_decimal *d,
340  const char **end) {
342 }
343 
344 int str2my_decimal(uint mask, const char *from, size_t length,
345  const CHARSET_INFO *charset, my_decimal *decimal_value);
346 
349 my_decimal *timeval2my_decimal(const struct timeval *tm, my_decimal *dec);
350 
351 inline int double2my_decimal(uint mask, double val, my_decimal *d) {
352  return check_result_and_overflow(mask, double2decimal(val, d), d);
353 }
354 
355 inline int int2my_decimal(uint mask, longlong i, bool unsigned_flag,
356  my_decimal *d) {
357  return d->check_result(mask,
358  (unsigned_flag ? ulonglong2decimal((ulonglong)i, d)
359  : longlong2decimal(i, d)));
360 }
361 
362 inline void my_decimal_neg(decimal_t *arg) {
363  // Avoid returning negative zero, cfr. decimal_cmp()
364  if (decimal_is_zero(arg)) {
365  arg->sign = false;
366  return;
367  }
368  arg->sign ^= 1;
369 }
370 
371 inline int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a,
372  const my_decimal *b) {
373  return check_result_and_overflow(mask, decimal_add(a, b, res), res);
374 }
375 
376 inline int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a,
377  const my_decimal *b) {
378  return check_result_and_overflow(mask, decimal_sub(a, b, res), res);
379 }
380 
381 inline int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a,
382  const my_decimal *b) {
383  return check_result_and_overflow(mask, decimal_mul(a, b, res), res);
384 }
385 
386 inline int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a,
387  const my_decimal *b, int div_scale_inc) {
388  return check_result_and_overflow(mask, decimal_div(a, b, res, div_scale_inc),
389  res);
390 }
391 
392 inline int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
393  const my_decimal *b) {
394  return check_result_and_overflow(mask, decimal_mod(a, b, res), res);
395 }
396 
397 /**
398  @retval -1 if a @< b
399  @retval 1 if a @> b
400  @retval 0 if a == b
401 */
402 inline int my_decimal_cmp(const my_decimal *a, const my_decimal *b) {
403  return decimal_cmp(a, b);
404 }
405 
406 inline bool operator<(const my_decimal &lhs, const my_decimal &rhs) {
407  return my_decimal_cmp(&lhs, &rhs) < 0;
408 }
409 
410 inline bool operator!=(const my_decimal &lhs, const my_decimal &rhs) {
411  return my_decimal_cmp(&lhs, &rhs) != 0;
412 }
413 
414 inline int my_decimal_intg(const my_decimal *a) { return decimal_intg(a); }
415 
416 void my_decimal_trim(ulong *precision, uint *scale);
417 
418 #endif // MY_DECIMAL_INCLUDED
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:165
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:92
int check_result(uint, int result) const
report result of decimal operation.
Definition: my_decimal.cc:55
int foo2
Definition: my_decimal.h:106
void sign(bool s)
Definition: my_decimal.h:157
decimal_digit_t buffer[DECIMAL_BUFF_LENGTH]
Definition: my_decimal.h:103
static const int test_value
Definition: my_decimal.h:107
my_decimal()
Definition: my_decimal.h:144
void init()
Definition: my_decimal.h:131
void sanity_check() const
Definition: my_decimal.h:150
int foo1
Definition: my_decimal.h:100
my_decimal(const my_decimal &rhs)
Definition: my_decimal.h:111
uint precision() const
Definition: my_decimal.h:158
my_decimal & operator=(const my_decimal &rhs)
Definition: my_decimal.h:121
~my_decimal()
Definition: my_decimal.h:147
bool sign() const
Definition: my_decimal.h:156
void swap(my_decimal &rhs)
Swap two my_decimal values.
Definition: my_decimal.h:161
int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, decimal_round_mode mode)
Definition: decimal.cc:1647
int decimal_bin_size(int precision, int scale)
Definition: decimal.cc:1625
int decimal2longlong(const decimal_t *from, longlong *to)
Definition: decimal.cc:1168
int ulonglong2decimal(ulonglong from, decimal_t *to)
Definition: decimal.cc:1132
int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
Definition: decimal.cc:2076
static int decimal_string_size(const decimal_t *dec)
Returns the length of the buffer to hold string representation of the decimal (including decimal dot,...
Definition: decimal.h:128
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale, bool keep_prec=false)
Definition: decimal.cc:1479
int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
Definition: decimal.cc:2502
@ CEILING
Definition: decimal.h:37
@ FLOOR
Definition: decimal.h:38
@ HALF_UP
Definition: decimal.h:36
@ TRUNCATE
Definition: decimal.h:34
int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
Definition: decimal.cc:2027
int decimal_is_zero(const decimal_t *from)
Definition: decimal.cc:2047
#define E_DEC_DIV_ZERO
Definition: decimal.h:144
int longlong2decimal(longlong from, decimal_t *to)
Definition: decimal.cc:1137
int decimal2lldiv_t(const decimal_t *from, lldiv_t *to)
Convert decimal to lldiv_t.
Definition: decimal.cc:1215
static constexpr int DECIMAL_NOT_SPECIFIED
Definition: decimal.h:153
void max_decimal(int precision, int frac, decimal_t *to)
Definition: decimal.cc:422
int32 decimal_digit_t
Definition: decimal.h:40
int decimal2ulonglong(const decimal_t *from, ulonglong *to)
Definition: decimal.cc:1144
int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, int scale_incr)
Definition: decimal.cc:2470
int string2decimal(const char *from, decimal_t *to, const char **end)
Definition: decimal.cc:922
static void decimal_make_zero(decimal_t *dec)
Definition: decimal.h:117
int decimal2double(const decimal_t *from, double *to)
Definition: decimal.cc:1062
int decimal_cmp(const decimal_t *from1, const decimal_t *from2)
Definition: decimal.cc:2037
int decimal_intg(const decimal_t *from)
Returns the number of decimal digits before the decimal point in a decimal_t, with any insignificant ...
Definition: decimal.cc:2021
int double2decimal(double from, decimal_t *to)
Definition: decimal.cc:1091
int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
Definition: decimal.cc:2032
#define E_DEC_OVERFLOW
Definition: decimal.h:143
static constexpr int DECIMAL_MAX_SCALE
Definition: decimal.h:152
static const std::string dec("DECRYPTION")
A better implementation of the UNIX ctype(3) library.
static mi_bit_type mask[]
Definition: mi_packrec.cc:140
int my_decimal_int_part(uint precision, uint decimals)
Definition: my_decimal.h:80
int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec, int scale)
Definition: my_decimal.cc:215
void max_internal_decimal(my_decimal *to)
Definition: my_decimal.h:189
int check_result_and_overflow(uint mask, int result, my_decimal *val)
Definition: my_decimal.h:193
int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b)
Definition: my_decimal.h:376
int int2my_decimal(uint mask, longlong i, bool unsigned_flag, my_decimal *d)
Definition: my_decimal.h:355
void print_decimal_buff(const my_decimal *dec, const uchar *ptr, int length)
Definition: my_decimal.cc:362
int double2my_decimal(uint mask, double val, my_decimal *d)
Definition: my_decimal.h:351
bool operator!=(const my_decimal &lhs, const my_decimal &rhs)
Definition: my_decimal.h:410
void max_my_decimal(my_decimal *to, int precision, int frac)
Definition: my_decimal.h:184
my_decimal * date2my_decimal(const MYSQL_TIME *ltime, my_decimal *dec)
Convert datetime value to my_decimal in format YYYYMMDDhhmmss.ffffff.
Definition: my_decimal.cc:303
int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec, uint fixed_dec, String *str)
Converting decimal to string.
Definition: my_decimal.cc:118
static constexpr int DECIMAL_MAX_FIELD_SIZE
maximum size of packet length.
Definition: my_decimal.h:78
int my_decimal_get_binary_size(uint precision, uint scale)
Definition: my_decimal.h:249
static constexpr int DECIMAL_LONGLONG_DIGITS
Definition: my_decimal.h:52
int my_decimal2lldiv_t(uint mask, const my_decimal *d, lldiv_t *to)
Definition: my_decimal.h:335
bool str_set_decimal(uint mask, const my_decimal *val, String *str, const CHARSET_INFO *cs, uint decimals)
Converting decimal to string with character set conversion.
Definition: my_decimal.cc:164
int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b)
Definition: my_decimal.h:371
static constexpr int DECIMAL_BUFF_LENGTH
maximum length of buffer in our big digits (uint32).
Definition: my_decimal.h:55
int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b)
Definition: my_decimal.h:392
void my_decimal_neg(decimal_t *arg)
Definition: my_decimal.h:362
int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to)
Definition: my_decimal.h:304
int my_decimal2double(uint, const my_decimal *d, double *result)
Definition: my_decimal.h:330
bool my_decimal_is_zero(const my_decimal *decimal_value)
Definition: my_decimal.h:294
void print_decimal(const my_decimal *dec)
Definition: my_decimal.cc:349
uint my_decimal_length_to_precision(uint length, uint scale, bool unsigned_flag)
Definition: my_decimal.h:209
int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec, int scale)
Definition: my_decimal.h:260
uint32 my_decimal_precision_to_length(uint precision, uint8 scale, bool unsigned_flag)
Definition: my_decimal.h:232
void my_decimal_trim(ulong *precision, uint *scale)
Definition: my_decimal.cc:334
int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
Definition: my_decimal.h:402
bool operator<(const my_decimal &lhs, const my_decimal &rhs)
Definition: my_decimal.h:406
int my_decimal_intg(const my_decimal *a)
Definition: my_decimal.h:414
const char * dbug_decimal_as_string(char *buff, const my_decimal *val)
Definition: my_decimal.cc:371
int my_decimal_set_zero(my_decimal *d)
Definition: my_decimal.h:284
int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc)
Definition: my_decimal.h:386
int my_decimal_round(uint mask, const my_decimal *from, int scale, bool truncate, my_decimal *to)
Definition: my_decimal.h:298
void my_decimal2decimal(const my_decimal *from, my_decimal *to)
Definition: my_decimal.h:253
static constexpr int DECIMAL_MAX_PRECISION
maximum guaranteed precision of number in decimal digits (number of our digits * number of decimal di...
Definition: my_decimal.h:66
int my_decimal2int(uint mask, const my_decimal *d, bool unsigned_flag, longlong *l)
Definition: my_decimal.h:320
static constexpr int DECIMAL_MAX_STR_LENGTH
maximum length of string representation (number of maximum decimal digits + 1 position for sign + 1 p...
Definition: my_decimal.h:73
int my_decimal_string_length(const my_decimal *d)
Definition: my_decimal.h:244
int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to)
Definition: my_decimal.h:308
static constexpr int DECIMAL_MAX_POSSIBLE_PRECISION
the number of digits that my_decimal can possibly contain
Definition: my_decimal.h:58
int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b)
Definition: my_decimal.h:381
int str2my_decimal(uint mask, const char *str, my_decimal *d, const char **end)
Definition: my_decimal.h:339
uint32 my_decimal_precision_to_length_no_truncation(uint precision, uint8 scale, bool unsigned_flag)
Definition: my_decimal.h:218
my_decimal decimal_zero
Definition: mysqld.cc:1485
my_decimal * timeval2my_decimal(const struct timeval *tm, my_decimal *dec)
Convert timeval value to my_decimal.
Definition: my_decimal.cc:327
my_decimal * time2my_decimal(const MYSQL_TIME *ltime, my_decimal *dec)
Convert time value to my_decimal in format hhmmss.ffffff.
Definition: my_decimal.cc:317
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
uint8_t uint8
Definition: my_inttypes.h:62
unsigned char uchar
Definition: my_inttypes.h:51
long long int longlong
Definition: my_inttypes.h:54
uint32_t uint32
Definition: my_inttypes.h:66
Some common macros.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1056
Definition: buf0block_hint.cc:29
const std::string charset("charset")
Definition: commit_order_queue.h:33
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
struct result result
Definition: result.h:33
static void swap(String &a, String &b) noexcept
Definition: sql_string.h:610
Definition: m_ctype.h:354
Definition: mysql_time.h:81
intg is the number of decimal digits (NOT number of decimal_digit_t's !) before the point frac is the...
Definition: decimal.h:51
int frac
Definition: decimal.h:52
int intg
Definition: decimal.h:52
bool sign
Definition: decimal.h:53
int len
Definition: decimal.h:52
Definition: result.h:29
unsigned int uint
Definition: uca-dump.cc:29