From 8e8140507d322374149426428b5d7a10bab79db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=8A=80=E5=9C=88=E5=AD=90?= Date: Thu, 9 Jan 2025 21:37:22 +0800 Subject: [PATCH] [fix] Add initialization list to the copy constructor of ScanPredicate in jni_connect.h (#46666) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: The copy constructor of `ScanPredicate` in `jni_connect.h` does not use an initialization list, which might result in uninitialized member variables or unintended behavior. --- be/src/vec/exec/jni_connector.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/be/src/vec/exec/jni_connector.h b/be/src/vec/exec/jni_connector.h index 52a3fb2e7782ca..a033a6520633b0 100644 --- a/be/src/vec/exec/jni_connector.h +++ b/be/src/vec/exec/jni_connector.h @@ -100,13 +100,11 @@ class JniConnector : public ProfileCollector { ScanPredicate(const std::string column_name) : column_name(std::move(column_name)) {} - ScanPredicate(const ScanPredicate& other) { - column_name = other.column_name; - op = other.op; + ScanPredicate(const ScanPredicate& other) + : column_name(other.column_name), op(other.op), scale(other.scale) { for (auto v : other.values) { values.emplace_back(v); } - scale = other.scale; } int length() {