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

stmtbundle: include TRIGGER related dependencies #142041

Open
yuzefovich opened this issue Feb 26, 2025 · 0 comments
Open

stmtbundle: include TRIGGER related dependencies #142041

yuzefovich opened this issue Feb 26, 2025 · 0 comments
Labels
A-sql-debug-bundle Issues related to statement bundle improvements A-sql-trigger Triggers and Trigger Functions C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-queries SQL Queries Team

Comments

@yuzefovich
Copy link
Member

yuzefovich commented Feb 26, 2025

Currently, we don't include TRIGGER functions nor tables they might modify in the stmt bundle. For example,

CREATE TABLE t1 (k1 INT PRIMARY KEY, v1 INT);

CREATE TABLE t2 (k2 INT PRIMARY KEY, v2 INT);

CREATE FUNCTION f() RETURNS TRIGGER LANGUAGE PLpgSQL AS $$
  BEGIN
    INSERT INTO t2 SELECT (NEW).k1, (NEW).v1;
    RETURN NEW;
  END
$$;

CREATE TRIGGER foo AFTER INSERT ON t1 FOR EACH ROW EXECUTE FUNCTION f();

EXPLAIN ANALYZE (DEBUG) INSERT INTO t1 VALUES (1, 10);

neither trigger foo, nor UDF f, nor table t2 are included in the bundle.

This is probably related to #138022.

Jira issue: CRDB-48135

@yuzefovich yuzefovich added A-sql-debug-bundle Issues related to statement bundle improvements A-sql-trigger Triggers and Trigger Functions C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-queries SQL Queries Team labels Feb 26, 2025
@github-project-automation github-project-automation bot moved this to Triage in SQL Queries Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-debug-bundle Issues related to statement bundle improvements A-sql-trigger Triggers and Trigger Functions C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-queries SQL Queries Team
Projects
Status: Triage
Development

No branches or pull requests

1 participant