File tree Expand file tree Collapse file tree
tests/queries/0_stateless Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,14 +109,25 @@ namespace
109109
110110 if (FunctionSecretArgumentsFinder::Result secret_arguments = TableFunctionSecretArgumentsFinderTreeNode (*table_function_node_ptr).getResult (); secret_arguments.count )
111111 {
112- auto & argument_nodes = table_function_node_ptr->getArgumentsNode ()-> as <ListNode &> ().getNodes ();
112+ auto & argument_nodes = table_function_node_ptr->getArguments ().getNodes ();
113113
114114 for (size_t n = secret_arguments.start ; n < secret_arguments.start + secret_arguments.count ; ++n)
115115 {
116+ ConstantNode * constant_node = nullptr ;
116117 if (secret_arguments.are_named )
117- argument_nodes[n]->as <FunctionNode&>().getArguments ().getNodes ()[1 ]->as <ConstantNode&>().setMaskId ();
118- else
119- argument_nodes[n]->as <ConstantNode&>().setMaskId ();
118+ {
119+ auto * function_node = argument_nodes[n]->as <FunctionNode>();
120+ if (function_node && function_node->getArguments ().getNodes ().size () >= 2 )
121+ constant_node = function_node->getArguments ().getNodes ().at (1 )->as <ConstantNode>();
122+ }
123+
124+ if (!constant_node)
125+ {
126+ constant_node = argument_nodes[n]->as <ConstantNode>();
127+ }
128+
129+ if (constant_node)
130+ constant_node->setMaskId ();
120131 }
121132 }
122133 }
Original file line number Diff line number Diff line change 33
44SELECT * FROM s3(headers(' random_header' = ' value' )); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
55SELECT * FROM s3Cluster(' test_cluster_two_shards_localhost' , headers(' random_header' = ' value' )); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
6+ SET enable_analyzer = 1 ;
7+ EXPLAIN QUERY TREE SELECT 1 FROM s3(' a' , 1 , CSV); -- { serverError BAD_ARGUMENTS }
You can’t perform that action at this time.
0 commit comments