Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QP-8003] PgActionAnalyzer에서 Insert Action 시 명시적 컬럼 지정이 있는 경우에는 base 메소드 호출 #78

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

irwin-chequer
Copy link
Contributor

@irwin-chequer irwin-chequer commented Apr 17, 2024

  1. INSERT INTO [테이블명] [SELECT 쿼리] 의 경우 PostgreSQL는 대상 컬럼이 암시적(implicit)으로 지정됐다고 보고 SELECT 쿼리에서 확인되는 컬럼의 개수만큼 기존 테이블의 가장 왼쪽 컬럼에서부터 차례대로 컬럼을 추출해 Insert Action을 수행합니다. (문서 참조: https://www.postgresql.org/docs/current/sql-insert.html )

  2. INSERT INTO [테이블명] (컬럼1, 컬럼2, ...) [SELECT 쿼리] 의 경우 대부분 RDBMS는 Insert Action의 대상 컬럼이 명시적으로 지정되었다고 보고 지정된 각 컬럼에 SELECT 쿼리에서 얻은 결과를 테이블에 삽입하나, 기존 QSI 코드의 PgActionAnalyzer의 경우 Insert Action 쿼리에 [SELECT 쿼리] 가 포함되면 일괄적으로 암시적 컬럼 지정으로 보고 처리합니다. 이렇게 되면, 잘못된 컬럼을 지정해 null 대입을 시도하는 등의 문제가 발생합니다. 이 PR은 명시적 컬럼 지정이 있는 경우를 세분화, 적절히 처리합니다. 또한, 이를 확인할 수 있는 테스트 데이터를 추가합니다.

  3. 추가로, base 메소드의 정상 작동을 확인하기 위해 (이를 override 하지 않는) MySQL 관련 테스트 코드를 추가합니다.

@irwin-chequer irwin-chequer self-assigned this Apr 17, 2024
Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@irwin-chequer irwin-chequer changed the title [QP-8003] PgActionAnalyzer에서 Insert Action 시 명시적 컬럼 지정이 있는 경우에는 base 메소드 호출 [QP-7661] PgActionAnalyzer에서 Insert Action 시 명시적 컬럼 지정이 있는 경우에는 base 메소드 호출 Apr 18, 2024
@irwin-chequer irwin-chequer changed the title [QP-7661] PgActionAnalyzer에서 Insert Action 시 명시적 컬럼 지정이 있는 경우에는 base 메소드 호출 [QP-8003] PgActionAnalyzer에서 Insert Action 시 명시적 컬럼 지정이 있는 경우에는 base 메소드 호출 Apr 20, 2024
@Web-Engine Web-Engine added this to the 9.19.0 milestone Apr 22, 2024
@Web-Engine Web-Engine added the bug Something isn't working label Apr 22, 2024
@irwin-chequer irwin-chequer merged commit fdc80c4 into main Apr 22, 2024
21 checks passed
@irwin-chequer irwin-chequer deleted the feature/QP-8003 branch April 22, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants