dolthub / dolthub/dolt

incorrect result when querying global only system variable without specifying the scope

Open
#7,596 1 comment 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bug correctness
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

When a scope of system variable is not specified, Dolt uses SESSION by default, which causes this issue.
Dolt:
```
test/main> SELECT @@GLOBAL.activate_all_roles_on_login;
+--------------------------------------+
| @@GLOBAL.activate_all_roles_on_login |
+--------------------------------------+
| 0 |
+--------------------------------------+
1 row in set (0.00 sec)
test/main> SET @@GLOBAL.activate_all_roles_on_login = true;
test/main> SELECT @@GLOBAL.activate_all_roles_on_login;
+--------------------------------------+
| @@GLOBAL.activate_all_roles_on_login |
+--------------------------------------+
| 1 |
+--------------------------------------+
1 row in set (0.00 sec)

test/main> SELECT @@activate_all_roles_on_login;
+-------------------------------+
| @@activate_all_roles_on_login |
+-------------------------------+
| 0 |
+-------------------------------+
1 row in set (0.00 sec)
```
MySQL:
```
mysql> SELECT @@GLOBAL.activate_all_roles_on_login;
+--------------------------------------+
| @@GLOBAL.activate_all_roles_on_login |
+--------------------------------------+
| 0 |
+--------------------------------------+
1 row in set (0.00 sec)

mysql> SET @@GLOBAL.activate_all_roles_on_login = true;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT @@GLOBAL.activate_all_roles_on_login;
+--------------------------------------+
| @@GLOBAL.activate_all_roles_on_login |
+--------------------------------------+
| 1 |
+--------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT @@activate_all_roles_on_login;
+-------------------------------+
| @@activate_all_roles_on_login |
+-------------------------------+
| 1 |
+-------------------------------+
1 row in set (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.