[MDEV-3943] MySQL opening .frm even when table is in table definition cache Created: 2012-12-17 Updated: 2014-10-20 Resolved: 2014-10-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.0, 5.5.28a, 5.3.11, 5.2.13, 5.1.66 |
| Fix Version/s: | 10.0.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Arjen Lentz | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
any |
||
| Description |
|
MySQL opening .frm even when table is in table definition cache |
| Comments |
| Comment by Sergei Golubchik [ 2012-12-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
According to Monty, this only happens for LOCK TABLES on a view and SHOW TABLES | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2012-12-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The original post indicates that it happens for various DDL operations, but also any general "open table". Will just doing a select on a table twice should do the trick? If we have a method to trigger the situation (if it still exists), then someone testing something else with a debug or trace could check this on the side some time soon - or I can do it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2012-12-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just doing select on a table will not open the .frm twice (just verified it). It can easily be checked by examining 'opened_files' in show status. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2012-12-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is mainly a problem with VIEW and DROP and RENAME TABLE. At least the DROP TABLE issue should be worth fixing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2012-12-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Stewart Smith pasted something into #maria when Monty, he and I were discussing this topic 2012-12-18. I think the bit I was talking about is op open_table() in sql_base.cc, namely this bit /* if (dd_frm_type(thd, path, ¬_used) == FRMTYPE_VIEW) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like it was fixed in 10.0.2, my suspicion is – as a part of table discovery implementation. See strace fragments related to t1.frm and t2.frm for 10.0.1 and 10.0.2 for the following test case:
So, I'm closing it as fixed in 10.0 (set 10.0.6 in Fix version because it's the lowest available on the list, but in fact it's 10.0.2). |