dolthub / dolthub/dolt

Global system variables don't update in other sessions

Open
#10,153 0 comments 0 reactions 0 assignees View on GitHub
bug correctness
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

System variables that **only** exist at a global scope (i.e. not at global and session scopes) should have changes visible in all sessions immediately when they are updated. Dolt currently seems to make a session-scoped copy of the system variable when the session is created and the global value can only be seen when explicitly using the `GLOBAL` keyword.

## MySQL 8.0 Behavior
```
-- Session 1:
select @@gtid_purged;
+---------------+
| @@gtid_purged |
+---------------+
| |
+---------------+
1 row in set (0.00 sec)

-- Session 2:
set @@GLOBAL.gtid_purged='9765edf2-82d5-11f0-99b2-ce1c22533a29:1-2';
Query OK, 0 rows affected (0.00 sec)

-- Session 1:
select @@gtid_purged;
+------------------------------------------+
| @@gtid_purged |
+------------------------------------------+
| 9765edf2-82d5-11f0-99b2-ce1c22533a29:1-2 |
+------------------------------------------+
1 row in set (0.00 sec)
```

## Dolt 1.78.5 Behavior
```
-- Session 1:
select @@gtid_purged;
+---------------+
| @@gtid_purged |
+---------------+
| |
+---------------+
1 row in set (0.00 sec)

-- Session 2:
set @@GLOBAL.gtid_purged='9765edf2-82d5-11f0-99b2-ce1c22533a29:1-2';
Query OK, 0 rows affected (0.00 sec)

-- Session 1:
select @@gtid_purged;
+---------------+
| @@gtid_purged |
+---------------+
| |
+---------------+
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.