summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 1885036f42b..b096abaf8ae 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -114,6 +114,14 @@ public:
bool sign() const { return decimal_t::sign; }
void sign(bool s) { decimal_t::sign= s; }
uint precision() const { return intg + frac; }
+
+ /** Swap two my_decimal values */
+ void swap(my_decimal &rhs)
+ {
+ swap_variables(my_decimal, *this, rhs);
+ /* Swap the buffer pointers back */
+ swap_variables(decimal_digit_t *, buf, rhs.buf);
+ }
};