@@ -718,9 +718,9 @@ TEST_P(ClientCase, Decimal) {
718
718
719
719
// Test special chars in names
720
720
TEST_P (ClientCase, ColEscapeNameTest) {
721
- client_->Execute (" DROP TABLE IF EXISTS test_clickhouse_cpp.\" col_escape_name_test \" ;" );
721
+ client_->Execute (" DROP TABLE IF EXISTS test_clickhouse_cpp.\" col_escape_ \"\" name_test \" ;" );
722
722
723
- client_->Execute (" CREATE TABLE IF NOT EXISTS test_clickhouse_cpp.\" col_escape_name_test \" (\" test space\" UInt64, \" test \"\" quote\" UInt64, \" test \"\" `'[]&_\\ all\" UInt64) ENGINE = Memory" );
723
+ client_->Execute (" CREATE TABLE IF NOT EXISTS test_clickhouse_cpp.\" col_escape_ \"\" name_test \" (\" test space\" UInt64, \" test \"\" quote\" UInt64, \" test \"\" `'[]&_\\ all\" UInt64) ENGINE = Memory" );
724
724
725
725
auto col1 = std::make_shared<ColumnUInt64>();
726
726
col1->Append (1 );
@@ -732,26 +732,26 @@ TEST_P(ClientCase, ColEscapeNameTest) {
732
732
col3->Append (16 );
733
733
col3->Append (32 );
734
734
735
- Block block;
736
- block.AppendColumn (" test space" , col1);
737
- block.AppendColumn (" test \" quote" , col2);
738
- block.AppendColumn (" test \" `'[]&_\\ all" , col3);
739
-
740
- client_->Insert (" test_clickhouse_cpp.col_escape_name_test " , block);
741
- client_->Select (" SELECT * FROM test_clickhouse_cpp.\" col_escape_name_test \" " , [] ([[maybe_unused]] const Block& sblock)
742
- {
743
- int row = sblock.GetRowCount ();
744
- if (row <= 0 ) {return ;}
745
- int col = sblock.GetColumnCount ();
746
- EXPECT_EQ (col, 3 );
747
- EXPECT_EQ (row, 2 );
748
- EXPECT_EQ (sblock[0 ]->As <ColumnUInt64>()->At (0 ), 1U );
749
- EXPECT_EQ (sblock[0 ]->As <ColumnUInt64>()->At (1 ), 2U );
750
- EXPECT_EQ (sblock[1 ]->As <ColumnUInt64>()->At (0 ), 4U );
751
- EXPECT_EQ (sblock[1 ]->As <ColumnUInt64>()->At (1 ), 8U );
752
- EXPECT_EQ (sblock[2 ]->As <ColumnUInt64>()->At (0 ), 16U );
753
- EXPECT_EQ (sblock[2 ]->As <ColumnUInt64>()->At (1 ), 32U );
754
- });
735
+ Block block;
736
+ block.AppendColumn (" test space" , col1);
737
+ block.AppendColumn (" test \" quote" , col2);
738
+ block.AppendColumn (" test \" `'[]&_\\ all" , col3);
739
+
740
+ client_->Insert (" test_clickhouse_cpp.\" col_escape_ \"\" name_test \" " , block);
741
+ client_->Select (" SELECT * FROM test_clickhouse_cpp.\" col_escape_ \"\" name_test \" " , [] (const Block& sblock)
742
+ {
743
+ int row = sblock.GetRowCount ();
744
+ if (row <= 0 ) {return ;}
745
+ int col = sblock.GetColumnCount ();
746
+ EXPECT_EQ (col, 3 );
747
+ EXPECT_EQ (row, 2 );
748
+ EXPECT_EQ (sblock[0 ]->As <ColumnUInt64>()->At (0 ), 1u );
749
+ EXPECT_EQ (sblock[0 ]->As <ColumnUInt64>()->At (1 ), 2u );
750
+ EXPECT_EQ (sblock[1 ]->As <ColumnUInt64>()->At (0 ), 4u );
751
+ EXPECT_EQ (sblock[1 ]->As <ColumnUInt64>()->At (1 ), 8u );
752
+ EXPECT_EQ (sblock[2 ]->As <ColumnUInt64>()->At (0 ), 16u );
753
+ EXPECT_EQ (sblock[2 ]->As <ColumnUInt64>()->At (1 ), 32u );
754
+ });
755
755
}
756
756
757
757
// Test roundtrip of DateTime64 values
0 commit comments