Skip to content

Conversation

@ricardopintottrdata
Copy link
Contributor

@ricardopintottrdata ricardopintottrdata commented Oct 15, 2025

Type of Change (select one):

  • Bug fix

Description of the Change:
Fixes the error "filter with empty name"

Related Issue (provide the link):
#887

How to test:

mysql> drop table if exists t; create table t(a int, b int); insert into t values(0,1,2); select a, count(*) from t where a=1 or b=2 group by a having count(*) = 1;  
--------------  
drop table if exists t  
--------------  
Query OK, 0 rows affected (0.10 sec)  
  
--------------  
create table t(a int, b int)  
--------------  
Query OK, 0 rows affected (0.05 sec)  
  
--------------  
insert into t values(0,1,2)  
--------------  
Query OK, 1 row affected (0.00 sec)  
  
--------------  
select a, count(*) from t where a=1 or b=2 group by a having count(*) = 1  
--------------  
  
ERROR 1064 (42000): index t: filter with empty name  

Replacing or with and solves the problem:

select a, count(*) from t where a=1 and b=2 group by a having count(*) = 1  
--------------  
  
 ------ ----------   
| a    | count(*) |  
 ------ ----------   
|    1 |        1 |  
 ------ ----------   
1 row in set (0.01 sec)  

Removing HAVING also solves the problem:

select a, count(*) from t where a=1 or b=2 group by a  
--------------  
  
 ------ ----------   
| a    | count(*) |  
 ------ ----------   
|    1 |        1 |  
 ------ ----------   
1 row in set (0.00 sec)  

@ricardopintottrdata
Copy link
Contributor Author

@sanikolaev hello, can you check this please ? the failing test was again the error that has nothing to do with the changes submitted. Thank you !

@sanikolaev
Copy link
Collaborator

Hello @ricardopintottrdata
These tests

image

are failing because:

  • GitHub runs the CI in the context of your organization, not https://github.com/manticoresoftware
  • the secret variables JINA_API_KEY, OPENAI_API_KEY, and VOYAGE_API_KEY are not defined in your organization or your repository

As said in the Github docs :

workflows from forks do not have access to sensitive data such as secrets

You can add these secrets, and that should stop the failures. We can also skip the tests if the variables are not set (implemented in this PR #3835), but I'm not sure it's a good solution. I'll check with my colleagues.

@sanikolaev sanikolaev requested a review from glookka October 17, 2025 04:52
@sanikolaev
Copy link
Collaborator

@glookka please review the PR

@ricardopintottrdata
Copy link
Contributor Author

@sanikolaev @glookka heyy! do you need anything else from me for this PR also ?
Thank you

@sanikolaev
Copy link
Collaborator

do you need anything else from me for this PR also ?

No, thank you! @glookka has been quite busy with other things lately, but be sure we'll find time to review and merge your PR if everything looks good.

@ricardopintottrdata
Copy link
Contributor Author

ok thank you @sanikolaev !

Copy link
Contributor

@glookka glookka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this solution works, it implicitly assumes that the last element in the filter tree is the HAVING filter. I would at least add an assert to check that m_pQuery->m_dFilterTree.Last().m_iFilterItem matches the id of the filter being removed.

@ricardopintottrdata
Copy link
Contributor Author

Hey @glookka thanks for the input, i've just updated the PR, think now is much better, thanks for the help!

@glookka glookka merged commit 516a492 into manticoresoftware:master Nov 4, 2025
55 of 56 checks passed
glookka added a commit that referenced this pull request Nov 5, 2025
glookka added a commit that referenced this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants