1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-17124: mariadb 10.1.34, views and prepared statements: ERROR 1615 (HY000): Prepared statement needs to be re-prepared

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 (microseconds) of the view to be sure that version really
   have changed;
 - time (microseconds) of creation of a trigger related to time
   (microseconds) of statement preparation.
This commit is contained in:
Oleksandr Byelkin
2019-04-17 15:50:59 +02:00
parent 98e62e6317
commit f65ba9aeb7
16 changed files with 329 additions and 74 deletions

View File

@ -115,7 +115,7 @@ public:
GRANT_INFO subject_table_grants;
sql_mode_t sql_mode;
/* Store create time. Can't be mysql_time_t as this holds also sub seconds */
ulonglong create_time;
my_hrtime_t hr_create_time; // Create time timestamp in microseconds
trg_event_type event;
trg_action_time_type action_time;
uint action_order;
@ -198,7 +198,7 @@ public:
*/
List<ulonglong> definition_modes_list;
/** Create times for triggers */
List<ulonglong> create_times;
List<ulonglong> hr_create_times;
List<LEX_CSTRING> definers_list;