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

bug: Relevant resources are not released after a thread is killed. #1352

Closed
3 tasks done
haitaoguan opened this issue Mar 3, 2023 · 4 comments · Fixed by #1353
Closed
3 tasks done

bug: Relevant resources are not released after a thread is killed. #1352

haitaoguan opened this issue Mar 3, 2023 · 4 comments · Fixed by #1353
Labels
A-bug Something isn't working

Comments

@haitaoguan
Copy link
Collaborator

haitaoguan commented Mar 3, 2023

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

###session1
mysql> use db;
Database changed
mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` bigint(10) NOT NULL,
  `c_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8
1 row in set (0.01 sec)

mysql> select count(*) from ttt;
+----------+
| count(*) |
+----------+
|  3841782 |
+----------+
1 row in set (0.01 sec)

mysql> explain select c_date
    ->   from ttt
    ->  where c_date >= date_sub(now(), interval 30 day)
    ->    AND c_date < now();

###session 2
mysql> show processlist;
......
mysql> kill 20;
Query OK, 0 rows affected (0.00 sec)

mysql> show processlist;
······
| 20 | root | localhost | charge_order | Killed  |  496 | explaining | explain select c_date
  from ttt
 where c_date >= date_sub(now(), interval 30 day)
   AND c_date <  |
......

Expected behavior

No response

How To Reproduce

No response

Environment

build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: 3e66e14
Last commit time: Date: Tue Feb 28 16:54:01 2023 +0800
Build time: Date: Thu Mar 2 17:09:04 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@haitaoguan haitaoguan added the A-bug Something isn't working label Mar 3, 2023
@stoneatom stoneatom deleted a comment from adofsauron Mar 3, 2023
@adofsauron
Copy link
Collaborator

adofsauron commented Mar 3, 2023

explain select c_date
       from ttt
      where c_date >= date_sub(now(), interval 30 day)
      AND c_date < now();

@adofsauron
Copy link
Collaborator

  1. Check whether the left and right addresses are the same

  2. Add comparisons for fetch data with ITEM_CACHE

  3. dawn_cast function encapsulated by mysql is used for downcasting to avoid runtime risks

@adofsauron
Copy link
Collaborator

65cf9db58a2c4f5372d223fb0bea4e08

@RingsC
Copy link
Contributor

RingsC commented Mar 5, 2023

Nice job.

@mergify mergify bot closed this as completed in #1353 Mar 6, 2023
mergify bot pushed a commit that referenced this issue Mar 6, 2023
    1. The CACHE_ITEM type does not recurse by making a direct comparison
    2. When two referenced variables have the same address,
        they are considered to be the same value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants