diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-04-17 15:50:59 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-24 14:41:06 +0100 |
commit | 349283c5e7a3a338445140156e866d6ade939edf (patch) | |
tree | ee5f87b18649f9b4ac55239bce87826c0f06bc31 /sql/sql_class.h | |
parent | ecfa9361406f9007af8a808567909a519aa9984b (diff) | |
download | mariadb-git-bb-10.2-MDEV-17124.tar.gz |
MDEV-17124: mariadb 10.1.34, views and prepared statements: ERROR 1615 (HY000): Prepared statement needs to be re-preparedbb-10.2-MDEV-17124
The problem is that if table definition cache (TDC) is full of real tables
which are in tables cache, view definition can not stay there so will be
removed by its own underlying tables.
In situation above old mechanism of detection matching definition in PS
and current version always require reprepare and so prevent executing
the PS.
One work around is to increase TDC, other - improve version check for
views/triggers (which is done here). Now in suspicious cases we check:
- timestamp (ms) of the view to be sure that version really have changed;
- time (ms) of creation of a trigger related to time (ms) of statement
preparation.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 3f0fba8fc10..b9bb9c978fb 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1079,6 +1079,7 @@ public: LEX_STRING name; /* name for named prepared statements */ LEX *lex; // parse tree descriptor + ulonglong ms_prepare_time; // time of preparation in microseconds /* Points to the query associated with this statement. It's const, but we need to declare it char * because all table handlers are written |