diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-26 22:58:41 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-26 22:58:41 +0300 |
commit | 99fa7c6c2f9c8d705481bec35f7c4af48848cf70 (patch) | |
tree | 1a479bdeaef6e4f2e874ce0274d9f577b5b828ce | |
parent | 2898c7ec9e5c76a6c6bba41c9d3f5a738cf2790a (diff) | |
parent | b4c5e4a717e3ce2c2d434106cc74417fe9a1d3dc (diff) | |
download | mariadb-git-99fa7c6c2f9c8d705481bec35f7c4af48848cf70.tar.gz |
Merge 10.2 into 10.3
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-isolation.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-isolation.test | 1 | ||||
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 13 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 51 | ||||
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 10 | ||||
-rw-r--r-- | storage/innobase/log/log0log.cc | 3 | ||||
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 15 |
8 files changed, 33 insertions, 70 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-isolation.result b/mysql-test/suite/innodb/r/innodb-isolation.result index 2248d25b39a..ce9c530ff44 100644 --- a/mysql-test/suite/innodb/r/innodb-isolation.result +++ b/mysql-test/suite/innodb/r/innodb-isolation.result @@ -1335,11 +1335,17 @@ UPDATE t6 SET b = "updated by client 2"; SELECT * FROM t6; a b aa bb 1 inserted by client 1 1 inserted by client 1 -2 updated by client 2 2 inserted by client 1 +2 inserted by client 1 2 inserted by client 1 3 inserted by client 1 3 inserted by client 1 4 updated by client 2 4 inserted by client 1 5 updated by client 2 NULL NULL 10 updated by client 2 1 inserted by client 1 +SELECT * FROM t6 LOCK IN SHARE MODE; +a b aa bb +2 updated by client 2 2 inserted by client 1 +4 updated by client 2 4 inserted by client 1 +5 updated by client 2 NULL NULL +10 updated by client 2 1 inserted by client 1 SELECT COUNT(*) FROM t6; COUNT(*) 6 diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index aafd31ae6f1..86f90c2bd79 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1701,7 +1701,7 @@ variable_value - @innodb_rows_inserted_orig 964 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; variable_value - @innodb_rows_updated_orig -866 +865 SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'; variable_value - @innodb_row_lock_waits_orig 0 diff --git a/mysql-test/suite/innodb/t/innodb-isolation.test b/mysql-test/suite/innodb/t/innodb-isolation.test index 56cd668b305..d00fefb9fc6 100644 --- a/mysql-test/suite/innodb/t/innodb-isolation.test +++ b/mysql-test/suite/innodb/t/innodb-isolation.test @@ -301,6 +301,7 @@ SELECT COUNT(*) FROM t5; UPDATE t6 SET b = "updated by client 2"; SELECT * FROM t6; +SELECT * FROM t6 LOCK IN SHARE MODE; SELECT COUNT(*) FROM t6; DELETE FROM t7; diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 2e7058ebdd3..b45720a3313 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -1417,12 +1417,13 @@ dict_check_sys_tables( continue; } - /* If the table is not a predefined tablespace then it must - be in a file-per-table tablespace. - Note that flags2 is not available for REDUNDANT tables, - so don't check those. */ - ut_ad(!DICT_TF_GET_COMPACT(flags) - || flags2 & DICT_TF2_USE_FILE_PER_TABLE); + /* For tables or partitions using .ibd files, the flag + DICT_TF2_USE_FILE_PER_TABLE was not set in MIX_LEN + before MySQL 5.6.5. The flag should not have been + introduced in persistent storage. MariaDB will keep + setting the flag when writing SYS_TABLES entries for + newly created or rebuilt tables or partitions, but + will otherwise ignore the flag. */ /* Now that we have the proper name for this tablespace, look to see if it is already in the tablespace cache. */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 72571217596..2940184ff91 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3620,7 +3620,6 @@ innobase_init( int err; char *default_path; ulong num_pll_degree; - ulint srv_buf_pool_size_org = 0; DBUG_ENTER("innobase_init"); handlerton* innobase_hton= (handlerton*) p; @@ -4128,31 +4127,9 @@ innobase_change_buffering_inited_ok: mysql_cond_register("innodb", all_innodb_conds, count); #endif /* HAVE_PSI_INTERFACE */ - /* Set buffer pool size to default for fast startup when mysqld is - run with --help --verbose options. */ - /* JAN: TODO: MySQL 5.7 has opt_verbose - if (opt_help && opt_verbose - && srv_buf_pool_size > srv_buf_pool_def_size) { - ib::warn() << "Setting innodb_buf_pool_size to " - << srv_buf_pool_def_size << " for fast startup, " - << "when running with --help --verbose options."; - srv_buf_pool_size_org = srv_buf_pool_size; - srv_buf_pool_size = srv_buf_pool_def_size; - } - */ - err = innobase_start_or_create_for_mysql(); - if (srv_buf_pool_size_org != 0) { - /* Set the original value back to show in help. */ - srv_buf_pool_size_org = - buf_pool_size_align(srv_buf_pool_size_org); - innobase_buffer_pool_size = - static_cast<long long>(srv_buf_pool_size_org); - } else { - innobase_buffer_pool_size = - static_cast<long long>(srv_buf_pool_size); - } + innobase_buffer_pool_size = static_cast<long long>(srv_buf_pool_size); if (err != DB_SUCCESS) { innodb_shutdown(); @@ -8822,7 +8799,13 @@ ha_innobase::update_row( goto func_exit; } - { + if (!uvect->n_fields) { + /* This is the same as success, but instructs + MySQL that the row is not really updated and it + should not increase the count of updated rows. + This is fix for http://bugs.mysql.com/29157 */ + DBUG_RETURN(HA_ERR_RECORD_IS_THE_SAME); + } else { const bool vers_set_fields = m_prebuilt->versioned_write && m_prebuilt->upd_node->update->affects_versioned(); const bool vers_ins_row = vers_set_fields @@ -8879,20 +8862,12 @@ ha_innobase::update_row( innobase_srv_conc_exit_innodb(m_prebuilt); func_exit: - - err = convert_error_code_to_mysql( - error, m_prebuilt->table->flags, m_user_thd); - - /* If success and no columns were updated. */ - if (err == 0 && uvect->n_fields == 0) { - - /* This is the same as success, but instructs - MySQL that the row is not really updated and it - should not increase the count of updated rows. - This is fix for http://bugs.mysql.com/29157 */ - err = HA_ERR_RECORD_IS_THE_SAME; - } else if (err == HA_FTS_INVALID_DOCID) { + if (error == DB_FTS_INVALID_DOCID) { + err = HA_FTS_INVALID_DOCID; my_error(HA_FTS_INVALID_DOCID, MYF(0)); + } else { + err = convert_error_code_to_mysql( + error, m_prebuilt->table->flags, m_user_thd); } /* Tell InnoDB server that there might be work for diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 01710a0e93a..b0e78e77f2c 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1450,16 +1450,8 @@ bool dict_table_is_file_per_table( const dict_table_t* table) /*!< in: table to check */ { - bool is_file_per_table = table->space != fil_system.sys_space + return table->space != fil_system.sys_space && table->space != fil_system.temp_space; - - /* If the table is file-per-table and it is not redundant, then - it should have the flags2 bit for DICT_TF2_USE_FILE_PER_TABLE. */ - ut_ad(!is_file_per_table - || !DICT_TF_GET_COMPACT(table->flags) - || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_USE_FILE_PER_TABLE)); - - return(is_file_per_table); } /** Get reference count. diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 1f217cf3526..002572df6aa 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -2104,6 +2104,9 @@ wait_suspend_loop: goto loop; } + /* Ensure that all buffered changes are written to the + redo log before fil_close_all_files(). */ + fil_flush_file_spaces(FIL_TYPE_LOG); } else { lsn = srv_start_lsn; } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index c41dba2366d..49337c684ab 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -108,11 +108,6 @@ Created 2/16/1996 Heikki Tuuri #include "btr0scrub.h" #include "ut0new.h" -#ifdef HAVE_LZO1X -#include <lzo/lzo1x.h> -extern bool srv_lzo_disabled; -#endif /* HAVE_LZO1X */ - /** Log sequence number immediately after startup */ lsn_t srv_start_lsn; /** Log sequence number at shutdown */ @@ -1492,16 +1487,6 @@ innobase_start_or_create_for_mysql() srv_use_doublewrite_buf = FALSE; } -#ifdef HAVE_LZO1X - if (lzo_init() != LZO_E_OK) { - ib::warn() << "lzo_init() failed, support disabled"; - srv_lzo_disabled = true; - } else { - ib::info() << "LZO1X support available"; - srv_lzo_disabled = false; - } -#endif /* HAVE_LZO1X */ - compile_time_assert(sizeof(ulint) == sizeof(void*)); #ifdef UNIV_DEBUG |