summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-18 15:45:55 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-18 15:45:55 +0300
commit45898c20928ae71f2c28dca48e66c661b9545347 (patch)
tree4b12470d4ee5dc1845d6e5680f5a67ac210195a6
parent0e3ca225ad65f14da79c9a73aeadcc2a3e1c0c2a (diff)
parent648d86615043e76633ac536b1000ba86abbc8af1 (diff)
downloadmariadb-git-45898c20928ae71f2c28dca48e66c661b9545347.tar.gz
Merge remote-tracking branch 'origin/10.0' into 10.0
-rw-r--r--client/mysqldump.c1
-rw-r--r--extra/replace.c1
-rw-r--r--mysql-test/t/mysqld--help.test1
-rw-r--r--mysql-test/unstable-tests141
-rw-r--r--mysys/ma_dyncol.c1
-rw-r--r--sql/events.cc2
-rw-r--r--sql/field.cc2
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/log.cc7
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/opt_sum.cc3
-rw-r--r--sql/slave.cc5
-rw-r--r--sql/sp_head.cc3
-rw-r--r--sql/sql_digest.cc4
-rw-r--r--sql/sql_lex.cc5
-rw-r--r--sql/sql_parse.cc6
-rw-r--r--sql/sql_plugin.cc5
-rw-r--r--sql/sql_prepare.cc4
-rw-r--r--sql/sql_show.cc3
-rw-r--r--sql/sql_table.cc3
-rw-r--r--sql/sql_yacc.yy2
-rw-r--r--storage/connect/array.cpp2
-rw-r--r--storage/connect/filamdbf.cpp4
-rw-r--r--storage/connect/filamfix.cpp3
-rw-r--r--storage/connect/filamtxt.cpp1
-rwxr-xr-xstorage/connect/filamvct.cpp3
-rw-r--r--storage/connect/filter.cpp3
-rw-r--r--storage/connect/ha_connect.cc26
-rw-r--r--storage/connect/json.cpp4
-rw-r--r--storage/connect/plgdbutl.cpp2
-rw-r--r--storage/connect/reldef.cpp1
-rw-r--r--storage/connect/tabdos.cpp1
-rw-r--r--storage/connect/tabjson.cpp2
-rw-r--r--storage/connect/value.cpp2
-rwxr-xr-xstorage/connect/xindex.cpp2
-rw-r--r--storage/connect/xobject.cpp2
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/heap/hp_create.c4
-rw-r--r--storage/innobase/btr/btr0cur.cc53
-rw-r--r--storage/innobase/buf/buf0buf.cc3
-rw-r--r--storage/innobase/fil/fil0fil.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.cc38
-rw-r--r--storage/innobase/handler/ha_innodb.h4
-rw-r--r--storage/innobase/handler/handler0alter.cc13
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc6
-rw-r--r--storage/innobase/include/btr0cur.h25
-rw-r--r--storage/innobase/include/data0type.ic4
-rw-r--r--storage/innobase/include/fil0fil.h2
-rw-r--r--storage/innobase/include/ha_prototypes.h12
-rw-r--r--storage/innobase/include/mach0data.ic15
-rw-r--r--storage/innobase/include/page0zip.ic4
-rw-r--r--storage/innobase/include/trx0rec.h11
-rw-r--r--storage/innobase/include/ut0rnd.ic7
-rw-r--r--storage/innobase/lock/lock0lock.cc12
-rw-r--r--storage/innobase/page/page0zip.cc5
-rw-r--r--storage/innobase/rem/rem0rec.cc6
-rw-r--r--storage/innobase/row/row0ftsort.cc4
-rw-r--r--storage/innobase/row/row0import.cc1
-rw-r--r--storage/innobase/row/row0ins.cc9
-rw-r--r--storage/innobase/row/row0log.cc2
-rw-r--r--storage/innobase/row/row0mysql.cc3
-rw-r--r--storage/innobase/row/row0purge.cc4
-rw-r--r--storage/innobase/srv/srv0srv.cc123
-rw-r--r--storage/innobase/sync/sync0sync.cc1
-rw-r--r--storage/innobase/trx/trx0i_s.cc4
-rw-r--r--storage/innobase/trx/trx0rec.cc45
-rw-r--r--storage/innobase/usr/usr0sess.cc3
-rw-r--r--storage/maria/ma_extra.c3
-rw-r--r--storage/maria/ma_recovery.c2
-rw-r--r--storage/myisam/mi_extra.c3
-rw-r--r--storage/sphinx/ha_sphinx.cc5
-rw-r--r--storage/spider/spd_db_conn.cc2
-rw-r--r--storage/xtradb/btr/btr0cur.cc71
-rw-r--r--storage/xtradb/buf/buf0buf.cc3
-rw-r--r--storage/xtradb/fil/fil0fil.cc6
-rw-r--r--storage/xtradb/handler/ha_innodb.cc81
-rw-r--r--storage/xtradb/handler/ha_innodb.h2
-rw-r--r--storage/xtradb/handler/handler0alter.cc12
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc6
-rw-r--r--storage/xtradb/include/btr0cur.h25
-rw-r--r--storage/xtradb/include/data0type.ic3
-rw-r--r--storage/xtradb/include/fil0fil.h2
-rw-r--r--storage/xtradb/include/ha_prototypes.h3
-rw-r--r--storage/xtradb/include/mach0data.ic15
-rw-r--r--storage/xtradb/include/page0zip.ic4
-rw-r--r--storage/xtradb/include/trx0rec.h11
-rw-r--r--storage/xtradb/include/ut0rnd.ic7
-rw-r--r--storage/xtradb/lock/lock0lock.cc12
-rw-r--r--storage/xtradb/rem/rem0rec.cc6
-rw-r--r--storage/xtradb/row/row0ftsort.cc4
-rw-r--r--storage/xtradb/row/row0import.cc1
-rw-r--r--storage/xtradb/row/row0ins.cc9
-rw-r--r--storage/xtradb/row/row0log.cc2
-rw-r--r--storage/xtradb/row/row0mysql.cc3
-rw-r--r--storage/xtradb/row/row0purge.cc4
-rw-r--r--storage/xtradb/srv/srv0srv.cc136
-rw-r--r--storage/xtradb/sync/sync0sync.cc5
-rw-r--r--storage/xtradb/trx/trx0i_s.cc4
-rw-r--r--storage/xtradb/trx/trx0rec.cc42
-rw-r--r--storage/xtradb/usr/usr0sess.cc3
-rw-r--r--strings/ctype-utf8.c10
-rw-r--r--strings/dtoa.c8
104 files changed, 574 insertions, 643 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 8ed10f1e5cb..245f24dd508 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2142,6 +2142,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
case '-':
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
break;
+ /* fall through */
default:
fputc(*comment_string, xml_file);
break;
diff --git a/extra/replace.c b/extra/replace.c
index 56cf02f2002..465c0c48f6e 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -174,6 +174,7 @@ register char **argv[];
break;
case 'V':
version=1;
+ /* fall through */
case 'I':
case '?':
help=1; /* Help text written */
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index cee9337ccc3..96774d829ec 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -3,6 +3,7 @@
#
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/have_profiling.inc
--source include/platform.inc
#
diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests
index 6c84d8d3ba6..0a2d5a85e51 100644
--- a/mysql-test/unstable-tests
+++ b/mysql-test/unstable-tests
@@ -1,17 +1,17 @@
##############################################################################
#
# List the test cases which, unlike tests from disabled.def files,
-# can still be run on the current tree meaningfully, but are known
+# can still be run on the current tree meaningfully, but are known
# or suspected to fail sporadically on different reasons.
#
# Most common reasons are either test failures observed in buildbot,
-# or recent modifications to the tests which make their stability
-# unknown.
+# or recent modifications to the tests which make their stability
+# unknown.
#
-# Tests included due to recent modifications are later removed from the
-# list, if during a certain period they do not fail (and are not
-# modified again). Tests included due to intermittent failures are
-# removed when corresponding bug reports are closed.
+# Tests included due to recent modifications are later removed from the
+# list, if during a certain period they do not fail (and are not
+# modified again). Tests included due to intermittent failures are
+# removed when corresponding bug reports are closed.
#
# Separate the test case name and the comment with ':'.
#
@@ -19,44 +19,46 @@
#
# '*' wildcard in testcase names is supported.
#
-# To use the list, run MTR with --skip-test-list=unstable-tests option.
+# To use the list, run MTR with --skip-test-list=unstable-tests option.
#
##############################################################################
-main.alter_table : Modified in 10.0.30
main.count_distinct2 : MDEV-11768 - timeout
main.create_delayed : MDEV-10605 - failed with timeout
main.debug_sync : MDEV-10607 - internal error
-main.derived : Modified in 10.0.30
main.derived_opt : MDEV-11768 - timeout
-main.events_restart : MDEV-11221 - assertion failure
-main.grant : Modified in 10.0.30
+main.derived_view : Modified in 10.0.31
+main.events_2 : Modified in 10.0.31
+main.events_slowlog : MDEV-12821 - wrong result
+main.func_regexp_pcre : Modified in 10.0.31
+main.gis : Modified in 10.0.31
main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown
main.index_intersect_innodb : MDEV-10643 - failed with timeout
main.index_merge_innodb : MDEV-7142 - wrong result
main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure
-main.join_nested : Modified in 10.0.30
+main.loaddata : Modified in 10.0.31
+main.log_tables-big : Modified in 10.0.31
main.mdev-504 : MDEV-10607 - sporadic "can't connect"
main.mdev375 : MDEV-10607 - sporadic "can't connect"
main.merge : MDEV-10607 - sporadic "can't connect"
-main.mysqldump : Modified in 10.0.30
+main.mysqld--help : Modified in 10.0.31
+main.mysqldump : Modified in 10.0.31
main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build
main.mysqltest : MDEV-9269 - fails on Alpha
-main.partition_innodb : Modified in 10.0.30
-main.partition_myisam : Modified in 10.0.30
main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count
-main.range_vs_index_merge : Modified in 10.0.30
-main.repair_symlink-5543 : Modified in 10.0.30
main.show_explain : MDEV-10674 - wrong result
-main.signal_demo3 : MDEV-11720 - Thread stack overrun on Solaris
-main.sp : Modified in 10.0.30
main.sp_notembedded : MDEV-10607 - internal error
main.sp-security : MDEV-10607 - sporadic "can't connect"
-main.subselect_innodb : MDEV-10614 - sporadic wrong results
-main.symlink-aria-11902 : Added in 10.0.30
-main.symlink-myisam-11902 : Added in 10.0.30
-main.table_elim : Modified in 10.0.30
-main.view : Modified in 10.0.30
+main.subselect4 : Modified in 10.0.31
+main.subselect_exists2in : Modified in 10.0.31
+main.subselect_innodb : MDEV-10614 - sporadic wrong results; modified in 10.0.31
+main.subselect_mat_cost_bugs : Modified in 10.0.31
+main.subselect_sj : Modified in 10.0.31
+main.subselect_sj_mat : Modified in 10.0.31
+main.subselect_sj2_mat : Modified in 10.0.31
+main.symlink : Modified in 10.0.31
+main.symlink-myisam-11902 : Modified in 10.0.31
+main.view : Modified in 10.0.31
main.xa : MDEV-11769 - lock wait timeout
#----------------------------------------------------------------
@@ -70,15 +72,16 @@ archive.mysqlhotcopy_archive : MDEV-10995 - test hangs on debug build
#----------------------------------------------------------------
binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed
-binlog.binlog_max_binlog_stmt_cache_size : Added in 10.0.30
binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
#----------------------------------------------------------------
+connect.jdbc_new : Modified in 10.0.31
connect.tbl : MDEV-9844, MDEV-10179 - sporadic crashes, valgrind warnings, wrong results
-connect.xml : Uses xsample2.xml modified in 10.0.30
-connect.xml_zip : Added in 10.0.30
-connect.zip : Added in 10.0.30
+
+#----------------------------------------------------------------
+
+csv.read_only : Added in 10.0.31
#----------------------------------------------------------------
@@ -86,7 +89,6 @@ engines/rr_trx.* : MDEV-10998 - tests not maintained
#----------------------------------------------------------------
-federated_bug_35333 : Modified in 10.0.30
federated.federatedx : MDEV-10617 - Wrong checksum, timeouts
federated.federated_innodb : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips
federated.federated_partition : MDEV-10417 - Fails on Mips
@@ -101,22 +103,19 @@ funcs_2/charset.* : MDEV-10999 - test not maintained
#----------------------------------------------------------------
-innodb.alter_key_block_size-11757 : Added in 10.0.30
-innodb.binlog_consistent : MDEV-10618 - Server fails to start
+innodb.autoinc_debug : Added in 10.0.31
+innodb.binlog_consistent : MDEV-10618 - Server fails to start
innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - checksum mismatch
+innodb.innodb-alter-debug : Added in 10.0.31
+innodb.innodb-alter-nullable : Added in 10.0.31
innodb.innodb-alter-table : MDEV-10619 - Testcase timeout
-innodb.innodb_blob_unrecoverable_crash : Modified in 10.0.30
-innodb.innodb_bug14676111 : Modified in 10.0.30
+innodb.innodb_bug14676111 : Modified in 10.0.31
innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan
-innodb.innodb_bug59641 : Modified in 10.0.30
-innodb.innodb-get-fk : Modified in 10.0.30
+innodb.innodb-index-online-norebuild : Added in 10.0.31
+innodb.log_file_size : Modified in 10.0.31
innodb.innodb_monitor : MDEV-10939 - Testcase timeout
-innodb.log_file_size : Added in 10.0.30
-innodb.read_only_recovery : Added in 10.0.30
-innodb.xa_recovery : Modified in 10.0.30
-innodb_fts.create : Added in 10.0.30
-innodb_fts.innodb_fts_stopword_charset : MDEV-12052 - Crash on shutdown
+innodb_fts.innodb_fts_stopword_charset : MDEV-12052 - Crash on shutdown; modified in 10.0.31
#----------------------------------------------------------------
@@ -134,29 +133,13 @@ multi_source.multisource : MDEV-10417 - Fails on Mips
multi_source.simple : MDEV-4633 - Wrong slave status output
multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_heartbeats
-
#----------------------------------------------------------------
-oqgraph.regression_mdev6282 : Modified in 10.0.30
-oqgraph.regression_mdev6345 : Modified in 10.0.30
+myisam_debug : Modified in 10.0.31
#----------------------------------------------------------------
-parts.partition_bigint_innodb : Added in 10.0.30
-parts.partition_bigint_myisam : Added in 10.0.30
-parts.partition_double_innodb : Added in 10.0.30
-parts.partition_double_myisam : Added in 10.0.30
parts.partition_exch_qa_10 : MDEV-11765 - wrong result
-parts.partition_float_innodb : Modified in 10.0.30
-parts.partition_float_myisam : Modified in 10.0.30
-parts.partition_int_innodb : Modified in 10.0.30
-parts.partition_int_myisam : Modified in 10.0.30
-parts.partition_mediumint_innodb : Added in 10.0.30
-parts.partition_mediumint_myisam : Added in 10.0.30
-parts.partition_smallint_innodb : Added in 10.0.30
-parts.partition_smallint_myisam : Added in 10.0.30
-parts.partition_tinyint_innodb : Added in 10.0.30
-parts.partition_tinyint_myisam : Added in 10.0.30
#----------------------------------------------------------------
@@ -165,7 +148,7 @@ perfschema.func_mutex : MDEV-5708 - fails for s390x
perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown
perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match
perfschema.stage_mdl_procedure : MDEV-11545 - Wrong result
-perfschema.threads_mysql : MDEV-12177 - Wrong result
+perfschema.start_server_1_digest : Added in 10.0.31
perfschema_stress.* : MDEV-10996 - tests not maintained
@@ -191,13 +174,11 @@ rpl.rpl_ddl : MDEV-10417 - Fails on Mips
rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master
rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown
rpl.rpl_gtid_until : MDEV-10625 - warnings in error log
-rpl.rpl_heartbeat_basic : Modified in 10.0.30
rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips
rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x
rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x
rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips
rpl.rpl_mdev6020 : MDEV-10630, MDEV-10417 - Timeouts, fails on Mips
-rpl.rpl_mdev6386 : Modified in 10.0.30
rpl.rpl_parallel : MDEV-10653 - Timeouts
rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables
rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips
@@ -238,31 +219,46 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout
sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x
sys_vars.innodb_buffer_pool_dump_pct_basic : MDEV-10651 - sporadic failure on file_exists
-sys_vars.innodb_force_recovery_crash_basic : Modified in 10.0.30
-sys_vars.innodb_stats_include_delete_marked_basic : Added in 10.0.30
sys_vars.innodb_status_output_basic : MDEV-12174 - Timeout
-sys_vars.secure_file_priv : Modified in 10.0.30
sys_vars.thread_cache_size_func : MDEV-11775 - wrong result
#----------------------------------------------------------------
+tokudb.background_job_manager : Modified in 10.0.31
+tokudb.bug-1657908 : Added in 10.0.31
+tokudb.card_auto_analyze_lots : Modified in 10.0.31
+tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection during query
+tokudb.change_column_bin : MDEV-12640 - Lost connection during query
+tokudb.change_column_char : MDEV-12822 - Lost connection during query
tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan
+tokudb.dir_cmd : Added in 10.0.31
tokudb.dir_per_db : MDEV-11537 - wrong result
-tokudb.dir_per_db_rename_to_nonexisting_schema : Added in 10.0.30
-tokudb.gap_lock_error : Added in 10.0.30
-tokudb.locks-select-update-3 : Modified in 10.0.30
-tokudb.percona_kill_idle_trx_tokudb : Added in 10.0.30
+tokudb.dir_per_db_rename_to_nonexisting_schema : MDEV-12823 - Valgrind
+tokudb.hotindex-update-1 : MDEV-12640 - Lost connection during query
+tokudb.i_s_tokudb_lock_waits_timeout : Modified in 10.0.31
+tokudb.i_s_tokudb_locks : Modified in 10.0.31
+tokudb.rows-32m-rand-insert : MDEV-12640 - Lost connection during query
+tokudb.rows-32m-seq-insert : MDEV-12640 - Lost connection during query
tokudb_backup.* : MDEV-11001 - tests don't work
+
+tokudb_backup.backup_master_info : Added in 10.0.31
+tokudb_backup.backup_master_state : Added in 10.0.31
+tokudb_backup.empty_slave_info_file : Added in 10.0.31
+tokudb_backup.innodb_use_native_aio_enabled : Added in 10.0.31
+tokudb_backup.rpl_safe_slave : Added in 10.0.31
+tokudb_backup.rpl_tokudb_commit_sync : Added in 10.0.31
+
tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output
tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output
+tokudb_bugs.db233 : Modified in 10.0.31
+tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind
+tokudb_bugs.leak172 : Modified in 10.0.31
tokudb_bugs.xa : MDEV-11804 - Lock wait timeout
tokudb_rpl.* : MDEV-11001 - tests don't work
tokudb_sys_vars.* : MDEV-11001 - tests don't work
-rpl-tokudb.rpl_extra_col_slave_tokudb : Result file modified in 10.0.30
-
#----------------------------------------------------------------
unit.ma_test_loghandler : MDEV-10638 - record read not ok
@@ -272,10 +268,5 @@ unit.pfs : MySQL:84457 - unittest pft-t failing
vcol.not_supported : MDEV-10639 - Testcase timeout
vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout
-vcol.vcol_misc : Modified in 10.0.30
-vcol.vcol_select_myisam : Modified in 10.0.30
-vcol.vcol_trigger_sp_innodb : Include file modified in 10.0.30
-vcol.vcol_trigger_sp_myisam : Include file modified in 10.0.30
-vcol.wrong_arena : Added in 10.0.30
#----------------------------------------------------------------
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index 7cd0c2b02df..85c0b947497 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -4039,6 +4039,7 @@ mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val)
*dbl= strtod(str, &end);
if (*end != '\0')
rc= ER_DYNCOL_TRUNCATED;
+ break;
}
case DYN_COL_DECIMAL:
if (decimal2double(&val->x.decimal.value, dbl) != E_DEC_OK)
diff --git a/sql/events.cc b/sql/events.cc
index 75780cd94c5..8d78497a29e 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2017, 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
@@ -242,6 +243,7 @@ common_1_lev_code:
break;
case INTERVAL_WEEK:
expr/= 7;
+ /* fall through */
default:
close_quote= FALSE;
break;
diff --git a/sql/field.cc b/sql/field.cc
index dec89e16674..7d7fad2d84d 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -9464,7 +9464,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
case MYSQL_TYPE_DATE:
/* We don't support creation of MYSQL_TYPE_DATE anymore */
sql_type= MYSQL_TYPE_NEWDATE;
- /* fall trough */
+ /* fall through */
case MYSQL_TYPE_NEWDATE:
length= MAX_DATE_WIDTH;
break;
diff --git a/sql/item.cc b/sql/item.cc
index ceb8d984d9e..4ce8396f71e 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 2017, MariaDB
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
@@ -5925,7 +5925,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
collation.collation);
break;
}
- /* Fall through to make_string_field() */
+ /* Fall through */
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_SET:
case MYSQL_TYPE_VAR_STRING:
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 2c43181e8bb..13ea5291edc 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
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
@@ -2034,6 +2034,7 @@ my_decimal *Item_func_mod::decimal_op(my_decimal *decimal_value)
return decimal_value;
case E_DEC_DIV_ZERO:
signal_divide_by_null();
+ /* fall through */
default:
null_value= 1;
return 0;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 9baa5d52319..7cd712cc5e1 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -5090,7 +5090,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
goto null;
case DYN_COL_INT:
signed_value= 1; // For error message
- /* fall_trough */
+ /* fall through */
case DYN_COL_UINT:
if (signed_value || val.x.ulong_value <= LONGLONG_MAX)
{
@@ -5103,7 +5103,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
}
/* let double_to_datetime_with_warn() issue the warning message */
val.x.double_value= static_cast<double>(ULONGLONG_MAX);
- /* fall_trough */
+ /* fall through */
case DYN_COL_DOUBLE:
if (double_to_datetime_with_warn(val.x.double_value, ltime, fuzzy_date,
0 /* TODO */))
diff --git a/sql/log.cc b/sql/log.cc
index b80d65e20db..6ebfda67ecf 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
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
@@ -8822,8 +8822,10 @@ void TC_LOG_MMAP::close()
mysql_cond_destroy(&COND_pool);
mysql_cond_destroy(&COND_active);
mysql_cond_destroy(&COND_queue_busy);
+ /* fall through */
case 5:
data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails
+ /* fall through */
case 4:
for (i=0; i < npages; i++)
{
@@ -8832,10 +8834,13 @@ void TC_LOG_MMAP::close()
mysql_mutex_destroy(&pages[i].lock);
mysql_cond_destroy(&pages[i].cond);
}
+ /* fall through */
case 3:
my_free(pages);
+ /* fall through */
case 2:
my_munmap((char*)data, (size_t)file_length);
+ /* fall through */
case 1:
mysql_file_close(fd, MYF(0));
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a8fef1bd8a3..0aa917cb7fe 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8724,6 +8724,9 @@ mysql_getopt_value(const char *name, uint length,
return (uchar**) &key_cache->changed_blocks_hash_size;
}
}
+ /* We return in all cases above. Let us silence -Wimplicit-fallthrough */
+ DBUG_ASSERT(0);
+ /* fall through */
case OPT_REPLICATE_DO_DB:
case OPT_REPLICATE_DO_TABLE:
case OPT_REPLICATE_IGNORE_DB:
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 5a5e17dda6d..9712b3c3d42 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+ Copyright (c) 2008, 2017, 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
@@ -1050,6 +1050,7 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond)
case Item_func::LT_FUNC:
case Item_func::LE_FUNC:
less_fl= 1;
+ /* fall through */
case Item_func::GT_FUNC:
case Item_func::GE_FUNC:
{
diff --git a/sql/slave.cc b/sql/slave.cc
index 3dd17fd7276..8c3627514ac 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
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
@@ -5798,9 +5798,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
mi->last_queued_gtid.seq_no == 1000)
goto skip_relay_logging;
});
- /* Fall through to default case ... */
#endif
-
+ /* fall through */
default:
default_action:
if (mi->using_gtid != Master_info::USE_GTID_NO && mi->gtid_event_seen)
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index fb0f3132816..ea9e1c1c822 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2002, 2016, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+ Copyright (c) 2011, 2017, MariaDB
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
@@ -142,6 +142,7 @@ sp_get_item_value(THD *thd, Item *item, String *str)
if (item->field_type() != MYSQL_TYPE_BIT)
return item->val_str(str);
else {/* Bit type is handled as binary string */}
+ /* fall through */
case STRING_RESULT:
{
String *result= item->val_str(str);
diff --git a/sql/sql_digest.cc b/sql/sql_digest.cc
index c8ba371ea7e..0cc969b3758 100644
--- a/sql/sql_digest.cc
+++ b/sql/sql_digest.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, 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
@@ -453,7 +454,8 @@ sql_digest_state* digest_add_token(sql_digest_state *state,
}
} while (found_unary);
}
- /* fall through, for case NULL_SYM below */
+ /* for case NULL_SYM below */
+ /* fall through */
case LEX_HOSTNAME:
case TEXT_STRING:
case NCHAR_STRING:
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 9351b7f61a9..19568bdd42c 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
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
@@ -1174,12 +1174,14 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
state= MY_LEX_HEX_NUMBER;
break;
}
+ /* fall through */
case MY_LEX_IDENT_OR_BIN:
if (lip->yyPeek() == '\'')
{ // Found b'bin-number'
state= MY_LEX_BIN_NUMBER;
break;
}
+ /* fall through */
case MY_LEX_IDENT:
const char *start;
#if defined(USE_MB) && defined(USE_MB_IDENT)
@@ -1527,6 +1529,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
break;
}
/* " used for strings */
+ /* fall through */
case MY_LEX_STRING: // Incomplete text string
if (!(yylval->lex_str.str = get_text(lip, 1, 1)))
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e57756217ca..b054dd3f5ed 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2518,8 +2518,8 @@ mysql_execute_command(THD *thd)
MYF(0));
goto error;
}
- /* no break; fall through */
}
+ /* fall through */
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
case SQLCOM_SHOW_DATABASES:
@@ -3323,8 +3323,8 @@ end_with_restore_list:
/* mysql_update return 2 if we need to switch to multi-update */
if (up_result != 2)
break;
- /* Fall through */
}
+ /* Fall through */
case SQLCOM_UPDATE_MULTI:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -3434,6 +3434,7 @@ end_with_restore_list:
DBUG_PRINT("debug", ("Just after generate_incident()"));
}
#endif
+ /* fall through */
case SQLCOM_INSERT:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -4273,6 +4274,7 @@ end_with_restore_list:
initialize this variable because RESET shares the same code as FLUSH
*/
lex->no_write_to_binlog= 1;
+ /* fall through */
case SQLCOM_FLUSH:
{
int write_to_binlog;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 23b795cdf7f..63c3933db93 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2014, SkySQL Ab.
+ Copyright (c) 2010, 2017, 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
@@ -1816,8 +1816,8 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
switch ((*(p++)= *(list++))) {
case '\0':
list= NULL; /* terminate the loop */
- /* fall through */
#ifndef __WIN__
+ /* fall through */
case ':': /* can't use this as delimiter as it may be drive letter */
#endif
case ';':
@@ -1858,6 +1858,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
str->str= p;
continue;
}
+ /* fall through */
default:
str->length++;
continue;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 03624647970..a88e6d776c7 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2015, MariaDB
+ Copyright (c) 2008, 2017, MariaDB
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
@@ -2108,7 +2108,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
/* mysql_test_update returns 2 if we need to switch to multi-update */
if (res != 2)
break;
-
+ /* fall through */
case SQLCOM_UPDATE_MULTI:
res= mysql_test_multiupdate(stmt, tables, res == 2);
break;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ea9f9ec2cca..ae074eee556 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
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
@@ -983,6 +983,7 @@ public:
is_handled= FALSE;
break;
}
+ /* fall through */
case ER_COLUMNACCESS_DENIED_ERROR:
case ER_VIEW_NO_EXPLAIN: /* Error was anonymized, ignore all the same. */
case ER_PROCACCESS_DENIED_ERROR:
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 503048f9f6a..2eff8fd5e2f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6851,7 +6851,8 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
case Alter_info::LEAVE_AS_IS:
if (!indexes_were_disabled)
break;
- /* fall-through: disabled indexes */
+ /* disabled indexes */
+ /* fall through */
case Alter_info::DISABLE:
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index cd5b9657730..95a683165e2 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4681,9 +4681,11 @@ size_number:
case 'g':
case 'G':
text_shift_number+=10;
+ /* fall through */
case 'm':
case 'M':
text_shift_number+=10;
+ /* fall through */
case 'k':
case 'K':
text_shift_number+=10;
diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp
index 8eaeeea2d8a..5cf15c5ac18 100644
--- a/storage/connect/array.cpp
+++ b/storage/connect/array.cpp
@@ -155,6 +155,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec)
switch (type) {
case TYPE_STRING:
Len = length;
+ /* fall through */
case TYPE_SHORT:
case TYPE_INT:
case TYPE_DOUBLE:
@@ -592,6 +593,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
switch (Type) {
case TYPE_DOUBLE:
prec = 2;
+ /* fall through */
case TYPE_SHORT:
case TYPE_INT:
case TYPE_DATE:
diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp
index 8878f2c922b..44abd962c56 100644
--- a/storage/connect/filamdbf.cpp
+++ b/storage/connect/filamdbf.cpp
@@ -503,7 +503,8 @@ bool DBFFAM::OpenTableFile(PGLOBAL g)
break;
} // endif
- // Selective delete, pass thru
+ // Selective delete
+ /* fall through */
case MODE_UPDATE:
UseTemp = Tdbp->IsUsingTemp(g);
strcpy(opmode, (UseTemp) ? "rb" : "r+b");
@@ -623,6 +624,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
case 'L': // Large (big) integer
case 'T': // Tiny integer
c = 'N'; // Numeric
+ /* fall through */
case 'N': // Numeric (integer)
case 'F': // Float (double)
descp->Decimals = (uchar)cdp->F.Prec;
diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp
index 962a4516bf2..1d6194b154d 100644
--- a/storage/connect/filamfix.cpp
+++ b/storage/connect/filamfix.cpp
@@ -920,7 +920,8 @@ bool BGXFAM::OpenTableFile(PGLOBAL g)
break;
} // endif
- // Selective delete, pass thru
+ // Selective delete
+ /* fall through */
case MODE_UPDATE:
UseTemp = Tdbp->IsUsingTemp(g);
oflag |= (UseTemp) ? O_RDONLY : O_RDWR;
diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp
index 382af51aae4..c456ee9e9b7 100644
--- a/storage/connect/filamtxt.cpp
+++ b/storage/connect/filamtxt.cpp
@@ -574,6 +574,7 @@ bool DOSFAM::OpenTableFile(PGLOBAL g)
// Selective delete, pass thru
Bin = true;
+ /* fall through */
case MODE_UPDATE:
if ((UseTemp = Tdbp->IsUsingTemp(g))) {
strcpy(opmode, "r");
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 9b4ef43eb8b..f8a7f2600f3 100755
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -440,6 +440,7 @@ bool VCTFAM::OpenTableFile(PGLOBAL g)
} // endif
// Selective delete, pass thru
+ /* fall through */
case MODE_UPDATE:
UseTemp = Tdbp->IsUsingTemp(g);
strcpy(opmode, (UseTemp) ? "rb" : "r+b");
@@ -1919,6 +1920,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g)
} // endif filter
// Selective delete, pass thru
+ /* fall through */
case MODE_UPDATE:
UseTemp = Tdbp->IsUsingTemp(g);
strcpy(opmode, (UseTemp) ? "rb": "r+b");
@@ -3586,6 +3588,7 @@ bool BGVFAM::OpenTableFile(PGLOBAL g)
} // endif
// Selective delete, pass thru
+ /* fall through */
case MODE_UPDATE:
UseTemp = Tdbp->IsUsingTemp(g);
oflag = (UseTemp) ? O_RDONLY : O_RDWR;
diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp
index 0c38d10a578..863c9ca6571 100644
--- a/storage/connect/filter.cpp
+++ b/storage/connect/filter.cpp
@@ -1193,7 +1193,7 @@ bool FILTER::Convert(PGLOBAL g, bool having)
Arg(0) = pXVOID;
} // endif void
- // pass thru
+ // fall through
case OP_IN:
// For IN operator do optimize if operand is an array
if (GetArgType(1) != TYPE_ARRAY)
@@ -1260,6 +1260,7 @@ bool FILTER::Eval(PGLOBAL g)
} // endif Opm
// For modified operators, pass thru
+ /* fall through */
case OP_IN:
case OP_EXIST:
// For IN operations, special processing is done here
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 9b8aa36b518..68b01e3c7f2 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -1427,7 +1427,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_VAR_STRING:
pcf->Flags |= U_VAR;
- /* no break */
+ /* fall through */
default:
pcf->Type= MYSQLtoPLG(fp->type(), &v);
break;
@@ -2802,6 +2802,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
case Item_func::LIKE_FUNC: vop= OP_LIKE; break;
case Item_func::ISNOTNULL_FUNC:
neg = true;
+ /* fall through */
case Item_func::ISNULL_FUNC: vop= OP_NULL; break;
case Item_func::IN_FUNC: vop= OP_IN;
case Item_func::BETWEEN:
@@ -4246,7 +4247,8 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick)
} else
return false;
- /* Fall through to check FILE_ACL */
+ /* check FILE_ACL */
+ /* fall through */
case TAB_ODBC:
case TAB_JDBC:
case TAB_MYSQL:
@@ -5475,16 +5477,16 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
supfnc |= (FNC_DRIVER | FNC_TABLE);
break;
#endif // JDBC_SUPPORT
- case TAB_DBF:
- dbf = true;
- // Passthru
- case TAB_CSV:
- if (!fn && fnc != FNC_NO)
- sprintf(g->Message, "Missing %s file name", topt->type);
- else if (sep && strlen(sep) > 1)
- sprintf(g->Message, "Invalid separator %s", sep);
- else
- ok = true;
+ case TAB_DBF:
+ dbf= true;
+ // fall through
+ case TAB_CSV:
+ if (!fn && fnc != FNC_NO)
+ sprintf(g->Message, "Missing %s file name", topt->type);
+ else if (sep && strlen(sep) > 1)
+ sprintf(g->Message, "Invalid separator %s", sep);
+ else
+ ok= true;
break;
case TAB_MYSQL:
diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp
index bcea0ec85aa..f8b1caa13e2 100644
--- a/storage/connect/json.cpp
+++ b/storage/connect/json.cpp
@@ -507,7 +507,7 @@ PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src)
if (!has_e)
goto err;
- // passthru
+ // fall through
case '-':
if (found_digit)
goto err;
@@ -797,7 +797,7 @@ bool JOUTSTR::Escape(const char *s)
case '\r':
case '\b':
case '\f': WriteChr('\\');
- // passthru
+ // fall through
default:
WriteChr(s[i]);
break;
diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp
index 4035e79e892..d990f082e5b 100644
--- a/storage/connect/plgdbutl.cpp
+++ b/storage/connect/plgdbutl.cpp
@@ -915,7 +915,7 @@ int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
fp->Memory = NULL;
fp->Mode = MODE_ANY;
- // Passthru
+ // fall through
case TYPE_FB_HANDLE:
if (fp->Handle && fp->Handle != INVALID_HANDLE_VALUE)
if (CloseFileHandle(fp->Handle))
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp
index 26cc27b1b01..50c8b1ffc29 100644
--- a/storage/connect/reldef.cpp
+++ b/storage/connect/reldef.cpp
@@ -129,6 +129,7 @@ int RELDEF::GetSizeCatInfo(PCSZ what, PCSZ sdef)
switch (toupper(c)) {
case 'M':
n *= 1024;
+ // fall through
case 'K':
n *= 1024;
} // endswitch c
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index 87925161320..21b64a41684 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -1309,6 +1309,7 @@ PBF TDBDOS::InitBlockFilter(PGLOBAL g, PFIL filp)
} // endif !opm
// if opm, pass thru
+ /* fall through */
case OP_IN:
if (filp->GetArgType(0) == TYPE_COLBLK &&
filp->GetArgType(1) == TYPE_ARRAY) {
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index 5853425a4e5..063115c7a60 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -1591,7 +1591,7 @@ void JSONCOL::WriteColumn(PGLOBAL g)
break;
} // endif Op
- // Passthru
+ // fall through
case TYPE_DATE:
case TYPE_INT:
case TYPE_TINY:
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index 1e215c4df69..429593f07d9 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -118,7 +118,7 @@ ulonglong CharToNumber(const char *p, int n, ulonglong maxval,
maxval++;
if (minus) *minus = true;
} // endif Unsigned
-
+ /* fall through */
case '+':
p++;
break;
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index e6e530c4dc2..a34d2e1c847 100755
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
@@ -464,7 +464,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
if (ApplyFilter(g, filp))
break;
- // passthru
+ // fall through
case RC_NF:
continue;
case RC_EF:
diff --git a/storage/connect/xobject.cpp b/storage/connect/xobject.cpp
index cdffcb2fa44..8f0b76d2ddc 100644
--- a/storage/connect/xobject.cpp
+++ b/storage/connect/xobject.cpp
@@ -408,7 +408,7 @@ bool STRING::Append_quoted(PCSZ s)
case '\r':
case '\b':
case '\f': b |= Append('\\');
- // passthru
+ // fall through
default:
b |= Append(*p);
break;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 97baa27aba6..927921d6df4 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2004, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2017, 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
@@ -2952,6 +2953,7 @@ int ha_federated::extra(ha_extra_function operation)
break;
case HA_EXTRA_PREPARE_FOR_DROP:
table_will_be_deleted = TRUE;
+ break;
default:
/* do nothing */
DBUG_PRINT("info",("unhandled operation: %d", (uint) operation));
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index a68a35e63fb..d03c7c46f15 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010, 2014, SkySQL Ab.
+ Copyright (c) 2010, 2017, 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
@@ -94,7 +94,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
case HA_KEYTYPE_VARBINARY1:
/* Case-insensitiveness is handled in coll->hash_sort */
keyinfo->seg[j].type= HA_KEYTYPE_VARTEXT1;
- /* fall_through */
+ /* fall through */
case HA_KEYTYPE_VARTEXT1:
keyinfo->flag|= HA_VAR_LENGTH_KEY;
length+= 2;
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 4f24ad75e26..7ca38c5b67d 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -3,6 +3,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1163,18 +1164,21 @@ btr_cur_ins_lock_and_undo(
index, thr, mtr, inherit);
if (err != DB_SUCCESS
+ || !(~flags | (BTR_NO_UNDO_LOG_FLAG | BTR_KEEP_SYS_FLAG))
|| !dict_index_is_clust(index) || dict_index_is_ibuf(index)) {
return(err);
}
- err = trx_undo_report_row_operation(flags, TRX_UNDO_INSERT_OP,
- thr, index, entry,
- NULL, 0, NULL, NULL,
- &roll_ptr);
- if (err != DB_SUCCESS) {
-
- return(err);
+ if (flags & BTR_NO_UNDO_LOG_FLAG) {
+ roll_ptr = 0;
+ } else {
+ err = trx_undo_report_row_operation(thr, index, entry,
+ NULL, 0, NULL, NULL,
+ &roll_ptr);
+ if (err != DB_SUCCESS) {
+ return(err);
+ }
}
/* Now we can fill in the roll ptr field in entry */
@@ -1223,15 +1227,17 @@ btr_cur_optimistic_insert(
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
- mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
+ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction;
if this function returns DB_SUCCESS on
a leaf page of a secondary index in a
@@ -1252,6 +1258,7 @@ btr_cur_optimistic_insert(
ulint rec_size;
dberr_t err;
+ ut_ad(thr || !(~flags & (BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG)));
*big_rec = NULL;
block = btr_cur_get_block(cursor);
@@ -1510,15 +1517,17 @@ btr_cur_pessimistic_insert(
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
dict_index_t* index = cursor->index;
@@ -1530,6 +1539,7 @@ btr_cur_pessimistic_insert(
ulint n_reserved = 0;
ut_ad(dtuple_check_typed(entry));
+ ut_ad(thr || !(~flags & (BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG)));
*big_rec = NULL;
@@ -1705,9 +1715,10 @@ btr_cur_upd_lock_and_undo(
/* Append the info about the update in the undo log */
- return(trx_undo_report_row_operation(
- flags, TRX_UNDO_MODIFY_OP, thr,
- index, NULL, update,
+ return((flags & BTR_NO_UNDO_LOG_FLAG)
+ ? DB_SUCCESS
+ : trx_undo_report_row_operation(
+ thr, index, NULL, update,
cmpl_info, rec, offsets, roll_ptr));
}
@@ -2426,12 +2437,12 @@ btr_cur_pessimistic_update(
ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
mem_heap_t* entry_heap,
/*!< in/out: memory heap for allocating
big_rec and the index tuple */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or NULL */
+ be stored externally by the caller */
const upd_t* update, /*!< in: update vector; this is allowed also
contain trx id and roll ptr fields, but
the values in update vector have no effect */
@@ -2978,7 +2989,7 @@ btr_cur_del_mark_set_clust_rec(
return(err);
}
- err = trx_undo_report_row_operation(0, TRX_UNDO_MODIFY_OP, thr,
+ err = trx_undo_report_row_operation(thr,
index, NULL, NULL, 0, rec, offsets,
&roll_ptr);
if (err != DB_SUCCESS) {
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e45a5b4f2a9..d045973133e 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2,6 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
+Copyright (c) 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1343,8 +1344,6 @@ buf_pool_init_instance(
buf_pool->chunks = chunk =
(buf_chunk_t*) mem_zalloc(sizeof *chunk);
- UT_LIST_INIT(buf_pool->free);
-
if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) {
mem_free(chunk);
mem_free(buf_pool);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 890794f6a23..3395d0431d4 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1547,8 +1547,6 @@ fil_init(
fil_system->spaces = hash_create(hash_size);
fil_system->name_hash = hash_create(hash_size);
- UT_LIST_INIT(fil_system->LRU);
-
fil_system->max_n_open = max_n_open;
}
@@ -2274,14 +2272,12 @@ fil_op_log_parse_or_replay(
} else if (log_flags & MLOG_FILE_FLAG_TEMP) {
/* Temporary table, do nothing */
} else {
- const char* path = NULL;
-
/* Create the database directory for name, if it does
not exist yet */
fil_create_directory_for_tablename(name);
if (fil_create_new_single_table_tablespace(
- space_id, name, path, flags,
+ space_id, name, NULL, flags,
DICT_TF2_USE_TABLESPACE,
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
ut_error;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 6baeca959a1..091f660dcee 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1322,19 +1322,6 @@ thd_is_replication_slave_thread(
}
/******************************************************************//**
-Gets information on the durability property requested by thread.
-Used when writing either a prepare or commit record to the log
-buffer. @return the durability property. */
-UNIV_INTERN
-enum durability_properties
-thd_requested_durability(
-/*=====================*/
- const THD* thd) /*!< in: thread handle */
-{
- return(thd_get_durability_property(thd));
-}
-
-/******************************************************************//**
Returns true if transaction should be flagged as read-only.
@return true if the thd is marked as read-only */
UNIV_INTERN
@@ -1998,15 +1985,11 @@ innobase_get_stmt(
THD* thd, /*!< in: MySQL thread handle */
size_t* length) /*!< out: length of the SQL statement */
{
- const char* query = NULL;
- LEX_STRING *stmt = NULL;
- ut_ad(thd != NULL);
- stmt = thd_query_string(thd);
- if (stmt) {
+ if (const LEX_STRING *stmt = thd_query_string(thd)) {
*length = stmt->length;
- query = stmt->str;
+ return stmt->str;
}
- return (query);
+ return NULL;
}
/**********************************************************************//**
@@ -7063,8 +7046,8 @@ ha_innobase::innobase_lock_autoinc(void)
break;
}
}
- /* Fall through to old style locking. */
-
+ /* Use old style locking. */
+ /* fall through */
case AUTOINC_OLD_STYLE_LOCKING:
DBUG_EXECUTE_IF("die_if_autoinc_old_lock_style_used",
ut_ad(0););
@@ -7523,8 +7506,8 @@ calc_row_difference(
}
}
- if (o_len != n_len || (o_len != UNIV_SQL_NULL &&
- 0 != memcmp(o_ptr, n_ptr, o_len))) {
+ if (o_len != n_len || (o_len != 0 && o_len != UNIV_SQL_NULL
+ && 0 != memcmp(o_ptr, n_ptr, o_len))) {
/* The field has changed */
ufield = uvect->fields + n_changed;
@@ -9725,7 +9708,8 @@ create_options_are_invalid(
case ROW_TYPE_DYNAMIC:
CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE(use_tablespace);
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
- /* fall through since dynamic also shuns KBS */
+ /* ROW_FORMAT=DYNAMIC also shuns KEY_BLOCK_SIZE */
+ /* fall through */
case ROW_TYPE_COMPACT:
case ROW_TYPE_REDUNDANT:
if (kbs_specified) {
@@ -10111,7 +10095,8 @@ index_bad:
break;
}
zip_allowed = FALSE;
- /* fall through to set row_format = COMPACT */
+ /* Set ROW_FORMAT = COMPACT */
+ /* fall through */
case ROW_TYPE_NOT_USED:
case ROW_TYPE_FIXED:
case ROW_TYPE_PAGE:
@@ -10119,6 +10104,7 @@ index_bad:
thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: assuming ROW_FORMAT=COMPACT.");
+ /* fall through */
case ROW_TYPE_DEFAULT:
/* If we fell through, set row format to Compact. */
row_format = ROW_TYPE_COMPACT;
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 9ddb1600378..46d689ce1e8 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2016, MariaDB Corporation.
+Copyright (c) 2013, 2017, 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
@@ -476,7 +476,7 @@ innobase_index_name_is_reserved(
const KEY* key_info, /*!< in: Indexes to be created */
ulint num_of_keys) /*!< in: Number of indexes to
be created. */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/*****************************************************************//**
Determines InnoDB table flags.
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index dc084dc1b95..8d6f3e79f61 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -2277,10 +2278,10 @@ online_retry_drop_indexes_with_trx(
@param drop_fk constraints being dropped
@param n_drop_fk number of constraints that are being dropped
@return whether the constraint is being dropped */
-inline MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1), warn_unused_result))
+inline
bool
innobase_dropping_foreign(
-/*======================*/
const dict_foreign_t* foreign,
dict_foreign_t** drop_fk,
ulint n_drop_fk)
@@ -2304,10 +2305,10 @@ column that is being dropped or modified to NOT NULL.
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1,4), warn_unused_result))
+static
bool
innobase_check_foreigns_low(
-/*========================*/
const dict_table_t* user_table,
dict_foreign_t** drop_fk,
ulint n_drop_fk,
@@ -2404,10 +2405,10 @@ column that is being dropped or modified to NOT NULL.
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1,2,3,4), warn_unused_result))
+static
bool
innobase_check_foreigns(
-/*====================*/
Alter_inplace_info* ha_alter_info,
const TABLE* altered_table,
const TABLE* old_table,
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 373c68503d7..49c1d1a4227 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -2894,8 +2895,7 @@ ibuf_get_volume_buffered_hash(
fold = ut_fold_binary(data, len);
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
- bitmask = static_cast<ulint>(
- 1 << (fold % (CHAR_BIT * sizeof(*hash))));
+ bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
if (*hash & bitmask) {
@@ -3662,7 +3662,7 @@ fail_exit:
if (mode == BTR_MODIFY_PREV) {
err = btr_cur_optimistic_insert(
- BTR_NO_LOCKING_FLAG,
+ BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG,
cursor, &offsets, &offsets_heap,
ibuf_entry, &ins_rec,
&dummy_big_rec, 0, thr, &mtr);
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index 28e01d4f02e..77de98d5812 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -220,15 +221,17 @@ btr_cur_optimistic_insert(
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
- mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
+ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction;
if this function returns DB_SUCCESS on
a leaf page of a secondary index in a
@@ -256,15 +259,17 @@ btr_cur_pessimistic_insert(
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
@@ -390,12 +395,12 @@ btr_cur_pessimistic_update(
ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
mem_heap_t* entry_heap,
/*!< in/out: memory heap for allocating
big_rec and the index tuple */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or NULL */
+ be stored externally by the caller */
const upd_t* update, /*!< in: update vector; this is allowed also
contain trx id and roll ptr fields, but
the values in update vector have no effect */
diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic
index d489bef89a8..b4dbf4b1213 100644
--- a/storage/innobase/include/data0type.ic
+++ b/storage/innobase/include/data0type.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -574,7 +575,8 @@ dtype_get_fixed_size_low(
#else /* !UNIV_HOTBACKUP */
return(len);
#endif /* !UNIV_HOTBACKUP */
- /* fall through for variable-length charsets */
+ /* Treat as variable-length. */
+ /* Fall through */
case DATA_VARCHAR:
case DATA_BINARY:
case DATA_DECIMAL:
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 4fe91af2a1f..099b28dc5e1 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -782,7 +782,7 @@ fil_create_new_single_table_tablespace(
ulint size) /*!< in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2), warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index 75b81e26f2f..488ed0257a7 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -127,18 +127,6 @@ thd_is_replication_slave_thread(
THD* thd); /*!< in: thread handle */
/******************************************************************//**
-Gets information on the durability property requested by thread.
-Used when writing either a prepare or commit record to the log
-buffer.
-@return the durability property. */
-UNIV_INTERN
-enum durability_properties
-thd_requested_durability(
-/*=====================*/
- const THD* thd) /*!< in: thread handle */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
-
-/******************************************************************//**
Returns true if the transaction this thread is processing has edited
non-transactional tables. Used by the deadlock detector when deciding
which transaction to rollback in case of a deadlock - we try to avoid
diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.ic
index 6b303979b18..9a8441280a6 100644
--- a/storage/innobase/include/mach0data.ic
+++ b/storage/innobase/include/mach0data.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -787,13 +788,13 @@ mach_swap_byte_order(
dest += len;
switch (len & 0x7) {
- case 0: *--dest = *from++;
- case 7: *--dest = *from++;
- case 6: *--dest = *from++;
- case 5: *--dest = *from++;
- case 4: *--dest = *from++;
- case 3: *--dest = *from++;
- case 2: *--dest = *from++;
+ case 0: *--dest = *from++; /* fall through */
+ case 7: *--dest = *from++; /* fall through */
+ case 6: *--dest = *from++; /* fall through */
+ case 5: *--dest = *from++; /* fall through */
+ case 4: *--dest = *from++; /* fall through */
+ case 3: *--dest = *from++; /* fall through */
+ case 2: *--dest = *from++; /* fall through */
case 1: *--dest = *from;
}
}
diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic
index 6c7d8cd32c7..9a583086925 100644
--- a/storage/innobase/include/page0zip.ic
+++ b/storage/innobase/include/page0zip.ic
@@ -2,6 +2,7 @@
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, 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
@@ -172,7 +173,8 @@ page_zip_rec_needs_ext(
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
{
- ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES);
+ ut_ad(rec_size
+ > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES));
ut_ad(ut_is_2pow(zip_size));
ut_ad(comp || !zip_size);
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h
index 359937e3583..a6e202d04e4 100644
--- a/storage/innobase/include/trx0rec.h
+++ b/storage/innobase/include/trx0rec.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -212,10 +213,6 @@ UNIV_INTERN
dberr_t
trx_undo_report_row_operation(
/*==========================*/
- ulint flags, /*!< in: if BTR_NO_UNDO_LOG_FLAG bit is
- set, does nothing */
- ulint op_type, /*!< in: TRX_UNDO_INSERT_OP or
- TRX_UNDO_MODIFY_OP */
que_thr_t* thr, /*!< in: query thread */
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* clust_entry, /*!< in: in the case of an insert,
@@ -233,7 +230,7 @@ trx_undo_report_row_operation(
inserted undo log record,
0 if BTR_NO_UNDO_LOG
flag was specified */
- MY_ATTRIBUTE((nonnull(3,4,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
/******************************************************************//**
Copies an undo record to heap. This function can be called if we know that
the undo log record exists.
@@ -313,10 +310,6 @@ record */
storage fields: used by purge to
free the external storage */
-/* Operation type flags used in trx_undo_report_row_operation */
-#define TRX_UNDO_INSERT_OP 1
-#define TRX_UNDO_MODIFY_OP 2
-
#ifndef UNIV_NONINL
#include "trx0rec.ic"
#endif
diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic
index 024c59e553b..987dfac03c1 100644
--- a/storage/innobase/include/ut0rnd.ic
+++ b/storage/innobase/include/ut0rnd.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -237,16 +238,22 @@ ut_fold_binary(
switch (len & 0x7) {
case 7:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 6:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 5:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 4:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 3:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 2:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 1:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
}
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 0a75389094d..869de0be182 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -4742,13 +4742,11 @@ lock_rec_unlock(
trx_mutex_exit(trx);
stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Error: unlock row could not"
- " find a %lu mode lock on the record\n",
- (ulong) lock_mode);
- ut_print_timestamp(stderr);
- fprintf(stderr, " InnoDB: current statement: %.*s\n",
+
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "unlock row could not find a %u mode lock on the record;"
+ " statement=%.*s",
+ lock_mode,
(int) stmt_len, stmt);
return;
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index e8a147aab47..878a0b8728f 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -2,6 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, 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
@@ -68,8 +69,8 @@ using namespace std;
# define buf_LRU_stat_inc_unzip() ((void) 0)
#endif /* !UNIV_HOTBACKUP */
-#ifndef UNIV_HOTBACKUP
#ifndef UNIV_INNOCHECKSUM
+#ifndef UNIV_HOTBACKUP
/** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_SSIZE_MAX];
/** Statistics on compression, indexed by index->id */
@@ -79,7 +80,6 @@ UNIV_INTERN ib_mutex_t page_zip_stat_per_index_mutex;
#ifdef HAVE_PSI_INTERFACE
UNIV_INTERN mysql_pfs_key_t page_zip_stat_per_index_mutex_key;
#endif /* HAVE_PSI_INTERFACE */
-#endif /* !UNIV_INNOCHECKSUM */
#endif /* !UNIV_HOTBACKUP */
/* Compression level to be used by zlib. Settable by user. */
@@ -128,7 +128,6 @@ Compare at most sizeof(field_ref_zero) bytes.
/* Enable some extra debugging output. This code can be enabled
independently of any UNIV_ debugging conditions. */
-#ifndef UNIV_INNOCHECKSUM
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
# include <stdarg.h>
MY_ATTRIBUTE((format (printf, 1, 2)))
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index a95e9c23613..a42f8f95083 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -1285,8 +1285,10 @@ rec_convert_dtuple_to_rec_comp(
}
}
- memcpy(end, dfield_get_data(field), len);
- end += len;
+ if (len) {
+ memcpy(end, dfield_get_data(field), len);
+ end += len;
+ }
}
}
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 5b8ed009a2a..db570467414 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -225,9 +226,6 @@ row_fts_psort_info_init(
each parallel sort thread. Each "sort bucket" holds records for
a particular "FTS index partition" */
for (j = 0; j < fts_sort_pll_degree; j++) {
-
- UT_LIST_INIT(psort_info[j].fts_doc_list);
-
for (i = 0; i < FTS_NUM_AUX_INDEX; i++) {
psort_info[j].merge_file[i] =
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index da8e1aab2c9..1337496b897 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -2018,6 +2018,7 @@ PageConverter::update_page(
case FIL_PAGE_TYPE_XDES:
err = set_current_xdes(
buf_block_get_page_no(block), get_frame(block));
+ /* fall through */
case FIL_PAGE_INODE:
case FIL_PAGE_TYPE_TRX_SYS:
case FIL_PAGE_IBUF_FREE_LIST:
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 9c1b5cb2d09..5cfa21c1fa2 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -2121,14 +2122,10 @@ for a clustered index!
@retval DB_SUCCESS if no error
@retval DB_DUPLICATE_KEY if error,
@retval DB_LOCK_WAIT if we have to wait for a lock on a possible duplicate
-record
-@retval DB_SUCCESS_LOCKED_REC if an exact match of the record was found
-in online table rebuild (flags & (BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG)) */
+record */
static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust(
-/*=============================*/
- ulint flags, /*!< in: undo logging and locking flags */
btr_cur_t* cursor, /*!< in: B-tree cursor */
const dtuple_t* entry, /*!< in: entry to insert */
que_thr_t* thr, /*!< in: query thread */
@@ -2386,7 +2383,7 @@ row_ins_clust_index_entry_low(
DB_LOCK_WAIT */
err = row_ins_duplicate_error_in_clust(
- flags, &cursor, entry, thr, &mtr);
+ &cursor, entry, thr, &mtr);
}
if (err != DB_SUCCESS) {
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index d05ad5939ec..0b7ef86fdd3 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -1872,6 +1873,7 @@ row_log_table_apply_update(
When applying the subsequent ROW_T_DELETE, no matching
record will be found. */
+ /* fall through */
case DB_SUCCESS:
ut_ad(row != NULL);
break;
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index a3f4355ec6c..69d77060bd8 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -5407,7 +5407,8 @@ loop:
fputs(" InnoDB: Warning: CHECK TABLE on ", stderr);
dict_index_name_print(stderr, prebuilt->trx, index);
fprintf(stderr, " returned %lu\n", ret);
- /* fall through (this error is ignored by CHECK TABLE) */
+ /* (this error is ignored by CHECK TABLE) */
+ /* fall through */
case DB_END_OF_INDEX:
func_exit:
mem_free(buf);
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index bc2e0b0e1cb..bb883310820 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -488,8 +489,9 @@ row_purge_remove_sec_if_poss_leaf(
success = false;
}
}
- /* fall through (the index entry is still needed,
+ /* (The index entry is still needed,
or the deletion succeeded) */
+ /* fall through */
case ROW_NOT_DELETED_REF:
/* The index entry is still needed. */
case ROW_BUFFERED:
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index d43946cc00c..fd85b8500b8 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -293,7 +293,7 @@ UNIV_INTERN double srv_adaptive_flushing_lwm = 10.0;
UNIV_INTERN ulong srv_flushing_avg_loops = 30;
/* The number of purge threads to use.*/
-UNIV_INTERN ulong srv_n_purge_threads = 1;
+UNIV_INTERN ulong srv_n_purge_threads;
/* the number of pages to purge in one batch */
UNIV_INTERN ulong srv_purge_batch_size = 20;
@@ -490,16 +490,16 @@ UNIV_INTERN uint srv_simulate_comp_failures = 0;
/** Acquire the system_mutex. */
#define srv_sys_mutex_enter() do { \
- mutex_enter(&srv_sys->mutex); \
+ mutex_enter(&srv_sys.mutex); \
} while (0)
/** Test if the system mutex is owned. */
-#define srv_sys_mutex_own() (mutex_own(&srv_sys->mutex) \
+#define srv_sys_mutex_own() (mutex_own(&srv_sys.mutex) \
&& !srv_read_only_mode)
/** Release the system mutex. */
#define srv_sys_mutex_exit() do { \
- mutex_exit(&srv_sys->mutex); \
+ mutex_exit(&srv_sys.mutex); \
} while (0)
#define fetch_lock_wait_timeout(trx) \
@@ -591,7 +591,7 @@ struct srv_sys_t{
ulint n_sys_threads; /*!< size of the sys_threads
array */
- srv_slot_t* sys_threads; /*!< server thread table;
+ srv_slot_t sys_threads[32 + 1]; /*!< server thread table;
os_event_set() and
os_event_reset() on
sys_threads[]->event are
@@ -611,7 +611,7 @@ struct srv_sys_t{
UNIV_INTERN ib_mutex_t server_mutex;
#endif /* !HAVE_ATOMIC_BUILTINS */
-static srv_sys_t* srv_sys = NULL;
+static srv_sys_t srv_sys;
/** Event to signal srv_monitor_thread. Not protected by a mutex.
Set after setting srv_print_innodb_monitor. */
@@ -633,10 +633,10 @@ and/or load it during startup. */
UNIV_INTERN char srv_buffer_pool_dump_at_shutdown = FALSE;
UNIV_INTERN char srv_buffer_pool_load_at_startup = FALSE;
-/** Slot index in the srv_sys->sys_threads array for the purge thread. */
+/** Slot index in the srv_sys.sys_threads array for the purge thread. */
static const ulint SRV_PURGE_SLOT = 1;
-/** Slot index in the srv_sys->sys_threads array for the master thread. */
+/** Slot index in the srv_sys.sys_threads array for the master thread. */
static const ulint SRV_MASTER_SLOT = 0;
/*********************************************************************//**
@@ -737,21 +737,21 @@ srv_reserve_slot(
switch (type) {
case SRV_MASTER:
- slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
+ slot = &srv_sys.sys_threads[SRV_MASTER_SLOT];
break;
case SRV_PURGE:
- slot = &srv_sys->sys_threads[SRV_PURGE_SLOT];
+ slot = &srv_sys.sys_threads[SRV_PURGE_SLOT];
break;
case SRV_WORKER:
/* Find an empty slot, skip the master and purge slots. */
- for (slot = &srv_sys->sys_threads[2];
+ for (slot = &srv_sys.sys_threads[2];
slot->in_use;
++slot) {
- ut_a(slot < &srv_sys->sys_threads[
- srv_sys->n_sys_threads]);
+ ut_a(slot < &srv_sys.sys_threads[
+ srv_sys.n_sys_threads]);
}
break;
@@ -767,7 +767,7 @@ srv_reserve_slot(
ut_ad(srv_slot_get_type(slot) == type);
- ++srv_sys->n_threads_active[type];
+ ++srv_sys.n_threads_active[type];
srv_sys_mutex_exit();
@@ -797,27 +797,27 @@ srv_suspend_thread_low(
case SRV_MASTER:
/* We have only one master thread and it
should be the first entry always. */
- ut_a(srv_sys->n_threads_active[type] == 1);
+ ut_a(srv_sys.n_threads_active[type] == 1);
break;
case SRV_PURGE:
/* We have only one purge coordinator thread
and it should be the second entry always. */
- ut_a(srv_sys->n_threads_active[type] == 1);
+ ut_a(srv_sys.n_threads_active[type] == 1);
break;
case SRV_WORKER:
ut_a(srv_n_purge_threads > 1);
- ut_a(srv_sys->n_threads_active[type] > 0);
+ ut_a(srv_sys.n_threads_active[type] > 0);
break;
}
ut_a(!slot->suspended);
slot->suspended = TRUE;
- ut_a(srv_sys->n_threads_active[type] > 0);
+ ut_a(srv_sys.n_threads_active[type] > 0);
- srv_sys->n_threads_active[type]--;
+ srv_sys.n_threads_active[type]--;
return(os_event_reset(slot->event));
}
@@ -872,7 +872,7 @@ srv_resume_thread(srv_slot_t* slot, ib_int64_t sig_count = 0, bool wait = true,
ut_ad(slot->suspended);
slot->suspended = FALSE;
- ++srv_sys->n_threads_active[slot->type];
+ ++srv_sys.n_threads_active[slot->type];
srv_sys_mutex_exit();
return(timeout);
}
@@ -894,8 +894,8 @@ srv_release_threads(enum srv_thread_type type, ulint n)
srv_sys_mutex_enter();
- for (ulint i = 0; i < srv_sys->n_sys_threads; i++) {
- srv_slot_t* slot = &srv_sys->sys_threads[i];
+ for (ulint i = 0; i < srv_sys.n_sys_threads; i++) {
+ srv_slot_t* slot = &srv_sys.sys_threads[i];
if (!slot->in_use || srv_slot_get_type(slot) != type) {
continue;
@@ -915,7 +915,7 @@ srv_release_threads(enum srv_thread_type type, ulint n)
should be the first entry always. */
ut_a(n == 1);
ut_a(i == SRV_MASTER_SLOT);
- ut_a(srv_sys->n_threads_active[type] == 0);
+ ut_a(srv_sys.n_threads_active[type] == 0);
break;
case SRV_PURGE:
@@ -924,12 +924,12 @@ srv_release_threads(enum srv_thread_type type, ulint n)
ut_a(n == 1);
ut_a(i == SRV_PURGE_SLOT);
ut_a(srv_n_purge_threads > 0);
- ut_a(srv_sys->n_threads_active[type] == 0);
+ ut_a(srv_sys.n_threads_active[type] == 0);
break;
case SRV_WORKER:
ut_a(srv_n_purge_threads > 1);
- ut_a(srv_sys->n_threads_active[type]
+ ut_a(srv_sys.n_threads_active[type]
< srv_n_purge_threads - 1);
break;
}
@@ -967,9 +967,6 @@ void
srv_init(void)
/*==========*/
{
- ulint n_sys_threads = 0;
- ulint srv_sys_sz = sizeof(*srv_sys);
-
#ifndef HAVE_ATOMIC_BUILTINS
mutex_create(server_mutex_key, &server_mutex, SYNC_ANY_LATCH);
#endif /* !HAVE_ATOMIC_BUILTINS */
@@ -977,29 +974,19 @@ srv_init(void)
mutex_create(srv_innodb_monitor_mutex_key,
&srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
- if (!srv_read_only_mode) {
-
- /* Number of purge threads + master thread */
- n_sys_threads = srv_n_purge_threads + 1;
-
- srv_sys_sz += n_sys_threads * sizeof(*srv_sys->sys_threads);
- }
-
- srv_sys = static_cast<srv_sys_t*>(mem_zalloc(srv_sys_sz));
-
- srv_sys->n_sys_threads = n_sys_threads;
+ srv_sys.n_sys_threads = srv_read_only_mode
+ ? 0
+ : srv_n_purge_threads + 1/* purge coordinator */;
if (!srv_read_only_mode) {
- mutex_create(srv_sys_mutex_key, &srv_sys->mutex, SYNC_THREADS);
+ mutex_create(srv_sys_mutex_key, &srv_sys.mutex, SYNC_THREADS);
mutex_create(srv_sys_tasks_mutex_key,
- &srv_sys->tasks_mutex, SYNC_ANY_LATCH);
+ &srv_sys.tasks_mutex, SYNC_ANY_LATCH);
- srv_sys->sys_threads = (srv_slot_t*) &srv_sys[1];
-
- for (ulint i = 0; i < srv_sys->n_sys_threads; ++i) {
- srv_slot_t* slot = &srv_sys->sys_threads[i];
+ for (ulint i = 0; i < srv_sys.n_sys_threads; ++i) {
+ srv_slot_t* slot = &srv_sys.sys_threads[i];
slot->event = os_event_create();
@@ -1011,8 +998,6 @@ srv_init(void)
srv_monitor_event = os_event_create();
srv_buf_dump_event = os_event_create();
-
- UT_LIST_INIT(srv_sys->tasks);
}
/* page_zip_stat_per_index_mutex is acquired from:
@@ -1050,10 +1035,8 @@ srv_free(void)
{
srv_conc_free();
- /* The mutexes srv_sys->mutex and srv_sys->tasks_mutex should have
+ /* The mutexes srv_sys.mutex and srv_sys.tasks_mutex should have
been freed by sync_close() already. */
- mem_free(srv_sys);
- srv_sys = NULL;
trx_i_s_cache_free(trx_i_s_cache);
@@ -1884,7 +1867,7 @@ void
srv_inc_activity_count(void)
/*========================*/
{
- srv_sys->activity_count.inc();
+ srv_sys.activity_count.inc();
}
/**********************************************************************//**
@@ -1906,7 +1889,7 @@ srv_get_active_thread_type(void)
srv_sys_mutex_enter();
for (ulint i = SRV_WORKER; i <= SRV_MASTER; ++i) {
- if (srv_sys->n_threads_active[i] != 0) {
+ if (srv_sys.n_threads_active[i] != 0) {
ret = static_cast<srv_thread_type>(i);
break;
}
@@ -1979,12 +1962,12 @@ srv_active_wake_master_thread(void)
srv_inc_activity_count();
- if (srv_sys->n_threads_active[SRV_MASTER] == 0) {
+ if (srv_sys.n_threads_active[SRV_MASTER] == 0) {
srv_slot_t* slot;
srv_sys_mutex_enter();
- slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
+ slot = &srv_sys.sys_threads[SRV_MASTER_SLOT];
/* Only if the master thread has been started. */
@@ -2011,7 +1994,7 @@ srv_wake_purge_thread_if_not_active(void)
ut_ad(!srv_sys_mutex_own());
if (purge_sys->state == PURGE_STATE_RUN
- && srv_sys->n_threads_active[SRV_PURGE] == 0) {
+ && srv_sys.n_threads_active[SRV_PURGE] == 0) {
srv_release_threads(SRV_PURGE, 1);
}
@@ -2040,7 +2023,7 @@ ulint
srv_get_activity_count(void)
/*========================*/
{
- return(srv_sys->activity_count);
+ return(srv_sys.activity_count);
}
/*******************************************************************//**
@@ -2052,7 +2035,7 @@ srv_check_activity(
/*===============*/
ulint old_activity_count) /*!< in: old activity count */
{
- return(srv_sys->activity_count != old_activity_count);
+ return(srv_sys.activity_count != old_activity_count);
}
/********************************************************************//**
@@ -2419,7 +2402,7 @@ DECLARE_THREAD(srv_master_thread)(
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
slot = srv_reserve_slot(SRV_MASTER);
- ut_a(slot == srv_sys->sys_threads);
+ ut_a(slot == srv_sys.sys_threads);
last_print_time = ut_time();
loop:
@@ -2510,18 +2493,18 @@ srv_task_execute(void)
ut_ad(!srv_read_only_mode);
ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- if (UT_LIST_GET_LEN(srv_sys->tasks) > 0) {
+ if (UT_LIST_GET_LEN(srv_sys.tasks) > 0) {
- thr = UT_LIST_GET_FIRST(srv_sys->tasks);
+ thr = UT_LIST_GET_FIRST(srv_sys.tasks);
ut_a(que_node_get_type(thr->child) == QUE_NODE_PURGE);
- UT_LIST_REMOVE(queue, srv_sys->tasks, thr);
+ UT_LIST_REMOVE(queue, srv_sys.tasks, thr);
}
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
if (thr != NULL) {
@@ -2563,7 +2546,7 @@ DECLARE_THREAD(srv_worker_thread)(
srv_sys_mutex_enter();
- ut_a(srv_sys->n_threads_active[SRV_WORKER] < srv_n_purge_threads);
+ ut_a(srv_sys.n_threads_active[SRV_WORKER] < srv_n_purge_threads);
srv_sys_mutex_exit();
@@ -2896,11 +2879,11 @@ srv_que_task_enqueue_low(
que_thr_t* thr) /*!< in: query thread */
{
ut_ad(!srv_read_only_mode);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
+ UT_LIST_ADD_LAST(queue, srv_sys.tasks, thr);
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
srv_release_threads(SRV_WORKER, 1);
}
@@ -2917,11 +2900,11 @@ srv_get_task_queue_length(void)
ut_ad(!srv_read_only_mode);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- n_tasks = UT_LIST_GET_LEN(srv_sys->tasks);
+ n_tasks = UT_LIST_GET_LEN(srv_sys.tasks);
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
return(n_tasks);
}
diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc
index a2165a917b8..855fd5dec11 100644
--- a/storage/innobase/sync/sync0sync.cc
+++ b/storage/innobase/sync/sync0sync.cc
@@ -1123,6 +1123,7 @@ sync_thread_add_level(
upgrading in innobase_start_or_create_for_mysql(). */
break;
}
+ /* fall through */
case SYNC_MEM_POOL:
case SYNC_MEM_HASH:
case SYNC_RECV:
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index 993006efc6d..b05161a9932 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -503,7 +503,9 @@ fill_trx_row(
row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd);
- stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
+ stmt = trx->mysql_thd
+ ? innobase_get_stmt(trx->mysql_thd, &stmt_len)
+ : NULL;
if (stmt != NULL) {
char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1];
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 5fa74846243..f694cdd3d5e 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -1185,10 +1186,6 @@ UNIV_INTERN
dberr_t
trx_undo_report_row_operation(
/*==========================*/
- ulint flags, /*!< in: if BTR_NO_UNDO_LOG_FLAG bit is
- set, does nothing */
- ulint op_type, /*!< in: TRX_UNDO_INSERT_OP or
- TRX_UNDO_MODIFY_OP */
que_thr_t* thr, /*!< in: query thread */
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* clust_entry, /*!< in: in the case of an insert,
@@ -1221,17 +1218,8 @@ trx_undo_report_row_operation(
ut_ad(!srv_read_only_mode);
ut_a(dict_index_is_clust(index));
ut_ad(!rec || rec_offs_validate(rec, index, offsets));
-
- if (flags & BTR_NO_UNDO_LOG_FLAG) {
-
- *roll_ptr = 0;
-
- return(DB_SUCCESS);
- }
-
ut_ad(thr);
- ut_ad((op_type != TRX_UNDO_INSERT_OP)
- || (clust_entry && !update && !rec));
+ ut_ad(!clust_entry || (!update && !rec));
trx = thr_get_trx(thr);
@@ -1252,8 +1240,7 @@ trx_undo_report_row_operation(
/* If the undo log is not assigned yet, assign one */
- switch (op_type) {
- case TRX_UNDO_INSERT_OP:
+ if (clust_entry) {
undo = trx->insert_undo;
if (undo == NULL) {
@@ -1269,10 +1256,7 @@ trx_undo_report_row_operation(
ut_ad(err == DB_SUCCESS);
}
- break;
- default:
- ut_ad(op_type == TRX_UNDO_MODIFY_OP);
-
+ } else {
undo = trx->update_undo;
if (undo == NULL) {
@@ -1296,23 +1280,14 @@ trx_undo_report_row_operation(
buf_block_dbg_add_level(undo_block, SYNC_TRX_UNDO_PAGE);
do {
- page_t* undo_page;
- ulint offset;
-
- undo_page = buf_block_get_frame(undo_block);
ut_ad(page_no == buf_block_get_page_no(undo_block));
-
- switch (op_type) {
- case TRX_UNDO_INSERT_OP:
- offset = trx_undo_page_report_insert(
- undo_page, trx, index, clust_entry, &mtr);
- break;
- default:
- ut_ad(op_type == TRX_UNDO_MODIFY_OP);
- offset = trx_undo_page_report_modify(
+ page_t* undo_page = buf_block_get_frame(undo_block);
+ ulint offset = clust_entry
+ ? trx_undo_page_report_insert(
+ undo_page, trx, index, clust_entry, &mtr)
+ : trx_undo_page_report_modify(
undo_page, trx, index, rec, offsets, update,
cmpl_info, &mtr);
- }
if (UNIV_UNLIKELY(offset == 0)) {
/* The record did not fit on the page. We erase the
@@ -1363,7 +1338,7 @@ trx_undo_report_row_operation(
mutex_exit(&trx->undo_mutex);
*roll_ptr = trx_undo_build_roll_ptr(
- op_type == TRX_UNDO_INSERT_OP,
+ clust_entry != NULL,
rseg->id, page_no, offset);
return(DB_SUCCESS);
}
diff --git a/storage/innobase/usr/usr0sess.cc b/storage/innobase/usr/usr0sess.cc
index ab7ba6bea09..e1bd71ff1a0 100644
--- a/storage/innobase/usr/usr0sess.cc
+++ b/storage/innobase/usr/usr0sess.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -48,8 +49,6 @@ sess_open(void)
sess->trx = trx_allocate_for_background();
sess->trx->sess = sess;
- UT_LIST_INIT(sess->graphs);
-
return(sess);
}
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index fd21d2863f8..c6f53eaa24b 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -157,6 +157,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
if (info->s->data_file_type != DYNAMIC_RECORD)
break;
/* Remove read/write cache if dynamic rows */
+ /* fall through */
case HA_EXTRA_NO_CACHE:
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
@@ -313,7 +314,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
share->state.open_count= 1;
share->changed= 1;
_ma_mark_file_changed_now(share);
- /* Fall trough */
+ /* Fall through */
case HA_EXTRA_PREPARE_FOR_RENAME:
{
my_bool do_flush= MY_TEST(function != HA_EXTRA_PREPARE_FOR_DROP);
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index 59e0630be8c..a09662544a2 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -3061,7 +3061,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
case LOGREC_REDO_INDEX:
case LOGREC_REDO_INDEX_FREE_PAGE:
index_page_redo_entry= 1;
- /* Fall trough*/
+ /* Fall through */
case LOGREC_REDO_INSERT_ROW_HEAD:
case LOGREC_REDO_INSERT_ROW_TAIL:
case LOGREC_REDO_PURGE_ROW_HEAD:
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index a47c1987e38..04e32378fd3 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -150,6 +150,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (info->s->data_file_type != DYNAMIC_RECORD)
break;
/* Remove read/write cache if dynamic rows */
+ /* fall through */
case HA_EXTRA_NO_CACHE:
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
@@ -262,7 +263,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
//share->deleting= TRUE;
share->global_changed= FALSE; /* force writing changed flag */
_mi_mark_file_changed(info);
- /* Fall trough */
+ /* Fall through */
case HA_EXTRA_PREPARE_FOR_RENAME:
mysql_mutex_lock(&THR_LOCK_myisam);
share->last_version= 0L; /* Impossible version */
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 3f035c7bc7d..c196295f69e 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -216,7 +216,9 @@ enum ESphGroupBy
SPH_GROUPBY_WEEK = 1, ///< group by week
SPH_GROUPBY_MONTH = 2, ///< group by month
SPH_GROUPBY_YEAR = 3, ///< group by year
- SPH_GROUPBY_ATTR = 4 ///< group by attribute value
+ SPH_GROUPBY_ATTR = 4, ///< group by attribute value
+ SPH_GROUPBY_ATTRPAIR = 5, ///< group by sequential attrs pair (rendered redundant by 64bit attrs support; removed)
+ SPH_GROUPBY_MULTIPLE = 6 ///< group by on multiple attribute values
};
/// known attribute types
@@ -1555,6 +1557,7 @@ bool CSphSEQuery::ParseField ( char * sField )
{ "month:", SPH_GROUPBY_MONTH },
{ "year:", SPH_GROUPBY_YEAR },
{ "attr:", SPH_GROUPBY_ATTR },
+ { "multi:", SPH_GROUPBY_MULTIPLE }
};
int i;
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index c29172a474a..495420dad32 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -1844,8 +1844,8 @@ int spider_db_append_key_where_internal(
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
case HA_READ_PREFIX_LAST:
result_list->desc_flg = TRUE;
- /* fall through */
#endif
+ /* fall through */
case HA_READ_KEY_EXACT:
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index dcb197a761f..c495e178b21 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -3,6 +3,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1268,18 +1269,21 @@ btr_cur_ins_lock_and_undo(
index, thr, mtr, inherit);
if (err != DB_SUCCESS
+ || !(~flags | (BTR_NO_UNDO_LOG_FLAG | BTR_KEEP_SYS_FLAG))
|| !dict_index_is_clust(index) || dict_index_is_ibuf(index)) {
return(err);
}
- err = trx_undo_report_row_operation(flags, TRX_UNDO_INSERT_OP,
- thr, index, entry,
- NULL, 0, NULL, NULL,
- &roll_ptr);
- if (err != DB_SUCCESS) {
-
- return(err);
+ if (flags & BTR_NO_UNDO_LOG_FLAG) {
+ roll_ptr = 0;
+ } else {
+ err = trx_undo_report_row_operation(thr, index, entry,
+ NULL, 0, NULL, NULL,
+ &roll_ptr);
+ if (err != DB_SUCCESS) {
+ return(err);
+ }
}
/* Now we can fill in the roll ptr field in entry */
@@ -1328,15 +1332,17 @@ btr_cur_optimistic_insert(
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
- mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
+ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction;
if this function returns DB_SUCCESS on
a leaf page of a secondary index in a
@@ -1357,6 +1363,7 @@ btr_cur_optimistic_insert(
ulint rec_size;
dberr_t err;
+ ut_ad(thr || !(~flags & (BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG)));
*big_rec = NULL;
block = btr_cur_get_block(cursor);
@@ -1366,7 +1373,10 @@ btr_cur_optimistic_insert(
page = buf_block_get_frame(block);
index = cursor->index;
- ut_ad((thr && thr_get_trx(thr)->fake_changes)
+ const bool fake_changes = (~flags & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG))
+ && thr_get_trx(thr)->fake_changes;
+ ut_ad(fake_changes
|| mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(!dict_index_is_online_ddl(index)
|| dict_index_is_clust(index)
@@ -1507,7 +1517,7 @@ fail_err:
goto fail_err;
}
- if (UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes)) {
+ if (UNIV_UNLIKELY(fake_changes)) {
/* skip CHANGE, LOG */
*big_rec = big_rec_vec;
return(err); /* == DB_SUCCESS */
@@ -1625,15 +1635,17 @@ btr_cur_pessimistic_insert(
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
dict_index_t* index = cursor->index;
@@ -1645,13 +1657,17 @@ btr_cur_pessimistic_insert(
ulint n_reserved = 0;
ut_ad(dtuple_check_typed(entry));
+ ut_ad(thr || !(~flags & (BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG)));
*big_rec = NULL;
- ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr,
+ const bool fake_changes = (~flags & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG))
+ && thr_get_trx(thr)->fake_changes;
+ ut_ad(fake_changes || mtr_memo_contains(mtr,
dict_index_get_lock(btr_cur_get_index(cursor)),
MTR_MEMO_X_LOCK));
- ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, btr_cur_get_block(cursor),
+ ut_ad(fake_changes || mtr_memo_contains(mtr, btr_cur_get_block(cursor),
MTR_MEMO_PAGE_X_FIX));
ut_ad(!dict_index_is_online_ddl(index)
|| dict_index_is_clust(index)
@@ -1712,7 +1728,7 @@ btr_cur_pessimistic_insert(
}
}
- if (UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes)) {
+ if (UNIV_UNLIKELY(fake_changes)) {
/* skip CHANGE, LOG */
if (n_reserved > 0) {
fil_space_release_free_extents(index->space,
@@ -1803,7 +1819,7 @@ btr_cur_upd_lock_and_undo(
ut_ad((thr != NULL) || (flags & BTR_NO_LOCKING_FLAG));
- if (UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes)) {
+ if (!(flags & BTR_NO_LOCKING_FLAG) && thr_get_trx(thr)->fake_changes) {
/* skip LOCK, UNDO */
return(DB_SUCCESS);
}
@@ -1838,9 +1854,10 @@ btr_cur_upd_lock_and_undo(
/* Append the info about the update in the undo log */
- return(trx_undo_report_row_operation(
- flags, TRX_UNDO_MODIFY_OP, thr,
- index, NULL, update,
+ return((flags & BTR_NO_UNDO_LOG_FLAG)
+ ? DB_SUCCESS
+ : trx_undo_report_row_operation(
+ thr, index, NULL, update,
cmpl_info, rec, offsets, roll_ptr));
}
@@ -2582,12 +2599,12 @@ btr_cur_pessimistic_update(
ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
mem_heap_t* entry_heap,
/*!< in/out: memory heap for allocating
big_rec and the index tuple */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or NULL */
+ be stored externally by the caller */
const upd_t* update, /*!< in: update vector; this is allowed also
contain trx id and roll ptr fields, but
the values in update vector have no effect */
@@ -3162,7 +3179,7 @@ btr_cur_del_mark_set_clust_rec(
return(err);
}
- err = trx_undo_report_row_operation(0, TRX_UNDO_MODIFY_OP, thr,
+ err = trx_undo_report_row_operation(thr,
index, NULL, NULL, 0, rec, offsets,
&roll_ptr);
if (err != DB_SUCCESS) {
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 0f989553440..c9aa1cf5c13 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -2,6 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
+Copyright (c) 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1432,8 +1433,6 @@ buf_pool_init_instance(
buf_pool->chunks = chunk =
(buf_chunk_t*) mem_zalloc(sizeof *chunk);
- UT_LIST_INIT(buf_pool->free);
-
if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) {
mem_free(chunk);
mem_free(buf_pool);
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 9855eaa87e5..1a0105aaf0b 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -1599,8 +1599,6 @@ fil_init(
fil_system->spaces = hash_create(hash_size);
fil_system->name_hash = hash_create(hash_size);
- UT_LIST_INIT(fil_system->LRU);
-
fil_system->max_n_open = max_n_open;
}
@@ -2326,14 +2324,12 @@ fil_op_log_parse_or_replay(
} else if (log_flags & MLOG_FILE_FLAG_TEMP) {
/* Temporary table, do nothing */
} else {
- const char* path = NULL;
-
/* Create the database directory for name, if it does
not exist yet */
fil_create_directory_for_tablename(name);
if (fil_create_new_single_table_tablespace(
- space_id, name, path, flags,
+ space_id, name, NULL, flags,
DICT_TF2_USE_TABLESPACE,
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
ut_error;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 684ea9d8222..da486507cfc 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -769,43 +769,6 @@ innobase_purge_changed_page_bitmaps(
ulonglong lsn) __attribute__((unused)); /*!< in: LSN to purge files up to */
-/*****************************************************************//**
-Check whether this is a fake change transaction.
-@return TRUE if a fake change transaction */
-static
-my_bool
-innobase_is_fake_change(
-/*====================*/
- handlerton *hton, /*!< in: InnoDB handlerton */
- THD* thd) __attribute__((unused)); /*!< in: MySQL thread handle of the user for
- whom the transaction is being committed */
-
-/** Empty free list algorithm.
-Checks if buffer pool is big enough to enable backoff algorithm.
-InnoDB empty free list algorithm backoff requires free pages
-from LRU for the best performance.
-buf_LRU_buf_pool_running_out cancels query if 1/4 of
-buffer pool belongs to LRU or freelist.
-At the same time buf_flush_LRU_list_batch
-keeps up to BUF_LRU_MIN_LEN in LRU.
-In order to avoid deadlock baclkoff requires buffer pool
-to be at least 4*BUF_LRU_MIN_LEN,
-but flush peformance is bad because of trashing
-and additional BUF_LRU_MIN_LEN pages are requested.
-@param[in] algorithm desired algorithm from srv_empty_free_list_t
-@return true if it's possible to enable backoff. */
-static inline
-bool
-innodb_empty_free_list_algorithm_allowed(
- srv_empty_free_list_t algorithm)
-{
- long long buf_pool_pages = srv_buf_pool_size / srv_page_size
- / srv_buf_pool_instances;
-
- return(buf_pool_pages >= BUF_LRU_MIN_LEN * (4 + 1)
- || algorithm != SRV_EMPTY_FREE_LIST_BACKOFF);
-}
-
/** Get the list of foreign keys referencing a specified table
table.
@param thd The thread handle
@@ -2332,15 +2295,11 @@ innobase_get_stmt(
THD* thd, /*!< in: MySQL thread handle */
size_t* length) /*!< out: length of the SQL statement */
{
- const char* query = NULL;
- LEX_STRING *stmt = NULL;
- ut_ad(thd != NULL);
- stmt = thd_query_string(thd);
- if (stmt) {
+ if (const LEX_STRING *stmt = thd_query_string(thd)) {
*length = stmt->length;
- query = stmt->str;
+ return stmt->str;
}
- return (query);
+ return NULL;
}
/**********************************************************************//**
@@ -4254,22 +4213,6 @@ innobase_purge_changed_page_bitmaps(
}
/*****************************************************************//**
-Check whether this is a fake change transaction.
-@return TRUE if a fake change transaction */
-static
-my_bool
-innobase_is_fake_change(
-/*====================*/
- handlerton *hton MY_ATTRIBUTE((unused)),
- /*!< in: InnoDB handlerton */
- THD* thd) /*!< in: MySQL thread handle of the user for
- whom the transaction is being committed */
-{
- trx_t* trx = check_trx_exists(thd);
- return UNIV_UNLIKELY(trx->fake_changes);
-}
-
-/*****************************************************************//**
Commits a transaction in an InnoDB database. */
static
void
@@ -7779,8 +7722,8 @@ ha_innobase::innobase_lock_autoinc(void)
break;
}
}
- /* Fall through to old style locking. */
-
+ /* Use old style locking. */
+ /* fall through */
case AUTOINC_OLD_STYLE_LOCKING:
DBUG_EXECUTE_IF("die_if_autoinc_old_lock_style_used",
ut_ad(0););
@@ -8263,8 +8206,8 @@ calc_row_difference(
}
}
- if (o_len != n_len || (o_len != UNIV_SQL_NULL &&
- 0 != memcmp(o_ptr, n_ptr, o_len))) {
+ if (o_len != n_len || (o_len != 0 && o_len != UNIV_SQL_NULL
+ && 0 != memcmp(o_ptr, n_ptr, o_len))) {
/* The field has changed */
ufield = uvect->fields + n_changed;
@@ -10503,7 +10446,8 @@ create_options_are_invalid(
case ROW_TYPE_DYNAMIC:
CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE(use_tablespace);
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
- /* fall through since dynamic also shuns KBS */
+ /* ROW_FORMAT=DYNAMIC also shuns KEY_BLOCK_SIZE */
+ /* fall through */
case ROW_TYPE_COMPACT:
case ROW_TYPE_REDUNDANT:
if (kbs_specified) {
@@ -10885,7 +10829,8 @@ index_bad:
break;
}
zip_allowed = FALSE;
- /* fall through to set row_format = COMPACT */
+ /* Set ROW_FORMAT = COMPACT */
+ /* fall through */
case ROW_TYPE_NOT_USED:
case ROW_TYPE_FIXED:
case ROW_TYPE_PAGE:
@@ -10894,6 +10839,7 @@ index_bad:
thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: assuming ROW_FORMAT=COMPACT.");
+ /* fall through */
case ROW_TYPE_DEFAULT:
/* If we fell through, set row format to Compact. */
row_format = ROW_TYPE_COMPACT;
@@ -13370,7 +13316,8 @@ fill_foreign_key_list(THD* thd,
{
ut_ad(mutex_own(&dict_sys->mutex));
- for (dict_foreign_set::iterator it = table->referenced_set.begin();
+ for (dict_foreign_set::const_iterator it
+ = table->referenced_set.begin();
it != table->referenced_set.end(); ++it) {
dict_foreign_t* foreign = *it;
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 38e45647a7c..faf1e5475b5 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -484,7 +484,7 @@ innobase_index_name_is_reserved(
const KEY* key_info, /*!< in: Indexes to be created */
ulint num_of_keys) /*!< in: Number of indexes to
be created. */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/*****************************************************************//**
Determines InnoDB table flags.
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 444c3095791..52127fbf0c0 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -2280,10 +2280,10 @@ online_retry_drop_indexes_with_trx(
@param drop_fk constraints being dropped
@param n_drop_fk number of constraints that are being dropped
@return whether the constraint is being dropped */
-inline MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1), warn_unused_result))
+inline
bool
innobase_dropping_foreign(
-/*======================*/
const dict_foreign_t* foreign,
dict_foreign_t** drop_fk,
ulint n_drop_fk)
@@ -2307,10 +2307,10 @@ column that is being dropped or modified to NOT NULL.
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1,4), warn_unused_result))
+static
bool
innobase_check_foreigns_low(
-/*========================*/
const dict_table_t* user_table,
dict_foreign_t** drop_fk,
ulint n_drop_fk,
@@ -2407,10 +2407,10 @@ column that is being dropped or modified to NOT NULL.
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
+MY_ATTRIBUTE((pure, nonnull(1,2,3,4), warn_unused_result))
+static
bool
innobase_check_foreigns(
-/*====================*/
Alter_inplace_info* ha_alter_info,
const TABLE* altered_table,
const TABLE* old_table,
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index a9f039d3f0f..414d7fc39be 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -2934,8 +2935,7 @@ ibuf_get_volume_buffered_hash(
fold = ut_fold_binary(data, len);
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
- bitmask = static_cast<ulint>(
- 1 << (fold % (CHAR_BIT * sizeof(*hash))));
+ bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
if (*hash & bitmask) {
@@ -3704,7 +3704,7 @@ fail_exit:
if (mode == BTR_MODIFY_PREV) {
err = btr_cur_optimistic_insert(
- BTR_NO_LOCKING_FLAG,
+ BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG,
cursor, &offsets, &offsets_heap,
ibuf_entry, &ins_rec,
&dummy_big_rec, 0, thr, &mtr);
diff --git a/storage/xtradb/include/btr0cur.h b/storage/xtradb/include/btr0cur.h
index 19ab7d8bc3a..d973eb80c59 100644
--- a/storage/xtradb/include/btr0cur.h
+++ b/storage/xtradb/include/btr0cur.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -220,15 +221,17 @@ btr_cur_optimistic_insert(
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
- mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
+ mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction;
if this function returns DB_SUCCESS on
a leaf page of a secondary index in a
@@ -256,15 +259,17 @@ btr_cur_pessimistic_insert(
cursor stays valid */
ulint** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
succeed */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or
- NULL */
+ be stored externally by the caller */
ulint n_ext, /*!< in: number of externally stored columns */
- que_thr_t* thr, /*!< in: query thread or NULL */
+ que_thr_t* thr, /*!< in/out: query thread; can be NULL if
+ !(~flags
+ & (BTR_NO_LOCKING_FLAG
+ | BTR_NO_UNDO_LOG_FLAG)) */
mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
@@ -392,12 +397,12 @@ btr_cur_pessimistic_update(
ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
- that can be emptied, or NULL */
+ that can be emptied */
mem_heap_t* entry_heap,
/*!< in/out: memory heap for allocating
big_rec and the index tuple */
big_rec_t** big_rec,/*!< out: big rec vector whose fields have to
- be stored externally by the caller, or NULL */
+ be stored externally by the caller */
const upd_t* update, /*!< in: update vector; this is allowed also
contain trx id and roll ptr fields, but
the values in update vector have no effect */
diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic
index 555852474aa..8f5cee0fd5f 100644
--- a/storage/xtradb/include/data0type.ic
+++ b/storage/xtradb/include/data0type.ic
@@ -576,7 +576,8 @@ dtype_get_fixed_size_low(
#else /* !UNIV_HOTBACKUP */
return(len);
#endif /* !UNIV_HOTBACKUP */
- /* fall through for variable-length charsets */
+ /* Treat as variable-length. */
+ /* Fall through */
case DATA_VARCHAR:
case DATA_BINARY:
case DATA_DECIMAL:
diff --git a/storage/xtradb/include/fil0fil.h b/storage/xtradb/include/fil0fil.h
index 6e7bd742374..9bba03f5200 100644
--- a/storage/xtradb/include/fil0fil.h
+++ b/storage/xtradb/include/fil0fil.h
@@ -778,7 +778,7 @@ fil_create_new_single_table_tablespace(
ulint size) /*!< in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2), warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
diff --git a/storage/xtradb/include/ha_prototypes.h b/storage/xtradb/include/ha_prototypes.h
index b1975287f23..1dfbfe7c8fb 100644
--- a/storage/xtradb/include/ha_prototypes.h
+++ b/storage/xtradb/include/ha_prototypes.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -143,7 +144,7 @@ enum durability_properties
thd_requested_durability(
/*=====================*/
const THD* thd) /*!< in: thread handle */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/******************************************************************//**
Returns true if the transaction this thread is processing has edited
diff --git a/storage/xtradb/include/mach0data.ic b/storage/xtradb/include/mach0data.ic
index 4b9275cc12c..26d6c879c9b 100644
--- a/storage/xtradb/include/mach0data.ic
+++ b/storage/xtradb/include/mach0data.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -779,13 +780,13 @@ mach_swap_byte_order(
dest += len;
switch (len & 0x7) {
- case 0: *--dest = *from++;
- case 7: *--dest = *from++;
- case 6: *--dest = *from++;
- case 5: *--dest = *from++;
- case 4: *--dest = *from++;
- case 3: *--dest = *from++;
- case 2: *--dest = *from++;
+ case 0: *--dest = *from++; /* fall through */
+ case 7: *--dest = *from++; /* fall through */
+ case 6: *--dest = *from++; /* fall through */
+ case 5: *--dest = *from++; /* fall through */
+ case 4: *--dest = *from++; /* fall through */
+ case 3: *--dest = *from++; /* fall through */
+ case 2: *--dest = *from++; /* fall through */
case 1: *--dest = *from;
}
}
diff --git a/storage/xtradb/include/page0zip.ic b/storage/xtradb/include/page0zip.ic
index 6c7d8cd32c7..9a583086925 100644
--- a/storage/xtradb/include/page0zip.ic
+++ b/storage/xtradb/include/page0zip.ic
@@ -2,6 +2,7 @@
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, 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
@@ -172,7 +173,8 @@ page_zip_rec_needs_ext(
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
{
- ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES);
+ ut_ad(rec_size
+ > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES));
ut_ad(ut_is_2pow(zip_size));
ut_ad(comp || !zip_size);
diff --git a/storage/xtradb/include/trx0rec.h b/storage/xtradb/include/trx0rec.h
index 359937e3583..a6e202d04e4 100644
--- a/storage/xtradb/include/trx0rec.h
+++ b/storage/xtradb/include/trx0rec.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -212,10 +213,6 @@ UNIV_INTERN
dberr_t
trx_undo_report_row_operation(
/*==========================*/
- ulint flags, /*!< in: if BTR_NO_UNDO_LOG_FLAG bit is
- set, does nothing */
- ulint op_type, /*!< in: TRX_UNDO_INSERT_OP or
- TRX_UNDO_MODIFY_OP */
que_thr_t* thr, /*!< in: query thread */
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* clust_entry, /*!< in: in the case of an insert,
@@ -233,7 +230,7 @@ trx_undo_report_row_operation(
inserted undo log record,
0 if BTR_NO_UNDO_LOG
flag was specified */
- MY_ATTRIBUTE((nonnull(3,4,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
/******************************************************************//**
Copies an undo record to heap. This function can be called if we know that
the undo log record exists.
@@ -313,10 +310,6 @@ record */
storage fields: used by purge to
free the external storage */
-/* Operation type flags used in trx_undo_report_row_operation */
-#define TRX_UNDO_INSERT_OP 1
-#define TRX_UNDO_MODIFY_OP 2
-
#ifndef UNIV_NONINL
#include "trx0rec.ic"
#endif
diff --git a/storage/xtradb/include/ut0rnd.ic b/storage/xtradb/include/ut0rnd.ic
index 024c59e553b..987dfac03c1 100644
--- a/storage/xtradb/include/ut0rnd.ic
+++ b/storage/xtradb/include/ut0rnd.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -237,16 +238,22 @@ ut_fold_binary(
switch (len & 0x7) {
case 7:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 6:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 5:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 4:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 3:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 2:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
+ /* fall through */
case 1:
fold = ut_fold_ulint_pair(fold, (ulint)(*str++));
}
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index ffbb1601ca5..e570f7ed494 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -4788,13 +4788,11 @@ lock_rec_unlock(
trx_mutex_exit(trx);
stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Error: unlock row could not"
- " find a %lu mode lock on the record\n",
- (ulong) lock_mode);
- ut_print_timestamp(stderr);
- fprintf(stderr, " InnoDB: current statement: %.*s\n",
+
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "unlock row could not find a %u mode lock on the record;"
+ " statement=%.*s",
+ lock_mode,
(int) stmt_len, stmt);
return;
diff --git a/storage/xtradb/rem/rem0rec.cc b/storage/xtradb/rem/rem0rec.cc
index c6d9ba935e1..1316c4f35c6 100644
--- a/storage/xtradb/rem/rem0rec.cc
+++ b/storage/xtradb/rem/rem0rec.cc
@@ -1290,8 +1290,10 @@ rec_convert_dtuple_to_rec_comp(
}
}
- memcpy(end, dfield_get_data(field), len);
- end += len;
+ if (len) {
+ memcpy(end, dfield_get_data(field), len);
+ end += len;
+ }
}
}
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index 13877b8fe08..734b4f8b2f7 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -228,9 +229,6 @@ row_fts_psort_info_init(
each parallel sort thread. Each "sort bucket" holds records for
a particular "FTS index partition" */
for (j = 0; j < fts_sort_pll_degree; j++) {
-
- UT_LIST_INIT(psort_info[j].fts_doc_list);
-
for (i = 0; i < FTS_NUM_AUX_INDEX; i++) {
psort_info[j].merge_file[i] =
diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc
index 23b9ba60269..bc7b5206a64 100644
--- a/storage/xtradb/row/row0import.cc
+++ b/storage/xtradb/row/row0import.cc
@@ -2018,6 +2018,7 @@ PageConverter::update_page(
case FIL_PAGE_TYPE_XDES:
err = set_current_xdes(
buf_block_get_page_no(block), get_frame(block));
+ /* fall through */
case FIL_PAGE_INODE:
case FIL_PAGE_TYPE_TRX_SYS:
case FIL_PAGE_IBUF_FREE_LIST:
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index 49744959dc6..ec9f74cd4ad 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -2139,14 +2140,10 @@ for a clustered index!
@retval DB_SUCCESS if no error
@retval DB_DUPLICATE_KEY if error,
@retval DB_LOCK_WAIT if we have to wait for a lock on a possible duplicate
-record
-@retval DB_SUCCESS_LOCKED_REC if an exact match of the record was found
-in online table rebuild (flags & (BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG)) */
+record */
static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust(
-/*=============================*/
- ulint flags, /*!< in: undo logging and locking flags */
btr_cur_t* cursor, /*!< in: B-tree cursor */
const dtuple_t* entry, /*!< in: entry to insert */
que_thr_t* thr, /*!< in: query thread */
@@ -2421,7 +2418,7 @@ row_ins_clust_index_entry_low(
DB_LOCK_WAIT */
err = row_ins_duplicate_error_in_clust(
- flags, &cursor, entry, thr, &mtr);
+ &cursor, entry, thr, &mtr);
}
if (err != DB_SUCCESS) {
diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc
index 79c249d52ec..874c0901451 100644
--- a/storage/xtradb/row/row0log.cc
+++ b/storage/xtradb/row/row0log.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -1872,6 +1873,7 @@ row_log_table_apply_update(
When applying the subsequent ROW_T_DELETE, no matching
record will be found. */
+ /* fall through */
case DB_SUCCESS:
ut_ad(row != NULL);
break;
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index c0c2b6fbabe..eca26ce9763 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -5421,7 +5421,8 @@ loop:
fputs(" InnoDB: Warning: CHECK TABLE on ", stderr);
dict_index_name_print(stderr, prebuilt->trx, index);
fprintf(stderr, " returned %lu\n", ret);
- /* fall through (this error is ignored by CHECK TABLE) */
+ /* (this error is ignored by CHECK TABLE) */
+ /* fall through */
case DB_END_OF_INDEX:
func_exit:
mem_free(buf);
diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc
index 35b3520749b..d1a7ac2036e 100644
--- a/storage/xtradb/row/row0purge.cc
+++ b/storage/xtradb/row/row0purge.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -488,8 +489,9 @@ row_purge_remove_sec_if_poss_leaf(
success = false;
}
}
- /* fall through (the index entry is still needed,
+ /* (The index entry is still needed,
or the deletion succeeded) */
+ /* fall through */
case ROW_NOT_DELETED_REF:
/* The index entry is still needed. */
case ROW_BUFFERED:
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index 219a6b3c014..22d7312643b 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -401,7 +401,7 @@ UNIV_INTERN my_bool srv_cleaner_thread_priority = FALSE;
UNIV_INTERN my_bool srv_master_thread_priority = FALSE;
/* The number of purge threads to use.*/
-UNIV_INTERN ulong srv_n_purge_threads = 1;
+UNIV_INTERN ulong srv_n_purge_threads;
/* the number of pages to purge in one batch */
UNIV_INTERN ulong srv_purge_batch_size = 20;
@@ -626,16 +626,16 @@ current_time % 5 != 0. */
/** Acquire the system_mutex. */
#define srv_sys_mutex_enter() do { \
- mutex_enter(&srv_sys->mutex); \
+ mutex_enter(&srv_sys.mutex); \
} while (0)
/** Test if the system mutex is owned. */
-#define srv_sys_mutex_own() (mutex_own(&srv_sys->mutex) \
+#define srv_sys_mutex_own() (mutex_own(&srv_sys.mutex) \
&& !srv_read_only_mode)
/** Release the system mutex. */
#define srv_sys_mutex_exit() do { \
- mutex_exit(&srv_sys->mutex); \
+ mutex_exit(&srv_sys.mutex); \
} while (0)
#define fetch_lock_wait_timeout(trx) \
@@ -730,7 +730,7 @@ struct srv_sys_t{
ulint n_sys_threads; /*!< size of the sys_threads
array */
- srv_slot_t* sys_threads; /*!< server thread table;
+ srv_slot_t sys_threads[32 + 1]; /*!< server thread table;
os_event_set() and
os_event_reset() on
sys_threads[]->event are
@@ -754,7 +754,7 @@ struct srv_sys_t{
UNIV_INTERN ib_mutex_t server_mutex;
#endif /* !HAVE_ATOMIC_BUILTINS */
-static srv_sys_t* srv_sys = NULL;
+static srv_sys_t srv_sys;
/** Event to signal srv_monitor_thread. Not protected by a mutex.
Set after setting srv_print_innodb_monitor. */
@@ -776,10 +776,10 @@ and/or load it during startup. */
UNIV_INTERN char srv_buffer_pool_dump_at_shutdown = FALSE;
UNIV_INTERN char srv_buffer_pool_load_at_startup = FALSE;
-/** Slot index in the srv_sys->sys_threads array for the purge thread. */
+/** Slot index in the srv_sys.sys_threads array for the purge thread. */
static const ulint SRV_PURGE_SLOT = 1;
-/** Slot index in the srv_sys->sys_threads array for the master thread. */
+/** Slot index in the srv_sys.sys_threads array for the master thread. */
static const ulint SRV_MASTER_SLOT = 0;
UNIV_INTERN os_event_t srv_checkpoint_completed_event;
@@ -889,21 +889,21 @@ srv_reserve_slot(
switch (type) {
case SRV_MASTER:
- slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
+ slot = &srv_sys.sys_threads[SRV_MASTER_SLOT];
break;
case SRV_PURGE:
- slot = &srv_sys->sys_threads[SRV_PURGE_SLOT];
+ slot = &srv_sys.sys_threads[SRV_PURGE_SLOT];
break;
case SRV_WORKER:
/* Find an empty slot, skip the master and purge slots. */
- for (slot = &srv_sys->sys_threads[2];
+ for (slot = &srv_sys.sys_threads[2];
slot->in_use;
++slot) {
- ut_a(slot < &srv_sys->sys_threads[
- srv_sys->n_sys_threads]);
+ ut_a(slot < &srv_sys.sys_threads[
+ srv_sys.n_sys_threads]);
}
break;
@@ -919,7 +919,7 @@ srv_reserve_slot(
ut_ad(srv_slot_get_type(slot) == type);
- ++srv_sys->n_threads_active[type];
+ ++srv_sys.n_threads_active[type];
srv_sys_mutex_exit();
@@ -949,27 +949,27 @@ srv_suspend_thread_low(
case SRV_MASTER:
/* We have only one master thread and it
should be the first entry always. */
- ut_a(srv_sys->n_threads_active[type] == 1);
+ ut_a(srv_sys.n_threads_active[type] == 1);
break;
case SRV_PURGE:
/* We have only one purge coordinator thread
and it should be the second entry always. */
- ut_a(srv_sys->n_threads_active[type] == 1);
+ ut_a(srv_sys.n_threads_active[type] == 1);
break;
case SRV_WORKER:
ut_a(srv_n_purge_threads > 1);
- ut_a(srv_sys->n_threads_active[type] > 0);
+ ut_a(srv_sys.n_threads_active[type] > 0);
break;
}
ut_a(!slot->suspended);
slot->suspended = TRUE;
- ut_a(srv_sys->n_threads_active[type] > 0);
+ ut_a(srv_sys.n_threads_active[type] > 0);
- srv_sys->n_threads_active[type]--;
+ srv_sys.n_threads_active[type]--;
return(os_event_reset(slot->event));
}
@@ -1024,7 +1024,7 @@ srv_resume_thread(srv_slot_t* slot, ib_int64_t sig_count = 0, bool wait = true,
ut_ad(slot->suspended);
slot->suspended = FALSE;
- ++srv_sys->n_threads_active[slot->type];
+ ++srv_sys.n_threads_active[slot->type];
srv_sys_mutex_exit();
return(timeout);
}
@@ -1046,8 +1046,8 @@ srv_release_threads(enum srv_thread_type type, ulint n)
srv_sys_mutex_enter();
- for (ulint i = 0; i < srv_sys->n_sys_threads; i++) {
- srv_slot_t* slot = &srv_sys->sys_threads[i];
+ for (ulint i = 0; i < srv_sys.n_sys_threads; i++) {
+ srv_slot_t* slot = &srv_sys.sys_threads[i];
if (!slot->in_use || srv_slot_get_type(slot) != type) {
continue;
@@ -1067,7 +1067,7 @@ srv_release_threads(enum srv_thread_type type, ulint n)
should be the first entry always. */
ut_a(n == 1);
ut_a(i == SRV_MASTER_SLOT);
- ut_a(srv_sys->n_threads_active[type] == 0);
+ ut_a(srv_sys.n_threads_active[type] == 0);
break;
case SRV_PURGE:
@@ -1076,12 +1076,12 @@ srv_release_threads(enum srv_thread_type type, ulint n)
ut_a(n == 1);
ut_a(i == SRV_PURGE_SLOT);
ut_a(srv_n_purge_threads > 0);
- ut_a(srv_sys->n_threads_active[type] == 0);
+ ut_a(srv_sys.n_threads_active[type] == 0);
break;
case SRV_WORKER:
ut_a(srv_n_purge_threads > 1);
- ut_a(srv_sys->n_threads_active[type]
+ ut_a(srv_sys.n_threads_active[type]
< srv_n_purge_threads - 1);
break;
}
@@ -1119,9 +1119,6 @@ void
srv_init(void)
/*==========*/
{
- ulint n_sys_threads = 0;
- ulint srv_sys_sz = sizeof(*srv_sys);
-
#ifndef HAVE_ATOMIC_BUILTINS
mutex_create(server_mutex_key, &server_mutex, SYNC_ANY_LATCH);
#endif /* !HAVE_ATOMIC_BUILTINS */
@@ -1129,29 +1126,19 @@ srv_init(void)
mutex_create(srv_innodb_monitor_mutex_key,
&srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
- if (!srv_read_only_mode) {
-
- /* Number of purge threads + master thread */
- n_sys_threads = srv_n_purge_threads + 1;
-
- srv_sys_sz += n_sys_threads * sizeof(*srv_sys->sys_threads);
- }
-
- srv_sys = static_cast<srv_sys_t*>(mem_zalloc(srv_sys_sz));
-
- srv_sys->n_sys_threads = n_sys_threads;
+ srv_sys.n_sys_threads = srv_read_only_mode
+ ? 0
+ : srv_n_purge_threads + 1/* purge coordinator */;
if (!srv_read_only_mode) {
- mutex_create(srv_sys_mutex_key, &srv_sys->mutex, SYNC_THREADS);
+ mutex_create(srv_sys_mutex_key, &srv_sys.mutex, SYNC_THREADS);
mutex_create(srv_sys_tasks_mutex_key,
- &srv_sys->tasks_mutex, SYNC_ANY_LATCH);
-
- srv_sys->sys_threads = (srv_slot_t*) &srv_sys[1];
+ &srv_sys.tasks_mutex, SYNC_ANY_LATCH);
- for (ulint i = 0; i < srv_sys->n_sys_threads; ++i) {
- srv_slot_t* slot = &srv_sys->sys_threads[i];
+ for (ulint i = 0; i < srv_sys.n_sys_threads; ++i) {
+ srv_slot_t* slot = &srv_sys.sys_threads[i];
slot->event = os_event_create();
@@ -1171,8 +1158,6 @@ srv_init(void)
if (srv_track_changed_pages) {
os_event_set(srv_redo_log_tracked_event);
}
-
- UT_LIST_INIT(srv_sys->tasks);
}
/* page_zip_stat_per_index_mutex is acquired from:
@@ -1212,8 +1197,8 @@ srv_free(void)
if (!srv_read_only_mode) {
- for (ulint i = 0; i < srv_sys->n_sys_threads; i++)
- os_event_free(srv_sys->sys_threads[i].event);
+ for (ulint i = 0; i < srv_sys.n_sys_threads; i++)
+ os_event_free(srv_sys.sys_threads[i].event);
os_event_free(srv_error_event);
srv_error_event = NULL;
@@ -1225,8 +1210,8 @@ srv_free(void)
srv_checkpoint_completed_event = NULL;
os_event_free(srv_redo_log_tracked_event);
srv_redo_log_tracked_event = NULL;
- mutex_free(&srv_sys->mutex);
- mutex_free(&srv_sys->tasks_mutex);
+ mutex_free(&srv_sys.mutex);
+ mutex_free(&srv_sys.tasks_mutex);
}
#ifndef HAVE_ATOMIC_BUILTINS
@@ -1235,9 +1220,6 @@ srv_free(void)
mutex_free(&srv_innodb_monitor_mutex);
mutex_free(&page_zip_stat_per_index_mutex);
- mem_free(srv_sys);
- srv_sys = NULL;
-
trx_i_s_cache_free(trx_i_s_cache);
}
@@ -2320,9 +2302,9 @@ srv_inc_activity_count(
is caused by the background
change buffer merge */
{
- srv_sys->activity_count.inc();
+ srv_sys.activity_count.inc();
if (ibuf_merge_activity)
- srv_sys->ibuf_merge_activity_count.inc();
+ srv_sys.ibuf_merge_activity_count.inc();
}
/**********************************************************************//**
@@ -2344,7 +2326,7 @@ srv_get_active_thread_type(void)
srv_sys_mutex_enter();
for (ulint i = SRV_WORKER; i <= SRV_MASTER; ++i) {
- if (srv_sys->n_threads_active[i] != 0) {
+ if (srv_sys.n_threads_active[i] != 0) {
ret = static_cast<srv_thread_type>(i);
break;
}
@@ -2597,12 +2579,12 @@ srv_active_wake_master_thread(void)
srv_inc_activity_count();
- if (srv_sys->n_threads_active[SRV_MASTER] == 0) {
+ if (srv_sys.n_threads_active[SRV_MASTER] == 0) {
srv_slot_t* slot;
srv_sys_mutex_enter();
- slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
+ slot = &srv_sys.sys_threads[SRV_MASTER_SLOT];
/* Only if the master thread has been started. */
@@ -2629,7 +2611,7 @@ srv_wake_purge_thread_if_not_active(void)
ut_ad(!srv_sys_mutex_own());
if (purge_sys->state == PURGE_STATE_RUN
- && srv_sys->n_threads_active[SRV_PURGE] == 0) {
+ && srv_sys.n_threads_active[SRV_PURGE] == 0) {
srv_release_threads(SRV_PURGE, 1);
}
@@ -2658,7 +2640,7 @@ ulint
srv_get_activity_count(void)
/*========================*/
{
- return(srv_sys->activity_count);
+ return(srv_sys.activity_count);
}
/** Get current server ibuf merge activity count.
@@ -2667,7 +2649,7 @@ static
ulint
srv_get_ibuf_merge_activity_count(void)
{
- return(srv_sys->ibuf_merge_activity_count);
+ return(srv_sys.ibuf_merge_activity_count);
}
/*******************************************************************//**
@@ -2686,14 +2668,14 @@ srv_check_activity(
ULINT_UNDEFINED */
ulint old_ibuf_merge_activity_count)
{
- ulint new_activity_count = srv_sys->activity_count;
+ ulint new_activity_count = srv_sys.activity_count;
if (old_ibuf_merge_activity_count == ULINT_UNDEFINED)
return(new_activity_count != old_activity_count);
/* If we care about ibuf merge activity, then the server is considered
idle if all activity, if any, was due to ibuf merge. */
ulint new_ibuf_merge_activity_count
- = srv_sys->ibuf_merge_activity_count;
+ = srv_sys.ibuf_merge_activity_count;
ut_ad(new_ibuf_merge_activity_count <= new_activity_count);
ut_ad(new_ibuf_merge_activity_count >= old_ibuf_merge_activity_count);
@@ -3086,7 +3068,7 @@ DECLARE_THREAD(srv_master_thread)(
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
slot = srv_reserve_slot(SRV_MASTER);
- ut_a(slot == srv_sys->sys_threads);
+ ut_a(slot == srv_sys.sys_threads);
last_print_time = ut_time();
loop:
@@ -3183,18 +3165,18 @@ srv_task_execute(void)
ut_ad(!srv_read_only_mode);
ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- if (UT_LIST_GET_LEN(srv_sys->tasks) > 0) {
+ if (UT_LIST_GET_LEN(srv_sys.tasks) > 0) {
- thr = UT_LIST_GET_FIRST(srv_sys->tasks);
+ thr = UT_LIST_GET_FIRST(srv_sys.tasks);
ut_a(que_node_get_type(thr->child) == QUE_NODE_PURGE);
- UT_LIST_REMOVE(queue, srv_sys->tasks, thr);
+ UT_LIST_REMOVE(queue, srv_sys.tasks, thr);
}
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
if (thr != NULL) {
@@ -3246,7 +3228,7 @@ DECLARE_THREAD(srv_worker_thread)(
srv_sys_mutex_enter();
- ut_a(srv_sys->n_threads_active[SRV_WORKER] < srv_n_purge_threads);
+ ut_a(srv_sys.n_threads_active[SRV_WORKER] < srv_n_purge_threads);
srv_sys_mutex_exit();
@@ -3590,11 +3572,11 @@ srv_que_task_enqueue_low(
que_thr_t* thr) /*!< in: query thread */
{
ut_ad(!srv_read_only_mode);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
+ UT_LIST_ADD_LAST(queue, srv_sys.tasks, thr);
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
srv_release_threads(SRV_WORKER, 1);
}
@@ -3611,11 +3593,11 @@ srv_get_task_queue_length(void)
ut_ad(!srv_read_only_mode);
- mutex_enter(&srv_sys->tasks_mutex);
+ mutex_enter(&srv_sys.tasks_mutex);
- n_tasks = UT_LIST_GET_LEN(srv_sys->tasks);
+ n_tasks = UT_LIST_GET_LEN(srv_sys.tasks);
- mutex_exit(&srv_sys->tasks_mutex);
+ mutex_exit(&srv_sys.tasks_mutex);
return(n_tasks);
}
diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc
index c270b73e5a0..48cfbf4d6c3 100644
--- a/storage/xtradb/sync/sync0sync.cc
+++ b/storage/xtradb/sync/sync0sync.cc
@@ -1220,6 +1220,7 @@ sync_thread_add_level(
upgrading in innobase_start_or_create_for_mysql(). */
break;
}
+ /* fall through */
case SYNC_MEM_POOL:
case SYNC_MEM_HASH:
case SYNC_RECV:
@@ -1282,9 +1283,9 @@ sync_thread_add_level(
}
}
ut_ad(found_current);
-
- /* fallthrough */
}
+
+ /* fall through */
case SYNC_BUF_FLUSH_LIST:
case SYNC_BUF_LRU_LIST:
case SYNC_BUF_FREE_LIST:
diff --git a/storage/xtradb/trx/trx0i_s.cc b/storage/xtradb/trx/trx0i_s.cc
index eacd9212d2f..0c9618d98eb 100644
--- a/storage/xtradb/trx/trx0i_s.cc
+++ b/storage/xtradb/trx/trx0i_s.cc
@@ -507,7 +507,9 @@ fill_trx_row(
row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd);
- stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
+ stmt = trx->mysql_thd
+ ? innobase_get_stmt(trx->mysql_thd, &stmt_len)
+ : NULL;
if (stmt != NULL) {
char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1];
diff --git a/storage/xtradb/trx/trx0rec.cc b/storage/xtradb/trx/trx0rec.cc
index 74a63b60286..8c0904dd57b 100644
--- a/storage/xtradb/trx/trx0rec.cc
+++ b/storage/xtradb/trx/trx0rec.cc
@@ -1186,10 +1186,6 @@ UNIV_INTERN
dberr_t
trx_undo_report_row_operation(
/*==========================*/
- ulint flags, /*!< in: if BTR_NO_UNDO_LOG_FLAG bit is
- set, does nothing */
- ulint op_type, /*!< in: TRX_UNDO_INSERT_OP or
- TRX_UNDO_MODIFY_OP */
que_thr_t* thr, /*!< in: query thread */
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* clust_entry, /*!< in: in the case of an insert,
@@ -1223,16 +1219,8 @@ trx_undo_report_row_operation(
ut_a(dict_index_is_clust(index));
ut_ad(!rec || rec_offs_validate(rec, index, offsets));
- if (flags & BTR_NO_UNDO_LOG_FLAG) {
-
- *roll_ptr = 0;
-
- return(DB_SUCCESS);
- }
-
ut_ad(thr);
- ut_ad((op_type != TRX_UNDO_INSERT_OP)
- || (clust_entry && !update && !rec));
+ ut_ad(!clust_entry || (!update && !rec));
trx = thr_get_trx(thr);
@@ -1253,8 +1241,7 @@ trx_undo_report_row_operation(
/* If the undo log is not assigned yet, assign one */
- switch (op_type) {
- case TRX_UNDO_INSERT_OP:
+ if (clust_entry) {
undo = trx->insert_undo;
if (undo == NULL) {
@@ -1270,10 +1257,7 @@ trx_undo_report_row_operation(
ut_ad(err == DB_SUCCESS);
}
- break;
- default:
- ut_ad(op_type == TRX_UNDO_MODIFY_OP);
-
+ } else {
undo = trx->update_undo;
if (undo == NULL) {
@@ -1297,23 +1281,15 @@ trx_undo_report_row_operation(
buf_block_dbg_add_level(undo_block, SYNC_TRX_UNDO_PAGE);
do {
- page_t* undo_page;
- ulint offset;
-
- undo_page = buf_block_get_frame(undo_block);
ut_ad(page_no == buf_block_get_page_no(undo_block));
- switch (op_type) {
- case TRX_UNDO_INSERT_OP:
- offset = trx_undo_page_report_insert(
- undo_page, trx, index, clust_entry, &mtr);
- break;
- default:
- ut_ad(op_type == TRX_UNDO_MODIFY_OP);
- offset = trx_undo_page_report_modify(
+ page_t* undo_page = buf_block_get_frame(undo_block);
+ ulint offset = clust_entry
+ ? trx_undo_page_report_insert(
+ undo_page, trx, index, clust_entry, &mtr)
+ : trx_undo_page_report_modify(
undo_page, trx, index, rec, offsets, update,
cmpl_info, &mtr);
- }
if (UNIV_UNLIKELY(offset == 0)) {
/* The record did not fit on the page. We erase the
@@ -1364,7 +1340,7 @@ trx_undo_report_row_operation(
mutex_exit(&trx->undo_mutex);
*roll_ptr = trx_undo_build_roll_ptr(
- op_type == TRX_UNDO_INSERT_OP,
+ clust_entry != NULL,
rseg->id, page_no, offset);
return(DB_SUCCESS);
}
diff --git a/storage/xtradb/usr/usr0sess.cc b/storage/xtradb/usr/usr0sess.cc
index ab7ba6bea09..e1bd71ff1a0 100644
--- a/storage/xtradb/usr/usr0sess.cc
+++ b/storage/xtradb/usr/usr0sess.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 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
@@ -48,8 +49,6 @@ sess_open(void)
sess->trx = trx_allocate_for_background();
sess->trx->sess = sess;
- UT_LIST_INIT(sess->graphs);
-
return(sess);
}
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index b4fc6297afd..f32150efa40 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -5031,7 +5031,9 @@ static int my_uni_utf8_no_range(CHARSET_INFO *cs __attribute__((unused)),
{
/* Fall through all cases!!! */
case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0]= (uchar) wc;
}
return count;
@@ -7509,8 +7511,11 @@ my_wc_mb_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
switch (count) {
/* Fall through all cases!!! */
case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000;
+ /* fall through */
case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0] = (uchar) wc;
}
return count;
@@ -7541,8 +7546,11 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)),
{
/* Fall through all cases!!! */
case 4: r[3]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x10000;
+ /* fall through */
case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0]= (uchar) wc;
}
return count;
diff --git a/strings/dtoa.c b/strings/dtoa.c
index c3ab347f94c..e66db5fed3d 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, MariaDB Corporation.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -1377,7 +1378,7 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
switch (*s) {
case '-':
sign= 1;
- /* no break */
+ /* fall through */
case '+':
s++;
goto break2;
@@ -1467,6 +1468,7 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
switch (c= *s) {
case '-':
esign= 1;
+ /* fall through */
case '+':
c= *++s;
}
@@ -2360,7 +2362,7 @@ static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
break;
case 2:
leftright= 0;
- /* no break */
+ /* fall through */
case 4:
if (ndigits <= 0)
ndigits= 1;
@@ -2368,7 +2370,7 @@ static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
break;
case 3:
leftright= 0;
- /* no break */
+ /* fall through */
case 5:
i= ndigits + k + 1;
ilim= i;