You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What did you do?
In TiDB, the current_user() function appears to just be an alias of the user() function. In MySQL these have differing behaviors.
What did you expect to see?
mysql [localhost] {root} ((none)) > CREATE USER 'testuser';
Query OK, 0 rows affected (0.00 sec)
..
mysql [localhost] {testuser} ((none)) > SELECT USER(), CURRENT_USER();
+--------------------+----------------+
| USER() | CURRENT_USER() |
+--------------------+----------------+
| testuser@localhost | testuser@% |
+--------------------+----------------+
1 row in set (0.00 sec)
Note that current_user() shows the same user you would see in SHOW GRANTS. This is useful for corner cases where multiple users could apply (the MySQL privilege system is weird).
What did you see instead?
MySQL [(none)]> SELECT USER(), CURRENT_USER();
+--------------------+--------------------+
| USER() | CURRENT_USER() |
+--------------------+--------------------+
| testuser@127.0.0.1 | testuser@127.0.0.1 |
+--------------------+--------------------+
1 row in set (0.00 sec)
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v2.1.0-rc.1-13-g1255973
Git Commit Hash: 1255973764f72575d71920b95fc0861d1677c6c5
Git Branch: master
UTC Build Time: 2018-08-28 07:35:57
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
In TiDB, the
current_user()
function appears to just be an alias of theuser()
function. In MySQL these have differing behaviors.Note that
current_user()
shows the same user you would see inSHOW GRANTS
. This is useful for corner cases where multiple users could apply (the MySQL privilege system is weird).tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: