[Fix](sql function) memory overflow to the left of string address when do_money_format has small negative value #36226 (#37870)

cherry pick from #36226

Co-authored-by: sparrow <38098988+biohazard4321@users.noreply.github.com>
This commit is contained in:
zhiqiang
2024-07-16 15:04:42 +08:00
committed by GitHub
parent 2c80259f66
commit 02716598d4
2 changed files with 6 additions and 2 deletions

View File

@ -511,7 +511,8 @@ TEST(MathFunctionTest, money_format_test) {
InputTypeSet input_types = {TypeIndex::Float64};
DataSet data_set = {{{Null()}, Null()},
{{DOUBLE(17014116.67)}, VARCHAR("17,014,116.67")},
{{DOUBLE(-17014116.67)}, VARCHAR("-17,014,116.67")}};
{{DOUBLE(-17014116.67)}, VARCHAR("-17,014,116.67")},
{{DOUBLE(-123.45)}, VARCHAR("-123.45")}};
static_cast<void>(check_function<DataTypeString, true>(func_name, input_types, data_set));
}