Skip to content

Commit beb10fc

Browse files
committed
Add small test for NothingColumn type
1 parent 5e8931f commit beb10fc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ut/client_ut.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,20 @@ TEST_P(ClientCase, Nullable) {
434434
EXPECT_EQ(sizeof(TEST_DATA) / sizeof(TEST_DATA[0]), row);
435435
}
436436

437+
TEST_P(ClientCase, Nothing) {
438+
size_t total_row_count = 0;
439+
client_->Select("SELECT NULL", [&total_row_count](const Block & block)
440+
{
441+
total_row_count += block.GetRowCount();
442+
for (size_t i = 0; i < block.GetRowCount(); ++i) {
443+
EXPECT_TRUE(block[0]->AsStrict<ColumnNullable>()->IsNull(i));
444+
auto column = ColumnNullableT<ColumnNothing>::Wrap(block[0]->AsStrict<ColumnNullable>());
445+
EXPECT_FALSE(column->At(i).has_value());
446+
}
447+
});
448+
ASSERT_EQ(total_row_count, 1UL);
449+
}
450+
437451
TEST_P(ClientCase, Numbers) {
438452
try {
439453
size_t num = 0;

0 commit comments

Comments
 (0)