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

create global binding on global temporary table not prohibited #26377

Closed
tiancaiamao opened this issue Jul 20, 2021 · 3 comments · Fixed by #27347
Closed

create global binding on global temporary table not prohibited #26377

tiancaiamao opened this issue Jul 20, 2021 · 3 comments · Fixed by #27347
Assignees
Labels
severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

tiancaiamao commented Jul 20, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> show create table t1;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                               |
+-------+------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                      |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE GLOBAL TEMPORARY TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL,
  KEY `a` (`a`),
  KEY `b` (`b`),
  KEY `idx` (`a`)
) ENGINE=memory DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ON COMMIT DELETE ROWS |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> create global binding for select * from t1 where t1.a in (select a from t) using select * from t1 where t1.a in (select a from t use index (a));
Query OK, 0 rows affected (0.00 sec)

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

Create binding on global temporary table should report error #25058

3. What did you see instead (Required)

Binding created, no error.

4. What is your TiDB version? (Required)

master

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                                       |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0-alpha-334-g0c7ff7fcb-dirty
Edition: Community
Git Commit Hash: 0c7ff7fcb6533f48156345aac1f1be186a2a4f12
Git Branch: issue-26250
UTC Build Time: 2021-07-20 08:30:56
GoVersion: go1.16.6
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@tiancaiamao tiancaiamao added the type/bug The issue is confirmed as a bug. label Jul 20, 2021
@tiancaiamao tiancaiamao self-assigned this Jul 20, 2021
@aytrack aytrack added the sig/planner SIG: Planner label Jul 20, 2021
@yudongusa
Copy link

@tiancaiamao So this issue is to be resolved by PR 25058? Please assign it to winoros to code review as eurekaka is currently out of office.

@tiancaiamao
Copy link
Contributor Author

It's a bug regression @yudongusa

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants