pingcap / pingcap/tidb

SELECT @@session.port; should return an error

Open
#32,340 0 comments 0 reactions 1 assignee Claimed by @zimulala View on GitHub
severity/moderate sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

This is not a major issue, but a behavior difference between TiDB and MySQL in the tests (variables.test specifically):

### 1. Minimal reproduce step (Required)

```sql
SELECT @@session.port;
```

### 2. What did you expect to see? (Required)

```sql
mysql [localhost:8028] {msandbox} ((none)) > SELECT @@session.port;
ERROR 1238 (HY000): Variable 'port' is a GLOBAL variable
```

### 3. What did you see instead (Required)

```sql
tidb> SELECT @@session.port;
+----------------+
| @@session.port |
+----------------+
| 4001 |
+----------------+
1 row in set (0.00 sec)

```

### 4. What is your TiDB version? (Required)

```sql
tidb> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.5.0-alpha-305-gc0244a380
Edition: Community
Git Commit Hash: c0244a380b2e0f63c1f9a813011ce87f97740ac4
Git Branch: HEAD
UTC Build Time: 2022-02-14 16:08:55
GoVersion: go1.16.9
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.