This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch branch-1.17.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 6bbfa26dd0fc3bc938022859273e6b285c818f15
Author: kedeng <[email protected]>
AuthorDate: Tue Jul 11 15:20:22 2023 +0800

    [compile] fix a compile warning
    
    I noticed that there is a warning during the compile process:
    `
    /data/github-kudu/kudu/src/kudu/client/client-test.cc: In member function 
‘virtual void 
kudu::client::ClientTestImmutableColumn_TestUpsert_Test::TestBody()’:
    /data/github-kudu/kudu/src/kudu/client/client-test.cc:9562:90: warning: 
‘iftmp.3716’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                       update_immu_col_to_null_ ? nullopt : 
optional<int>(999));
    `
    
    Although it does not involve functional defects, it
    still needs to be fixed.
    
    As it does not involve any logic changes, no new unit tests
    have been added.
    
    Change-Id: Ib2c3d430b26e4c7961a54894429e09938c7ed692
    Reviewed-on: http://gerrit.cloudera.org:8080/20183
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <[email protected]>
    (cherry picked from commit 7f9b3e3e29d951c35d4c28fe9f90b9f7cabe873f)
    Reviewed-on: http://gerrit.cloudera.org:8080/20290
    Reviewed-by: Yingchun Lai <[email protected]>
    Tested-by: Yingchun Lai <[email protected]>
---
 src/kudu/client/client-test.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 02e7e0acb..f5fc102ed 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -9479,10 +9479,13 @@ TEST_P(ClientTestImmutableColumn, TestUpsert) {
     EXPECT_EQ(expect_row, rows[0]);
   }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
   // Perform an UPSERT. This upsert will attemp to update an immutable column,
   // which will result an error.
   Status s = ApplyUpsertToSession(session.get(), client_table_, 1, 4, 
"upserted row 3",
                                   update_immu_col_to_null_ ? nullopt : 
optional<int>(999));
+#pragma GCC diagnostic pop
   ASSERT_TRUE(s.IsIOError()) << s.ToString();
   ASSERT_STR_CONTAINS(s.ToString(),
                       "failed to flush data: error details are available "

Reply via email to