[MDEV-25217] optimizer stops working inside stored procedure in another database Created: 2021-03-22 Updated: 2021-03-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Storage Engine - InnoDB |
| Affects Version/s: | 10.5.9 |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip orleans | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Description |
|
I have a table with two fields
I write a simple stored procedure
and the explanation is correct, it uses the primary key now I create the same exact stored procedure in another database, and the optimizer never finds the proper key, and even if I use force index or force key, it takes forever to find the data, maybe hours:
So the optimizer cannot function when a query is fired from a stored procedure in a different database, only on its own database? |
| Comments |
| Comment by Elena Stepanova [ 2021-03-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you please paste the output of SHOW CREATE DATABASE for both databases? I think the difference is caused not by having the procedure in a different database, but having it in a database with a different charset (e.g. utf8<something> while your table is latin1).
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Philip orleans [ 2021-03-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
You are right. But this should not be the case. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Philip orleans [ 2021-03-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
One question, Elena. I need to install Mariadb from the installer, but as root, because this is a non-privileged container and I can't give rights to user mysql on /proc/, and it needs to read some stuff. |