[MDEV-11225] SELECT from view, which was replaced in prepared statement inside cursor, gives wrong result Created: 2016-11-02 Updated: 2022-11-29 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements, Views |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Wolfgang Walther | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.22 | ||||||||
| Description |
|
Affects earlier versions as well. The following creates and replaces a view pointing to different tables within prepared statements inside a cursor. While still in the cursor a SELECT from the replaced view yields results from the table referenced previously, the view doesn't seem to be updated. SHOW CREATE VIEW gives correct results, though. Test case:
|
| Comments |
| Comment by Elena Stepanova [ 2016-11-03 ] |
|
Thanks for the report. Reproducible as described on all of 5.5-10.2. |
| Comment by Oleksandr Byelkin [ 2017-03-05 ] |
|
Problem is that view detect prepare on previous execution and do not try to process it second time. It is in mysql_make_view "if (table->view)" branch. |
| Comment by Oleksandr Byelkin [ 2017-03-05 ] |
|
need to talk with somebody about memory allocation in this scenario (there is solution but this in general should allocate memory for each view definition). |
| Comment by Oleksandr Byelkin [ 2017-03-06 ] |
|
in mysql we have new TABLE_LIST object on each SELECT execution. |
| Comment by Oleksandr Byelkin [ 2017-03-07 ] |
|
It looks like we lack this https://dev.mysql.com/worklog/task/?id=4179 |