summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-04-24 09:26:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-04-24 09:26:40 +0300
commit9c34a4124d67d9e3f70837eaeb11290f35e8f8d0 (patch)
tree1adb4d44b9b7e7cf20e63e3ebc95ba05f7dc47e9 /storage
parent5b79303b40e31d77f616c2b797f58de41973e6a3 (diff)
parentc7bb33724826dab53831b74bc0cf7ec311eb13f0 (diff)
downloadmariadb-git-9c34a4124d67d9e3f70837eaeb11290f35e8f8d0.tar.gz
Merge 10.0 into 10.1
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/dict/dict0load.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
-rw-r--r--storage/innobase/handler/handler0alter.cc12
-rw-r--r--storage/innobase/include/data0type.ic2
-rw-r--r--storage/innobase/page/page0page.cc17
-rw-r--r--storage/oqgraph/graphcore-config.h2
-rw-r--r--storage/oqgraph/oqgraph_shim.h3
-rw-r--r--storage/xtradb/dict/dict0load.cc6
-rw-r--r--storage/xtradb/handler/handler0alter.cc12
-rw-r--r--storage/xtradb/include/data0type.ic2
-rw-r--r--storage/xtradb/page/page0page.cc17
11 files changed, 41 insertions, 43 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 4a2b6d43bbd..b2065c7c464 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 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
@@ -2067,10 +2067,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");
}
@@ -2078,6 +2080,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(
@@ -2157,6 +2160,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/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9401f737a06..d3d9313e4f7 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
@@ -14757,6 +14757,7 @@ ha_innobase::start_stmt(
case SQLCOM_INSERT:
case SQLCOM_UPDATE:
case SQLCOM_DELETE:
+ case SQLCOM_REPLACE:
init_table_handle_for_HANDLER();
prebuilt->select_lock_type = LOCK_X;
prebuilt->stored_select_lock_type = LOCK_X;
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index f8e61631dfe..28d329ea604 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1619,6 +1619,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
@@ -1934,14 +1935,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 eaa90f6d33a..c04da618a84 100644
--- a/storage/innobase/include/data0type.ic
+++ b/storage/innobase/include/data0type.ic
@@ -524,6 +524,7 @@ dtype_get_fixed_size_low(
return(0);
}
#endif /* UNIV_DEBUG */
+ /* fall through */
case DATA_CHAR:
case DATA_FIXBINARY:
case DATA_INT:
@@ -601,6 +602,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 231c0101266..2cc967129a9 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/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
@@ -93,17 +94,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) {
@@ -119,7 +116,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 6171bbd80d0..fb14a9058a5 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 2a2c466fd4f..9d76876b8a4 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)) {