You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/11/03 08:09:22 UTC
(doris) branch branch-2.0 updated: [FIX](decimalv3)Fix cast decimalv2 2 decimalv3 #26368
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 2f986ccd822 [FIX](decimalv3)Fix cast decimalv2 2 decimalv3 #26368
2f986ccd822 is described below
commit 2f986ccd822f7beec7aea5c1175a1b5acded8845
Author: amory <wa...@selectdb.com>
AuthorDate: Fri Nov 3 16:09:14 2023 +0800
[FIX](decimalv3)Fix cast decimalv2 2 decimalv3 #26368
---
be/src/vec/sink/vmysql_result_writer.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/sink/vmysql_result_writer.cpp b/be/src/vec/sink/vmysql_result_writer.cpp
index 75d8606a3e8..bc2c1bf54e7 100644
--- a/be/src/vec/sink/vmysql_result_writer.cpp
+++ b/be/src/vec/sink/vmysql_result_writer.cpp
@@ -640,7 +640,15 @@ Status VMysqlResultWriter<is_binary_format>::append_block(Block& input_block) {
// from expr
DataTypeSerDeSPtr serde;
if (_output_vexpr_ctxs[i]->root()->type().is_decimal_v2_type()) {
- serde = std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale, 27);
+ if (_output_vexpr_ctxs[i]->root()->is_nullable()) {
+ auto nested_serde =
+ std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale,
+ 27);
+ serde = std::make_shared<DataTypeNullableSerDe>(nested_serde);
+ } else {
+ serde = std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale,
+ 27);
+ }
} else {
serde = block.get_by_position(i).type->get_serde();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org