[MDEV-28335] TABLE_TYPE for temporary sequences is the same as for permanent ones Created: 2022-04-17 Updated: 2023-08-12 Resolved: 2023-08-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Temporary, Information Schema, Sequences |
| Affects Version/s: | N/A |
| Fix Version/s: | 11.2.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Anel Husakovic |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
|
| Comments |
| Comment by Anel Husakovic [ 2022-04-18 ] | ||||||||||||
|
I have updated | ||||||||||||
| Comment by Elena Stepanova [ 2022-04-18 ] | ||||||||||||
|
It is still a bit of a problem (although a small one, considering the low probability of using temporary sequences in real life and even lower probability of overshadowing). Suppose we have
The old version of sys.table_exists, even though it doesn't understand sequences at all (see However, the new version fails with
– understandably, since the check for TABLE_TYPE = 'temporary' returns nothing, and the next SELECT returns both rows. | ||||||||||||
| Comment by Anel Husakovic [ 2022-04-19 ] | ||||||||||||
|
I don't know the sys schema code and I don't know how did you get result from above (I understand that is from the latest patch and why did it fail but don't know how sys schema should be tested)? | ||||||||||||
| Comment by Anel Husakovic [ 2022-05-04 ] | ||||||||||||
|
V can you please review https://github.com/MariaDB/server/commit/676b16eedc4dd42815969ee5f74d6e54f8a276d0 | ||||||||||||
| Comment by Vicențiu Ciorbaru [ 2022-05-31 ] | ||||||||||||
|
anel The commit you linked only seems to contain the test case, not the actual code changes and I can't figure out from the log which other commit I'm supposed to look at as it seems Monty reviewed the other ones. Can you please create a commit that covers the changes required by this MDEV and then send it for review? The test case does show that having 2 tables (or rather sequences), one shadowing the other one makes sys.table_exists return the type of the one that's visible. That's ok (I think). We need to document this behavior properly. https://mariadb.com/kb/en/sys-schema/ has no info at all regarding this intended behaviour. https://dev.mysql.com/doc/refman/8.0/en/sys-table-exists.html does, but MySQL does not have any temporary sequences. Additionally, from the test case the output doesn't match what I would expect the output of sys.table_exists to be. Like elenst mentioned, when executing the stored procedure on a temporary sequence one gets a close-to-valid TEMPORARY. I would extend the behavior for it to properly say TEMPORARY SEQUENCE when we do pass it a temporary sequence, much like you extended it to say SEQUENCE. greenman remember this MDEV when documenting sys_schema. | ||||||||||||
| Comment by Anel Husakovic [ 2022-07-26 ] | ||||||||||||
|
PR 2189 created MDEV-28335 | ||||||||||||
| Comment by Vicențiu Ciorbaru [ 2023-04-18 ] | ||||||||||||
|
This MDEV covers the last review comment from We will introduce TEMPORARY SEQUENCE as a string in I_S.tables.
Anel, please close this when that patch is pushed. |