-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL] WARNING: 0A000: WITH clause not supported yet #6511
Comments
The following is a reminder to update the YSQL doc for the "Bacon Distance" use case in the "WITH clause" section when this issue is closed. Here is the ideal code:
But the first-published version will have this workaround:
|
Summary: In #6511, it was pointed out that in the following example: ``` with a as ( select 1 as k) delete from t where k in (select k from a); ``` we throw the following warning: ``` WARNING: 0A000: WITH clause not supported yet LINE 1: with a as ( ^ HINT: Please report the issue on https://github.com/YugaByte/yugabyte-db/issues LOCATION: raise_feature_not_supported_signal, gram.y:17327 ``` However, we do support WITH clause, and this warning notwithstanding, the delete does go through fine. As part of this change, removed this warning message, and also imported PG tests for WITH clause. The imported PG tests have the following major changes: 1) Temporary tables have been replaced by normal tables due to #6783 2) Disabled the failing for test for updating a row more than once in different parts of a wCTE, will be handled separately in #6782 Test Plan: ybd --scb --sj --java-test org.yb.pgsql.TestPgRegressWithClause Reviewers: mihnea, neil Reviewed By: neil Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D10257
Fixed with the above commit. |
@bllewell Just pasting this from our slack conversation for future reference: The fix is present in v2.5.2.0 which is the current latest release as of now, can see this issue [6511] here - https://github.com/yugabyte/yugabyte-db/releases/tag/v2.5.2 |
Between when I filed this bug and when I published my “Recursive CTEs” doc, I had found a better, more compact way to formulate the required pruning SQL. So I decided, after all, not to change that code. I’m glad that I was able to characterize a bug with a small testcase and that the bug has now been fixed. |
Summary: In yugabyte#6511, it was pointed out that in the following example: ``` with a as ( select 1 as k) delete from t where k in (select k from a); ``` we throw the following warning: ``` WARNING: 0A000: WITH clause not supported yet LINE 1: with a as ( ^ HINT: Please report the issue on https://github.com/YugaByte/yugabyte-db/issues LOCATION: raise_feature_not_supported_signal, gram.y:17327 ``` However, we do support WITH clause, and this warning notwithstanding, the delete does go through fine. As part of this change, removed this warning message, and also imported PG tests for WITH clause. The imported PG tests have the following major changes: 1) Temporary tables have been replaced by normal tables due to yugabyte#6783 2) Disabled the failing for test for updating a row more than once in different parts of a wCTE, will be handled separately in yugabyte#6782 Test Plan: ybd --scb --sj --java-test org.yb.pgsql.TestPgRegressWithClause Reviewers: mihnea, neil Reviewed By: neil Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D10257
Using YB-2.3.2.0 on macOS Big Sur Version 11.0.1.
Create and populate a test table:
Postitive tests
This is the result, exactly as expected:
Negative test
It cause this outcome:
The wording,
WARNING: 0A000: WITH clause not supported yet
is nonsense. The positive tests show that theWITH
clause can be used without error when the final main substatement is anINSERT
orUPDATE
. And the YSQL doc here:has countless other examples where the final main substatement is a
SELECT
.Notice that this query:
produces this new result:
So in fact the
DELETE
did produce the intented effect.Notice that, of course, the testcase runs without error on vanilla PostgreSQL. And the observer
SELECT
statements produce the same results.The text was updated successfully, but these errors were encountered: