GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: 分页包装SQL的结果列无法解析物理表字段导致列权限失效 by xlorne · Pull Request #213 · codingapi/springboot-framework

Conversation

@xlorne

@xlorne xlorne commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

查询引擎将业务SQL包装为 SELECT 裸列 FROM (...) AS base 形态后, 结果集元数据的表名为派生表别名或空串,无法映射回物理表字段,
DataAuthorizationFilter.supportColumnAuthorization 收到错误表名, 列权限/脱敏失效。

修复方式:遍历AST时为派生表(FROM/JOIN子查询)构建"输出列→物理表字段"
投影映射(DerivedTableProjection),支持多层派生链归因与单 * 展开归因;
列权限解析改为联合解析 resolveTableNameAndColumn,命中派生表别名或
表名为空/未知时沿投影归因,已知物理表及歧义场景保持原有行为不变。

Closes #212

Describe what this PR does / why we need it

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@xlorne @claude
fix: 分页包装SQL的结果列无法解析物理表字段导致列权限失效
b2b6e9f
查询引擎将业务SQL包装为 SELECT 裸列 FROM (...) AS __base__ 形态后,
结果集元数据的表名为派生表别名或空串,无法映射回物理表字段,
DataAuthorizationFilter.supportColumnAuthorization 收到错误表名,
列权限/脱敏失效。

修复方式:遍历AST时为派生表(FROM/JOIN子查询)构建"输出列→物理表字段"
投影映射(DerivedTableProjection),支持多层派生链归因与单 * 展开归因;
列权限解析改为联合解析 resolveTableNameAndColumn,命中派生表别名或
表名为空/未知时沿投影归因,已知物理表及歧义场景保持原有行为不变。

Closes #212

Co-Authored-By: Claude <[email protected]>
@xlorne
xlorne merged commit e340e59 into main Sep 11, 2026
2 of 4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.14286% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.32%. Comparing base (9f49a29) to head (b2b6e9f).
⚠️ Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
...authorization/enhancer/TableColumnAliasHolder.java 57.81% 15 Missing and 12 partials ⚠️
...uthorization/enhancer/TableColumnAliasContext.java 61.70% 11 Missing and 7 partials ⚠️
...authorization/enhancer/DerivedTableProjection.java 68.00% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #213      +/-   ##
============================================
- Coverage     87.99%   87.32%   -0.67%     
- Complexity     2117     2156      +39     
============================================
  Files           210      211       +1     
  Lines          5756     5894     +138     
  Branches        370      408      +38     
============================================
+ Hits           5065     5147      +82     
- Misses          567      602      +35     
- Partials        124      145      +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

如下SQL无法正常的提取到表名和字段数据信息

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@xlorne
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.