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

Fix parent-child relationship #6126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZhengguanLi
Copy link
Contributor

@ZhengguanLi ZhengguanLi commented Sep 5, 2024

Changes:

  • Fix parent-child relationship
  • Set parenthesized for SQLListExpr
  • Update tests

@@ -143,7 +143,7 @@ INSERT INTO profile_group_execution
, status, count, error_msg, error_code)
VALUES (now(), now(), ?, ?, ?
, ?, ?, ?, ?)
RETURNING (id, gmt_create, gmt_modified, group_id, mode, sql, status, count, error_msg, error_code)
RETURNING id, gmt_create, gmt_modified, group_id, mode, sql, status, count, error_msg, error_code
Copy link
Contributor Author

Choose a reason for hiding this comment

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

根据PG文档 returning 不需要括号:https://www.postgresql.org/docs/current/dml-returning.html

@@ -166,7 +166,7 @@ public void test_2() throws Exception {
+ "\t, ACCOUNT_ID, SUBTOTAL_DETAILBILL_ID, NVL(ACCT_HOME_COUNTY, -1)\n"
+ "\t, TO_CHAR(NVL(BILLCYCLE_INURE_DATE, TO_DATE(TO_CHAR(GEN_TIME, 'yyyymm'), 'yyyymm')), 'yyyymmdd')\n"
+ "\t, NVL(BILLCYCLE_MONTH, -1)\n" + "\t, NVL(Detailbill_Flag, 0)\n"
+ "INTO (:b0, :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8, :b9, :b10, :b11, :b12, :b13, :b14, :b15, :b16, :b17, :b18, :b19, :b20:b21, :b22:b23, :b24:b25, :b26:b27, :b28:b29, :b30, :b31, :b32, :b33)\n"
+ "INTO :b0, :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8, :b9, :b10, :b11, :b12, :b13, :b14, :b15, :b16, :b17, :b18, :b19, :b20:b21, :b22:b23, :b24:b25, :b26:b27, :b28:b29, :b30, :b31, :b32, :b33\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

x.getTarget().accept(this);
print0(" := ");
x.getValue().accept(this);
return false;
Copy link
Contributor Author

@ZhengguanLi ZhengguanLi Oct 1, 2024

Choose a reason for hiding this comment

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

super.visit(x); 会使用SQLASTOutputVisitor的方法,用=来赋值,但是PG支持两种,:=更常用(https://www.postgresql.org/docs/current/plpgsql-statements.html)

@ZhengguanLi
Copy link
Contributor Author

@wenshao 可以看下这个吗

@ZhengguanLi ZhengguanLi reopened this Nov 22, 2024
@ZhengguanLi ZhengguanLi force-pushed the fix-parent-child-relationship branch from 9f1c61d to 558ea7d Compare November 22, 2024 01:37
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.

1 participant