Skip to content

fix(query): system.columns will return empty result when where database in (y,x) - #18063

Merged
b41sh merged 1 commit into
databendlabs:mainfrom
TCeason:fix_18056
Jun 4, 2025
Merged

fix(query): system.columns will return empty result when where database in (y,x)#18063
b41sh merged 1 commit into
databendlabs:mainfrom
TCeason:fix_18056

Conversation

@TCeason

@TCeason TCeason commented Jun 4, 2025

Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Problem

This PR fixes system.columns returning incomplete results when users have partial grants and queries include multi-database conditions like WHERE database IN (...).

The root cause was the old filtering mechanism, find_eq_filter, failing to correctly process such complex filters.

Solution

By replacing it with find_eq_or_filter, the system now accurately identifies and displays all accessible metadata, significantly improving system.columns reliability for users with granular access rights.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-bugfix this PR patches a bug in codebase label Jun 4, 2025
@TCeason
TCeason requested a review from b41sh June 4, 2025 02:16
@b41sh
b41sh merged commit 7fd7f28 into databendlabs:main Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: normal user query from system.columns with or filter will return empty result

2 participants