revision-id: 509de900aff841863d3dff9e376ea5a63e337b7a (mariadb-10.4.4-93-g509de900aff) parent(s): 6c85bd30543e38155a77ceb8328646fbe121fa6d author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2019-05-17 13:18:09 +0200 message: more fixes --- mysql-test/main/grant4.test | 4 ++++ mysql-test/main/partition_innodb.result | 4 ++-- sql/sql_acl.cc | 2 +- sql/sql_select.cc | 6 +++++- sql/sql_statistics.cc | 2 -- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mysql-test/main/grant4.test b/mysql-test/main/grant4.test index 30f08f9eea2..a63bd158a0d 100644 --- a/mysql-test/main/grant4.test +++ b/mysql-test/main/grant4.test @@ -148,6 +148,7 @@ drop user mysqltest_u1@localhost; # # MDEV-18241 Downgrade from 10.4 to 10.3 crashes # +source include/switch_to_mysql_user.inc; call mtr.add_suppression("Table 'mysql.user' doesn't exist"); call mtr.add_suppression("'mysql.user' is not of type 'TABLE'"); rename table mysql.user to mysql.user1; @@ -160,10 +161,12 @@ create temporary table mysql.user select * from mysql.user1 limit 0; flush privileges; drop temporary table mysql.user; rename table mysql.user1 to mysql.user; +source include/switch_to_mysql_global_priv.inc; # # Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH # +source include/switch_to_mysql_user.inc; call mtr.add_suppression('mysql.user table is damaged'); rename table mysql.user to mysql.user1; create table mysql.user (Host char(100), User char(100)); @@ -171,6 +174,7 @@ create table mysql.user (Host char(100), User char(100)); flush privileges; drop table mysql.user; rename table mysql.user1 to mysql.user; +source include/switch_to_mysql_global_priv.inc; --echo End of 5.5 tests diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result index cf1248663e4..c0f36a284fd 100644 --- a/mysql-test/main/partition_innodb.result +++ b/mysql-test/main/partition_innodb.result @@ -417,11 +417,11 @@ t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL par insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 InnoDB 10 Dynamic 5 3276 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned 0 N +t1 InnoDB 10 Dynamic 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned 0 N insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 InnoDB 10 Dynamic 9 1820 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned 0 N +t1 InnoDB 10 Dynamic 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned 0 N drop table t1; create table t1 (a int) partition by key (a) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index a649ad0e335..f1d77c3d6d6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1842,7 +1842,7 @@ class Grant_tables TABLE_LIST *tl= tables + USER_TABLE; tl->init_one_table(&MYSQL_SCHEMA_NAME, &MYSQL_TABLE_NAME_USER, NULL, lock_type); - tl->updating= lock_type >= TL_WRITE_ALLOW_WRITE; + tl->i_s_requested_object= OPEN_TABLE_ONLY; p_user_table= &m_user_table_tabular; counter++; res= really_open(thd, tl, &unused); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 21fab0cf07b..af52255b6ff 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17410,7 +17410,11 @@ Field *Item::tmp_table_field_from_field_type_maybe_null(TABLE *table, const Tmp_field_param *param, bool is_explicit_null) { - DBUG_ASSERT(!param->make_copy_field()); + /* + item->type() == CONST_ITEM excluded due to making fields for counter + With help of Item_uint + */ + DBUG_ASSERT(!param->make_copy_field() || type() == CONST_ITEM); DBUG_ASSERT(!is_result_field()); Field *result; if ((result= tmp_table_field_from_field_type(table))) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 2bc4296e4ed..86a6e1c2222 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -4151,8 +4151,6 @@ bool is_eits_usable(Field *field) if (!col_stats) return false; - DBUG_ASSERT(field->table->stats_is_read); - /* (1): checks if we have EITS statistics for a particular column (2): Don't use EITS for GEOMETRY columns