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

dev row constructor #90

Merged
merged 10 commits into from
Sep 10, 2015
Merged

dev row constructor #90

merged 10 commits into from
Sep 10, 2015

Conversation

siddontang
Copy link
Member

base support row constructor like select row(1, 1) > row(1,1)

row constructor now only supports in comparison operation.

TODO in other PRs:

  • add more checks in other expressions for Row constructor.
  • check row constructor in select list, group by, order by, having, e,g select row(1, 1) is not allowed.
  • support row constructor with sub select.

@@ -557,6 +558,7 @@ sys_var "@@"(({global}".")|({session}".")|{local}".")?{ident}
{right} return right
{rollback} lval.item = string(l.val)
return rollback
{row} return row
Copy link
Member

Choose a reason for hiding this comment

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

row is an unreserved keyword. Please treat is as other unreserved keyword, like "rollback".
And also update the test case in parser_test.go.

@siddontang
Copy link
Member Author

PTAL

// CheckOneColumn checks whether expression e has only one column for the evaluation result.
// Now most of the expressions have one column except Row expression.
func CheckOneColumn(e expression.Expression) error {
_, ok := e.(*Row)
Copy link
Member

Choose a reason for hiding this comment

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

Not need to check if len(e.values) == 1?
Or why not rename this function to "IsRowExpr" and return bool?

Copy link
Member Author

Choose a reason for hiding this comment

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

no need, row(1) is valid.

because later we may check subselect expression, not only row.

Copy link
Member Author

Choose a reason for hiding this comment

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

row(1) will be parsed failed in parser

Copy link
Member

Choose a reason for hiding this comment

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

ok

@siddontang
Copy link
Member Author

PTAL @shenli

@shenli
Copy link
Member

shenli commented Sep 10, 2015

LGTM

if err != nil {
return
}

return Val == nil != is.Not, nil
return val == nil != is.Not, nil
Copy link
Member

Choose a reason for hiding this comment

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

should this line split into two lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we just need a parenthesis

@coocood
Copy link
Member

coocood commented Sep 10, 2015

LGTM

1 similar comment
@qiuyesuifeng
Copy link
Member

LGTM

siddontang added a commit that referenced this pull request Sep 10, 2015
@siddontang siddontang merged commit 44d0a7c into master Sep 10, 2015
@siddontang siddontang deleted the siddontang/dev-row-constructor branch September 10, 2015 03:23
YuJuncen pushed a commit to YuJuncen/tidb that referenced this pull request Apr 23, 2021
* *: added support for storing checkpoint at local filesystem

* config, tests: change default checkpoint driver to "file"

* mydump: regenerate the parser to avoid golang/go#27350 during coverage

* checkpoints: addressed comments
xhebox pushed a commit to xhebox/tidb that referenced this pull request Sep 28, 2021
xhebox pushed a commit to xhebox/tidb that referenced this pull request Oct 8, 2021
okJiang pushed a commit to okJiang/tidb that referenced this pull request Oct 19, 2021
iosmanthus pushed a commit to iosmanthus/tidb that referenced this pull request Oct 31, 2022
Signed-off-by: disksing <i@disksing.com>

Signed-off-by: disksing <i@disksing.com>
Co-authored-by: ystaticy <y_static_y@sina.com>
mittalrishabh pushed a commit to mittalrishabh/tidb that referenced this pull request May 30, 2024
close pingcap#53037

Co-authored-by: Michael Deng <33045922+michaelmdeng@users.noreply.github.com>
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.

4 participants