summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 21:38:55 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 21:38:55 +0300
commit1c587481966abc7a9ad5309d0a91ca920f7a5657 (patch)
tree28b936bd807cab0ba7b82e4cc9ec963fa6de6307 /sql/sql_string.cc
parent17be2b47ba32535e69e28da9a444e528ba8ab155 (diff)
parenteae968f62d285de97ed607c87bc131cd863d5d03 (diff)
downloadmariadb-git-1c587481966abc7a9ad5309d0a91ca920f7a5657.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 030075aa793..e2defba434d 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -183,6 +183,17 @@ bool Binary_string::set_hex(const char *str, uint32 len)
}
+bool Binary_string::set_fcvt(double num, uint decimals)
+{
+ // Assert that `decimals` is small enough to fit into FLOATING_POINT_BUFFER
+ DBUG_ASSERT(decimals < DECIMAL_NOT_SPECIFIED);
+ if (alloc(FLOATING_POINT_BUFFER))
+ return true;
+ length(my_fcvt(num, decimals, Ptr, NULL));
+ return false;
+}
+
+
bool String::set_real(double num,uint decimals, CHARSET_INFO *cs)
{
char buff[FLOATING_POINT_BUFFER];