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

add func user() #5584

Merged
merged 1 commit into from
May 25, 2022
Merged

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented May 25, 2022

in MySQL only has function user()

We has already impl current_user so we can use this function.

 select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

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

Summary

Changelog

  • New Feature

Related Issues

Fixes #5023

in MySQL only has function user()

We has already impl current_user so we can use this function.

```
 select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)
```
@vercel
Copy link

vercel bot commented May 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) May 25, 2022 at 11:44AM (UTC)

@mergify
Copy link
Contributor

mergify bot commented May 25, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 25, 2022
@TCeason
Copy link
Collaborator Author

TCeason commented May 25, 2022

And have a question, I try to add a test on stateless test but ther has some err: test_statements_in_legacy_suites

'root'@mysqldb 19:44:26 [(none)]> set enable_planner_v2 = 1;
Query OK, 0 rows affected (0.04 sec)
Read 0 rows, 0.00 B in 0.002 sec., 0 rows/sec., 0.00 B/sec.

'root'@mysqldb 19:44:31 [(none)]> select user();
ERROR 1105 (HY000): Code: 1005, displayText = error: 
  --> SQL:1:8
  |
1 | select user()
  | ------ ^^^^ expected `*`, `IS`, `IN`, `BETWEEN`, `+`, `-`, or 46 more ...
  | |       
  | while parsing `SELECT ...`

@BohuTANG
Copy link
Member

cc @andylokandy for help, thanks.

@BohuTANG
Copy link
Member

We can do it in another PR as #5562 (comment)

@BohuTANG BohuTANG merged commit fc10848 into databendlabs:main May 25, 2022
@TCeason TCeason deleted the ISSUE-5023/support_user_func branch June 9, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Support function USER()
3 participants