[MDEV-7753] Regression on executing prepare statement Created: 2015-03-11 Updated: 2020-08-25 Due: 2015-04-08 Resolved: 2015-03-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 10.0.16 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | VAROQUI Stephane | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
REHL5 |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Hello, After migration from MariaDB 5.5 to 10.0.16 the value of table_definition_cache have change to the table_open_cache that was set to 400 , this was a regression to the default 1024 value proposed in 5.5. and produced some unexpected new error s on the API Prepared statement needs to be re-prepared (1615). Raising table_definition_cache to 1024 fixed the issue. Why the value of a cache would make queries to failed is an other question |
| Comments |
| Comment by Sergei Golubchik [ 2015-03-11 ] |
|
What is the bug here? |
| Comment by VAROQUI Stephane [ 2015-03-11 ] |
|
Why the success of the execution of a prepare statement is tied to the value of a server cache variable. For me that's a bug but i may be wrong and miss educated here ! |
| Comment by Sergei Golubchik [ 2015-03-11 ] |
|
A prepared statement needs to be re-prepared if any of its tables is ALTER-ed. For example, if you prepare SELECT * FROM t1 and somebody adds a new column to the table, then your prepared statement will have different metadata — number of columns, and it needs to be re-prepared to notice that. There are no persistent table metadata versions in MySQL, so when a table is reopened, the server assumes that table metadata might have changed, there is no way to detect it in MySQL. That's why when you make the table definition cache smaller, and tables are pushed out of the cache more often, you'll have re-prepares more often. So, it's not a bug. But in MariaDB we do have a persistent table metadata version, though. If we'll use it for this, it will make spurious re-prepares go away. It is MDEV-4261. |
| Comment by VAROQUI Stephane [ 2015-03-11 ] |
|
Thanks Sergei, that all clear now |