From 1afb17047a61d7666d4c3d6e5fae97ec526693ba Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 20 Dec 2016 18:06:49 +0200 Subject: [PATCH] Fixed bugs found by mysql-test-run: - privilege_table_io.test didn't properly reset roles_mapping - Fixed memory allocation problem with CHECK CONSTRAINT, found when running --valgrind main.check_constraint --- mysql-test/suite/perfschema/r/privilege_table_io.result | 1 + mysql-test/suite/perfschema/t/privilege_table_io.test | 1 + sql/table.cc | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index f1f0946cb90..aeacd0ba011 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -15,6 +15,7 @@ optimize table mysql.proxies_priv; optimize table mysql.tables_priv; optimize table mysql.procs_priv; optimize table mysql.servers; +optimize table mysql.roles_mapping; update performance_schema.setup_consumers set enabled='YES'; update performance_schema.setup_objects set enabled='YES' where object_type='TABLE' and object_schema= 'mysql'; diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test index 35c49bf33fb..8f06be5075e 100644 --- a/mysql-test/suite/perfschema/t/privilege_table_io.test +++ b/mysql-test/suite/perfschema/t/privilege_table_io.test @@ -24,6 +24,7 @@ optimize table mysql.proxies_priv; optimize table mysql.tables_priv; optimize table mysql.procs_priv; optimize table mysql.servers; +optimize table mysql.roles_mapping; --enable_result_log # Start recording events diff --git a/sql/table.cc b/sql/table.cc index 6d11ac3d3eb..5c9d4805943 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3110,7 +3110,8 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, share->default_expressions +1)* sizeof(Field*)), &check_constraint_ptr, - (uint) ((share->table_check_constraints + 1)* + (uint) ((share->table_check_constraints + + share->field_check_constraints + 1)* sizeof(Virtual_column_info*)), NullS)) goto err;