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: forbid end at stream syntax #15173

Merged
merged 1 commit into from
Apr 7, 2024
Merged

Conversation

zhyass
Copy link
Member

@zhyass zhyass commented Apr 7, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

disallowing the use of end => '....' within the changes clause, since it does not make sense so much.

mysql> create table t(a int)change_tracking=true;
Query OK, 0 rows affected (0.15 sec)

mysql> insert into t values(2);
Query OK, 1 row affected (0.15 sec)

mysql> insert into t values(1);
Query OK, 1 row affected (0.16 sec)

mysql> create stream s on table t append_only = false;
Query OK, 0 rows affected (0.14 sec)

mysql> select * from t changes(information=>default) at(snapshot=>'c8aa4edd973246749520bc7c57c47e1a') end(stream=>s1);
 
ERROR 1105 (HY000): SyntaxException. Code: 1005, Text = error: 
  --> SQL:1:100
  |
1 | select * from t changes(information=>default) at(snapshot=>'c8aa4edd973246749520bc7c57c47e1a') end(stream=>s1)
  | ------                                                                                             ^^^^^^ unexpected `stream`, expecting `TIMESTAMP` or `SNAPSHOT`
  | |                                                                                                   
  | while parsing `SELECT ...`
  • Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Apr 7, 2024
@zhyass zhyass changed the title chore: forbid end at stream syntax fix: forbid end at stream syntax Apr 7, 2024
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Apr 7, 2024
@zhyass zhyass removed the pr-chore this PR only has small changes that no need to record, like coding styles. label Apr 7, 2024
@zhyass zhyass requested a review from dantengsky April 7, 2024 05:27
@zhyass zhyass added this pull request to the merge queue Apr 7, 2024
Merged via the queue into databendlabs:main with commit 7ab8c27 Apr 7, 2024
90 of 93 checks passed
@zhyass zhyass deleted the feat_stream branch April 7, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants