-
Notifications
You must be signed in to change notification settings - Fork 126
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
[CBRD-24420] dblink: correct oracle syntax error in rewritten query. #3705
Conversation
src/parser/view_transform.c
Outdated
PT_INTERNAL_ERROR (parser, "allocate new node"); | ||
return NULL; | ||
} | ||
*new_node = *old_node->info.expr.arg1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvl(col1) in cast( nvl(col1) as int) cannot be copied. It is recommended to make a full copy and remove cast().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please show the full query as an incorrect rewrite result.
the below query is executed well:
select * from dblink(srv, 'select a, b, c from tbl') as t(col1 int, col2 varchar, col3 int) where cast( nvl(col1,1) as int) = 9999;
the rewritten query is as below:
SELECT * FROM (select a, b, c from tbl) cublink(col1, col2, col3) WHERE cast(nvl(col1, 1) as integer)=9999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the routin "pt_remove_cast_wrap_for_dblink"
…backport to 11.2). (#3705) (#3731) http://jira.cubrid.org/browse/CBRD-24420 This is a backport of #3705 for 11.2.1
http://jira.cubrid.org/browse/CBRD-24420
The rewritten query by "predicate push down" at DBLINK would not be executed at ORACLE.
We should modify the rewritten routine not to ban the grammar of ORACLE.
The error arise as like "ORA-00933: SQL command not properly ended"