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