diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-24 09:39:45 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-24 09:39:45 +0300 |
commit | 4cd7979c56130194cc3742e1037998d11f98c047 (patch) | |
tree | 70131981da1d874d68b9e8cc8e7bf293e405907e /storage | |
parent | 619dc2b24f26aea29345dc3f3289bed406738025 (diff) | |
parent | 9c34a4124d67d9e3f70837eaeb11290f35e8f8d0 (diff) | |
download | mariadb-git-4cd7979c56130194cc3742e1037998d11f98c047.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 2 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 5 | ||||
-rw-r--r-- | storage/innobase/handler/handler0alter.cc | 11 | ||||
-rw-r--r-- | storage/innobase/include/data0type.ic | 2 | ||||
-rw-r--r-- | storage/innobase/page/page0page.cc | 16 | ||||
-rw-r--r-- | storage/oqgraph/graphcore-config.h | 2 | ||||
-rw-r--r-- | storage/oqgraph/oqgraph_shim.h | 3 | ||||
-rw-r--r-- | storage/xtradb/dict/dict0load.cc | 6 | ||||
-rw-r--r-- | storage/xtradb/handler/handler0alter.cc | 12 | ||||
-rw-r--r-- | storage/xtradb/include/data0type.ic | 2 | ||||
-rw-r--r-- | storage/xtradb/page/page0page.cc | 17 |
11 files changed, 36 insertions, 42 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 3606b902510..67f863ee907 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -2674,11 +2674,13 @@ dict_load_table_low(table_name_t& name, const rec_t* rec, dict_table_t** table) ulint n_v_col; if (const char* error_text = dict_sys_tables_rec_check(rec)) { + *table = NULL; return(error_text); } if (!dict_sys_tables_rec_read(rec, name, &table_id, &space_id, &t_num, &flags, &flags2)) { + *table = NULL; return(dict_load_table_flags); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 3f707e5e631..9eb924b6595 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1,10 +1,10 @@ /***************************************************************************** -Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2018, MariaDB Corporation. +Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2013, 2018, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -15641,6 +15641,7 @@ ha_innobase::start_stmt( case SQLCOM_INSERT: case SQLCOM_UPDATE: case SQLCOM_DELETE: + case SQLCOM_REPLACE: init_table_handle_for_HANDLER(); m_prebuilt->select_lock_type = LOCK_X; m_prebuilt->stored_select_lock_type = LOCK_X; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 02a8428cdc9..d064ebccfe2 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -2593,14 +2593,9 @@ innobase_create_key_defs( ulint primary_key_number; if (new_primary) { - if (n_add == 0) { - DBUG_ASSERT(got_default_clust); - DBUG_ASSERT(altered_table->s->primary_key - == 0); - primary_key_number = 0; - } else { - primary_key_number = *add; - } + DBUG_ASSERT(n_add || got_default_clust); + DBUG_ASSERT(n_add || !altered_table->s->primary_key); + primary_key_number = altered_table->s->primary_key; } else if (got_default_clust) { /* Create the GEN_CLUST_INDEX */ index_def_t* index = indexdef++; diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index c0b32953cff..59f8c75fd65 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -479,6 +479,7 @@ dtype_get_fixed_size_low( return(0); } #endif /* UNIV_DEBUG */ + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: @@ -552,6 +553,7 @@ dtype_get_min_size_low( return(0); } #endif /* UNIV_DEBUG */ + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index c33623e9398..1b010448135 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -87,17 +87,13 @@ page_dir_find_owner_slot( /*=====================*/ const rec_t* rec) /*!< in: the physical record */ { - const page_t* page; - register uint16 rec_offs_bytes; - register const page_dir_slot_t* slot; - register const page_dir_slot_t* first_slot; - register const rec_t* r = rec; - ut_ad(page_rec_check(rec)); - page = page_align(rec); - first_slot = page_dir_get_nth_slot(page, 0); - slot = page_dir_get_nth_slot(page, page_dir_get_n_slots(page) - 1); + const page_t* page = page_align(rec); + const page_dir_slot_t* first_slot = page_dir_get_nth_slot(page, 0); + const page_dir_slot_t* slot = page_dir_get_nth_slot( + page, page_dir_get_n_slots(page) - 1); + const rec_t* r = rec; if (page_is_comp(page)) { while (rec_get_n_owned_new(r) == 0) { @@ -113,7 +109,7 @@ page_dir_find_owner_slot( } } - rec_offs_bytes = mach_encode_2(r - page); + uint16 rec_offs_bytes = mach_encode_2(r - page); while (UNIV_LIKELY(*(uint16*) slot != rec_offs_bytes)) { diff --git a/storage/oqgraph/graphcore-config.h b/storage/oqgraph/graphcore-config.h index 2afb7dfbcd6..3ef9da152ad 100644 --- a/storage/oqgraph/graphcore-config.h +++ b/storage/oqgraph/graphcore-config.h @@ -27,6 +27,8 @@ #define BOOST_ALL_NO_LIB 1 #define BOOST_NO_RTTI 1 #define BOOST_NO_TYPEID 1 +#define BOOST_NO_HASH 1 +#define BOOST_NO_SLIST 1 #ifdef DBUG_OFF #define NDEBUG 1 diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h index df578c9e4d0..aab6e797306 100644 --- a/storage/oqgraph/oqgraph_shim.h +++ b/storage/oqgraph/oqgraph_shim.h @@ -27,9 +27,6 @@ #include "oqgraph_judy.h" #include "oqgraph_thunk.h" -#define BOOST_NO_HASH 1 -#define BOOST_NO_SLIST 1 - #include <boost/graph/directed_graph.hpp> #include <boost/graph/adjacency_iterator.hpp> diff --git a/storage/xtradb/dict/dict0load.cc b/storage/xtradb/dict/dict0load.cc index 4c3dd47761f..1ff444b05c0 100644 --- a/storage/xtradb/dict/dict0load.cc +++ b/storage/xtradb/dict/dict0load.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2017, MariaDB Corporation. +Copyright (c) 2016, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2088,10 +2088,12 @@ dict_load_table_low( ulint flags2; if (rec_get_deleted_flag(rec, 0)) { + *table = NULL; return("delete-marked record in SYS_TABLES"); } if (rec_get_n_fields_old(rec) != DICT_NUM_FIELDS__SYS_TABLES) { + *table = NULL; return("wrong number of columns in SYS_TABLES record"); } @@ -2099,6 +2101,7 @@ dict_load_table_low( rec, DICT_FLD__SYS_TABLES__NAME, &len); if (len == 0 || len == UNIV_SQL_NULL) { err_len: + *table = NULL; return("incorrect column length in SYS_TABLES"); } rec_get_nth_field_offs_old( @@ -2178,6 +2181,7 @@ err_len: "InnoDB: in InnoDB data dictionary" " has unknown type %lx.\n", (ulong) flags); + *table = NULL; return("incorrect flags in SYS_TABLES"); } diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index d5faaabc9d2..90cc91dfb59 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -1622,6 +1622,7 @@ innobase_create_index_def( if (key_clustered) { DBUG_ASSERT(!(key->flags & HA_FULLTEXT)); + DBUG_ASSERT(key->flags & HA_NOSAME); index->ind_type |= DICT_CLUSTERED; } else if (key->flags & HA_FULLTEXT) { DBUG_ASSERT(!(key->flags & HA_KEYFLAG_MASK @@ -1937,14 +1938,9 @@ innobase_create_key_defs( ulint primary_key_number; if (new_primary) { - if (n_add == 0) { - DBUG_ASSERT(got_default_clust); - DBUG_ASSERT(altered_table->s->primary_key - == 0); - primary_key_number = 0; - } else { - primary_key_number = *add; - } + DBUG_ASSERT(n_add || got_default_clust); + DBUG_ASSERT(n_add || !altered_table->s->primary_key); + primary_key_number = altered_table->s->primary_key; } else if (got_default_clust) { /* Create the GEN_CLUST_INDEX */ index_def_t* index = indexdef++; diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic index 96b001e197e..a7e2eb0682c 100644 --- a/storage/xtradb/include/data0type.ic +++ b/storage/xtradb/include/data0type.ic @@ -525,6 +525,7 @@ dtype_get_fixed_size_low( return(0); } #endif /* UNIV_DEBUG */ + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: @@ -602,6 +603,7 @@ dtype_get_min_size_low( return(0); } #endif /* UNIV_DEBUG */ + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: diff --git a/storage/xtradb/page/page0page.cc b/storage/xtradb/page/page0page.cc index fc93eebd445..e21880c2d4b 100644 --- a/storage/xtradb/page/page0page.cc +++ b/storage/xtradb/page/page0page.cc @@ -2,6 +2,7 @@ Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -98,17 +99,13 @@ page_dir_find_owner_slot( /*=====================*/ const rec_t* rec) /*!< in: the physical record */ { - const page_t* page; - register uint16 rec_offs_bytes; - register const page_dir_slot_t* slot; - register const page_dir_slot_t* first_slot; - register const rec_t* r = rec; - ut_ad(page_rec_check(rec)); - page = page_align(rec); - first_slot = page_dir_get_nth_slot(page, 0); - slot = page_dir_get_nth_slot(page, page_dir_get_n_slots(page) - 1); + const page_t* page = page_align(rec); + const page_dir_slot_t* first_slot = page_dir_get_nth_slot(page, 0); + const page_dir_slot_t* slot = page_dir_get_nth_slot( + page, page_dir_get_n_slots(page) - 1); + const rec_t* r = rec; if (page_is_comp(page)) { while (rec_get_n_owned_new(r) == 0) { @@ -124,7 +121,7 @@ page_dir_find_owner_slot( } } - rec_offs_bytes = mach_encode_2(r - page); + uint16 rec_offs_bytes = mach_encode_2(r - page); while (UNIV_LIKELY(*(uint16*) slot != rec_offs_bytes)) { |