summaryrefslogtreecommitdiff
path: root/sql/parse_file.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-11-13 10:10:09 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-11-13 10:10:09 +0100
commit5e63f616a7ed511e6e69581f6659f60f1ec8633b (patch)
tree5939124c3b798374f9c76f022206ca66d3f4034a /sql/parse_file.cc
parent1368a63589d0b4900f7d7efb57444c4ea34e6c26 (diff)
downloadmariadb-git-bb-10.1-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.1-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 me 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 arount is to increase TDC, other - improve version check for views (which is done here). Now in suspiciouse cases we check MD5 of the view to be sure that version really have chenged.
Diffstat (limited to 'sql/parse_file.cc')
-rw-r--r--sql/parse_file.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index f3dab4f7b2f..6f188660407 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -145,6 +145,7 @@ write_parameter(IO_CACHE *file, uchar* base, File_option *parameter)
switch (parameter->type) {
case FILE_OPTIONS_STRING:
+ case FILE_OPTIONS_FIXSTRING:
{
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
if (my_b_write(file, (const uchar *)val_s->str, val_s->length))
@@ -830,6 +831,22 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
}
ptr= eol+1;
break;
+ case FILE_OPTIONS_FIXSTRING:
+ {
+ /* string have to be allocated already and length set */
+ LEX_STRING *val= (LEX_STRING *)(base + parameter->offset);
+ DBUG_ASSERT(val->length != 0);
+ if (ptr[val->length] != '\n')
+ {
+ my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0),
+ parameter->name.str, line);
+ DBUG_RETURN(TRUE);
+ }
+ memcpy(val->str, ptr, val->length);
+ val->str[val->length]= '\0';
+ ptr+= (val->length + 1);
+ break;
+ }
case FILE_OPTIONS_TIMESTAMP:
{
/* string have to be allocated already */