Skip to content

Commit

Permalink
Fix string search with const position
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio2368 committed Mar 18, 2024
1 parent b01526a commit 7029a0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Functions/FunctionsStringSearch.h
Expand Up @@ -197,7 +197,7 @@ class FunctionsStringSearch : public IFunction
Impl::constantConstant(
col_haystack_const->getValue<String>(),
col_needle_const->getValue<String>(),
column_start_pos,
is_col_start_pos_const ? nullptr : column_start_pos,
vec_res,
null_map.get());

Expand Down
Empty file.
3 changes: 3 additions & 0 deletions tests/queries/0_stateless/03013_position_const_start_pos.sql
@@ -0,0 +1,3 @@
CREATE TABLE 03013_position_const_start_pos (n Int16) ENGINE = Memory;
INSERT INTO 03013_position_const_start_pos SELECT * FROM generateRandom() LIMIT 1000;
SELECT position(concat(NULLIF(1, 1), materialize(3)), 'ca', 2) FROM 03013_position_const_start_pos FORMAT Null;

0 comments on commit 7029a0f

Please sign in to comment.