summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-03-31 21:20:32 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:03:01 +0400
commit48a7ea6da3dc98f055e7aee0d05df04cfbc5855e (patch)
tree6c0de71d46cdd9269161803d7eb4db7b3f0ba91a /sql/sp_head.h
parent281f8a42ee15a7b50811f449d4070a7f753cb427 (diff)
downloadmariadb-git-48a7ea6da3dc98f055e7aee0d05df04cfbc5855e.tar.gz
Uninitialized Column_definition::pack_flag for ROW-type SP variables and their fields
Fixed that the Column_definition::pack_flag member corresponding to ROW-type SP variables and their fields was not properly initialized. This lead to sporadic test failures. Valgrind complained about jumps depending on uninitialized value in VALGRIND builds. This patch makes sure that sp_head::fill_spvar_definition() is always called for ROW variables and their fields. Additionally, fixed that a function with a scalar parameter erroneously acceptes ROWs with one fields. Now an error is returned.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 3dbed697f75..28b94732b5c 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -632,6 +632,21 @@ public:
return field_def->check(thd) ||
field_def->sp_prepare_create_field(thd, mem_root);
}
+ bool row_fill_field_definitions(THD *thd, Row_definition_list *row)
+ {
+ /*
+ Prepare all row fields. This will (among other things)
+ - convert VARCHAR lengths from character length to octet length
+ - calculate interval lengths for SET and ENUM
+ */
+ List_iterator<Spvar_definition> it(*row);
+ for (Spvar_definition *def= it++; def; def= it++)
+ {
+ if (fill_spvar_definition(thd, def))
+ return true;
+ }
+ return false;
+ }
/**
Check and prepare a Column_definition for a variable or a parameter.
*/