diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-05-15 06:15:10 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-05-15 06:15:10 +0400 |
commit | 1408e26d0b15ea95d3d017bb059cd65b53b00a86 (patch) | |
tree | 4b49aa818aeb7945561791bad577ec178abf06bc /sql/sql_tvc.cc | |
parent | f7cf60991d7d4f78ee91004d522f9417cca0f7b9 (diff) | |
download | mariadb-git-1408e26d0b15ea95d3d017bb059cd65b53b00a86.tar.gz |
MDEV-22560 Crash on a table value constructor with an SP variable
fix_fields_for_tvc() could call fix_fields() for Items that have
already been fixed before. Changing fix_fields() to fix_fields_if_needed().
Diffstat (limited to 'sql/sql_tvc.cc')
-rw-r--r-- | sql/sql_tvc.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index b4538248e07..92cd229eebb 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -52,7 +52,14 @@ bool fix_fields_for_tvc(THD *thd, List_iterator_fast<List_item> &li) while ((item= it++)) { - if (item->fix_fields(thd, 0)) + /* + Some items have already been fixed. + For example Item_splocal items get fixed in + Item_splocal::append_for_log(), which is called from subst_spvars() + while replacing their values to NAME_CONST()s. + So fix only those that have not been. + */ + if (item->fix_fields_if_needed(thd, 0)) DBUG_RETURN(true); } } |