summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-10-12 15:59:46 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-10-24 14:09:46 +0200
commit4fd6dd2d3b9bb08a3897d59160515a09fe357114 (patch)
treed9538f746e4cc44f8a4328fbb80de554f4c88084 /sql/table.cc
parente00ea301efd9e02f89341dfec3a5e0e751213ed8 (diff)
downloadmariadb-git-4fd6dd2d3b9bb08a3897d59160515a09fe357114.tar.gz
MDEV-29748 ASAN errors or server crash in File_parser::parse upon concurrent view operations
Read the version of the view share when we read definition to prevent simultaniouse access to a view table SHARE (and so its MEM_ROOT) from different threads.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 5a3e704d3ff..9dc7cabffc6 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -633,7 +633,11 @@ enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share, uint flags)
if (!share->view_def)
share->error= OPEN_FRM_ERROR_ALREADY_ISSUED;
else
+ {
share->error= OPEN_FRM_OK;
+ if (mariadb_view_version_get(share))
+ share->error= OPEN_FRM_ERROR_ALREADY_ISSUED;
+ }
}
else
share->error= OPEN_FRM_NOT_A_TABLE;