-
Notifications
You must be signed in to change notification settings - Fork 489
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
*: add as of clause for SET
and SELECT
#1206
Conversation
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Some details need to discuss pingcap/tidb#22765 (comment) |
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
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.
is it possible to use a TSO as the input to the AS OF clause?
select * from a as of timestamp 424430616285806594;
-- or?
select * from a as of tso 424430616285806594;
Signed-off-by: nolouch <nolouch@gmail.com>
@kennytm Our TSO has some logic bits, not really Unix timestamp. if really have a scene TSO as input we can add it in the future. |
/lgtm
I'd like to note that |
If want tso as input, may we also support it in |
/lgtm |
@@ -5604,6 +5604,7 @@ func (checker *nodeTextCleaner) Enter(in ast.Node) (out ast.Node, skipChildren b | |||
} | |||
case *ast.FuncCallExpr: | |||
node.FnName.O = strings.ToLower(node.FnName.O) | |||
node.SetOriginTextPosition(0) |
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.
What does this line work for?
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.
It's cleans the some text in the node, then we can use reflect.DeepEquals to compare two statements in :
Lines 388 to 391 in f416dc9
c.Assert(err, IsNil, comment) | |
CleanNodeText(stmt) | |
CleanNodeText(restoreStmt) | |
c.Assert(restoreStmt, DeepEquals, stmt, comment) |
* *: add as of clause Signed-off-by: nolouch <nolouch@gmail.com> * resolve shift-reduce conflict * *: fix and try to add test Signed-off-by: nolouch <nolouch@gmail.com> * *: add timestamp Signed-off-by: nolouch <nolouch@gmail.com> * make as of to token Signed-off-by: nolouch <nolouch@gmail.com> * address comments Signed-off-by: nolouch <nolouch@gmail.com> * add test Signed-off-by: nolouch <nolouch@gmail.com> * make of as Reserved(from mysql 8.0) Signed-off-by: nolouch <nolouch@gmail.com> * add set test case Signed-off-by: nolouch <nolouch@gmail.com> * address comment Signed-off-by: nolouch <nolouch@gmail.com> Co-authored-by: tangenta <tangenta@126.com>
Signed-off-by: nolouch nolouch@gmail.com
What problem does this PR solve?
Ref pingcap/tidb#22765 (comment)
What is changed and how it works?
Check List
Tests