diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index a91ec63bedd..cd3ddd83900 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -27,6 +27,7 @@ SET(MY_WARNING_FLAGS -Wenum-conversion -Wextra -Wformat-security + -Winconsistent-missing-override -Wmissing-braces -Wno-format-truncation -Wno-init-self @@ -34,8 +35,9 @@ SET(MY_WARNING_FLAGS -Wno-null-conversion -Wno-unused-parameter -Wno-unused-private-field - -Woverloaded-virtual -Wnon-virtual-dtor + -Woverloaded-virtual + -Wsuggest-override -Wvla -Wwrite-strings ) diff --git a/extra/perror.c b/extra/perror.c index ee6e362e06b..d678d46d1be 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -359,7 +359,8 @@ int main(int argc,char *argv[]) { found= 1; if (verbose) - printf("MariaDB error code %3d (%s): %s\n", code, name, msg); + printf("MariaDB error code %3d (%s): %s\n" + "Learn more: https://mariadb.com/kb/en/e%3d/\n", code, name, msg, code); else puts(msg); } diff --git a/mysql-test/main/ctype_uca.result b/mysql-test/main/ctype_uca.result index f9b831176f8..959a68172b2 100644 --- a/mysql-test/main/ctype_uca.result +++ b/mysql-test/main/ctype_uca.result @@ -15370,3 +15370,39 @@ DROP TABLE t1; # # End of MariaDB-10.2 tests # +# +# Start of 10.5 tests +# +# +# MDEV-34417 Wrong result set with utf8mb4_danish_ci and BNLH join +# +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci); +INSERT INTO t1 VALUES ('aaaa'),('åå'); +SELECT * FROM t1 WHERE a='aaaa'; +a +aaaa +åå +SET join_cache_level=1; +SELECT * FROM t1 NATURAL JOIN t1 t2; +a +aaaa +åå +aaaa +åå +# Expect a BNHL join +SET join_cache_level=3; +EXPLAIN SELECT * FROM t1 NATURAL JOIN t1 t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 2003 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) +SELECT * FROM t1 NATURAL JOIN t1 t2; +a +aaaa +åå +aaaa +åå +DROP TABLE t1; +SET join_cache_level=DEFAULT; +# +# End of 10.5 tests +# diff --git a/mysql-test/main/ctype_uca.test b/mysql-test/main/ctype_uca.test index 8ccda3e680c..a88db7ea512 100644 --- a/mysql-test/main/ctype_uca.test +++ b/mysql-test/main/ctype_uca.test @@ -696,3 +696,32 @@ DROP TABLE t1; --echo # --echo # End of MariaDB-10.2 tests --echo # + + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-34417 Wrong result set with utf8mb4_danish_ci and BNLH join +--echo # + +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci); +INSERT INTO t1 VALUES ('aaaa'),('åå'); +SELECT * FROM t1 WHERE a='aaaa'; + +SET join_cache_level=1; +SELECT * FROM t1 NATURAL JOIN t1 t2; + +--echo # Expect a BNHL join +SET join_cache_level=3; +EXPLAIN SELECT * FROM t1 NATURAL JOIN t1 t2; +SELECT * FROM t1 NATURAL JOIN t1 t2; + +DROP TABLE t1; +SET join_cache_level=DEFAULT; + + +--echo # +--echo # End of 10.5 tests +--echo # diff --git a/mysql-test/main/func_misc.result b/mysql-test/main/func_misc.result index fb260d978c4..413d8003b09 100644 --- a/mysql-test/main/func_misc.result +++ b/mysql-test/main/func_misc.result @@ -1743,3 +1743,16 @@ RELEASE_ALL_LOCKS() SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; LOCK_MODE LOCK_TYPE TABLE_SCHEMA +# +# MDEV-32583 UUID() should be treated as stochastic for the purposes of +# forcing query materialization +# +create table t1 as WITH cte AS (SELECT UUID() as r FROM seq_1_to_10) +SELECT r as r1, r FROM cte; +select count(*) from t1 where r1!=r; +count(*) +0 +drop table t1; +# +# End of 10.5 tests +# diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test index 64e2e44084d..e3439c40a3c 100644 --- a/mysql-test/main/func_misc.test +++ b/mysql-test/main/func_misc.test @@ -1366,3 +1366,18 @@ FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHE --enable_ps2_protocol --enable_view_protocol + +--echo # +--echo # MDEV-32583 UUID() should be treated as stochastic for the purposes of +--echo # forcing query materialization +--echo # + +--source include/have_sequence.inc +create table t1 as WITH cte AS (SELECT UUID() as r FROM seq_1_to_10) +SELECT r as r1, r FROM cte; +select count(*) from t1 where r1!=r; +drop table t1; + +--echo # +--echo # End of 10.5 tests +--echo # diff --git a/mysql-test/main/perror-win.result b/mysql-test/main/perror-win.result index a0ea54f9187..696dd47b72d 100644 --- a/mysql-test/main/perror-win.result +++ b/mysql-test/main/perror-win.result @@ -3,5 +3,6 @@ Win32 error code 150: System trace information was not specified in your CONFIG. OS error code 23: Too many open files in system Win32 error code 23: Data error (cyclic redundancy check). MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d +Learn more: https://mariadb.com/kb/en/e1062/ Win32 error code 1062: The service has not been started. Illegal error code: 30000 diff --git a/mysql-test/main/perror.result b/mysql-test/main/perror.result index b95b8b8dd99..a6293bda6d8 100644 --- a/mysql-test/main/perror.result +++ b/mysql-test/main/perror.result @@ -1,6 +1,10 @@ Illegal error code: 10000 MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d +Learn more: https://mariadb.com/kb/en/e1062/ MariaDB error code 1408 (ER_STARTUP): %s: ready for connections. Version: '%s' socket: '%s' port: %d %s +Learn more: https://mariadb.com/kb/en/e1408/ MariaDB error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it! +Learn more: https://mariadb.com/kb/en/e1459/ MariaDB error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u) +Learn more: https://mariadb.com/kb/en/e1461/ diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index 15b738ea940..0a2b36d3230 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -2062,21 +2062,24 @@ DROP TABLE t1; CREATE TABLE t1 (pk int) engine=myisam ; INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 ( -pk int auto_increment PRIMARY KEY, -i1 int, i2 int, c2 varchar(1), -KEY (i1), KEY (i2) +pk int PRIMARY KEY, +i1 int, i2 int, +c2 varchar(100), +KEY (i1), +KEY (i2) ) engine=myisam; -INSERT INTO t2 VALUES -(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'), -(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'), -(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u'); +insert into t2 +select +seq, floor(seq/100), floor(seq/100), 'abcd' +from +seq_1_to_10000; SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3); pk EXPLAIN EXTENDED SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t2 ref i1,i2 i1 5 const 1 100.00 Using index condition; Using where +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0 DROP TABLE t1,t2; diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test index a2543e197ca..61ddf32407e 100644 --- a/mysql-test/main/rowid_filter.test +++ b/mysql-test/main/rowid_filter.test @@ -298,15 +298,18 @@ CREATE TABLE t1 (pk int) engine=myisam ; INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 ( - pk int auto_increment PRIMARY KEY, - i1 int, i2 int, c2 varchar(1), - KEY (i1), KEY (i2) + pk int PRIMARY KEY, + i1 int, i2 int, + c2 varchar(100), + KEY (i1), + KEY (i2) ) engine=myisam; -INSERT INTO t2 VALUES - (1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'), - (6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'), - (11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u'); +insert into t2 +select + seq, floor(seq/100), floor(seq/100), 'abcd' +from + seq_1_to_10000; SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3); EXPLAIN EXTENDED diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index f3818f25924..f7f3d1a6f4e 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -2018,21 +2018,24 @@ DROP TABLE t1; CREATE TABLE t1 (pk int) engine=myisam ; INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 ( -pk int auto_increment PRIMARY KEY, -i1 int, i2 int, c2 varchar(1), -KEY (i1), KEY (i2) +pk int PRIMARY KEY, +i1 int, i2 int, +c2 varchar(100), +KEY (i1), +KEY (i2) ) engine=myisam; -INSERT INTO t2 VALUES -(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'), -(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'), -(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u'); +insert into t2 +select +seq, floor(seq/100), floor(seq/100), 'abcd' +from +seq_1_to_10000; SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3); pk EXPLAIN EXTENDED SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t2 ref i1,i2 i1 5 const 1 100.00 Using index condition; Using where +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0 DROP TABLE t1,t2; @@ -4000,5 +4003,71 @@ count(*) SET optimizer_switch=@save_optimizer_switch; DROP TABLE t0, t1; # End of 10.4 tests +# +# MDEV-33875: ORDER BY DESC causes ROWID Filter slowdown +# +create table t1 ( +pk int primary key auto_increment, +a int, +b int, +f1 varchar(200), +f2 varchar(200), +f3 varchar(200), +f4 varchar(200), +f5 varchar(200), +key(a, pk), +key(b) +) engine=innodb; +insert into t1 (a,b,f1, f2, f3, f4) select +seq, seq, +repeat('1-', 100), +repeat('2-', 100), +repeat('3-', 100), +repeat('4-', 100) +from +seq_1_to_5000; +insert into t1 (a,b,f1, f2, f3, f4)select +30100, 30100, +'abcd','abcd','abcd','abcd' +from +seq_1_to_250; +insert into t1 (a,b,f1) values ( 110, 100, 12345); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +# The following must NOT use Rowid Filter: +analyze format=json select * from t1 +where +a =30100 and b in (30100,30101,30102) +order by +pk desc; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ref", + "possible_keys": ["a", "b"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["const"], + "r_loops": 1, + "rows": 250, + "r_rows": 250, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "r_engine_stats": REPLACED, + "filtered": 4.799086094, + "r_filtered": 100, + "attached_condition": "t1.a <=> 30100 and t1.b in (30100,30101,30102)" + } + } +} +drop table t1; # End of 10.6 tests set global innodb_stats_persistent= @stats.save; diff --git a/mysql-test/main/rowid_filter_innodb.test b/mysql-test/main/rowid_filter_innodb.test index b0d65837127..d82dccd0551 100644 --- a/mysql-test/main/rowid_filter_innodb.test +++ b/mysql-test/main/rowid_filter_innodb.test @@ -760,7 +760,49 @@ DROP TABLE t0, t1; --echo # End of 10.4 tests +--echo # +--echo # MDEV-33875: ORDER BY DESC causes ROWID Filter slowdown +--echo # +create table t1 ( + pk int primary key auto_increment, + a int, + b int, + f1 varchar(200), + f2 varchar(200), + f3 varchar(200), + f4 varchar(200), + f5 varchar(200), + key(a, pk), + key(b) +) engine=innodb; + +insert into t1 (a,b,f1, f2, f3, f4) select + seq, seq, + repeat('1-', 100), + repeat('2-', 100), + repeat('3-', 100), + repeat('4-', 100) +from + seq_1_to_5000; + +insert into t1 (a,b,f1, f2, f3, f4)select + 30100, 30100, + 'abcd','abcd','abcd','abcd' +from + seq_1_to_250; +insert into t1 (a,b,f1) values ( 110, 100, 12345); +analyze table t1; + +--echo # The following must NOT use Rowid Filter: +--source include/analyze-format.inc +analyze format=json select * from t1 +where + a =30100 and b in (30100,30101,30102) +order by + pk desc; + +drop table t1; + --echo # End of 10.6 tests set global innodb_stats_persistent= @stats.save; - diff --git a/mysql-test/suite/binlog/t/binlog_recover_checksum_error.test b/mysql-test/suite/binlog/t/binlog_recover_checksum_error.test index 12c9f3d914f..377eaba89a5 100644 --- a/mysql-test/suite/binlog/t/binlog_recover_checksum_error.test +++ b/mysql-test/suite/binlog/t/binlog_recover_checksum_error.test @@ -16,7 +16,7 @@ call mtr.add_suppression("Error in Log_event::read_log_event"); # Proof of no crash follows. # There's no need for actual bin-loggable queries to the server ---let $restart_parameters= --master_verify_checksum=ON --debug_dbug="+d,corrupt_read_log_event_char" +--let $restart_parameters= --master_verify_checksum=ON --debug_dbug=+d,corrupt_read_log_event_char --let $shutdown_timeout=0 --source include/restart_mysqld.inc --let $restart_parameters= diff --git a/mysql-test/suite/galera/r/galera_kill_applier.result b/mysql-test/suite/galera/r/galera_kill_applier.result index a47f486b5fb..c0538212a5f 100644 --- a/mysql-test/suite/galera/r/galera_kill_applier.result +++ b/mysql-test/suite/galera/r/galera_kill_applier.result @@ -6,13 +6,13 @@ SELECT @@wsrep_slave_threads; 1 SET GLOBAL wsrep_slave_threads=2; KILL ID; -Got one of the listed errors +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster KILL QUERY ID; -Got one of the listed errors +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster KILL ID; -Got one of the listed errors +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster KILL QUERY ID; -Got one of the listed errors +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster SET GLOBAL wsrep_slave_threads=DEFAULT; connection node_1; create table t1(a int not null primary key) engine=innodb; diff --git a/mysql-test/suite/galera/r/galera_kill_bf.result b/mysql-test/suite/galera/r/galera_kill_bf.result new file mode 100644 index 00000000000..783ce7e09e4 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_kill_bf.result @@ -0,0 +1,25 @@ +connection node_2; +connection node_1; +connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1; +call mtr.add_suppression("WSREP: ALTER TABLE isolation failure"); +CREATE TABLE t1(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB; +INSERT into t1 values (1,1); +SET DEBUG_SYNC = 'alter_table_after_open_tables SIGNAL bf_started WAIT_FOR bf_continue'; +ALTER TABLE t1 DROP COLUMN c2;; +connection node_1; +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC = 'now WAIT_FOR bf_started'; +KILL ID; +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster +KILL QUERY ID; +ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL bf_continue'; +connection con1; +SET DEBUG_SYNC = 'RESET'; +SELECT * FROM t1; +c1 +1 +connection node_1; +DROP TABLE t1; +disconnect con1; diff --git a/mysql-test/suite/galera/t/galera_kill_applier.test b/mysql-test/suite/galera/t/galera_kill_applier.test index 88ec55ed0c1..90c553a0591 100644 --- a/mysql-test/suite/galera/t/galera_kill_applier.test +++ b/mysql-test/suite/galera/t/galera_kill_applier.test @@ -17,21 +17,21 @@ SET GLOBAL wsrep_slave_threads=2; --let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle' LIMIT 1` --replace_result $applier_thread ID ---error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR +--error ER_KILL_DENIED_ERROR --eval KILL $applier_thread --replace_result $applier_thread ID ---error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR +--error ER_KILL_DENIED_ERROR --eval KILL QUERY $applier_thread --let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` --replace_result $aborter_thread ID ---error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR +--error ER_KILL_DENIED_ERROR --eval KILL $aborter_thread --replace_result $aborter_thread ID ---error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR +--error ER_KILL_DENIED_ERROR --eval KILL QUERY $aborter_thread SET GLOBAL wsrep_slave_threads=DEFAULT; diff --git a/mysql-test/suite/galera/t/galera_kill_bf.test b/mysql-test/suite/galera/t/galera_kill_bf.test new file mode 100644 index 00000000000..ba588ab659d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_kill_bf.test @@ -0,0 +1,41 @@ +--source include/galera_cluster.inc +--source include/have_debug_sync.inc +--source include/have_debug.inc + +--connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1 + +call mtr.add_suppression("WSREP: ALTER TABLE isolation failure"); + +CREATE TABLE t1(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB; +INSERT into t1 values (1,1); + +SET DEBUG_SYNC = 'alter_table_after_open_tables SIGNAL bf_started WAIT_FOR bf_continue'; +--send ALTER TABLE t1 DROP COLUMN c2; + +--connection node_1 +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC = 'now WAIT_FOR bf_started'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_after_open_tables' +--source include/wait_condition.inc + +--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'debug sync point:%' LIMIT 1` + +--replace_result $applier_thread ID +--error ER_KILL_DENIED_ERROR +--eval KILL $applier_thread + +--replace_result $applier_thread ID +--error ER_KILL_DENIED_ERROR +--eval KILL QUERY $applier_thread + +--connection node_1 +SET DEBUG_SYNC = 'now SIGNAL bf_continue'; + +--connection con1 +--reap +SET DEBUG_SYNC = 'RESET'; +SELECT * FROM t1; + +--connection node_1 +DROP TABLE t1; +--disconnect con1 diff --git a/mysql-test/suite/galera_3nodes/t/MDEV-29171.test b/mysql-test/suite/galera_3nodes/t/MDEV-29171.test index 1ce33bee974..9e35cd0e0d9 100644 --- a/mysql-test/suite/galera_3nodes/t/MDEV-29171.test +++ b/mysql-test/suite/galera_3nodes/t/MDEV-29171.test @@ -90,7 +90,7 @@ show variables like 'wsrep_gtid_domain_id'; # If bug is present, node_3 remains on domain id 100 # --connection node_3 ---let $restart_parameters = --wsrep_sst_donor="node2" +--let $restart_parameters = --wsrep_sst_donor=node2 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect --source include/start_mysqld.inc diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result index 9879ef206f2..1a8f16e4efb 100644 --- a/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result +++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result @@ -6,3 +6,4 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile # MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways # # restart: --debug_dbug=+d,ib_buf_chunk_init_fails +FOUND 1 /\[ERROR\] InnoDB: Cannot allocate memory for the buffer pool/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/r/log_file_overwrite.result b/mysql-test/suite/innodb/r/log_file_overwrite.result new file mode 100644 index 00000000000..5f1f38784f6 --- /dev/null +++ b/mysql-test/suite/innodb/r/log_file_overwrite.result @@ -0,0 +1,8 @@ +call mtr.add_suppression("InnoDB: Plugin initialization aborted"); +call mtr.add_suppression("plugin 'InnoDB' registration as a STORAGE ENGINE failed."); +CREATE TABLE t1(f1 INT NOT NULL, f2 TEXT)ENGINE=InnoDB; +# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0 +INSERT INTO t1 SELECT seq, repeat('a', 4000) FROM seq_1_to_1800; +# restart: --debug_dbug=+d,before_final_redo_apply --innodb_log_file_size=8M +# restart: --innodb_log_file_size=10M +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/recovery_memory,debug.rdiff b/mysql-test/suite/innodb/r/recovery_memory,debug.rdiff new file mode 100644 index 00000000000..f0e9985b04e --- /dev/null +++ b/mysql-test/suite/innodb/r/recovery_memory,debug.rdiff @@ -0,0 +1,10 @@ +--- recovery_memory.result 2024-06-21 12:54:38.026355524 +0530 ++++ recovery_memory.reject 2024-06-21 17:22:49.394535026 +0530 +@@ -23,6 +23,7 @@ + CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; + INSERT INTO t1 SELECT * FROM seq_1_to_65536; + # restart: with restart_parameters ++FOUND 1 /\[ERROR\] InnoDB: The change buffer is corrupted or has been removed on upgrade to MariaDB 11.0 or later/ in mysqld.1.err + # restart + SHOW CREATE TABLE t1; + Table Create Table diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test index 1d938e12e78..e8e070c5061 100644 --- a/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test @@ -7,5 +7,8 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile --echo # --echo # MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways --echo # -let restart_parameters=--debug_dbug="+d,ib_buf_chunk_init_fails"; +let restart_parameters=--debug_dbug=+d,ib_buf_chunk_init_fails; --source include/restart_mysqld.inc +let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_PATTERN=\[ERROR\] InnoDB: Cannot allocate memory for the buffer pool; +--source include/search_pattern_in_file.inc diff --git a/mysql-test/suite/innodb/t/log_file_overwrite.test b/mysql-test/suite/innodb/t/log_file_overwrite.test new file mode 100644 index 00000000000..209f21c67cd --- /dev/null +++ b/mysql-test/suite/innodb/t/log_file_overwrite.test @@ -0,0 +1,17 @@ +--source include/have_innodb.inc +--source include/have_sequence.inc +--source include/have_debug.inc + +call mtr.add_suppression("InnoDB: Plugin initialization aborted"); +call mtr.add_suppression("plugin 'InnoDB' registration as a STORAGE ENGINE failed."); +CREATE TABLE t1(f1 INT NOT NULL, f2 TEXT)ENGINE=InnoDB; +let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0; +--source include/restart_mysqld.inc +INSERT INTO t1 SELECT seq, repeat('a', 4000) FROM seq_1_to_1800; +let $restart_parameters=--debug_dbug=+d,before_final_redo_apply --innodb_log_file_size=8M; +let $shutdown_timeout=0; +--source include/restart_mysqld.inc +let $restart_parameters=--innodb_log_file_size=10M; +let $shutdown_timeout=; +--source include/restart_mysqld.inc +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/recovery_memory.test b/mysql-test/suite/innodb/t/recovery_memory.test index 145b39d56f6..06101377f10 100644 --- a/mysql-test/suite/innodb/t/recovery_memory.test +++ b/mysql-test/suite/innodb/t/recovery_memory.test @@ -33,7 +33,7 @@ DROP PROCEDURE dorepeat; --echo # if ($have_debug) { SET DEBUG_DBUG="+d,ib_log_checkpoint_avoid_hard"; -let $restart_parameters=--innodb_buffer_pool_size=5242880 --debug_dbug="+d,ibuf_init_corrupt"; +let $restart_parameters=--innodb_buffer_pool_size=5242880 --debug_dbug=+d,ibuf_init_corrupt; } if (!$have_debug) { --echo SET DEBUG_DBUG="+d,ib_log_checkpoint_avoid_hard"; @@ -44,6 +44,11 @@ INSERT INTO t1 SELECT * FROM seq_1_to_65536; let $restart_noprint=1; let $shutdown_timeout=0; --source include/restart_mysqld.inc +if ($have_debug) { +let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_PATTERN=\[ERROR\] InnoDB: The change buffer is corrupted or has been removed on upgrade to MariaDB 11.0 or later; +--source include/search_pattern_in_file.inc +} let $restart_noprint=0; let $restart_parameters=; --source include/restart_mysqld.inc diff --git a/mysql-test/suite/rpl/r/rpl_slave_restart_long_password.result b/mysql-test/suite/rpl/r/rpl_slave_restart_long_password.result new file mode 100644 index 00000000000..52686c1b6ee --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_slave_restart_long_password.result @@ -0,0 +1,28 @@ +include/master-slave.inc +[connection master] +include/assert.inc [Password length is 96] +connection master; +SET SQL_LOG_BIN=0; +GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY '123456789X12141618202224262830323436384042444648505254565860626466687072747678808284868890929496'; +SET SQL_LOG_BIN=1; +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_HOST='127.0.0.1', master_user='rpl', master_password='123456789X12141618202224262830323436384042444648505254565860626466687072747678808284868890929496'; +include/start_slave.inc +include/check_slave_param.inc [Slave_IO_Running] +connection master; +include/rpl_restart_server.inc [server_number=2] +connection slave; +include/start_slave.inc +include/check_slave_param.inc [Slave_IO_Running] +connection master; +SET SQL_LOG_BIN=0; +DROP USER rpl@127.0.0.1; +FLUSH PRIVILEGES; +SET SQL_LOG_BIN=1; +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; +include/start_slave.inc +connection master; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_restart_long_password.test b/mysql-test/suite/rpl/t/rpl_slave_restart_long_password.test new file mode 100644 index 00000000000..e004777aa76 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_slave_restart_long_password.test @@ -0,0 +1,80 @@ +# +# This test validates a fix for a bug where slaves only read the +# first 41 characters of MASTER_PASSWORD from the master.info file +# after restarts. +# +# The test ensures that passwords up to the maximum allowable +# length (96 ASCII characters) will be read from the master.info +# file after slave restarts +# +# References: +# MDEV-23857: replication master password length +# + +# Test is format independent, so only run with one format +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + + +##### +# Setup +# +--let $passwd=123456789X12141618202224262830323436384042444648505254565860626466687072747678808284868890929496 +--let $expected_pwlen=96 +--let assert_cond=CHAR_LENGTH("$passwd")=$expected_pwlen +--let assert_text=Password length is $expected_pwlen +--source include/assert.inc + +connection master; +SET SQL_LOG_BIN=0; +--eval GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY '$passwd' +SET SQL_LOG_BIN=1; +##### + + +##### +# Change master to new user/password combination +# +connection slave; +--source include/stop_slave.inc +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', master_user='rpl', master_password='$passwd' + +--source include/start_slave.inc +--let $slave_param= Slave_IO_Running +--let $slave_param_value= Yes +--source include/check_slave_param.inc +##### + + +##### +# Ensure slave can re-connect to master after restart +# +connection master; +--let $rpl_server_number= 2 +--source include/rpl_restart_server.inc + +connection slave; +--source include/start_slave.inc +--let $slave_param= Slave_IO_Running +--let $slave_param_value= Yes +--source include/check_slave_param.inc +##### + + +##### +# Cleanup +# +connection master; +SET SQL_LOG_BIN=0; +DROP USER rpl@127.0.0.1; +FLUSH PRIVILEGES; +SET SQL_LOG_BIN=1; + +connection slave; +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; +--source include/start_slave.inc + +connection master; +-- source include/rpl_end.inc +##### diff --git a/mysql-test/suite/vcol/r/vcol_utf32.result b/mysql-test/suite/vcol/r/vcol_utf32.result new file mode 100644 index 00000000000..f5bb46f45ea --- /dev/null +++ b/mysql-test/suite/vcol/r/vcol_utf32.result @@ -0,0 +1,37 @@ +# +# MDEV-27966 Assertion `fixed()' failed and Assertion `fixed == 1' failed, both in Item_func_concat::val_str on SELECT after INSERT with collation utf32_bin on utf8_bin table +# +SET NAMES utf8mb3; +SET sql_mode=''; +CREATE TABLE t (c1 INT,c2 CHAR AS (CONCAT ('',DAYNAME ('')))) COLLATE utf8_bin ENGINE=InnoDB; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't' +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +Warnings: +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +SET collation_connection='utf32_bin'; +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +ERROR HY000: Illegal mix of collations (utf8mb3_bin,COERCIBLE) and (utf32_bin,COERCIBLE) for operation 'concat' +SELECT * FROM t; +ERROR HY000: Illegal mix of collations (utf8mb3_bin,COERCIBLE) and (utf32_bin,COERCIBLE) for operation 'concat' +DROP TABLE t; +SET sql_mode=DEFAULT; +SET NAMES utf8mb3; diff --git a/mysql-test/suite/vcol/t/vcol_utf32.test b/mysql-test/suite/vcol/t/vcol_utf32.test new file mode 100644 index 00000000000..a8a116201de --- /dev/null +++ b/mysql-test/suite/vcol/t/vcol_utf32.test @@ -0,0 +1,18 @@ +--source include/have_utf32.inc + +--echo # +--echo # MDEV-27966 Assertion `fixed()' failed and Assertion `fixed == 1' failed, both in Item_func_concat::val_str on SELECT after INSERT with collation utf32_bin on utf8_bin table +--echo # + +SET NAMES utf8mb3; +SET sql_mode=''; +CREATE TABLE t (c1 INT,c2 CHAR AS (CONCAT ('',DAYNAME ('')))) COLLATE utf8_bin ENGINE=InnoDB; +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +SET collation_connection='utf32_bin'; +--error ER_CANT_AGGREGATE_2COLLATIONS +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +--error ER_CANT_AGGREGATE_2COLLATIONS +SELECT * FROM t; +DROP TABLE t; +SET sql_mode=DEFAULT; +SET NAMES utf8mb3; diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc index 00447e73d79..0356b64ccfb 100644 --- a/mysys_ssl/my_crypt.cc +++ b/mysys_ssl/my_crypt.cc @@ -101,10 +101,10 @@ public: uchar source_tail[MY_AES_BLOCK_SIZE]; MyCTX_nopad() : MyCTX() { } - ~MyCTX_nopad() = default; + ~MyCTX_nopad() override = default; int init(const EVP_CIPHER *cipher, int encrypt, const uchar *key, uint klen, - const uchar *iv, uint ivlen) + const uchar *iv, uint ivlen) override { compile_time_assert(MY_AES_CTX_SIZE >= sizeof(MyCTX_nopad)); this->key= key; @@ -141,13 +141,13 @@ public: source_tail_len= new_tail_len; } - int update(const uchar *src, uint slen, uchar *dst, uint *dlen) + int update(const uchar *src, uint slen, uchar *dst, uint *dlen) override { update_source_tail(src, slen); return MyCTX::update(src, slen, dst, dlen); } - int finish(uchar *dst, uint *dlen) + int finish(uchar *dst, uint *dlen) override { if (source_tail_len) { @@ -206,10 +206,10 @@ public: const uchar *aad; int aadlen; MyCTX_gcm() : MyCTX() { } - ~MyCTX_gcm() { } + ~MyCTX_gcm() override { } int init(const EVP_CIPHER *cipher, int encrypt, const uchar *key, uint klen, - const uchar *iv, uint ivlen) + const uchar *iv, uint ivlen) override { compile_time_assert(MY_AES_CTX_SIZE >= sizeof(MyCTX_gcm)); int res= MyCTX::init(cipher, encrypt, key, klen, iv, ivlen); @@ -219,7 +219,7 @@ public: return res; } - int update(const uchar *src, uint slen, uchar *dst, uint *dlen) + int update(const uchar *src, uint slen, uchar *dst, uint *dlen) override { /* note that this GCM class cannot do streaming decryption, because @@ -244,7 +244,7 @@ public: return MyCTX::update(src, slen, dst, dlen); } - int finish(uchar *dst, uint *dlen) + int finish(uchar *dst, uint *dlen) override { int fin; if (!EVP_CipherFinal_ex(ctx, dst, &fin)) diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc index 7740c2eae60..18ec8f0c087 100644 --- a/plugin/aws_key_management/aws_key_management_plugin.cc +++ b/plugin/aws_key_management/aws_key_management_plugin.cc @@ -154,7 +154,7 @@ public: Base(logLevel) { } - virtual LogLevel GetLogLevel(void) const override + LogLevel GetLogLevel(void) const override { return (LogLevel)log_level; } @@ -162,12 +162,12 @@ public: { } - virtual void Flush(void) override + void Flush(void) override { } protected: - virtual void ProcessFormattedStatement(Aws::String&& statement) override + void ProcessFormattedStatement(Aws::String&& statement) override { #ifdef _WIN32 /* diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc index 590bb06cc5f..712d175c37d 100644 --- a/plugin/feedback/url_http.cc +++ b/plugin/feedback/url_http.cc @@ -53,7 +53,7 @@ class Url_http: public Url { { proxy_host.length= 0; } - ~Url_http() + ~Url_http() override { my_free(host.str); my_free(port.str); @@ -62,9 +62,9 @@ class Url_http: public Url { } public: - void abort(); - int send(const char* data, size_t data_length); - int set_proxy(const char *proxy, size_t proxy_len) + void abort() override; + int send(const char* data, size_t data_length) override; + int set_proxy(const char *proxy, size_t proxy_len) override { if (use_proxy()) { diff --git a/plugin/handler_socket/handlersocket/database.cpp b/plugin/handler_socket/handlersocket/database.cpp index db24e33a141..0a006a42f00 100644 --- a/plugin/handler_socket/handlersocket/database.cpp +++ b/plugin/handler_socket/handlersocket/database.cpp @@ -84,10 +84,10 @@ prep_stmt::operator =(const prep_stmt& x) struct database : public database_i, private noncopyable { database(const config& c); - virtual ~database(); - virtual dbcontext_ptr create_context(bool for_write) volatile; - virtual void stop() volatile; - virtual const config& get_conf() const volatile; + ~database() override; + dbcontext_ptr create_context(bool for_write) volatile override; + void stop() volatile override; + const config& get_conf() const volatile override; public: int child_running; private: @@ -128,21 +128,21 @@ struct expr_user_lock : private noncopyable { struct dbcontext : public dbcontext_i, private noncopyable { dbcontext(volatile database *d, bool for_write); - virtual ~dbcontext(); - virtual void init_thread(const void *stack_botton, - volatile int& shutdown_flag); - virtual void term_thread(); - virtual bool check_alive(); - virtual void lock_tables_if(); - virtual void unlock_tables_if(); - virtual bool get_commit_error(); - virtual void clear_error(); - virtual void close_tables_if(); - virtual void table_addref(size_t tbl_id); - virtual void table_release(size_t tbl_id); - virtual void cmd_open(dbcallback_i& cb, const cmd_open_args& args); - virtual void cmd_exec(dbcallback_i& cb, const cmd_exec_args& args); - virtual void set_statistics(size_t num_conns, size_t num_active); + ~dbcontext() override; + void init_thread(const void *stack_botton, + volatile int& shutdown_flag) override; + void term_thread() override; + bool check_alive() override; + void lock_tables_if() override; + void unlock_tables_if() override; + bool get_commit_error() override; + void clear_error() override; + void close_tables_if() override; + void table_addref(size_t tbl_id) override; + void table_release(size_t tbl_id) override; + void cmd_open(dbcallback_i& cb, const cmd_open_args& args) override; + void cmd_exec(dbcallback_i& cb, const cmd_exec_args& args) override; + void set_statistics(size_t num_conns, size_t num_active) override; private: int set_thread_message(const char *fmt, ...) __attribute__((format (printf, 2, 3))); diff --git a/plugin/handler_socket/handlersocket/hstcpsvr.cpp b/plugin/handler_socket/handlersocket/hstcpsvr.cpp index 250ef2c7be5..336d36422b0 100644 --- a/plugin/handler_socket/handlersocket/hstcpsvr.cpp +++ b/plugin/handler_socket/handlersocket/hstcpsvr.cpp @@ -34,8 +34,8 @@ struct worker_throbj { struct hstcpsvr : public hstcpsvr_i, private noncopyable { hstcpsvr(const config& c); - ~hstcpsvr(); - virtual std::string start_listen(); + ~hstcpsvr() override; + std::string start_listen() override; private: hstcpsvr_shared_c cshared; volatile hstcpsvr_shared_v vshared; diff --git a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp index f6bbe9004c2..0796546cb5e 100644 --- a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp +++ b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp @@ -77,15 +77,15 @@ struct hstcpsvr_conn : public dbcallback_i { bool write_more(bool *more_r = 0); bool read_more(bool *more_r = 0); public: - virtual void dbcb_set_prep_stmt(size_t pst_id, const prep_stmt& v); - virtual const prep_stmt *dbcb_get_prep_stmt(size_t pst_id) const; - virtual void dbcb_resp_short(uint32_t code, const char *msg); - virtual void dbcb_resp_short_num(uint32_t code, uint32_t value); - virtual void dbcb_resp_short_num64(uint32_t code, uint64_t value); - virtual void dbcb_resp_begin(size_t num_flds); - virtual void dbcb_resp_entry(const char *fld, size_t fldlen); - virtual void dbcb_resp_end(); - virtual void dbcb_resp_cancel(); + void dbcb_set_prep_stmt(size_t pst_id, const prep_stmt& v) override; + const prep_stmt *dbcb_get_prep_stmt(size_t pst_id) const override; + void dbcb_resp_short(uint32_t code, const char *msg) override; + void dbcb_resp_short_num(uint32_t code, uint32_t value) override; + void dbcb_resp_short_num64(uint32_t code, uint64_t value) override; + void dbcb_resp_begin(size_t num_flds) override; + void dbcb_resp_entry(const char *fld, size_t fldlen) override; + void dbcb_resp_end() override; + void dbcb_resp_cancel() override; public: hstcpsvr_conn() : addr_len(sizeof(addr)), readsize(4096), nonblocking(false), read_finished(false), write_finished(false), @@ -254,7 +254,7 @@ hstcpsvr_conn::dbcb_resp_cancel() struct hstcpsvr_worker : public hstcpsvr_worker_i, private noncopyable { hstcpsvr_worker(const hstcpsvr_worker_arg& arg); - virtual void run(); + void run() override; private: const hstcpsvr_shared_c& cshared; volatile hstcpsvr_shared_v& vshared; diff --git a/plugin/handler_socket/libhsclient/hstcpcli.cpp b/plugin/handler_socket/libhsclient/hstcpcli.cpp index 461bed3f5d0..c2823d139fd 100644 --- a/plugin/handler_socket/libhsclient/hstcpcli.cpp +++ b/plugin/handler_socket/libhsclient/hstcpcli.cpp @@ -27,23 +27,23 @@ namespace dena { struct hstcpcli : public hstcpcli_i, private noncopyable { hstcpcli(const socket_args& args); - virtual void close(); - virtual int reconnect(); - virtual bool stable_point(); - virtual void request_buf_open_index(size_t pst_id, const char *dbn, - const char *tbl, const char *idx, const char *retflds, const char *filflds); - virtual void request_buf_auth(const char *secret, const char *typ); - virtual void request_buf_exec_generic(size_t pst_id, const string_ref& op, + void close() override; + int reconnect() override; + bool stable_point() override; + void request_buf_open_index(size_t pst_id, const char *dbn, + const char *tbl, const char *idx, const char *retflds, const char *filflds) override; + void request_buf_auth(const char *secret, const char *typ) override; + void request_buf_exec_generic(size_t pst_id, const string_ref& op, const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip, const string_ref& mod_op, const string_ref *mvs, size_t mvslen, const hstcpcli_filter *fils, size_t filslen, int invalues_keypart, - const string_ref *invalues, size_t invalueslen); - virtual int request_send(); - virtual int response_recv(size_t& num_flds_r); - virtual const string_ref *get_next_row(); - virtual void response_buf_remove(); - virtual int get_error_code(); - virtual std::string get_error(); + const string_ref *invalues, size_t invalueslen) override; + int request_send() override; + int response_recv(size_t& num_flds_r) override; + const string_ref *get_next_row() override; + void response_buf_remove() override; + int get_error_code() override; + std::string get_error() override; private: int read_more(); void clear_error(); diff --git a/plugin/type_inet/item_inetfunc.h b/plugin/type_inet/item_inetfunc.h index 4acb42d2175..d77a1647c8c 100644 --- a/plugin/type_inet/item_inetfunc.h +++ b/plugin/type_inet/item_inetfunc.h @@ -90,7 +90,7 @@ public: { null_value= false; } - bool need_parentheses_in_default() { return false; } + bool need_parentheses_in_default() override { return false; } }; diff --git a/plugin/type_inet/plugin.cc b/plugin/type_inet/plugin.cc index bb7603d5abe..b68a5568cf2 100644 --- a/plugin/type_inet/plugin.cc +++ b/plugin/type_inet/plugin.cc @@ -40,7 +40,7 @@ public: static Create_func_inet_ntoa s_singleton; protected: Create_func_inet_ntoa() {} - virtual ~Create_func_inet_ntoa() {} + ~Create_func_inet_ntoa() override {} }; @@ -54,7 +54,7 @@ public: static Create_func_inet_aton s_singleton; protected: Create_func_inet_aton() {} - virtual ~Create_func_inet_aton() {} + ~Create_func_inet_aton() override {} }; @@ -68,7 +68,7 @@ public: static Create_func_inet6_aton s_singleton; protected: Create_func_inet6_aton() {} - virtual ~Create_func_inet6_aton() {} + ~Create_func_inet6_aton() override {} }; @@ -82,7 +82,7 @@ public: static Create_func_inet6_ntoa s_singleton; protected: Create_func_inet6_ntoa() {} - virtual ~Create_func_inet6_ntoa() {} + ~Create_func_inet6_ntoa() override {} }; @@ -96,7 +96,7 @@ public: static Create_func_is_ipv4 s_singleton; protected: Create_func_is_ipv4() {} - virtual ~Create_func_is_ipv4() {} + ~Create_func_is_ipv4() override {} }; @@ -110,7 +110,7 @@ public: static Create_func_is_ipv6 s_singleton; protected: Create_func_is_ipv6() {} - virtual ~Create_func_is_ipv6() {} + ~Create_func_is_ipv6() override {} }; @@ -124,7 +124,7 @@ public: static Create_func_is_ipv4_compat s_singleton; protected: Create_func_is_ipv4_compat() {} - virtual ~Create_func_is_ipv4_compat() {} + ~Create_func_is_ipv4_compat() override {} }; @@ -138,7 +138,7 @@ public: static Create_func_is_ipv4_mapped s_singleton; protected: Create_func_is_ipv4_mapped() {} - virtual ~Create_func_is_ipv4_mapped() {} + ~Create_func_is_ipv4_mapped() override {} }; diff --git a/plugin/type_mysql_json/type.cc b/plugin/type_mysql_json/type.cc index 8454201cd82..68a9b3874cd 100644 --- a/plugin/type_mysql_json/type.cc +++ b/plugin/type_mysql_json/type.cc @@ -62,14 +62,14 @@ public: &my_charset_utf8mb4_bin) {} - String *val_str(String *val_buffer, String *val_str); - const Type_handler *type_handler() const { return &type_handler_mysql_json; } + String *val_str(String *val_buffer, String *val_str) override; + const Type_handler *type_handler() const override { return &type_handler_mysql_json; } bool parse_mysql(String *dest, const char *data, size_t length) const; - bool send(Protocol *protocol) { return Field::send(protocol); } - void sql_type(String &s) const + bool send(Protocol *protocol) override { return Field::send(protocol); } + void sql_type(String &s) const override { s.set_ascii(STRING_WITH_LEN("mysql_json /* JSON from MySQL 5.7 */")); } /* this will make ALTER TABLE to consider it different from built-in field */ - Compression_method *compression_method() const { return (Compression_method*)1; } + Compression_method *compression_method() const override { return (Compression_method*)1; } }; Field *Type_handler_mysql_json::make_conversion_table_field(MEM_ROOT *root, diff --git a/plugin/versioning/versioning.cc b/plugin/versioning/versioning.cc index a4916e2f9c1..387dfa80ae9 100644 --- a/plugin/versioning/versioning.cc +++ b/plugin/versioning/versioning.cc @@ -30,14 +30,14 @@ template class Create_func_trt : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_trt s_singleton; protected: Create_func_trt() = default; - virtual ~Create_func_trt() = default; + ~Create_func_trt() override = default; }; template @@ -104,8 +104,8 @@ template class Create_func_trt_trx_sees : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override { Item *func= NULL; int arg_count= 0; @@ -133,7 +133,7 @@ public: protected: Create_func_trt_trx_sees() = default; - virtual ~Create_func_trt_trx_sees() = default; + ~Create_func_trt_trx_sees() override = default; }; template diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 9eec793c9fb..a136125b5ae 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -233,6 +233,7 @@ ELSE() SET(sysconfdir "/etc") ENDIF() SET(bindir ${INSTALL_BINDIRABS}) +SET(sbindir ${INSTALL_SBINDIRABS}) SET(libexecdir ${INSTALL_SBINDIRABS}) SET(scriptdir ${INSTALL_BINDIRABS}) SET(datadir ${INSTALL_MYSQLSHAREDIRABS}) diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index dbbffee7942..189e54c0c56 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -152,7 +152,6 @@ WSREP_SST_OPT_DATA="" WSREP_SST_OPT_AUTH="${WSREP_SST_OPT_AUTH:-}" WSREP_SST_OPT_USER="${WSREP_SST_OPT_USER:-}" WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_PSWD:-}" -WSREP_SST_OPT_REMOTE_AUTH="${WSREP_SST_OPT_REMOTE_AUTH:-}" WSREP_SST_OPT_DEFAULT="" WSREP_SST_OPT_DEFAULTS="" WSREP_SST_OPT_EXTRA_DEFAULT="" @@ -1008,11 +1007,6 @@ in_config() echo $found } -wsrep_auth_not_set() -{ - [ -z "$WSREP_SST_OPT_AUTH" ] -} - # Get rid of incorrect values resulting from substitution # in programs external to the script: if [ "$WSREP_SST_OPT_USER" = '(null)' ]; then @@ -1028,12 +1022,12 @@ fi # Let's read the value of the authentication string from the # configuration file so that it does not go to the command line # and does not appear in the ps output: -if wsrep_auth_not_set; then +if [ -z "$WSREP_SST_OPT_AUTH" ]; then WSREP_SST_OPT_AUTH=$(parse_cnf 'sst' 'wsrep-sst-auth') fi # Splitting WSREP_SST_OPT_AUTH as "user:password" pair: -if ! wsrep_auth_not_set; then +if [ -n "$WSREP_SST_OPT_AUTH" ]; then # Extract username as shortest prefix up to first ':' character: WSREP_SST_OPT_AUTH_USER="${WSREP_SST_OPT_AUTH%%:*}" if [ -z "$WSREP_SST_OPT_USER" ]; then @@ -1057,19 +1051,20 @@ if ! wsrep_auth_not_set; then fi fi +WSREP_SST_OPT_REMOTE_AUTH="${WSREP_SST_OPT_REMOTE_AUTH:-}" +WSREP_SST_OPT_REMOTE_USER= +WSREP_SST_OPT_REMOTE_PSWD= +if [ -n "$WSREP_SST_OPT_REMOTE_AUTH" ]; then + # Split auth string at the last ':' + WSREP_SST_OPT_REMOTE_USER="${WSREP_SST_OPT_REMOTE_AUTH%%:*}" + WSREP_SST_OPT_REMOTE_PSWD="${WSREP_SST_OPT_REMOTE_AUTH#*:}" +fi + readonly WSREP_SST_OPT_USER readonly WSREP_SST_OPT_PSWD readonly WSREP_SST_OPT_AUTH - -if [ -n "$WSREP_SST_OPT_REMOTE_AUTH" ]; then - # Split auth string at the last ':' - readonly WSREP_SST_OPT_REMOTE_USER="${WSREP_SST_OPT_REMOTE_AUTH%%:*}" - readonly WSREP_SST_OPT_REMOTE_PSWD="${WSREP_SST_OPT_REMOTE_AUTH#*:}" -else - readonly WSREP_SST_OPT_REMOTE_USER= - readonly WSREP_SST_OPT_REMOTE_PSWD= -fi - +readonly WSREP_SST_OPT_REMOTE_USER +readonly WSREP_SST_OPT_REMOTE_PSWD readonly WSREP_SST_OPT_REMOTE_AUTH if [ -n "$WSREP_SST_OPT_DATA" ]; then diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 2cae93ed694..6eea14df5d2 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -1100,15 +1100,13 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then wsrep_log_info "Using '$itmpdir' as mariadb-backup working directory" - usrst=0 if [ -n "$WSREP_SST_OPT_USER" ]; then INNOEXTRA="$INNOEXTRA --user='$WSREP_SST_OPT_USER'" - usrst=1 fi if [ -n "$WSREP_SST_OPT_PSWD" ]; then export MYSQL_PWD="$WSREP_SST_OPT_PSWD" - elif [ $usrst -eq 1 ]; then + elif [ -n "$WSREP_SST_OPT_USER" ]; then # Empty password, used for testing, debugging etc. unset MYSQL_PWD fi diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh index 5bd2e9ff656..a06231424b5 100644 --- a/scripts/wsrep_sst_mysqldump.sh +++ b/scripts/wsrep_sst_mysqldump.sh @@ -40,17 +40,15 @@ then fi # Check client version -if ! $MYSQL_CLIENT --version | grep -q -E 'Distrib 10\.[1-9]'; then +if ! $MYSQL_CLIENT --version | grep -q -E '(Distrib 10\.[1-9])|( from 1[1-9]\.)'; then $MYSQL_CLIENT --version >&2 wsrep_log_error "this operation requires MySQL client version 10.1 or newer" exit $EINVAL fi AUTH="" -usrst=0 if [ -n "$WSREP_SST_OPT_USER" ]; then AUTH="-u$WSREP_SST_OPT_USER" - usrst=1 fi # Refs https://github.com/codership/mysql-wsrep/issues/141 @@ -64,7 +62,7 @@ fi # word, it is arguably more secure than passing password on the command line. if [ -n "$WSREP_SST_OPT_PSWD" ]; then export MYSQL_PWD="$WSREP_SST_OPT_PSWD" -elif [ $usrst -eq 1 ]; then +elif [ -n "$WSREP_SST_OPT_USER" ]; then # Empty password, used for testing, debugging etc. unset MYSQL_PWD fi diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc index b7a76746a7f..f42bf961732 100644 --- a/sql/ddl_log.cc +++ b/sql/ddl_log.cc @@ -919,12 +919,12 @@ public: first_error(0), only_ignore_non_existing_errors(0) {} - bool handle_condition(THD *thd, + bool handle_condition(THD *, uint sql_errno, - const char* sqlstate, + const char*, Sql_condition::enum_warning_level *level, - const char* msg, - Sql_condition ** cond_hdl) + const char*, + Sql_condition **cond_hdl) override { *cond_hdl= NULL; if (non_existing_table_error(sql_errno) || diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index bb552aa9de8..3486e76f19d 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -71,14 +71,14 @@ public: Stored_program_creation_ctx **ctx); public: - virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) + Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) override { return new (mem_root) Event_creation_ctx(m_client_cs, m_connection_cl, m_db_cl); } protected: - virtual Object_creation_ctx *create_backup_ctx(THD *thd) const + Object_creation_ctx *create_backup_ctx(THD *thd) const override { /* We can avoid usual backup/restore employed in stored programs since we diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index c51d5433e15..d66707c0eaa 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -117,7 +117,7 @@ public: virtual ~Event_queue_element(); virtual bool - load_from_row(THD *thd, TABLE *table); + load_from_row(THD *thd, TABLE *table) override; bool compute_next_execution_time(); @@ -155,7 +155,7 @@ public: init(); virtual bool - load_from_row(THD *thd, TABLE *table); + load_from_row(THD *thd, TABLE *table) override; int get_create_event(THD *thd, String *buf); @@ -176,7 +176,7 @@ public: Event_job_data(); virtual bool - load_from_row(THD *thd, TABLE *table); + load_from_row(THD *thd, TABLE *table) override; bool execute(THD *thd, bool drop); diff --git a/sql/field.h b/sql/field.h index 321b5be8197..b9a5940071a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3186,7 +3186,7 @@ public: :Field_temporal(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg) {} - bool validate_value_in_record(THD *thd, const uchar *record) const; + bool validate_value_in_record(THD *thd, const uchar *record) const override; }; @@ -5150,20 +5150,20 @@ public: m_table(NULL) {} ~Field_row(); - en_fieldtype tmp_engine_column_type(bool use_packed_rows) const + en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override { DBUG_ASSERT(0); return Field::tmp_engine_column_type(use_packed_rows); } enum_conv_type rpl_conv_type_from(const Conv_source &source, const Relay_log_info *rli, - const Conv_param ¶m) const + const Conv_param ¶m) const override { DBUG_ASSERT(0); return CONV_TYPE_IMPOSSIBLE; } - Virtual_tmp_table **virtual_tmp_table_addr() { return &m_table; } - bool sp_prepare_and_store_item(THD *thd, Item **value); + Virtual_tmp_table **virtual_tmp_table_addr() override { return &m_table; } + bool sp_prepare_and_store_item(THD *thd, Item **value) override; }; diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h index bb1f473e180..f7a05633ace 100644 --- a/sql/gcalc_tools.h +++ b/sql/gcalc_tools.h @@ -146,16 +146,16 @@ public: Gcalc_operation_transporter(Gcalc_function *fn, Gcalc_heap *heap) : Gcalc_shape_transporter(heap), m_fn(fn) {} - int single_point(double x, double y); - int start_line(); - int complete_line(); - int start_poly(); - int complete_poly(); - int start_ring(); - int complete_ring(); - int add_point(double x, double y); - int start_collection(int n_objects); - int empty_shape(); + int single_point(double x, double y) override; + int start_line() override; + int complete_line() override; + int start_poly() override; + int complete_poly() override; + int start_ring() override; + int complete_ring() override; + int add_point(double x, double y) override; + int start_collection(int n_objects) override; + int empty_shape() override; }; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 73cbf340468..52e6dc4bf9f 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -10508,7 +10508,7 @@ public: m_tot_parts(tot_parts) {} - ~ha_partition_inplace_ctx() + ~ha_partition_inplace_ctx() override { if (handler_ctx_array) { diff --git a/sql/ha_sequence.h b/sql/ha_sequence.h index 72e59a40479..ac64c978b5b 100644 --- a/sql/ha_sequence.h +++ b/sql/ha_sequence.h @@ -67,44 +67,44 @@ public: ~ha_sequence(); /* virtual function that are re-implemented for sequence */ - int open(const char *name, int mode, uint test_if_locked); + int open(const char *name, int mode, uint test_if_locked) override; int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); - handler *clone(const char *name, MEM_ROOT *mem_root); - int write_row(const uchar *buf); - Table_flags table_flags() const; + HA_CREATE_INFO *create_info) override; + handler *clone(const char *name, MEM_ROOT *mem_root) override; + int write_row(const uchar *buf) override; + Table_flags table_flags() const override; /* One can't update or delete from sequence engine */ - int update_row(const uchar *old_data, const uchar *new_data) + int update_row(const uchar *old_data, const uchar *new_data) override { return HA_ERR_WRONG_COMMAND; } - int delete_row(const uchar *buf) + int delete_row(const uchar *buf) override { return HA_ERR_WRONG_COMMAND; } /* One can't delete from sequence engine */ - int truncate() + int truncate() override { return HA_ERR_WRONG_COMMAND; } /* Can't use query cache */ - uint8 table_cache_type() + uint8 table_cache_type() override { return HA_CACHE_TBL_NOCACHE; } - void print_error(int error, myf errflag); - int info(uint); - LEX_CSTRING *engine_name() { return hton_name(file->ht); } - int external_lock(THD *thd, int lock_type); - int extra(enum ha_extra_function operation); + void print_error(int error, myf errflag) override; + int info(uint) override; + LEX_CSTRING *engine_name() override { return hton_name(file->ht); } + int external_lock(THD *thd, int lock_type) override; + int extra(enum ha_extra_function operation) override; /* For ALTER ONLINE TABLE */ bool check_if_incompatible_data(HA_CREATE_INFO *create_info, - uint table_changes); + uint table_changes) override; void write_lock() { write_locked= 1;} void unlock() { write_locked= 0; } bool is_locked() { return write_locked; } /* Functions that are directly mapped to the underlying handler */ - int rnd_init(bool scan) + int rnd_init(bool scan) override { return file->rnd_init(scan); } /* We need to have a lock here to protect engines like MyISAM from simultaneous read and write. For sequence's this is not critical as this function is used extremely seldom. */ - int rnd_next(uchar *buf) + int rnd_next(uchar *buf) override { int error; table->s->sequence->read_lock(table); @@ -112,9 +112,9 @@ public: table->s->sequence->read_unlock(table); return error; } - int rnd_end() + int rnd_end() override { return file->rnd_end(); } - int rnd_pos(uchar *buf, uchar *pos) + int rnd_pos(uchar *buf, uchar *pos) override { int error; table->s->sequence->read_lock(table); @@ -122,37 +122,37 @@ public: table->s->sequence->read_unlock(table); return error; } - void position(const uchar *record) + void position(const uchar *record) override { return file->position(record); } - const char *table_type() const + const char *table_type() const override { return file->table_type(); } - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return file->index_flags(inx, part, all_parts); } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type) + enum thr_lock_type lock_type) override { return file->store_lock(thd, to, lock_type); } - int close(void) + int close(void) override { return file->close(); } const char **bas_ext() const { return file->bas_ext(); } - int delete_table(const char*name) + int delete_table(const char*name) override { return file->delete_table(name); } - int rename_table(const char *from, const char *to) + int rename_table(const char *from, const char *to) override { return file->rename_table(from, to); } - void unbind_psi() + void unbind_psi() override { file->unbind_psi(); } - void rebind_psi() + void rebind_psi() override { file->rebind_psi(); } - bool auto_repair(int error) const + bool auto_repair(int error) const override { return file->auto_repair(error); } - int repair(THD* thd, HA_CHECK_OPT* check_opt) + int repair(THD* thd, HA_CHECK_OPT* check_opt) override { return file->repair(thd, check_opt); } - bool check_and_repair(THD *thd) + bool check_and_repair(THD *thd) override { return file->check_and_repair(thd); } - bool is_crashed() const + bool is_crashed() const override { return file->is_crashed(); } - void column_bitmaps_signal() + void column_bitmaps_signal() override { return file->column_bitmaps_signal(); } /* New methods */ diff --git a/sql/handler.cc b/sql/handler.cc index 0819c91f6d5..a7214402163 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -169,7 +169,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { *cond_hdl= NULL; if (non_existing_table_error(sql_errno)) diff --git a/sql/handler.h b/sql/handler.h index 6968607611a..86487171fe0 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -5349,8 +5349,8 @@ public: : thd(thd_arg), wild(NULL), with_temps(true), tables(tables_arg) {} ~Discovered_table_list() = default; - bool add_table(const char *tname, size_t tlen); - bool add_file(const char *fname); + bool add_table(const char *tname, size_t tlen) override; + bool add_file(const char *fname) override; void sort(); void remove_duplicates(); // assumes that the list is sorted diff --git a/sql/item.cc b/sql/item.cc index e6723f0d294..717379e844f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -8032,7 +8032,7 @@ class Dependency_marker: public Field_enumerator public: THD *thd; st_select_lex *current_select; - virtual void visit_field(Item_field *item) + void visit_field(Item_field *item) override { // Find which select the field is in. This is achieved by walking up // the select tree and looking for the table of interest. diff --git a/sql/item.h b/sql/item.h index b6eee551110..b47753e8938 100644 --- a/sql/item.h +++ b/sql/item.h @@ -458,16 +458,16 @@ public: class Sp_rcontext_handler_local: public Sp_rcontext_handler { public: - const LEX_CSTRING *get_name_prefix() const; - sp_rcontext *get_rcontext(sp_rcontext *ctx) const; + const LEX_CSTRING *get_name_prefix() const override; + sp_rcontext *get_rcontext(sp_rcontext *ctx) const override; }; class Sp_rcontext_handler_package_body: public Sp_rcontext_handler { public: - const LEX_CSTRING *get_name_prefix() const; - sp_rcontext *get_rcontext(sp_rcontext *ctx) const; + const LEX_CSTRING *get_name_prefix() const override; + sp_rcontext *get_rcontext(sp_rcontext *ctx) const override; }; @@ -3040,8 +3040,8 @@ class Item_basic_constant :public Item_basic_value public: Item_basic_constant(THD *thd): Item_basic_value(thd) {}; Item_basic_constant(): Item_basic_value() {}; - bool check_vcol_func_processor(void *arg) { return false; } - const Item_const *get_item_const() const { return this; } + bool check_vcol_func_processor(void *) override { return false; } + const Item_const *get_item_const() const override { return this; } virtual Item_basic_constant *make_string_literal_concat(THD *thd, const LEX_CSTRING *) { @@ -4791,7 +4791,7 @@ public: const LEX_CSTRING &str, CHARSET_INFO *tocs): Item_string(thd, name_arg, str, tocs) { } - virtual bool is_cs_specified() const + bool is_cs_specified() const override { return true; } @@ -4870,7 +4870,7 @@ public: { max_length= length; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function("safe_string", arg, VCOL_IMPOSSIBLE); } @@ -4895,7 +4895,7 @@ public: :Item_partition_func_safe_string(thd, LEX_CSTRING({header, strlen(header)}), length * cs->mbmaxlen, cs) { } - void make_send_field(THD *thd, Send_field *field); + void make_send_field(THD *thd, Send_field *field) override; }; @@ -5311,7 +5311,7 @@ public: { base_flags&= ~item_base_t::MAYBE_NULL; } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { cached_time.copy_to_mysql_time(ltime); return (null_value= false); @@ -5333,7 +5333,7 @@ public: { base_flags&= ~item_base_t::MAYBE_NULL; } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { cached_time.copy_to_mysql_time(ltime); return (null_value= false); @@ -7284,7 +7284,7 @@ class Item_cache_year: public Item_cache_int public: Item_cache_year(THD *thd, const Type_handler *handler) :Item_cache_int(thd, handler) { } - bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) + bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override { return type_handler_year.Item_get_date_with_warn(thd, this, to, mode); } @@ -7791,9 +7791,9 @@ class Item_iterator_ref_list: public Item_iterator public: Item_iterator_ref_list(List_iterator &arg_list): list(arg_list) {} - void open() { list.rewind(); } - Item *next() { return *(list++); } - void close() {} + void open() override { list.rewind(); } + Item *next() override { return *(list++); } + void close() override {} }; @@ -7807,9 +7807,9 @@ class Item_iterator_list: public Item_iterator public: Item_iterator_list(List_iterator &arg_list): list(arg_list) {} - void open() { list.rewind(); } - Item *next() { return (list++); } - void close() {} + void open() override { list.rewind(); } + Item *next() override { return (list++); } + void close() override {} }; @@ -7823,14 +7823,14 @@ class Item_iterator_row: public Item_iterator uint current; public: Item_iterator_row(Item *base) : base_item(base), current(0) {} - void open() { current= 0; } - Item *next() + void open() override { current= 0; } + Item *next() override { if (current >= base_item->cols()) return NULL; return base_item->element_index(current++); } - void close() {} + void close() override {} }; @@ -7876,84 +7876,85 @@ public: void change_item(THD *thd, Item *); - bool fix_fields(THD *thd, Item **it); + bool fix_fields(THD *thd, Item **it) override; - void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type) override; - Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs); - Item *get_tmp_table_item(THD *thd) + Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override; + Item *get_tmp_table_item(THD *thd) override { return m_item->get_tmp_table_item(thd); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy(thd, this); } COND *build_equal_items(THD *thd, COND_EQUAL *inherited, bool link_item_fields, - COND_EQUAL **cond_equal_ref) + COND_EQUAL **cond_equal_ref) override { return m_item->build_equal_items(thd, inherited, link_item_fields, cond_equal_ref); } - const char *full_name() const { return m_item->full_name(); } - void make_send_field(THD *thd, Send_field *field) + LEX_CSTRING full_name_cstring() const override + { return m_item->full_name_cstring(); } + void make_send_field(THD *thd, Send_field *field) override { m_item->make_send_field(thd, field); } - bool eq(const Item *item, bool binary_cmp) const + bool eq(const Item *item, bool binary_cmp) const override { const Item *it= item->real_item(); return m_item->eq(it, binary_cmp); } - void fix_after_pullout(st_select_lex *new_parent, Item **refptr, bool merge) + void fix_after_pullout(st_select_lex *new_parent, Item **refptr, bool merge) override { m_item->fix_after_pullout(new_parent, &m_item, merge); } - void save_val(Field *to) + void save_val(Field *to) override { return m_item->save_val(to); } - void save_result(Field *to) + void save_result(Field *to) override { return m_item->save_result(to); } - int save_in_field(Field *to, bool no_conversions) + int save_in_field(Field *to, bool no_conversions) override { return m_item->save_in_field(to, no_conversions); } - const Type_handler *type_handler() const { return m_item->type_handler(); } - table_map used_tables() const { return m_item->used_tables(); } - void update_used_tables() + const Type_handler *type_handler() const override { return m_item->type_handler(); } + table_map used_tables() const override { return m_item->used_tables(); } + void update_used_tables() override { m_item->update_used_tables(); } - bool const_item() const { return m_item->const_item(); } - table_map not_null_tables() const { return m_item->not_null_tables(); } - bool walk(Item_processor processor, bool walk_subquery, void *arg) + bool const_item() const override { return m_item->const_item(); } + table_map not_null_tables() const override { return m_item->not_null_tables(); } + bool walk(Item_processor processor, bool walk_subquery, void *arg) override { return m_item->walk(processor, walk_subquery, arg) || (this->*processor)(arg); } - bool enumerate_field_refs_processor(void *arg) + bool enumerate_field_refs_processor(void *arg) override { return m_item->enumerate_field_refs_processor(arg); } - Item_field *field_for_view_update() + Item_field *field_for_view_update() override { return m_item->field_for_view_update(); } /* Row emulation: forwarding of ROW-related calls to orig_item */ - uint cols() const + uint cols() const override { return m_item->cols(); } - Item* element_index(uint i) + Item* element_index(uint i) override { return this; } - Item** addr(uint i) + Item** addr(uint i) override { return &m_item; } - bool check_cols(uint c) + bool check_cols(uint c) override { return Item::check_cols(c); } - bool null_inside() + bool null_inside() override { return m_item->null_inside(); } - void bring_value() + void bring_value() override {} - Item_equal *get_item_equal() { return m_item->get_item_equal(); } - void set_item_equal(Item_equal *item_eq) { m_item->set_item_equal(item_eq); } - Item_equal *find_item_equal(COND_EQUAL *cond_equal) + Item_equal *get_item_equal() override { return m_item->get_item_equal(); } + void set_item_equal(Item_equal *item_eq) override { m_item->set_item_equal(item_eq); } + Item_equal *find_item_equal(COND_EQUAL *cond_equal) override { return m_item->find_item_equal(cond_equal); } - Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) override { return m_item->propagate_equal_fields(thd, ctx, cond); } - Item *replace_equal_field(THD *thd, uchar *arg) + Item *replace_equal_field(THD *thd, uchar *arg) override { return m_item->replace_equal_field(thd, arg); } - bool excl_dep_on_table(table_map tab_map) + bool excl_dep_on_table(table_map tab_map) override { return m_item->excl_dep_on_table(tab_map); } - bool excl_dep_on_grouping_fields(st_select_lex *sel) + bool excl_dep_on_grouping_fields(st_select_lex *sel) override { return m_item->excl_dep_on_grouping_fields(sel); } - bool is_expensive() { return m_item->is_expensive(); } + bool is_expensive() override { return m_item->is_expensive(); } void set_item(Item *item) { m_item= item; } - Item *build_clone(THD *thd) + Item *build_clone(THD *thd) override { Item *clone_item= m_item->build_clone(thd); if (clone_item) @@ -7968,7 +7969,7 @@ public: } void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, - List &fields, uint flags) + List &fields, uint flags) override { m_item->split_sum_func(thd, ref_pointer_array, fields, flags); } @@ -7976,7 +7977,7 @@ public: This processor states that this is safe for virtual columns (because this Item transparency) */ - bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_vcol_func_processor(void *arg) override { return FALSE;} }; inline bool TABLE::mark_column_with_deps(Field *field) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 493aae11f49..c9795ded6fe 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4927,7 +4927,7 @@ class Func_handler_bit_or_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); Longlong_null a= item->arguments()[0]->to_longlong_null(); @@ -4940,7 +4940,7 @@ class Func_handler_bit_or_dec_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); VDec a(item->arguments()[0]); @@ -4962,7 +4962,7 @@ class Func_handler_bit_and_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); Longlong_null a= item->arguments()[0]->to_longlong_null(); @@ -4975,7 +4975,7 @@ class Func_handler_bit_and_dec_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); VDec a(item->arguments()[0]); diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 92973d4e39c..3ad3c0878e9 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -454,10 +454,10 @@ public: Item_bool_func2(THD *thd, Item *a, Item *b): Item_bool_func(thd, a, b) { } - bool is_null() { return MY_TEST(args[0]->is_null() || args[1]->is_null()); } + bool is_null() override { return MY_TEST(args[0]->is_null() || args[1]->is_null()); } COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value, - bool top_level); - bool count_sargable_conds(void *arg); + bool top_level) override; + bool count_sargable_conds(void *arg) override; /* Specifies which result type the function uses to compare its arguments. This method is used in equal field propagation. @@ -472,7 +472,7 @@ public: */ return &type_handler_varchar; } - SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) + SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override { DBUG_ENTER("Item_bool_func2::get_mm_tree"); DBUG_ASSERT(arg_count == 2); @@ -505,7 +505,7 @@ class Item_bool_func2_with_rev :public Item_bool_func2 { protected: SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, - Field *field, Item *value) + Field *field, Item *value) override { DBUG_ENTER("Item_bool_func2_with_rev::get_func_mm_tree"); Item_func::Functype func_type= @@ -516,7 +516,7 @@ public: Item_bool_func2_with_rev(THD *thd, Item *a, Item *b): Item_bool_func2(thd, a, b) { } virtual enum Functype rev_functype() const= 0; - SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) + SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override { DBUG_ENTER("Item_bool_func2_with_rev::get_mm_tree"); DBUG_ASSERT(arg_count == 2); @@ -1276,32 +1276,32 @@ public: :Item_func_case_abbreviation2(thd, a, b, c) { } - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { Datetime_truncation_not_needed dt(thd, find_item(), fuzzydate); return (null_value= dt.copy_to_mysql_time(ltime, mysql_timestamp_type())); } - bool time_op(THD *thd, MYSQL_TIME *ltime) + bool time_op(THD *thd, MYSQL_TIME *ltime) override { return (null_value= Time(find_item()).copy_to_mysql_time(ltime)); } - longlong int_op() + longlong int_op() override { return val_int_from_item(find_item()); } - double real_op() + double real_op() override { return val_real_from_item(find_item()); } - my_decimal *decimal_op(my_decimal *decimal_value) + my_decimal *decimal_op(my_decimal *decimal_value) override { return val_decimal_from_item(find_item(), decimal_value); } - String *str_op(String *str) + String *str_op(String *str) override { return val_str_from_item(find_item(), str); } - bool native_op(THD *thd, Native *to) + bool native_op(THD *thd, Native *to) override { return val_native_with_conversion_from_item(thd, find_item(), to, type_handler()); @@ -1618,8 +1618,8 @@ public: in_temporal(THD *thd, uint elements) :in_longlong(thd, elements) {}; - Item *create_item(THD *thd); - void value_to_item(uint pos, Item *item) + Item *create_item(THD *thd) override; + void value_to_item(uint pos, Item *item) override { packed_longlong *val= reinterpret_cast(base)+pos; Item_datetime *dt= static_cast(item); @@ -1756,7 +1756,7 @@ public: cmp_item_sort_string(CHARSET_INFO *cs): cmp_item_string(cs), value(value_buff, sizeof(value_buff), cs) {} - void store_value(Item *item) + void store_value(Item *item) override { value_res= item->val_str(&value); m_null_value= item->null_value; @@ -1768,13 +1768,13 @@ public: value_res= &value; } } - int cmp_not_null(const Value *val) + int cmp_not_null(const Value *val) override { DBUG_ASSERT(!val->is_null()); DBUG_ASSERT(val->is_string()); return sortcmp(value_res, &val->m_string, cmp_charset) != 0; } - int cmp(Item *arg) + int cmp(Item *arg) override { char buff[STRING_BUFFER_USUAL_SIZE]; String tmp(buff, sizeof(buff), cmp_charset), *res= arg->val_str(&tmp); @@ -1787,12 +1787,12 @@ public: else return TRUE; } - int compare(cmp_item *ci) + int compare(cmp_item *ci) override { cmp_item_string *l_cmp= (cmp_item_string *) ci; return sortcmp(value_res, l_cmp->value_res, cmp_charset); - } - cmp_item *make_same(THD *thd); + } + cmp_item *make_same(THD *thd) override; void set_charset(CHARSET_INFO *cs) { cmp_charset= cs; @@ -1805,28 +1805,28 @@ class cmp_item_int : public cmp_item_scalar longlong value; public: cmp_item_int() = default; /* Remove gcc warning */ - void store_value(Item *item) + void store_value(Item *item) override { value= item->val_int(); m_null_value= item->null_value; } - int cmp_not_null(const Value *val) + int cmp_not_null(const Value *val) override { DBUG_ASSERT(!val->is_null()); DBUG_ASSERT(val->is_longlong()); return value != val->value.m_longlong; } - int cmp(Item *arg) + int cmp(Item *arg) override { const bool rc= value != arg->val_int(); return (m_null_value || arg->null_value) ? UNKNOWN : rc; } - int compare(cmp_item *ci) + int compare(cmp_item *ci) override { cmp_item_int *l_cmp= (cmp_item_int *)ci; return (value < l_cmp->value) ? -1 : ((value == l_cmp->value) ? 0 : 1); } - cmp_item *make_same(THD *thd); + cmp_item *make_same(THD *thd) override; }; /* @@ -1838,7 +1838,7 @@ protected: longlong value; public: cmp_item_temporal() = default; - int compare(cmp_item *ci); + int compare(cmp_item *ci) override; }; @@ -1848,14 +1848,14 @@ public: cmp_item_datetime() :cmp_item_temporal() { } - void store_value(Item *item) + void store_value(Item *item) override { value= item->val_datetime_packed(current_thd); m_null_value= item->null_value; } - int cmp_not_null(const Value *val); - int cmp(Item *arg); - cmp_item *make_same(THD *thd); + int cmp_not_null(const Value *val) override; + int cmp(Item *arg) override; + cmp_item *make_same(THD *thd) override; }; @@ -1865,14 +1865,14 @@ public: cmp_item_time() :cmp_item_temporal() { } - void store_value(Item *item) + void store_value(Item *item) override { value= item->val_time_packed(current_thd); m_null_value= item->null_value; } - int cmp_not_null(const Value *val); - int cmp(Item *arg); - cmp_item *make_same(THD *thd); + int cmp_not_null(const Value *val) override; + int cmp(Item *arg) override; + cmp_item *make_same(THD *thd) override; }; @@ -1881,11 +1881,11 @@ class cmp_item_timestamp: public cmp_item_scalar Timestamp_or_zero_datetime_native m_native; public: cmp_item_timestamp() :cmp_item_scalar() { } - void store_value(Item *item); - int cmp_not_null(const Value *val); - int cmp(Item *arg); - int compare(cmp_item *ci); - cmp_item *make_same(THD *thd); + void store_value(Item *item) override; + int cmp_not_null(const Value *val) override; + int cmp(Item *arg) override; + int compare(cmp_item *ci) override; + cmp_item *make_same(THD *thd) override; }; @@ -1894,28 +1894,28 @@ class cmp_item_real : public cmp_item_scalar double value; public: cmp_item_real() = default; /* Remove gcc warning */ - void store_value(Item *item) + void store_value(Item *item) override { value= item->val_real(); m_null_value= item->null_value; } - int cmp_not_null(const Value *val) + int cmp_not_null(const Value *val) override { DBUG_ASSERT(!val->is_null()); DBUG_ASSERT(val->is_double()); return value != val->value.m_double; } - int cmp(Item *arg) + int cmp(Item *arg) override { const bool rc= value != arg->val_real(); return (m_null_value || arg->null_value) ? UNKNOWN : rc; } - int compare(cmp_item *ci) + int compare(cmp_item *ci) override { cmp_item_real *l_cmp= (cmp_item_real *) ci; return (value < l_cmp->value)? -1 : ((value == l_cmp->value) ? 0 : 1); } - cmp_item *make_same(THD *thd); + cmp_item *make_same(THD *thd) override; }; @@ -1924,11 +1924,11 @@ class cmp_item_decimal : public cmp_item_scalar my_decimal value; public: cmp_item_decimal() = default; /* Remove gcc warning */ - void store_value(Item *item); - int cmp(Item *arg); - int cmp_not_null(const Value *val); - int compare(cmp_item *c); - cmp_item *make_same(THD *thd); + void store_value(Item *item) override; + int cmp(Item *arg) override; + int cmp_not_null(const Value *val) override; + int compare(cmp_item *c) override; + cmp_item *make_same(THD *thd) override; }; @@ -1944,28 +1944,28 @@ class cmp_item_sort_string_in_static :public cmp_item_string public: cmp_item_sort_string_in_static(CHARSET_INFO *cs): cmp_item_string(cs) {} - void store_value(Item *item) + void store_value(Item *item) override { value_res= item->val_str(&value); m_null_value= item->null_value; } - int cmp_not_null(const Value *val) + int cmp_not_null(const Value *val) override { DBUG_ASSERT(false); return TRUE; } - int cmp(Item *item) + int cmp(Item *item) override { // Should never be called DBUG_ASSERT(false); return TRUE; } - int compare(cmp_item *ci) + int compare(cmp_item *ci) override { cmp_item_string *l_cmp= (cmp_item_string *) ci; return sortcmp(value_res, l_cmp->value_res, cmp_charset); } - cmp_item *make_same(THD *thd) + cmp_item *make_same(THD *) override { return new cmp_item_sort_string_in_static(cmp_charset); } @@ -2692,7 +2692,7 @@ public: bool prepare_comparators(THD *, const LEX_CSTRING &funcname, const Item_args *args, uint level); int cmp(Item *arg) override; - int cmp_not_null(const Value *val) override + int cmp_not_null(const Value *) override { DBUG_ASSERT(false); return TRUE; @@ -3694,11 +3694,11 @@ public: Item_func_cursor_bool_attr(THD *thd, const LEX_CSTRING *name, uint offset) :Item_bool_func(thd), Cursor_ref(name, offset) { } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), arg, VCOL_SESSION_FUNC); } - void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { Cursor_ref::print_func(str, func_name_cstring()); } @@ -3793,11 +3793,11 @@ class Eq_creator :public Comp_creator public: Eq_creator() = default; /* Remove gcc warning */ virtual ~Eq_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? "<>" : "="; } - bool eqne_op() const { return 1; } - bool l_op() const { return 0; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? "<>" : "="; } + bool eqne_op() const override { return 1; } + bool l_op() const override { return 0; } }; class Ne_creator :public Comp_creator @@ -3805,11 +3805,11 @@ class Ne_creator :public Comp_creator public: Ne_creator() = default; /* Remove gcc warning */ virtual ~Ne_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? "=" : "<>"; } - bool eqne_op() const { return 1; } - bool l_op() const { return 0; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? "=" : "<>"; } + bool eqne_op() const override { return 1; } + bool l_op() const override { return 0; } }; class Gt_creator :public Comp_creator @@ -3817,11 +3817,11 @@ class Gt_creator :public Comp_creator public: Gt_creator() = default; /* Remove gcc warning */ virtual ~Gt_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? "<=" : ">"; } - bool eqne_op() const { return 0; } - bool l_op() const { return 0; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? "<=" : ">"; } + bool eqne_op() const override { return 0; } + bool l_op() const override { return 0; } }; class Lt_creator :public Comp_creator @@ -3829,11 +3829,11 @@ class Lt_creator :public Comp_creator public: Lt_creator() = default; /* Remove gcc warning */ virtual ~Lt_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? ">=" : "<"; } - bool eqne_op() const { return 0; } - bool l_op() const { return 1; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? ">=" : "<"; } + bool eqne_op() const override { return 0; } + bool l_op() const override { return 1; } }; class Ge_creator :public Comp_creator @@ -3841,11 +3841,11 @@ class Ge_creator :public Comp_creator public: Ge_creator() = default; /* Remove gcc warning */ virtual ~Ge_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? "<" : ">="; } - bool eqne_op() const { return 0; } - bool l_op() const { return 0; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? "<" : ">="; } + bool eqne_op() const override { return 0; } + bool l_op() const override { return 0; } }; class Le_creator :public Comp_creator @@ -3853,11 +3853,11 @@ class Le_creator :public Comp_creator public: Le_creator() = default; /* Remove gcc warning */ virtual ~Le_creator() = default; /* Remove gcc warning */ - Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const; - Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const; - const char* symbol(bool invert) const { return invert? ">" : "<="; } - bool eqne_op() const { return 0; } - bool l_op() const { return 1; } + Item_bool_rowready_func2* create(THD *thd, Item *a, Item *b) const override; + Item_bool_rowready_func2* create_swap(THD *thd, Item *a, Item *b) const override; + const char* symbol(bool invert) const override { return invert? ">" : "<="; } + bool eqne_op() const override { return 0; } + bool l_op() const override { return 1; } }; /* diff --git a/sql/item_create.cc b/sql/item_create.cc index e060a038c70..76bb8e3fa17 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -67,10 +67,10 @@ extern Native_func_registry_array native_func_registry_array_geom; class Create_sp_func : public Create_qfunc { public: - virtual Item *create_with_db(THD *thd, + Item *create_with_db(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *name, - bool use_explicit_name, List *item_list); + bool use_explicit_name, List *item_list) override; static Create_sp_func s_singleton; @@ -78,7 +78,7 @@ protected: /** Constructor. */ Create_sp_func() = default; /** Destructor. */ - virtual ~Create_sp_func() = default; + ~Create_sp_func() override = default; }; @@ -91,46 +91,46 @@ protected: class Create_func_abs : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_abs s_singleton; protected: Create_func_abs() = default; - virtual ~Create_func_abs() = default; + ~Create_func_abs() override = default; }; class Create_func_acos : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_acos s_singleton; protected: Create_func_acos() = default; - virtual ~Create_func_acos() = default; + ~Create_func_acos() override = default; }; class Create_func_addtime : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_addtime s_singleton; protected: Create_func_addtime() = default; - virtual ~Create_func_addtime() = default; + ~Create_func_addtime() override = default; }; class Create_func_addmonths : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_addmonths s_singleton; @@ -143,138 +143,138 @@ protected: class Create_func_aes_encrypt : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_aes_encrypt s_singleton; protected: Create_func_aes_encrypt() = default; - virtual ~Create_func_aes_encrypt() = default; + ~Create_func_aes_encrypt() override = default; }; class Create_func_aes_decrypt : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_aes_decrypt s_singleton; protected: Create_func_aes_decrypt() = default; - virtual ~Create_func_aes_decrypt() = default; + ~Create_func_aes_decrypt() override = default; }; class Create_func_asin : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_asin s_singleton; protected: Create_func_asin() = default; - virtual ~Create_func_asin() = default; + ~Create_func_asin() override = default; }; class Create_func_atan : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_atan s_singleton; protected: Create_func_atan() = default; - virtual ~Create_func_atan() = default; + ~Create_func_atan() override = default; }; class Create_func_benchmark : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_benchmark s_singleton; protected: Create_func_benchmark() = default; - virtual ~Create_func_benchmark() = default; + ~Create_func_benchmark() override = default; }; class Create_func_bin : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_bin s_singleton; protected: Create_func_bin() = default; - virtual ~Create_func_bin() = default; + ~Create_func_bin() override = default; }; class Create_func_binlog_gtid_pos : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_binlog_gtid_pos s_singleton; protected: Create_func_binlog_gtid_pos() = default; - virtual ~Create_func_binlog_gtid_pos() = default; + ~Create_func_binlog_gtid_pos() override = default; }; class Create_func_bit_count : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_bit_count s_singleton; protected: Create_func_bit_count() = default; - virtual ~Create_func_bit_count() = default; + ~Create_func_bit_count() override = default; }; class Create_func_bit_length : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_bit_length s_singleton; protected: Create_func_bit_length() = default; - virtual ~Create_func_bit_length() = default; + ~Create_func_bit_length() override = default; }; class Create_func_ceiling : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ceiling s_singleton; protected: Create_func_ceiling() = default; - virtual ~Create_func_ceiling() = default; + ~Create_func_ceiling() override = default; }; class Create_func_collation : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_collation s_singleton; @@ -287,95 +287,95 @@ protected: class Create_func_chr : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_chr s_singleton; protected: Create_func_chr() = default; - virtual ~Create_func_chr() = default; + ~Create_func_chr() override = default; }; class Create_func_char_length : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_char_length s_singleton; protected: Create_func_char_length() = default; - virtual ~Create_func_char_length() = default; + ~Create_func_char_length() override = default; }; class Create_func_coercibility : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_coercibility s_singleton; protected: Create_func_coercibility() = default; - virtual ~Create_func_coercibility() = default; + ~Create_func_coercibility() override = default; }; class Create_func_dyncol_check : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dyncol_check s_singleton; protected: Create_func_dyncol_check() = default; - virtual ~Create_func_dyncol_check() = default; + ~Create_func_dyncol_check() override = default; }; class Create_func_dyncol_exists : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_dyncol_exists s_singleton; protected: Create_func_dyncol_exists() = default; - virtual ~Create_func_dyncol_exists() = default; + ~Create_func_dyncol_exists() override = default; }; class Create_func_dyncol_list : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dyncol_list s_singleton; protected: Create_func_dyncol_list() = default; - virtual ~Create_func_dyncol_list() = default; + ~Create_func_dyncol_list() override = default; }; class Create_func_dyncol_json : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dyncol_json s_singleton; protected: Create_func_dyncol_json() = default; - virtual ~Create_func_dyncol_json() = default; + ~Create_func_dyncol_json() override = default; }; class Create_func_coalesce : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_coalesce s_singleton; @@ -388,62 +388,62 @@ protected: class Create_func_compress : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_compress s_singleton; protected: Create_func_compress() = default; - virtual ~Create_func_compress() = default; + ~Create_func_compress() override = default; }; class Create_func_concat : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_concat s_singleton; protected: Create_func_concat() = default; - virtual ~Create_func_concat() = default; + ~Create_func_concat() override = default; }; class Create_func_concat_operator_oracle : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_concat_operator_oracle s_singleton; protected: Create_func_concat_operator_oracle() = default; - virtual ~Create_func_concat_operator_oracle() = default; + ~Create_func_concat_operator_oracle() override = default; }; class Create_func_decode_histogram : public Create_func_arg2 { public: - Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_decode_histogram s_singleton; protected: Create_func_decode_histogram() = default; - virtual ~Create_func_decode_histogram() = default; + ~Create_func_decode_histogram() override = default; }; class Create_func_decode_oracle : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override { if (unlikely(!item_list || item_list->elements < 3)) { @@ -457,15 +457,15 @@ public: protected: Create_func_decode_oracle() = default; - virtual ~Create_func_decode_oracle() = default; + ~Create_func_decode_oracle() override = default; }; class Create_func_decode : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override { if (unlikely(!item_list || item_list->elements != 2)) { @@ -481,41 +481,41 @@ public: protected: Create_func_decode() {} - virtual ~Create_func_decode() {} + ~Create_func_decode() override {} }; class Create_func_concat_ws : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_concat_ws s_singleton; protected: Create_func_concat_ws() = default; - virtual ~Create_func_concat_ws() = default; + ~Create_func_concat_ws() override = default; }; class Create_func_connection_id : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_connection_id s_singleton; protected: Create_func_connection_id() = default; - virtual ~Create_func_connection_id() = default; + ~Create_func_connection_id() override = default; }; class Create_func_database : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_database s_singleton; @@ -528,99 +528,99 @@ protected: class Create_func_nvl2 : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_nvl2 s_singleton; protected: Create_func_nvl2() = default; - virtual ~Create_func_nvl2() = default; + ~Create_func_nvl2() override = default; }; class Create_func_conv : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_conv s_singleton; protected: Create_func_conv() = default; - virtual ~Create_func_conv() = default; + ~Create_func_conv() override = default; }; class Create_func_convert_tz : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_convert_tz s_singleton; protected: Create_func_convert_tz() = default; - virtual ~Create_func_convert_tz() = default; + ~Create_func_convert_tz() override = default; }; class Create_func_cos : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_cos s_singleton; protected: Create_func_cos() = default; - virtual ~Create_func_cos() = default; + ~Create_func_cos() override = default; }; class Create_func_cot : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_cot s_singleton; protected: Create_func_cot() = default; - virtual ~Create_func_cot() = default; + ~Create_func_cot() override = default; }; class Create_func_crc32 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_crc32 s_singleton; protected: Create_func_crc32() = default; - virtual ~Create_func_crc32() = default; + ~Create_func_crc32() override = default; }; class Create_func_datediff : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_datediff s_singleton; protected: Create_func_datediff() = default; - virtual ~Create_func_datediff() = default; + ~Create_func_datediff() override = default; }; class Create_func_date_format : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_date_format s_singleton; @@ -635,826 +635,826 @@ protected: class Create_func_dayname : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dayname s_singleton; protected: Create_func_dayname() = default; - virtual ~Create_func_dayname() = default; + ~Create_func_dayname() override = default; }; class Create_func_dayofmonth : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dayofmonth s_singleton; protected: Create_func_dayofmonth() = default; - virtual ~Create_func_dayofmonth() = default; + ~Create_func_dayofmonth() override = default; }; class Create_func_dayofweek : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dayofweek s_singleton; protected: Create_func_dayofweek() = default; - virtual ~Create_func_dayofweek() = default; + ~Create_func_dayofweek() override = default; }; class Create_func_dayofyear : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_dayofyear s_singleton; protected: Create_func_dayofyear() = default; - virtual ~Create_func_dayofyear() = default; + ~Create_func_dayofyear() override = default; }; class Create_func_degrees : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_degrees s_singleton; protected: Create_func_degrees() = default; - virtual ~Create_func_degrees() = default; + ~Create_func_degrees() override = default; }; class Create_func_des_decrypt : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_des_decrypt s_singleton; protected: Create_func_des_decrypt() = default; - virtual ~Create_func_des_decrypt() = default; + ~Create_func_des_decrypt() override = default; }; class Create_func_des_encrypt : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_des_encrypt s_singleton; protected: Create_func_des_encrypt() = default; - virtual ~Create_func_des_encrypt() = default; + ~Create_func_des_encrypt() override = default; }; class Create_func_elt : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_elt s_singleton; protected: Create_func_elt() = default; - virtual ~Create_func_elt() = default; + ~Create_func_elt() override = default; }; class Create_func_encode : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_encode s_singleton; protected: Create_func_encode() = default; - virtual ~Create_func_encode() = default; + ~Create_func_encode() override = default; }; class Create_func_encrypt : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_encrypt s_singleton; protected: Create_func_encrypt() = default; - virtual ~Create_func_encrypt() = default; + ~Create_func_encrypt() override = default; }; class Create_func_exp : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_exp s_singleton; protected: Create_func_exp() = default; - virtual ~Create_func_exp() = default; + ~Create_func_exp() override = default; }; class Create_func_export_set : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_export_set s_singleton; protected: Create_func_export_set() = default; - virtual ~Create_func_export_set() = default; + ~Create_func_export_set() override = default; }; class Create_func_field : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_field s_singleton; protected: Create_func_field() = default; - virtual ~Create_func_field() = default; + ~Create_func_field() override = default; }; class Create_func_find_in_set : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_find_in_set s_singleton; protected: Create_func_find_in_set() = default; - virtual ~Create_func_find_in_set() = default; + ~Create_func_find_in_set() override = default; }; class Create_func_floor : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_floor s_singleton; protected: Create_func_floor() = default; - virtual ~Create_func_floor() = default; + ~Create_func_floor() override = default; }; class Create_func_format : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_format s_singleton; protected: Create_func_format() = default; - virtual ~Create_func_format() = default; + ~Create_func_format() override = default; }; class Create_func_found_rows : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_found_rows s_singleton; protected: Create_func_found_rows() = default; - virtual ~Create_func_found_rows() = default; + ~Create_func_found_rows() override = default; }; class Create_func_from_base64 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_from_base64 s_singleton; protected: Create_func_from_base64() = default; - virtual ~Create_func_from_base64() = default; + ~Create_func_from_base64() override = default; }; class Create_func_from_days : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_from_days s_singleton; protected: Create_func_from_days() = default; - virtual ~Create_func_from_days() = default; + ~Create_func_from_days() override = default; }; class Create_func_from_unixtime : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_from_unixtime s_singleton; protected: Create_func_from_unixtime() = default; - virtual ~Create_func_from_unixtime() = default; + ~Create_func_from_unixtime() override = default; }; class Create_func_get_lock : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_get_lock s_singleton; protected: Create_func_get_lock() = default; - virtual ~Create_func_get_lock() = default; + ~Create_func_get_lock() override = default; }; class Create_func_greatest : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_greatest s_singleton; protected: Create_func_greatest() = default; - virtual ~Create_func_greatest() = default; + ~Create_func_greatest() override = default; }; class Create_func_hex : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_hex s_singleton; protected: Create_func_hex() = default; - virtual ~Create_func_hex() = default; + ~Create_func_hex() override = default; }; class Create_func_ifnull : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_ifnull s_singleton; protected: Create_func_ifnull() = default; - virtual ~Create_func_ifnull() = default; + ~Create_func_ifnull() override = default; }; class Create_func_instr : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_instr s_singleton; protected: Create_func_instr() = default; - virtual ~Create_func_instr() = default; + ~Create_func_instr() override = default; }; class Create_func_is_free_lock : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_is_free_lock s_singleton; protected: Create_func_is_free_lock() = default; - virtual ~Create_func_is_free_lock() = default; + ~Create_func_is_free_lock() override = default; }; class Create_func_is_used_lock : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_is_used_lock s_singleton; protected: Create_func_is_used_lock() = default; - virtual ~Create_func_is_used_lock() = default; + ~Create_func_is_used_lock() override = default; }; class Create_func_isnull : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_isnull s_singleton; protected: Create_func_isnull() = default; - virtual ~Create_func_isnull() = default; + ~Create_func_isnull() override = default; }; class Create_func_json_exists : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_json_exists s_singleton; protected: Create_func_json_exists() = default; - virtual ~Create_func_json_exists() = default; + ~Create_func_json_exists() override = default; }; class Create_func_json_valid : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_valid s_singleton; protected: Create_func_json_valid() = default; - virtual ~Create_func_json_valid() = default; + ~Create_func_json_valid() override = default; }; class Create_func_json_compact : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_compact s_singleton; protected: Create_func_json_compact() = default; - virtual ~Create_func_json_compact() = default; + ~Create_func_json_compact() override = default; }; class Create_func_json_loose : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_loose s_singleton; protected: Create_func_json_loose() = default; - virtual ~Create_func_json_loose() = default; + ~Create_func_json_loose() override = default; }; class Create_func_json_detailed: public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_detailed s_singleton; protected: Create_func_json_detailed() = default; - virtual ~Create_func_json_detailed() = default; + ~Create_func_json_detailed() override = default; }; class Create_func_json_type : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_type s_singleton; protected: Create_func_json_type() = default; - virtual ~Create_func_json_type() = default; + ~Create_func_json_type() override = default; }; class Create_func_json_depth : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_depth s_singleton; protected: Create_func_json_depth() = default; - virtual ~Create_func_json_depth() = default; + ~Create_func_json_depth() override = default; }; class Create_func_json_value : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_json_value s_singleton; protected: Create_func_json_value() = default; - virtual ~Create_func_json_value() = default; + ~Create_func_json_value() override = default; }; class Create_func_json_query : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_json_query s_singleton; protected: Create_func_json_query() = default; - virtual ~Create_func_json_query() = default; + ~Create_func_json_query() override = default; }; class Create_func_json_keys: public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_keys s_singleton; protected: Create_func_json_keys() = default; - virtual ~Create_func_json_keys() = default; + ~Create_func_json_keys() override = default; }; class Create_func_json_contains: public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_contains s_singleton; protected: Create_func_json_contains() = default; - virtual ~Create_func_json_contains() = default; + ~Create_func_json_contains() override = default; }; class Create_func_json_contains_path : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_contains_path s_singleton; protected: Create_func_json_contains_path() = default; - virtual ~Create_func_json_contains_path() = default; + ~Create_func_json_contains_path() override = default; }; class Create_func_json_extract : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_extract s_singleton; protected: Create_func_json_extract() = default; - virtual ~Create_func_json_extract() = default; + ~Create_func_json_extract() override = default; }; class Create_func_json_search : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_search s_singleton; protected: Create_func_json_search() = default; - virtual ~Create_func_json_search() = default; + ~Create_func_json_search() override = default; }; class Create_func_json_array : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_array s_singleton; protected: Create_func_json_array() = default; - virtual ~Create_func_json_array() = default; + ~Create_func_json_array() override = default; }; class Create_func_json_array_append : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_array_append s_singleton; protected: Create_func_json_array_append() = default; - virtual ~Create_func_json_array_append() = default; + ~Create_func_json_array_append() override = default; }; class Create_func_json_array_insert : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_array_insert s_singleton; protected: Create_func_json_array_insert() = default; - virtual ~Create_func_json_array_insert() = default; + ~Create_func_json_array_insert() override = default; }; class Create_func_json_insert : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_insert s_singleton; protected: Create_func_json_insert() = default; - virtual ~Create_func_json_insert() = default; + ~Create_func_json_insert() override = default; }; class Create_func_json_set : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_set s_singleton; protected: Create_func_json_set() = default; - virtual ~Create_func_json_set() = default; + ~Create_func_json_set() override = default; }; class Create_func_json_replace : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_replace s_singleton; protected: Create_func_json_replace() = default; - virtual ~Create_func_json_replace() = default; + ~Create_func_json_replace() override = default; }; class Create_func_json_remove : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_remove s_singleton; protected: Create_func_json_remove() = default; - virtual ~Create_func_json_remove() = default; + ~Create_func_json_remove() override = default; }; class Create_func_json_object : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_object s_singleton; protected: Create_func_json_object() = default; - virtual ~Create_func_json_object() = default; + ~Create_func_json_object() override = default; }; class Create_func_json_length : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_length s_singleton; protected: Create_func_json_length() = default; - virtual ~Create_func_json_length() = default; + ~Create_func_json_length() override = default; }; class Create_func_json_merge : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_merge s_singleton; protected: Create_func_json_merge() = default; - virtual ~Create_func_json_merge() = default; + ~Create_func_json_merge() override = default; }; class Create_func_json_merge_patch : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_json_merge_patch s_singleton; protected: Create_func_json_merge_patch() = default; - virtual ~Create_func_json_merge_patch() = default; + ~Create_func_json_merge_patch() override = default; }; class Create_func_json_quote : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_quote s_singleton; protected: Create_func_json_quote() = default; - virtual ~Create_func_json_quote() = default; + ~Create_func_json_quote() override = default; }; class Create_func_json_unquote : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_json_unquote s_singleton; protected: Create_func_json_unquote() = default; - virtual ~Create_func_json_unquote() = default; + ~Create_func_json_unquote() override = default; }; class Create_func_last_day : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_last_day s_singleton; protected: Create_func_last_day() = default; - virtual ~Create_func_last_day() = default; + ~Create_func_last_day() override = default; }; class Create_func_last_insert_id : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_last_insert_id s_singleton; protected: Create_func_last_insert_id() = default; - virtual ~Create_func_last_insert_id() = default; + ~Create_func_last_insert_id() override = default; }; class Create_func_lcase : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_lcase s_singleton; protected: Create_func_lcase() = default; - virtual ~Create_func_lcase() = default; + ~Create_func_lcase() override = default; }; class Create_func_least : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_least s_singleton; protected: Create_func_least() = default; - virtual ~Create_func_least() = default; + ~Create_func_least() override = default; }; class Create_func_length : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_length s_singleton; protected: Create_func_length() = default; - virtual ~Create_func_length() = default; + ~Create_func_length() override = default; }; class Create_func_octet_length : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_octet_length s_singleton; protected: Create_func_octet_length() = default; - virtual ~Create_func_octet_length() = default; + ~Create_func_octet_length() override = default; }; class Create_func_old_password : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_old_password s_singleton; @@ -1467,7 +1467,7 @@ protected: class Create_func_password : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_password s_singleton; @@ -1481,26 +1481,26 @@ protected: class Create_func_like_range_min : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_like_range_min s_singleton; protected: Create_func_like_range_min() = default; - virtual ~Create_func_like_range_min() = default; + ~Create_func_like_range_min() override = default; }; class Create_func_like_range_max : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_like_range_max s_singleton; protected: Create_func_like_range_max() = default; - virtual ~Create_func_like_range_max() = default; + ~Create_func_like_range_max() override = default; }; #endif @@ -1508,88 +1508,88 @@ protected: class Create_func_ln : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ln s_singleton; protected: Create_func_ln() = default; - virtual ~Create_func_ln() = default; + ~Create_func_ln() override = default; }; class Create_func_load_file : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_load_file s_singleton; protected: Create_func_load_file() = default; - virtual ~Create_func_load_file() = default; + ~Create_func_load_file() override = default; }; class Create_func_locate : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_locate s_singleton; protected: Create_func_locate() = default; - virtual ~Create_func_locate() = default; + ~Create_func_locate() override = default; }; class Create_func_log : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_log s_singleton; protected: Create_func_log() = default; - virtual ~Create_func_log() = default; + ~Create_func_log() override = default; }; class Create_func_log10 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_log10 s_singleton; protected: Create_func_log10() = default; - virtual ~Create_func_log10() = default; + ~Create_func_log10() override = default; }; class Create_func_log2 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_log2 s_singleton; protected: Create_func_log2() = default; - virtual ~Create_func_log2() = default; + ~Create_func_log2() override = default; }; class Create_func_lpad : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override { return create_native_std(thd, name, item_list); } @@ -1597,7 +1597,7 @@ public: protected: Create_func_lpad() = default; - virtual ~Create_func_lpad() = default; + ~Create_func_lpad() override = default; Item *create_native_std(THD *thd, const LEX_CSTRING *name, List *items); Item *create_native_oracle(THD *thd, const LEX_CSTRING *name, @@ -1609,7 +1609,7 @@ class Create_func_lpad_oracle : public Create_func_lpad { public: Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + List *item_list) override { return create_native_oracle(thd, name, item_list); } @@ -1620,114 +1620,114 @@ public: class Create_func_ltrim : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ltrim s_singleton; protected: Create_func_ltrim() = default; - virtual ~Create_func_ltrim() = default; + ~Create_func_ltrim() override = default; }; class Create_func_ltrim_oracle : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ltrim_oracle s_singleton; protected: Create_func_ltrim_oracle() = default; - virtual ~Create_func_ltrim_oracle() = default; + ~Create_func_ltrim_oracle() override = default; }; class Create_func_makedate : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_makedate s_singleton; protected: Create_func_makedate() = default; - virtual ~Create_func_makedate() = default; + ~Create_func_makedate() override = default; }; class Create_func_maketime : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_maketime s_singleton; protected: Create_func_maketime() = default; - virtual ~Create_func_maketime() = default; + ~Create_func_maketime() override = default; }; class Create_func_make_set : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_make_set s_singleton; protected: Create_func_make_set() = default; - virtual ~Create_func_make_set() = default; + ~Create_func_make_set() override = default; }; class Create_func_master_pos_wait : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_master_pos_wait s_singleton; protected: Create_func_master_pos_wait() = default; - virtual ~Create_func_master_pos_wait() = default; + ~Create_func_master_pos_wait() override = default; }; class Create_func_master_gtid_wait : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_master_gtid_wait s_singleton; protected: Create_func_master_gtid_wait() = default; - virtual ~Create_func_master_gtid_wait() = default; + ~Create_func_master_gtid_wait() override = default; }; class Create_func_md5 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_md5 s_singleton; protected: Create_func_md5() = default; - virtual ~Create_func_md5() = default; + ~Create_func_md5() override = default; }; class Create_func_microsecond : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_microsecond s_singleton; @@ -1740,7 +1740,7 @@ protected: class Create_func_mod : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_mod s_singleton; @@ -1753,124 +1753,124 @@ protected: class Create_func_monthname : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_monthname s_singleton; protected: Create_func_monthname() = default; - virtual ~Create_func_monthname() = default; + ~Create_func_monthname() override = default; }; class Create_func_name_const : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_name_const s_singleton; protected: Create_func_name_const() = default; - virtual ~Create_func_name_const() = default; + ~Create_func_name_const() override = default; }; class Create_func_nullif : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_nullif s_singleton; protected: Create_func_nullif() = default; - virtual ~Create_func_nullif() = default; + ~Create_func_nullif() override = default; }; class Create_func_oct : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_oct s_singleton; protected: Create_func_oct() = default; - virtual ~Create_func_oct() = default; + ~Create_func_oct() override = default; }; class Create_func_ord : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ord s_singleton; protected: Create_func_ord() = default; - virtual ~Create_func_ord() = default; + ~Create_func_ord() override = default; }; class Create_func_period_add : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_period_add s_singleton; protected: Create_func_period_add() = default; - virtual ~Create_func_period_add() = default; + ~Create_func_period_add() override = default; }; class Create_func_period_diff : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_period_diff s_singleton; protected: Create_func_period_diff() = default; - virtual ~Create_func_period_diff() = default; + ~Create_func_period_diff() override = default; }; class Create_func_pi : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_pi s_singleton; protected: Create_func_pi() = default; - virtual ~Create_func_pi() = default; + ~Create_func_pi() override = default; }; class Create_func_pow : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_pow s_singleton; protected: Create_func_pow() = default; - virtual ~Create_func_pow() = default; + ~Create_func_pow() override = default; }; class Create_func_quarter : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_quarter s_singleton; @@ -1883,26 +1883,26 @@ protected: class Create_func_quote : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_quote s_singleton; protected: Create_func_quote() = default; - virtual ~Create_func_quote() = default; + ~Create_func_quote() override = default; }; class Create_func_regexp_instr : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_regexp_instr s_singleton; protected: Create_func_regexp_instr() = default; - virtual ~Create_func_regexp_instr() = default; + ~Create_func_regexp_instr() override = default; }; @@ -1918,7 +1918,7 @@ public: protected: Create_func_regexp_replace() = default; - virtual ~Create_func_regexp_replace() = default; + ~Create_func_regexp_replace() override = default; }; Create_func_regexp_replace Create_func_regexp_replace::s_singleton; @@ -1937,7 +1937,7 @@ public: protected: Create_func_regexp_replace_oracle() = default; - virtual ~Create_func_regexp_replace_oracle() = default; + ~Create_func_regexp_replace_oracle() override = default; }; Create_func_regexp_replace_oracle @@ -1947,47 +1947,47 @@ Create_func_regexp_replace_oracle class Create_func_regexp_substr : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_regexp_substr s_singleton; protected: Create_func_regexp_substr() = default; - virtual ~Create_func_regexp_substr() = default; + ~Create_func_regexp_substr() override = default; }; class Create_func_radians : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_radians s_singleton; protected: Create_func_radians() = default; - virtual ~Create_func_radians() = default; + ~Create_func_radians() override = default; }; class Create_func_rand : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_rand s_singleton; protected: Create_func_rand() = default; - virtual ~Create_func_rand() = default; + ~Create_func_rand() override = default; }; class Create_func_release_all_locks : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_release_all_locks s_singleton; }; @@ -1996,60 +1996,60 @@ public: class Create_func_release_lock : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_release_lock s_singleton; protected: Create_func_release_lock() = default; - virtual ~Create_func_release_lock() = default; + ~Create_func_release_lock() override = default; }; class Create_func_replace_oracle : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_replace_oracle s_singleton; protected: Create_func_replace_oracle() = default; - virtual ~Create_func_replace_oracle() = default; + ~Create_func_replace_oracle() override = default; }; class Create_func_reverse : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_reverse s_singleton; protected: Create_func_reverse() = default; - virtual ~Create_func_reverse() = default; + ~Create_func_reverse() override = default; }; class Create_func_round : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_round s_singleton; protected: Create_func_round() = default; - virtual ~Create_func_round() = default; + ~Create_func_round() override = default; }; class Create_func_row_count : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_row_count s_singleton; @@ -2062,8 +2062,8 @@ protected: class Create_func_rpad : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override { return create_native_std(thd, name, item_list); } @@ -2071,7 +2071,7 @@ public: protected: Create_func_rpad() = default; - virtual ~Create_func_rpad() = default; + ~Create_func_rpad() override = default; Item *create_native_std(THD *thd, const LEX_CSTRING *name, List *items); Item *create_native_oracle(THD *thd, const LEX_CSTRING *name, @@ -2083,7 +2083,7 @@ class Create_func_rpad_oracle : public Create_func_rpad { public: Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list) + List *item_list) override { return create_native_oracle(thd, name, item_list); } @@ -2094,274 +2094,274 @@ public: class Create_func_rtrim : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_rtrim s_singleton; protected: Create_func_rtrim() = default; - virtual ~Create_func_rtrim() = default; + ~Create_func_rtrim() override = default; }; class Create_func_rtrim_oracle : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_rtrim_oracle s_singleton; protected: Create_func_rtrim_oracle() = default; - virtual ~Create_func_rtrim_oracle() = default; + ~Create_func_rtrim_oracle() override = default; }; class Create_func_sec_to_time : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sec_to_time s_singleton; protected: Create_func_sec_to_time() = default; - virtual ~Create_func_sec_to_time() = default; + ~Create_func_sec_to_time() override = default; }; class Create_func_sha : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sha s_singleton; protected: Create_func_sha() = default; - virtual ~Create_func_sha() = default; + ~Create_func_sha() override = default; }; class Create_func_sha2 : public Create_func_arg2 { public: - virtual Item* create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_sha2 s_singleton; protected: Create_func_sha2() = default; - virtual ~Create_func_sha2() = default; + ~Create_func_sha2() override = default; }; class Create_func_sign : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sign s_singleton; protected: Create_func_sign() = default; - virtual ~Create_func_sign() = default; + ~Create_func_sign() override = default; }; class Create_func_sin : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sin s_singleton; protected: Create_func_sin() = default; - virtual ~Create_func_sin() = default; + ~Create_func_sin() override = default; }; class Create_func_sleep : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sleep s_singleton; protected: Create_func_sleep() = default; - virtual ~Create_func_sleep() = default; + ~Create_func_sleep() override = default; }; class Create_func_soundex : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_soundex s_singleton; protected: Create_func_soundex() = default; - virtual ~Create_func_soundex() = default; + ~Create_func_soundex() override = default; }; class Create_func_space : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_space s_singleton; protected: Create_func_space() = default; - virtual ~Create_func_space() = default; + ~Create_func_space() override = default; }; class Create_func_sqrt : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_sqrt s_singleton; protected: Create_func_sqrt() = default; - virtual ~Create_func_sqrt() = default; + ~Create_func_sqrt() override = default; }; class Create_func_str_to_date : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_str_to_date s_singleton; protected: Create_func_str_to_date() = default; - virtual ~Create_func_str_to_date() = default; + ~Create_func_str_to_date() override = default; }; class Create_func_strcmp : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_strcmp s_singleton; protected: Create_func_strcmp() = default; - virtual ~Create_func_strcmp() = default; + ~Create_func_strcmp() override = default; }; class Create_func_substr_index : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_substr_index s_singleton; protected: Create_func_substr_index() = default; - virtual ~Create_func_substr_index() = default; + ~Create_func_substr_index() override = default; }; class Create_func_substr_oracle : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_substr_oracle s_singleton; protected: Create_func_substr_oracle() = default; - virtual ~Create_func_substr_oracle() = default; + ~Create_func_substr_oracle() override = default; }; class Create_func_subtime : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_subtime s_singleton; protected: Create_func_subtime() = default; - virtual ~Create_func_subtime() = default; + ~Create_func_subtime() override = default; }; class Create_func_tan : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_tan s_singleton; protected: Create_func_tan() = default; - virtual ~Create_func_tan() = default; + ~Create_func_tan() override = default; }; class Create_func_time_format : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_time_format s_singleton; protected: Create_func_time_format() = default; - virtual ~Create_func_time_format() = default; + ~Create_func_time_format() override = default; }; class Create_func_time_to_sec : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_time_to_sec s_singleton; protected: Create_func_time_to_sec() = default; - virtual ~Create_func_time_to_sec() = default; + ~Create_func_time_to_sec() override = default; }; class Create_func_timediff : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_timediff s_singleton; protected: Create_func_timediff() = default; - virtual ~Create_func_timediff() = default; + ~Create_func_timediff() override = default; }; class Create_func_to_base64 : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_to_base64 s_singleton; protected: Create_func_to_base64() = default; - virtual ~Create_func_to_base64() = default; + ~Create_func_to_base64() override = default; }; @@ -2382,110 +2382,110 @@ protected: class Create_func_to_days : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_to_days s_singleton; protected: Create_func_to_days() = default; - virtual ~Create_func_to_days() = default; + ~Create_func_to_days() override = default; }; class Create_func_to_seconds : public Create_func_arg1 { public: - virtual Item* create_1_arg(THD *thd, Item *arg1); + Item* create_1_arg(THD *thd, Item *arg1) override; static Create_func_to_seconds s_singleton; protected: Create_func_to_seconds() = default; - virtual ~Create_func_to_seconds() = default; + ~Create_func_to_seconds() override = default; }; class Create_func_ucase : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_ucase s_singleton; protected: Create_func_ucase() = default; - virtual ~Create_func_ucase() = default; + ~Create_func_ucase() override = default; }; class Create_func_uncompress : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_uncompress s_singleton; protected: Create_func_uncompress() = default; - virtual ~Create_func_uncompress() = default; + ~Create_func_uncompress() override = default; }; class Create_func_uncompressed_length : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_uncompressed_length s_singleton; protected: Create_func_uncompressed_length() = default; - virtual ~Create_func_uncompressed_length() = default; + ~Create_func_uncompressed_length() override = default; }; class Create_func_unhex : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_unhex s_singleton; protected: Create_func_unhex() = default; - virtual ~Create_func_unhex() = default; + ~Create_func_unhex() override = default; }; class Create_func_unix_timestamp : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_unix_timestamp s_singleton; protected: Create_func_unix_timestamp() = default; - virtual ~Create_func_unix_timestamp() = default; + ~Create_func_unix_timestamp() override = default; }; class Create_func_uuid : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_uuid s_singleton; protected: Create_func_uuid() = default; - virtual ~Create_func_uuid() = default; + ~Create_func_uuid() override = default; }; class Create_func_sys_guid : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_sys_guid s_singleton; @@ -2497,34 +2497,34 @@ protected: class Create_func_uuid_short : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_uuid_short s_singleton; protected: Create_func_uuid_short() = default; - virtual ~Create_func_uuid_short() = default; + ~Create_func_uuid_short() override = default; }; class Create_func_version : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_version s_singleton; protected: Create_func_version() = default; - virtual ~Create_func_version() = default; + ~Create_func_version() override = default; }; class Create_func_week : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_week s_singleton; @@ -2537,26 +2537,26 @@ protected: class Create_func_weekday : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_weekday s_singleton; protected: Create_func_weekday() = default; - virtual ~Create_func_weekday() = default; + ~Create_func_weekday() override = default; }; class Create_func_weekofyear : public Create_func_arg1 { public: - virtual Item *create_1_arg(THD *thd, Item *arg1); + Item *create_1_arg(THD *thd, Item *arg1) override; static Create_func_weekofyear s_singleton; protected: Create_func_weekofyear() = default; - virtual ~Create_func_weekofyear() = default; + ~Create_func_weekofyear() override = default; }; @@ -2564,26 +2564,26 @@ protected: class Create_func_wsrep_last_written_gtid : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_wsrep_last_written_gtid s_singleton; protected: Create_func_wsrep_last_written_gtid() = default; - virtual ~Create_func_wsrep_last_written_gtid() = default; + ~Create_func_wsrep_last_written_gtid() override = default; }; class Create_func_wsrep_last_seen_gtid : public Create_func_arg0 { public: - virtual Item *create_builder(THD *thd); + Item *create_builder(THD *thd) override; static Create_func_wsrep_last_seen_gtid s_singleton; protected: Create_func_wsrep_last_seen_gtid() = default; - virtual ~Create_func_wsrep_last_seen_gtid() = default; + ~Create_func_wsrep_last_seen_gtid() override = default; }; @@ -2597,7 +2597,7 @@ public: protected: Create_func_wsrep_sync_wait_upto() = default; - virtual ~Create_func_wsrep_sync_wait_upto() = default; + ~Create_func_wsrep_sync_wait_upto() override = default; }; #endif /* WITH_WSREP */ @@ -2605,40 +2605,40 @@ protected: class Create_func_xml_extractvalue : public Create_func_arg2 { public: - virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override; static Create_func_xml_extractvalue s_singleton; protected: Create_func_xml_extractvalue() = default; - virtual ~Create_func_xml_extractvalue() = default; + ~Create_func_xml_extractvalue() override = default; }; class Create_func_xml_update : public Create_func_arg3 { public: - virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3); + Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override; static Create_func_xml_update s_singleton; protected: Create_func_xml_update() = default; - virtual ~Create_func_xml_update() = default; + ~Create_func_xml_update() override = default; }; class Create_func_year_week : public Create_native_func { public: - virtual Item *create_native(THD *thd, const LEX_CSTRING *name, - List *item_list); + Item *create_native(THD *thd, const LEX_CSTRING *name, + List *item_list) override; static Create_func_year_week s_singleton; protected: Create_func_year_week() = default; - virtual ~Create_func_year_week() = default; + ~Create_func_year_week() override = default; }; @@ -5660,7 +5660,7 @@ Create_func_uuid::create_builder(THD *thd) { DBUG_ENTER("Create_func_uuid::create"); thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); - thd->lex->safe_to_cache_query= 0; + thd->lex->uncacheable(UNCACHEABLE_RAND); // disallow cache and query merges DBUG_RETURN(new (thd->mem_root) Item_func_uuid(thd, 0)); } @@ -5671,7 +5671,7 @@ Create_func_sys_guid::create_builder(THD *thd) { DBUG_ENTER("Create_func_sys_guid::create"); thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); - thd->lex->safe_to_cache_query= 0; + thd->lex->uncacheable(UNCACHEABLE_RAND); // disallow cache and query merges DBUG_RETURN(new (thd->mem_root) Item_func_uuid(thd, 1)); } @@ -5683,7 +5683,7 @@ Create_func_uuid_short::create_builder(THD *thd) { DBUG_ENTER("Create_func_uuid_short::create"); thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); - thd->lex->safe_to_cache_query= 0; + thd->lex->uncacheable(UNCACHEABLE_RAND); // disallow cache and query merges DBUG_RETURN(new (thd->mem_root) Item_func_uuid_short(thd)); } diff --git a/sql/item_func.cc b/sql/item_func.cc index 729646532a7..292ccaa57c3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2143,7 +2143,7 @@ class Func_handler_shift_left_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null() << @@ -2156,7 +2156,7 @@ class Func_handler_shift_left_decimal_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() << @@ -2177,7 +2177,7 @@ class Func_handler_shift_right_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null() >> @@ -2190,7 +2190,7 @@ class Func_handler_shift_right_decimal_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() >> @@ -2211,7 +2211,7 @@ class Func_handler_bit_neg_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return ~ item->arguments()[0]->to_longlong_null(); @@ -2223,7 +2223,7 @@ class Func_handler_bit_neg_decimal_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return ~ VDec(item->arguments()[0]).to_xlonglong_null(); @@ -3423,7 +3423,7 @@ class Func_handler_bit_count_int_to_slong: public Item_handled_func::Handler_slong2 { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null().bit_count(); @@ -3435,7 +3435,7 @@ class Func_handler_bit_count_decimal_to_slong: public Item_handled_func::Handler_slong2 { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null().bit_count(); @@ -4169,7 +4169,7 @@ public: const char * /* sqlstate */, Sql_condition::enum_warning_level* /* level */, const char *message, - Sql_condition ** /* cond_hdl */); + Sql_condition ** /* cond_hdl */) override; }; bool @@ -6487,7 +6487,7 @@ class Func_handler_bit_xor_int_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return item->arguments()[0]->to_longlong_null() ^ @@ -6500,7 +6500,7 @@ class Func_handler_bit_xor_dec_to_ulonglong: public Item_handled_func::Handler_ulonglong { public: - Longlong_null to_longlong_null(Item_handled_func *item) const + Longlong_null to_longlong_null(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); return VDec(item->arguments()[0]).to_xlonglong_null() ^ diff --git a/sql/item_func.h b/sql/item_func.h index 63df8b4255c..8d3943f509e 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -244,7 +244,7 @@ public: bool is_null() override { update_null_value(); - return null_value; + return null_value; } String *val_str_from_val_str_ascii(String *str, String *str2); @@ -459,7 +459,7 @@ public: } void convert_const_compared_to_int_field(THD *thd); Item_func *get_item_func() override { return this; } - bool is_simplified_cond_processor(void *arg) override + bool is_simplified_cond_processor(void *) override { return const_item() && !val_int(); } }; @@ -567,30 +567,30 @@ public: class Handler_str: public Handler { public: - String *val_str_ascii(Item_handled_func *item, String *str) const + String *val_str_ascii(Item_handled_func *item, String *str) const override { return item->Item::val_str_ascii(str); } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); StringBuffer<64> tmp; String *res= item->val_str(&tmp); return res ? item->double_from_string_with_check(res) : 0.0; } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { DBUG_ASSERT(item->fixed()); StringBuffer<22> tmp; String *res= item->val_str(&tmp); return res ? item->longlong_from_string_with_check(res) : 0; } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return item->val_decimal_from_string(to); } bool get_date(THD *thd, Item_handled_func *item, MYSQL_TIME *to, - date_mode_t fuzzydate) const + date_mode_t fuzzydate) const override { return item->get_date_from_string(thd, to, fuzzydate); } @@ -603,7 +603,7 @@ public: class Handler_temporal: public Handler { public: - String *val_str(Item_handled_func *item, String *to) const + String *val_str(Item_handled_func *item, String *to) const override { StringBuffer ascii_buf; return item->val_str_from_val_str_ascii(to, &ascii_buf); @@ -618,28 +618,28 @@ public: class Handler_temporal_string: public Handler_temporal { public: - const Type_handler *return_type_handler(const Item_handled_func *) const + const Type_handler *return_type_handler(const Item_handled_func *) const override { return &type_handler_string; } const Type_handler * - type_handler_for_create_select(const Item_handled_func *item) const + type_handler_for_create_select(const Item_handled_func *item) const override { return return_type_handler(item)->type_handler_for_tmp_table(item); } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { return Temporal_hybrid(item).to_double(); } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { return Temporal_hybrid(item).to_longlong(); } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return Temporal_hybrid(item).to_decimal(to); } - String *val_str_ascii(Item_handled_func *item, String *to) const + String *val_str_ascii(Item_handled_func *item, String *to) const override { return Temporal_hybrid(item).to_string(to, item->decimals); } @@ -649,28 +649,28 @@ public: class Handler_date: public Handler_temporal { public: - const Type_handler *return_type_handler(const Item_handled_func *) const + const Type_handler *return_type_handler(const Item_handled_func *) const override { return &type_handler_newdate; } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->fix_attributes_date(); return false; } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { return Date(item).to_double(); } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { return Date(item).to_longlong(); } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return Date(item).to_decimal(to); } - String *val_str_ascii(Item_handled_func *item, String *to) const + String *val_str_ascii(Item_handled_func *item, String *to) const override { return Date(item).to_string(to); } @@ -680,27 +680,27 @@ public: class Handler_time: public Handler_temporal { public: - const Type_handler *return_type_handler(const Item_handled_func *) const + const Type_handler *return_type_handler(const Item_handled_func *) const override { return &type_handler_time2; } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { return Time(item).to_double(); } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { return Time(item).to_longlong(); } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return Time(item).to_decimal(to); } - String *val_str_ascii(Item_handled_func *item, String *to) const + String *val_str_ascii(Item_handled_func *item, String *to) const override { return Time(item).to_string(to, item->decimals); } - bool val_native(THD *thd, Item_handled_func *item, Native *to) const + bool val_native(THD *thd, Item_handled_func *item, Native *to) const override { return Time(thd, item).to_native(to, item->decimals); } @@ -710,23 +710,23 @@ public: class Handler_datetime: public Handler_temporal { public: - const Type_handler *return_type_handler(const Item_handled_func *) const + const Type_handler *return_type_handler(const Item_handled_func *) const override { return &type_handler_datetime2; } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { return Datetime(item).to_double(); } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { return Datetime(item).to_longlong(); } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return Datetime(item).to_decimal(to); } - String *val_str_ascii(Item_handled_func *item, String *to) const + String *val_str_ascii(Item_handled_func *item, String *to) const override { return Datetime(item).to_string(to, item->decimals); } @@ -736,7 +736,7 @@ public: class Handler_int: public Handler { public: - String *val_str(Item_handled_func *item, String *to) const + String *val_str(Item_handled_func *item, String *to) const override { longlong nr= val_int(item); if (item->null_value) @@ -744,25 +744,25 @@ public: to->set_int(nr, item->unsigned_flag, item->collation.collation); return to; } - String *val_str_ascii(Item_handled_func *item, String *to) const + String *val_str_ascii(Item_handled_func *item, String *to) const override { return item->Item::val_str_ascii(to); } - double val_real(Item_handled_func *item) const + double val_real(Item_handled_func *item) const override { return item->unsigned_flag ? (double) ((ulonglong) val_int(item)) : (double) val_int(item); } - my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const + my_decimal *val_decimal(Item_handled_func *item, my_decimal *to) const override { return item->val_decimal_from_int(to); } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzydate) const + MYSQL_TIME *to, date_mode_t fuzzydate) const override { return item->get_date_from_int(thd, to, fuzzydate); } - longlong val_int(Item_handled_func *item) const + longlong val_int(Item_handled_func *item) const override { Longlong_null tmp= to_longlong_null(item); item->null_value= tmp.is_null(); @@ -774,11 +774,11 @@ public: class Handler_slong: public Handler_int { public: - const Type_handler *return_type_handler(const Item_handled_func *item) const + const Type_handler *return_type_handler(const Item_handled_func *item) const override { return &type_handler_slong; } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->unsigned_flag= false; item->collation= DTCollation_numeric(); @@ -790,7 +790,7 @@ public: class Handler_slong2: public Handler_slong { public: - bool fix_length_and_dec(Item_handled_func *func) const + bool fix_length_and_dec(Item_handled_func *func) const override { bool rc= Handler_slong::fix_length_and_dec(func); func->max_length= 2; @@ -801,11 +801,11 @@ public: class Handler_ulonglong: public Handler_int { public: - const Type_handler *return_type_handler(const Item_handled_func *item) const + const Type_handler *return_type_handler(const Item_handled_func *item) const override { return &type_handler_ulonglong; } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->unsigned_flag= true; item->collation= DTCollation_numeric(); @@ -1102,7 +1102,7 @@ public: Item_func_case_expression(THD *thd, List &list): Item_func_hybrid_field_type(thd, list) { } - bool find_not_null_fields(table_map allowed) { return false; } + bool find_not_null_fields(table_map allowed) override { return false; } }; @@ -1131,18 +1131,18 @@ public: Item_func_numhybrid(THD *thd, List &list): Item_func_hybrid_field_type(thd, list) { } - String *str_op(String *str) { DBUG_ASSERT(0); return 0; } - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + String *str_op(String *str) override { DBUG_ASSERT(0); return 0; } + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { DBUG_ASSERT(0); return true; } - bool time_op(THD *thd, MYSQL_TIME *ltime) + bool time_op(THD *thd, MYSQL_TIME *ltime) override { DBUG_ASSERT(0); return true; } - bool native_op(THD *thd, Native *to) + bool native_op(THD *thd, Native *to) override { DBUG_ASSERT(0); return true; @@ -1156,8 +1156,8 @@ class Item_func_num1: public Item_func_numhybrid public: Item_func_num1(THD *thd, Item *a): Item_func_numhybrid(thd, a) {} Item_func_num1(THD *thd, Item *a, Item *b): Item_func_numhybrid(thd, a, b) {} - bool check_partition_func_processor(void *int_arg) { return FALSE; } - bool check_vcol_func_processor(void *arg) { return FALSE; } + bool check_partition_func_processor(void *int_arg) override { return FALSE; } + bool check_vcol_func_processor(void *arg) override { return FALSE; } }; @@ -1272,12 +1272,12 @@ public: Item_long_ge0_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {} Item_long_ge0_func(THD *thd, List &list): Item_int_func(thd, list) { } Item_long_ge0_func(THD *thd, Item_long_ge0_func *item) :Item_int_func(thd, item) {} - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { DBUG_ASSERT(!unsigned_flag); return &type_handler_slong_ge0; } - bool fix_length_and_dec() { max_length= 10; return FALSE; } + bool fix_length_and_dec() override { max_length= 10; return FALSE; } }; @@ -1305,10 +1305,14 @@ public: Item_func_hash_mariadb_100403(THD *thd, List &item) :Item_func_hash(thd, item) {} - longlong val_int(); - Item *get_copy(THD *thd) + longlong val_int() override; + Item *get_copy(THD *thd) override { return get_item_copy(thd, this); } - const char *func_name() const { return ""; } + LEX_CSTRING func_name_cstring() const override + { + static LEX_CSTRING name= {STRING_WITH_LEN("") }; + return name; + } }; class Item_longlong_func: public Item_int_func @@ -1557,8 +1561,8 @@ public: decimals= (uint8) dec; max_length= (uint32) len; } - bool need_parentheses_in_default() { return true; } - void print(String *str, enum_query_type query_type); + bool need_parentheses_in_default() override { return true; } + void print(String *str, enum_query_type query_type) override; void fix_length_and_dec_generic() { set_maybe_null(); @@ -1627,9 +1631,9 @@ class Item_func_additive_op :public Item_num_op { public: Item_func_additive_op(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {} - void result_precision(); - bool check_partition_func_processor(void *int_arg) {return FALSE;} - bool check_vcol_func_processor(void *arg) { return FALSE;} + void result_precision() override; + bool check_partition_func_processor(void *int_arg) override {return FALSE;} + bool check_vcol_func_processor(void *arg) override { return FALSE;} }; @@ -3262,7 +3266,7 @@ class Item_func_get_lock final :public Item_func_lock String value; public: Item_func_get_lock(THD *thd, Item *a, Item *b) :Item_func_lock(thd, a, b) {} - longlong val_int() final; + longlong val_int() override final; LEX_CSTRING func_name_cstring() const override final { static LEX_CSTRING name= {STRING_WITH_LEN("get_lock") }; @@ -3274,7 +3278,7 @@ class Item_func_get_lock final :public Item_func_lock set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) final + Item *get_copy(THD *thd) override final { return get_item_copy(thd, this); } }; @@ -3284,13 +3288,13 @@ class Item_func_release_all_locks final :public Item_func_lock public: Item_func_release_all_locks(THD *thd): Item_func_lock(thd) { unsigned_flag= 1; } - longlong val_int() final; + longlong val_int() override final; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("release_all_locks") }; return name; } - Item *get_copy(THD *thd) final + Item *get_copy(THD *thd) override final { return get_item_copy(thd, this); } }; @@ -3302,7 +3306,7 @@ class Item_func_release_lock final :public Item_func_lock String value; public: Item_func_release_lock(THD *thd, Item *a): Item_func_lock(thd, a) {} - longlong val_int() final; + longlong val_int() override final; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("release_lock") }; @@ -3314,7 +3318,7 @@ public: set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) final + Item *get_copy(THD *thd) override final { return get_item_copy(thd, this); } }; @@ -3411,16 +3415,16 @@ public: :Item_hybrid_func(thd, item), m_var_entry(item->m_var_entry), name(item->name) { } Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, - const Tmp_field_param *param) + const Tmp_field_param *param) override { DBUG_ASSERT(fixed()); return create_tmp_field_ex_from_handler(root, table, src, param, type_handler()); } - Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) + Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override { return create_table_field_from_handler(root, table); } - bool check_vcol_func_processor(void *arg); - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool check_vcol_func_processor(void *arg) override; + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate); } diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index b8a743c2b6f..bc6d07f5f3d 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -2786,7 +2786,7 @@ public: protected: Create_func_area() = default; - virtual ~Create_func_area() = default; + ~Create_func_area() override = default; }; @@ -2802,7 +2802,7 @@ public: protected: Create_func_as_wkb() = default; - virtual ~Create_func_as_wkb() = default; + ~Create_func_as_wkb() override = default; }; @@ -2818,7 +2818,7 @@ public: protected: Create_func_as_wkt() = default; - virtual ~Create_func_as_wkt() = default; + ~Create_func_as_wkt() override = default; }; @@ -2835,7 +2835,7 @@ public: protected: Create_func_centroid() = default; - virtual ~Create_func_centroid() = default; + ~Create_func_centroid() override = default; }; @@ -2851,7 +2851,7 @@ public: protected: Create_func_convexhull() = default; - virtual ~Create_func_convexhull() = default; + ~Create_func_convexhull() override = default; }; @@ -2867,7 +2867,7 @@ public: protected: Create_func_pointonsurface() = default; - virtual ~Create_func_pointonsurface() = default; + ~Create_func_pointonsurface() override = default; }; @@ -2884,7 +2884,7 @@ public: protected: Create_func_mbr_contains() = default; - virtual ~Create_func_mbr_contains() = default; + ~Create_func_mbr_contains() override = default; }; @@ -2900,7 +2900,7 @@ public: protected: Create_func_contains() = default; - virtual ~Create_func_contains() = default; + ~Create_func_contains() override = default; }; @@ -2916,7 +2916,7 @@ public: protected: Create_func_crosses() = default; - virtual ~Create_func_crosses() = default; + ~Create_func_crosses() override = default; }; @@ -2932,7 +2932,7 @@ public: protected: Create_func_dimension() = default; - virtual ~Create_func_dimension() = default; + ~Create_func_dimension() override = default; }; @@ -2949,7 +2949,7 @@ public: protected: Create_func_mbr_disjoint() = default; - virtual ~Create_func_mbr_disjoint() = default; + ~Create_func_mbr_disjoint() override = default; }; @@ -2965,7 +2965,7 @@ public: protected: Create_func_disjoint() = default; - virtual ~Create_func_disjoint() = default; + ~Create_func_disjoint() override = default; }; @@ -2981,7 +2981,7 @@ public: protected: Create_func_distance() = default; - virtual ~Create_func_distance() = default; + ~Create_func_distance() override = default; }; @@ -2994,7 +2994,7 @@ public: protected: Create_func_distance_sphere() = default; - virtual ~Create_func_distance_sphere() = default; + ~Create_func_distance_sphere() override = default; }; @@ -3029,7 +3029,7 @@ public: protected: Create_func_endpoint() = default; - virtual ~Create_func_endpoint() = default; + ~Create_func_endpoint() override = default; }; @@ -3045,7 +3045,7 @@ public: protected: Create_func_envelope() = default; - virtual ~Create_func_envelope() = default; + ~Create_func_envelope() override = default; }; class Create_func_boundary : public Create_func_arg1 @@ -3060,7 +3060,7 @@ public: protected: Create_func_boundary() = default; - virtual ~Create_func_boundary() = default; + ~Create_func_boundary() override = default; }; @@ -3077,7 +3077,7 @@ public: protected: Create_func_mbr_equals() = default; - virtual ~Create_func_mbr_equals() = default; + ~Create_func_mbr_equals() override = default; }; @@ -3094,7 +3094,7 @@ public: protected: Create_func_equals() = default; - virtual ~Create_func_equals() = default; + ~Create_func_equals() override = default; }; @@ -3111,7 +3111,7 @@ public: protected: Create_func_exteriorring() = default; - virtual ~Create_func_exteriorring() = default; + ~Create_func_exteriorring() override = default; }; @@ -3126,7 +3126,7 @@ public: protected: Create_func_geometry_from_text() = default; - virtual ~Create_func_geometry_from_text() = default; + ~Create_func_geometry_from_text() override = default; }; @@ -3177,7 +3177,7 @@ public: protected: Create_func_geometry_from_wkb() = default; - virtual ~Create_func_geometry_from_wkb() = default; + ~Create_func_geometry_from_wkb() override = default; }; @@ -3227,7 +3227,7 @@ public: protected: Create_func_geometry_from_json() = default; - virtual ~Create_func_geometry_from_json() = default; + ~Create_func_geometry_from_json() override = default; }; @@ -3287,7 +3287,7 @@ public: protected: Create_func_as_geojson() = default; - virtual ~Create_func_as_geojson() = default; + ~Create_func_as_geojson() override = default; }; @@ -3347,7 +3347,7 @@ public: protected: Create_func_geometry_type() = default; - virtual ~Create_func_geometry_type() = default; + ~Create_func_geometry_type() override = default; }; @@ -3364,7 +3364,7 @@ public: protected: Create_func_geometryn() = default; - virtual ~Create_func_geometryn() = default; + ~Create_func_geometryn() override = default; }; @@ -3381,7 +3381,7 @@ public: protected: Create_func_gis_debug() = default; - virtual ~Create_func_gis_debug() = default; + ~Create_func_gis_debug() override = default; }; #endif @@ -3398,7 +3398,7 @@ public: protected: Create_func_glength() = default; - virtual ~Create_func_glength() = default; + ~Create_func_glength() override = default; }; @@ -3415,7 +3415,7 @@ public: protected: Create_func_interiorringn() = default; - virtual ~Create_func_interiorringn() = default; + ~Create_func_interiorringn() override = default; }; @@ -3431,7 +3431,7 @@ public: protected: Create_func_relate() = default; - virtual ~Create_func_relate() = default; + ~Create_func_relate() override = default; }; @@ -3448,7 +3448,7 @@ public: protected: Create_func_mbr_intersects() = default; - virtual ~Create_func_mbr_intersects() = default; + ~Create_func_mbr_intersects() override = default; }; @@ -3465,7 +3465,7 @@ public: protected: Create_func_intersects() = default; - virtual ~Create_func_intersects() = default; + ~Create_func_intersects() override = default; }; @@ -3482,7 +3482,7 @@ public: protected: Create_func_intersection() = default; - virtual ~Create_func_intersection() = default; + ~Create_func_intersection() override = default; }; @@ -3499,7 +3499,7 @@ public: protected: Create_func_difference() = default; - virtual ~Create_func_difference() = default; + ~Create_func_difference() override = default; }; @@ -3516,7 +3516,7 @@ public: protected: Create_func_union() = default; - virtual ~Create_func_union() = default; + ~Create_func_union() override = default; }; @@ -3533,7 +3533,7 @@ public: protected: Create_func_symdifference() = default; - virtual ~Create_func_symdifference() = default; + ~Create_func_symdifference() override = default; }; @@ -3549,7 +3549,7 @@ public: protected: Create_func_buffer() = default; - virtual ~Create_func_buffer() = default; + ~Create_func_buffer() override = default; }; @@ -3565,7 +3565,7 @@ public: protected: Create_func_isclosed() = default; - virtual ~Create_func_isclosed() = default; + ~Create_func_isclosed() override = default; }; @@ -3581,7 +3581,7 @@ public: protected: Create_func_isring() = default; - virtual ~Create_func_isring() = default; + ~Create_func_isring() override = default; }; @@ -3597,7 +3597,7 @@ public: protected: Create_func_isempty() = default; - virtual ~Create_func_isempty() = default; + ~Create_func_isempty() override = default; }; @@ -3613,7 +3613,7 @@ public: protected: Create_func_issimple() = default; - virtual ~Create_func_issimple() = default; + ~Create_func_issimple() override = default; }; @@ -3630,7 +3630,7 @@ public: protected: Create_func_numgeometries() = default; - virtual ~Create_func_numgeometries() = default; + ~Create_func_numgeometries() override = default; }; @@ -3646,7 +3646,7 @@ public: protected: Create_func_numinteriorring() = default; - virtual ~Create_func_numinteriorring() = default; + ~Create_func_numinteriorring() override = default; }; @@ -3662,7 +3662,7 @@ public: protected: Create_func_numpoints() = default; - virtual ~Create_func_numpoints() = default; + ~Create_func_numpoints() override = default; }; @@ -3679,7 +3679,7 @@ public: protected: Create_func_mbr_overlaps() = default; - virtual ~Create_func_mbr_overlaps() = default; + ~Create_func_mbr_overlaps() override = default; }; @@ -3696,7 +3696,7 @@ public: protected: Create_func_overlaps() = default; - virtual ~Create_func_overlaps() = default; + ~Create_func_overlaps() override = default; }; @@ -3715,7 +3715,7 @@ public: protected: Create_func_pointn() = default; - virtual ~Create_func_pointn() = default; + ~Create_func_pointn() override = default; }; @@ -3733,7 +3733,7 @@ public: protected: Create_func_srid() = default; - virtual ~Create_func_srid() = default; + ~Create_func_srid() override = default; }; @@ -3750,7 +3750,7 @@ public: protected: Create_func_startpoint() = default; - virtual ~Create_func_startpoint() = default; + ~Create_func_startpoint() override = default; }; @@ -3768,7 +3768,7 @@ public: protected: Create_func_touches() = default; - virtual ~Create_func_touches() = default; + ~Create_func_touches() override = default; }; @@ -3785,7 +3785,7 @@ public: protected: Create_func_mbr_within() = default; - virtual ~Create_func_mbr_within() = default; + ~Create_func_mbr_within() override = default; }; @@ -3802,7 +3802,7 @@ public: protected: Create_func_within() = default; - virtual ~Create_func_within() = default; + ~Create_func_within() override = default; }; @@ -3818,7 +3818,7 @@ public: protected: Create_func_x() = default; - virtual ~Create_func_x() = default; + ~Create_func_x() override = default; }; @@ -3834,7 +3834,7 @@ public: protected: Create_func_y() = default; - virtual ~Create_func_y() = default; + ~Create_func_y() override = default; }; diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index e7f465170ab..15a86f24e2c 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -454,16 +454,16 @@ class Item_func_boundary: public Item_geometry_func_args_geometry Transporter(Gcalc_result_receiver *receiver) : Gcalc_shape_transporter(NULL), m_receiver(receiver) {} - int single_point(double x, double y); - int start_line(); - int complete_line(); - int start_poly(); - int complete_poly(); - int start_ring(); - int complete_ring(); - int add_point(double x, double y); + int single_point(double x, double y) override; + int start_line() override; + int complete_line() override; + int start_poly() override; + int complete_poly() override; + int start_ring() override; + int complete_ring() override; + int add_point(double x, double y) override; - int start_collection(int n_objects); + int start_collection(int n_objects) override; }; Gcalc_result_receiver res_receiver; public: @@ -909,16 +909,16 @@ protected: Gcalc_function::op_difference), skip_line(FALSE) {} - int single_point(double x, double y); - int start_line(); - int complete_line(); - int start_poly(); - int complete_poly(); - int start_ring(); - int complete_ring(); - int add_point(double x, double y); + int single_point(double x, double y) override; + int start_line() override; + int complete_line() override; + int start_poly() override; + int complete_poly() override; + int start_ring() override; + int complete_ring() override; + int add_point(double x, double y) override; - int start_collection(int n_objects); + int start_collection(int n_objects) override; }; Gcalc_heap collector; Gcalc_function func; diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 0611c6f15e5..01c3b4b3338 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -265,7 +265,7 @@ public: Item_json_func(thd, list), paths(NULL), tmp_paths(0), n_paths(0) {} virtual ~Item_json_str_multipath(); - bool fix_fields(THD *thd, Item **ref); + bool fix_fields(THD *thd, Item **ref) override; virtual uint get_n_paths() const = 0; }; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index f65358c801b..f79dfb712bd 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -109,7 +109,7 @@ public: :Item_str_ascii_func(thd, a) { } Item_str_ascii_checksum_func(THD *thd, Item *a, Item *b) :Item_str_ascii_func(thd, a, b) { } - bool eq(const Item *item, bool binary_cmp) const + bool eq(const Item *item, bool binary_cmp) const override { // Always use binary argument comparison: MD5('x') != MD5('X') return Item_func::eq(item, true); @@ -129,7 +129,7 @@ public: :Item_str_func(thd, a) { } Item_str_binary_checksum_func(THD *thd, Item *a, Item *b) :Item_str_func(thd, a, b) { } - bool eq(const Item *item, bool binary_cmp) const + bool eq(const Item *item, bool binary_cmp) const override { /* Always use binary argument comparison: @@ -238,7 +238,7 @@ protected: public: Item_aes_crypt(THD *thd, Item *a, Item *b) :Item_str_binary_checksum_func(thd, a, b) {} - String *val_str(String *); + String *val_str(String *) override; }; class Item_func_aes_encrypt :public Item_aes_crypt @@ -491,14 +491,14 @@ public: Item_func_regexp_replace_oracle(THD *thd, Item *a, Item *b, Item *c) :Item_func_regexp_replace(thd, a, b, c) {} - const Schema *schema() const { return &oracle_schema_ref; } - bool fix_length_and_dec() + const Schema *schema() const override { return &oracle_schema_ref; } + bool fix_length_and_dec() override { bool rc= Item_func_regexp_replace::fix_length_and_dec(); set_maybe_null(); // Empty result is converted to NULL return rc; } - String *val_str(String *str) + String *val_str(String *str) override { return val_str_internal(str, true); } @@ -1053,19 +1053,19 @@ class Item_func_sysconst :public Item_str_func public: Item_func_sysconst(THD *thd): Item_str_func(thd) { collation.set(system_charset_info,DERIVATION_SYSCONST); } - Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs); + Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override; /* Used to create correct Item name in new converted item in safe_charset_converter, return string representation of this function call */ virtual const char *fully_qualified_func_name() const = 0; - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(fully_qualified_func_name(), arg, VCOL_SESSION_FUNC); } - bool const_item() const; + bool const_item() const override; }; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 75b9ac6cbe9..af9a57f751e 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -472,7 +472,7 @@ class Field_fixer: public Field_enumerator public: table_map used_tables; /* Collect used_tables here */ st_select_lex *new_parent; /* Select we're in */ - virtual void visit_field(Item_field *item) + void visit_field(Item_field *item) override { //for (TABLE_LIST *tbl= new_parent->leaf_tables; tbl; tbl= tbl->next_local) //{ diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 4f7b7e88196..cf7a0f59edc 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -797,16 +797,16 @@ public: chooser_compare_func_creator fc, st_select_lex *select_lex, bool all); - void cleanup(); + void cleanup() override; // only ALL subquery has upper not - subs_type substype() { return all?ALL_SUBS:ANY_SUBS; } - bool select_transformer(JOIN *join); + subs_type substype() override { return all?ALL_SUBS:ANY_SUBS; } + bool select_transformer(JOIN *join) override; void create_comp_func(bool invert) { func= func_creator(invert); } - void print(String *str, enum_query_type query_type); - enum precedence precedence() const { return CMP_PRECEDENCE; } + void print(String *str, enum_query_type query_type) override; + enum precedence precedence() const override { return CMP_PRECEDENCE; } bool is_maxmin_applicable(JOIN *join); bool transform_into_max_min(JOIN *join); - void no_rows_in_result(); + void no_rows_in_result() override; }; @@ -1066,9 +1066,9 @@ public: check_null(chk_null), having(having_arg) { DBUG_ASSERT(subs); } - int exec(); - void print (String *str, enum_query_type query_type); - virtual enum_engine_type engine_type() { return INDEXSUBQUERY_ENGINE; } + int exec() override; + void print (String *str, enum_query_type query_type) override; + enum_engine_type engine_type() override { return INDEXSUBQUERY_ENGINE; } }; /* @@ -1510,7 +1510,7 @@ protected: bool test_null_row(rownum_t row_num); bool exists_complementing_null_row(MY_BITMAP *keys_to_complement); - bool partial_match(); + bool partial_match() override; public: subselect_rowid_merge_engine(THD *thd, subselect_uniquesubquery_engine *engine_arg, @@ -1530,15 +1530,15 @@ public: {} ~subselect_rowid_merge_engine(); bool init(MY_BITMAP *non_null_key_parts, MY_BITMAP *partial_match_key_parts); - void cleanup(); - virtual enum_engine_type engine_type() { return ROWID_MERGE_ENGINE; } + void cleanup() override; + enum_engine_type engine_type() override { return ROWID_MERGE_ENGINE; } }; class subselect_table_scan_engine: public subselect_partial_match_engine { protected: - bool partial_match(); + bool partial_match() override; public: subselect_table_scan_engine(THD *thd, subselect_uniquesubquery_engine *engine_arg, @@ -1548,7 +1548,7 @@ public: bool has_covering_null_row_arg, bool has_covering_null_columns_arg, uint count_columns_with_nulls_arg); - void cleanup(); - virtual enum_engine_type engine_type() { return TABLE_SCAN_ENGINE; } + void cleanup() override; + enum_engine_type engine_type() override { return TABLE_SCAN_ENGINE; } }; #endif /* ITEM_SUBSELECT_INCLUDED */ diff --git a/sql/item_sum.h b/sql/item_sum.h index dc2c0282f0a..f40109fb108 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -704,15 +704,15 @@ public: Aggregator(sum), table(NULL), tmp_table_param(NULL), tree(NULL), always_null(false), use_distinct_values(false) {} virtual ~Aggregator_distinct (); - Aggregator_type Aggrtype() { return DISTINCT_AGGREGATOR; } + Aggregator_type Aggrtype() override { return DISTINCT_AGGREGATOR; } - bool setup(THD *); - void clear(); - bool add(); - void endup(); - virtual my_decimal *arg_val_decimal(my_decimal * value); - virtual double arg_val_real(); - virtual bool arg_is_null(bool use_null_value); + bool setup(THD *) override; + void clear() override; + bool add() override; + void endup() override; + my_decimal *arg_val_decimal(my_decimal * value) override; + double arg_val_real() override; + bool arg_is_null(bool use_null_value) override; bool unique_walk_function(void *element); bool unique_walk_function_for_count(void *element); @@ -731,15 +731,15 @@ public: Aggregator_simple (Item_sum *sum) : Aggregator(sum) {} - Aggregator_type Aggrtype() { return Aggregator::SIMPLE_AGGREGATOR; } + Aggregator_type Aggrtype() override { return Aggregator::SIMPLE_AGGREGATOR; } - bool setup(THD * thd) { return item_sum->setup(thd); } - void clear() { item_sum->clear(); } - bool add() { return item_sum->add(); } - void endup() {}; - virtual my_decimal *arg_val_decimal(my_decimal * value); - virtual double arg_val_real(); - virtual bool arg_is_null(bool use_null_value); + bool setup(THD * thd) override { return item_sum->setup(thd); } + void clear() override { item_sum->clear(); } + bool add() override { return item_sum->add(); } + void endup() override {}; + my_decimal *arg_val_decimal(my_decimal * value) override; + double arg_val_real() override; + bool arg_is_null(bool use_null_value) override; }; @@ -755,7 +755,7 @@ public: Item_sum(thd, list) {} Item_sum_num(THD *thd, Item_sum_num *item): Item_sum(thd, item) {} - bool fix_fields(THD *, Item **); + bool fix_fields(THD *, Item **) override; }; @@ -807,7 +807,8 @@ public: max_length=21; base_flags&= ~item_base_t::MAYBE_NULL; null_value=0; - return FALSE; } + return false; + } }; @@ -834,8 +835,8 @@ public: } Item_sum_sum(THD *thd, Item_sum_sum *item); enum Sumfunctype sum_func() const override - { - return has_with_distinct() ? SUM_DISTINCT_FUNC : SUM_FUNC; + { + return has_with_distinct() ? SUM_DISTINCT_FUNC : SUM_FUNC; } void cleanup() override; void direct_add(my_decimal *add_sum_decimal); @@ -1184,7 +1185,8 @@ public: { return get_arg(0)->real_type_handler(); } - const TYPELIB *get_typelib() const override { return args[0]->get_typelib(); } + const TYPELIB *get_typelib() const override + { return args[0]->get_typelib(); } void update_field() override; void min_max_update_str_field(); void min_max_update_real_field(); @@ -1225,7 +1227,7 @@ class Item_sum_max final :public Item_sum_min_max public: Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {} Item_sum_max(THD *thd, Item_sum_max *item) :Item_sum_min_max(thd, item) {} - enum Sumfunctype sum_func () const override {return MAX_FUNC;} + enum Sumfunctype sum_func() const override {return MAX_FUNC;} bool add() override; LEX_CSTRING func_name_cstring() const override @@ -1276,9 +1278,7 @@ public: clear_as_window(); Item_sum_int::cleanup(); } - void setup_window_func(THD *thd __attribute__((unused)), - Window_spec *window_spec __attribute__((unused))) - override + void setup_window_func(THD *, Window_spec *) override { as_window_function= TRUE; clear_as_window(); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 01af477d515..83b41926317 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3265,21 +3265,21 @@ String *Item_char_typecast::val_str_binary_from_native(String *str) class Item_char_typecast_func_handler: public Item_handled_func::Handler_str { public: - const Type_handler *return_type_handler(const Item_handled_func *item) const + const Type_handler *return_type_handler(const Item_handled_func *item) const override { return Type_handler::string_type_handler(item->max_length); } const Type_handler * - type_handler_for_create_select(const Item_handled_func *item) const + type_handler_for_create_select(const Item_handled_func *item) const override { return return_type_handler(item)->type_handler_for_tmp_table(item); } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { return false; } - String *val_str(Item_handled_func *item, String *to) const + String *val_str(Item_handled_func *item, String *to) const override { DBUG_ASSERT(dynamic_cast(item)); return static_cast(item)->val_str_generic(to); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 5ac8492594a..db41fef83a4 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -560,9 +560,9 @@ public: else set_handler(type_handler_long_or_longlong()); } - double real_op() { DBUG_ASSERT(0); return 0; } - String *str_op(String *str) { DBUG_ASSERT(0); return 0; } - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + double real_op() override { DBUG_ASSERT(0); return 0; } + String *str_op(String *str) override { DBUG_ASSERT(0); return 0; } + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { DBUG_ASSERT(0); return true; @@ -1320,7 +1320,7 @@ public: &my_charset_latin1), m_fsp(fsp) { } - String *val_str(String *to) + String *val_str(String *to) override { Interval_DDhhmmssff it(current_thd, args[0], m_fsp); null_value= !it.is_valid_interval_DDhhmmssff(); @@ -1718,7 +1718,7 @@ class Func_handler_date_add_interval_datetime: public Func_handler_date_add_interval { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { uint dec= MY_MAX(item->arguments()[0]->datetime_precision(current_thd), interval_dec(item->arguments()[1], int_type(item))); @@ -1726,7 +1726,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { Datetime::Options opt(TIME_CONV_NONE, thd); Datetime dt(thd, item->arguments()[0], opt); @@ -1745,7 +1745,7 @@ class Func_handler_date_add_interval_datetime_arg0_time: { public: bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const; + MYSQL_TIME *to, date_mode_t fuzzy) const override; }; @@ -1755,7 +1755,7 @@ class Func_handler_date_add_interval_date: { public: bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { /* The first argument is known to be of the DATE data type (not DATETIME). @@ -1777,7 +1777,7 @@ class Func_handler_date_add_interval_time: public Func_handler_date_add_interval { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { uint dec= MY_MAX(item->arguments()[0]->time_precision(current_thd), interval_dec(item->arguments()[1], int_type(item))); @@ -1785,7 +1785,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { Time t(thd, item->arguments()[0]); if (!t.is_valid_time()) @@ -1802,7 +1802,7 @@ class Func_handler_date_add_interval_string: public Func_handler_date_add_interval { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { uint dec= MY_MAX(item->arguments()[0]->datetime_precision(current_thd), interval_dec(item->arguments()[1], int_type(item))); @@ -1814,7 +1814,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { if (item->arguments()[0]-> get_date(thd, to, Datetime::Options(TIME_CONV_NONE, thd)) || @@ -1843,7 +1843,7 @@ public: Func_handler_add_time_datetime(int sign) :Func_handler_sign(sign) { } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { THD *thd= current_thd; uint dec0= item->arguments()[0]->datetime_precision(thd); @@ -1852,7 +1852,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { DBUG_ASSERT(item->fixed()); Datetime::Options opt(TIME_CONV_NONE, thd); @@ -1877,7 +1877,7 @@ public: Func_handler_add_time_time(int sign) :Func_handler_sign(sign) { } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { THD *thd= current_thd; uint dec0= item->arguments()[0]->time_precision(thd); @@ -1886,7 +1886,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { DBUG_ASSERT(item->fixed()); Time t(thd, item->arguments()[0]); @@ -1910,7 +1910,7 @@ public: Func_handler_add_time_string(int sign) :Func_handler_sign(sign) { } - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { uint dec0= item->arguments()[0]->decimals; uint dec1= Interval_DDhhmmssff::fsp(current_thd, item->arguments()[1]); @@ -1923,7 +1923,7 @@ public: return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { DBUG_ASSERT(item->fixed()); // Detect a proper timestamp type based on the argument values @@ -1947,13 +1947,13 @@ class Func_handler_str_to_date_datetime_sec: public Item_handled_func::Handler_datetime { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->fix_attributes_datetime(0); return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { return static_cast(item)-> get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATETIME); @@ -1965,13 +1965,13 @@ class Func_handler_str_to_date_datetime_usec: public Item_handled_func::Handler_datetime { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->fix_attributes_datetime(TIME_SECOND_PART_DIGITS); return false; } bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { return static_cast(item)-> get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATETIME); @@ -1983,7 +1983,7 @@ class Func_handler_str_to_date_date: public Item_handled_func::Handler_date { public: bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { return static_cast(item)-> get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_DATE); @@ -1995,7 +1995,7 @@ class Func_handler_str_to_date_time: public Item_handled_func::Handler_time { public: bool get_date(THD *thd, Item_handled_func *item, - MYSQL_TIME *to, date_mode_t fuzzy) const + MYSQL_TIME *to, date_mode_t fuzzy) const override { if (static_cast(item)-> get_date_common(thd, to, fuzzy, MYSQL_TIMESTAMP_TIME)) @@ -2018,7 +2018,7 @@ public: class Func_handler_str_to_date_time_sec: public Func_handler_str_to_date_time { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->fix_attributes_time(0); return false; @@ -2029,7 +2029,7 @@ public: class Func_handler_str_to_date_time_usec: public Func_handler_str_to_date_time { public: - bool fix_length_and_dec(Item_handled_func *item) const + bool fix_length_and_dec(Item_handled_func *item) const override { item->fix_attributes_time(TIME_SECOND_PART_DIGITS); return false; diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index cb09ef75581..5854b0bc884 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -584,13 +584,13 @@ public: CHARSET_INFO *cs): Item_string(thd, str, length, cs) { } - bool const_item() const { return false ; } - bool basic_const_item() const { return false; } + bool const_item() const override { return false ; } + bool basic_const_item() const override { return false; } void set_value(const char *str, uint length, CHARSET_INFO *cs) { str_value.set(str, length, cs); } - Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) + Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override { /* Item_string::safe_charset_converter() does not accept non-constants. diff --git a/sql/key.cc b/sql/key.cc index c34f8240fae..d58fd5ea1ea 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -754,13 +754,11 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key) if (is_string) { - if (cs->mbmaxlen > 1) - { - size_t char_length= cs->charpos(pos + pack_length, - pos + pack_length + length, - length / cs->mbmaxlen); - set_if_smaller(length, char_length); - } + /* + Prefix keys are not possible in BNLH joins. + Use the whole string to calculate the hash. + */ + DBUG_ASSERT((key_part->key_part_flag & HA_PART_KEY_SEG) == 0); cs->hash_sort(pos+pack_length, length, &nr, &nr2); key+= pack_length; } @@ -864,25 +862,13 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts, if (is_string) { /* - Compare the strings taking into account length in characters - and collation + Prefix keys are not possible in BNLH joins. + Compare whole strings. */ - size_t byte_len1= length1, byte_len2= length2; - if (cs->mbmaxlen > 1) - { - size_t char_length1= cs->charpos(pos1 + pack_length, - pos1 + pack_length + length1, - length1 / cs->mbmaxlen); - size_t char_length2= cs->charpos(pos2 + pack_length, - pos2 + pack_length + length2, - length2 / cs->mbmaxlen); - set_if_smaller(length1, char_length1); - set_if_smaller(length2, char_length2); - } - if (length1 != length2 || - cs->strnncollsp(pos1 + pack_length, byte_len1, - pos2 + pack_length, byte_len2)) - return TRUE; + DBUG_ASSERT((key_part->key_part_flag & HA_PART_KEY_SEG) == 0); + if (cs->strnncollsp(pos1 + pack_length, length1, + pos2 + pack_length, length2)) + return true; key1+= pack_length; key2+= pack_length; } else diff --git a/sql/keycaches.cc b/sql/keycaches.cc index 10bec7c1de8..d0ad1c5f56a 100644 --- a/sql/keycaches.cc +++ b/sql/keycaches.cc @@ -48,7 +48,7 @@ public: { return length == name_length && !memcmp(name, name_cmp, length); } - ~NAMED_ILINK() + ~NAMED_ILINK() override { my_free((void *) name); } diff --git a/sql/log.cc b/sql/log.cc index b26757ec4e2..9b2249825a5 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -213,14 +213,14 @@ public: m_message[0]= '\0'; } - virtual ~Silence_log_table_errors() = default; + ~Silence_log_table_errors() override = default; - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sql_state, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; const char *message() const { return m_message; } }; diff --git a/sql/log.h b/sql/log.h index a66486acf0a..130b701378d 100644 --- a/sql/log.h +++ b/sql/log.h @@ -101,25 +101,25 @@ class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging { public: TC_LOG_DUMMY() = default; - int open(const char *opt_name) { return 0; } - void close() { } + int open(const char *opt_name) override { return 0; } + void close() override { } /* TC_LOG_DUMMY is only used when there are <= 1 XA-capable engines, and we only use internal XA during commit when >= 2 XA-capable engines participate. */ int log_and_order(THD *thd, my_xid xid, bool all, - bool need_prepare_ordered, bool need_commit_ordered) + bool need_prepare_ordered, bool need_commit_ordered) override { DBUG_ASSERT(0); return 1; } - int unlog(ulong cookie, my_xid xid) { return 0; } - int unlog_xa_prepare(THD *thd, bool all) + int unlog(ulong cookie, my_xid xid) override { return 0; } + int unlog_xa_prepare(THD *thd, bool all) override { return 0; } - void commit_checkpoint_notify(void *cookie) { DBUG_ASSERT(0); }; + void commit_checkpoint_notify(void *cookie) override { DBUG_ASSERT(0); }; }; #define TC_LOG_PAGE_SIZE 8192 @@ -197,16 +197,16 @@ class TC_LOG_MMAP: public TC_LOG public: TC_LOG_MMAP(): inited(0), pending_checkpoint(0) {} - int open(const char *opt_name); - void close(); + int open(const char *opt_name) override; + void close() override; int log_and_order(THD *thd, my_xid xid, bool all, - bool need_prepare_ordered, bool need_commit_ordered); - int unlog(ulong cookie, my_xid xid); - int unlog_xa_prepare(THD *thd, bool all) + bool need_prepare_ordered, bool need_commit_ordered) override; + int unlog(ulong cookie, my_xid xid) override; + int unlog_xa_prepare(THD *thd, bool all) override { return 0; } - void commit_checkpoint_notify(void *cookie); + void commit_checkpoint_notify(void *cookie) override; int recover(); private: @@ -721,15 +721,15 @@ public: } #endif - int open(const char *opt_name); - void close(); - virtual int generate_new_name(char *new_name, const char *log_name, - ulong next_log_number); + int open(const char *opt_name) override; + void close() override; + int generate_new_name(char *new_name, const char *log_name, + ulong next_log_number) override; int log_and_order(THD *thd, my_xid xid, bool all, - bool need_prepare_ordered, bool need_commit_ordered); - int unlog(ulong cookie, my_xid xid); - int unlog_xa_prepare(THD *thd, bool all); - void commit_checkpoint_notify(void *cookie); + bool need_prepare_ordered, bool need_commit_ordered) override; + int unlog(ulong cookie, my_xid xid) override; + int unlog_xa_prepare(THD *thd, bool all) override; + void commit_checkpoint_notify(void *cookie) override; int recover(LOG_INFO *linfo, const char *last_log_name, IO_CACHE *first_log, Format_description_log_event *fdle, bool do_xa); int do_binlog_recovery(const char *opt_name, bool do_xa_recovery); @@ -1023,19 +1023,19 @@ class Log_to_csv_event_handler: public Log_event_handler public: Log_to_csv_event_handler(); ~Log_to_csv_event_handler(); - virtual bool init(); - virtual void cleanup(); + bool init() override; + void cleanup() override; - virtual bool log_slow(THD *thd, my_hrtime_t current_time, + bool log_slow(THD *thd, my_hrtime_t current_time, const char *user_host, size_t user_host_len, ulonglong query_utime, ulonglong lock_utime, bool is_command, - const char *sql_text, size_t sql_text_len); - virtual bool log_error(enum loglevel level, const char *format, - va_list args); - virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id, + const char *sql_text, size_t sql_text_len) override; + bool log_error(enum loglevel level, const char *format, + va_list args) override; + bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id, const char *command_type, size_t command_type_len, const char *sql_text, size_t sql_text_len, - CHARSET_INFO *client_cs); + CHARSET_INFO *client_cs) override; int activate_log(THD *thd, uint log_type); }; @@ -1053,19 +1053,19 @@ class Log_to_file_event_handler: public Log_event_handler public: Log_to_file_event_handler(): is_initialized(FALSE) {} - virtual bool init(); - virtual void cleanup(); + bool init() override; + void cleanup() override; - virtual bool log_slow(THD *thd, my_hrtime_t current_time, + bool log_slow(THD *thd, my_hrtime_t current_time, const char *user_host, size_t user_host_len, ulonglong query_utime, ulonglong lock_utime, bool is_command, - const char *sql_text, size_t sql_text_len); - virtual bool log_error(enum loglevel level, const char *format, - va_list args); - virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id, + const char *sql_text, size_t sql_text_len) override; + bool log_error(enum loglevel level, const char *format, + va_list args) override; + bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host, size_t user_host_len, my_thread_id thread_id, const char *command_type, size_t command_type_len, const char *sql_text, size_t sql_text_len, - CHARSET_INFO *client_cs); + CHARSET_INFO *client_cs) override; void flush(); void init_pthread_objects(); MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; } diff --git a/sql/log_event.h b/sql/log_event.h index 879a5a78270..a442ea8d38b 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -934,7 +934,7 @@ typedef struct st_print_event_info fflush(file); } } PRINT_EVENT_INFO; -#endif +#endif // MYSQL_CLIENT /** This class encapsulates writing of Log_event objects to IO_CACHE. @@ -2143,13 +2143,13 @@ public: Query_log_event(THD* thd_arg, const char* query_arg, size_t query_length, bool using_trans, bool direct, bool suppress_use, int error); - const char* get_db() { return db; } + const char* get_db() override { return db; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else bool print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info); - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Query_log_event(); @@ -2161,14 +2161,14 @@ public: if (data_buf) my_free(data_buf); } - Log_event_type get_type_code() { return QUERY_EVENT; } + Log_event_type get_type_code() override { return QUERY_EVENT; } static int dummy_event(String *packet, ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg); static int begin_event(String *packet, ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg); #ifdef MYSQL_SERVER - bool write(); + bool write() override; virtual bool write_post_header_for_derived() { return FALSE; } #endif - bool is_valid() const { return query != 0; } + bool is_valid() const override { return query != 0; } /* Returns number of bytes additionally written to post header by derived @@ -2179,8 +2179,8 @@ public: public: /* !!! Public in this patch to allow old usage */ #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); - virtual int do_apply_event(rpl_group_info *rgi); + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; + int do_apply_event(rpl_group_info *rgi) override; int do_apply_event(rpl_group_info *rgi, const char *query_arg, @@ -2229,21 +2229,21 @@ public: if (query_buf) my_free(query_buf); } - Log_event_type get_type_code() { return QUERY_COMPRESSED_EVENT; } + Log_event_type get_type_code() override { return QUERY_COMPRESSED_EVENT; } /* the min length of log_bin_compress_min_len is 10, means that Begin/Commit/Rollback would never be compressed! */ - virtual bool is_begin() { return false; } - virtual bool is_commit() { return false; } - virtual bool is_rollback() { return false; } + bool is_begin() override { return false; } + bool is_commit() override { return false; } + bool is_rollback() override { return false; } #ifdef MYSQL_SERVER Query_compressed_log_event(THD* thd_arg, const char* query_arg, ulong query_length, bool using_trans, bool direct, bool suppress_use, int error); - virtual bool write(); + bool write() override; #endif }; @@ -2553,12 +2553,12 @@ public: bool using_trans); void set_fields(const char* db, List &fields_arg, Name_resolution_context *context); - const char* get_db() { return db; } + const char* get_db() override { return db; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented); #endif @@ -2571,16 +2571,16 @@ public: Load_log_event(const uchar *buf, uint event_len, const Format_description_log_event* description_event); ~Load_log_event() = default; - Log_event_type get_type_code() + Log_event_type get_type_code() override { return sql_ex.new_format() ? NEW_LOAD_EVENT: LOAD_EVENT; } #ifdef MYSQL_SERVER - bool write_data_header(); - bool write_data_body(); + bool write_data_header() override; + bool write_data_body() override; #endif - bool is_valid() const { return table_name != 0; } - int get_data_size() + bool is_valid() const override { return table_name != 0; } + int get_data_size() override { return (table_name_len + db_len + 2 + fname_len + LOAD_HEADER_LEN @@ -2589,7 +2589,7 @@ public: public: /* !!! Public in this patch to allow old usage */ #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi) + int do_apply_event(rpl_group_info *rgi) override { return do_apply_event(thd->slave_net,rgi,0); } @@ -2651,32 +2651,32 @@ public: #ifdef MYSQL_SERVER Start_log_event_v3(); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() = default; - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Start_log_event_v3(const uchar *buf, uint event_len, const Format_description_log_event* description_event); ~Start_log_event_v3() = default; - Log_event_type get_type_code() { return START_EVENT_V3;} - my_off_t get_header_len(my_off_t l __attribute__((unused))) + Log_event_type get_type_code() override { return START_EVENT_V3;} + my_off_t get_header_len(my_off_t l __attribute__((unused))) override { return LOG_EVENT_MINIMAL_HEADER_LEN; } #ifdef MYSQL_SERVER - bool write(); + bool write() override; #endif - bool is_valid() const { return server_version[0] != 0; } - int get_data_size() + bool is_valid() const override { return server_version[0] != 0; } + int get_data_size() override { return START_V3_HEADER_LEN; //no variable-sized part } protected: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info*) + int do_apply_event(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info*) override { /* Events from ourself should be skipped, but they should not @@ -2714,7 +2714,7 @@ public: memcpy(nonce, nonce_arg, BINLOG_NONCE_LENGTH); } - bool write_data_body() + bool write_data_body() override { uchar scheme_buf= crypto_scheme; uchar key_version_buf[BINLOG_KEY_VERSION_LENGTH]; @@ -2724,18 +2724,18 @@ public: write_data(nonce, BINLOG_NONCE_LENGTH); } #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Start_encryption_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); - bool is_valid() const { return crypto_scheme == 1; } + bool is_valid() const override { return crypto_scheme == 1; } - Log_event_type get_type_code() { return START_ENCRYPTION_EVENT; } + Log_event_type get_type_code() override { return START_ENCRYPTION_EVENT; } - int get_data_size() + int get_data_size() override { return BINLOG_CRYPTO_SCHEME_LENGTH + BINLOG_KEY_VERSION_LENGTH + BINLOG_NONCE_LENGTH; @@ -2747,9 +2747,9 @@ public: protected: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info* rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info* rgi) + int do_apply_event(rpl_group_info* rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info* rgi) override { return Log_event::EVENT_SKIP_NOT; } @@ -2840,9 +2840,9 @@ public: { my_free(post_header_len); } - Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;} + Log_event_type get_type_code() override { return FORMAT_DESCRIPTION_EVENT;} #ifdef MYSQL_SERVER - bool write(); + bool write() override; #endif bool header_is_valid() const { @@ -2851,12 +2851,12 @@ public: (post_header_len != NULL)); } - bool is_valid() const + bool is_valid() const override { return header_is_valid() && server_version_split.version_is_valid(); } - int get_data_size() + int get_data_size() override { /* The vector of post-header lengths is considered as part of the @@ -2882,9 +2882,9 @@ public: static bool is_version_before_checksum(const master_version_split *version_split); protected: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -2942,29 +2942,31 @@ Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg, cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Intvar_log_event(const uchar *buf, const Format_description_log_event *description_event); ~Intvar_log_event() = default; - Log_event_type get_type_code() { return INTVAR_EVENT;} + Log_event_type get_type_code() override { return INTVAR_EVENT;} const char* get_var_type_name(); - int get_data_size() { return 9; /* sizeof(type) + sizeof(val) */;} + int get_data_size() override { return 9; /* sizeof(type) + sizeof(val) */;} #ifdef MYSQL_SERVER - bool write(); + bool write() override; +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } #endif - bool is_valid() const { return 1; } - bool is_part_of_group() { return 1; } +#endif + bool is_valid() const override { return 1; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -3023,28 +3025,30 @@ class Rand_log_event: public Log_event cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Rand_log_event(const uchar *buf, const Format_description_log_event *description_event); ~Rand_log_event() = default; - Log_event_type get_type_code() { return RAND_EVENT;} - int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ } + Log_event_type get_type_code() override { return RAND_EVENT;} + int get_data_size() override { return 16; /* sizeof(ulonglong) * 2*/ } #ifdef MYSQL_SERVER - bool write(); + bool write() override; +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } #endif - bool is_valid() const { return 1; } - bool is_part_of_group() { return 1; } +#endif + bool is_valid() const override { return 1; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -3061,14 +3065,14 @@ public: Log_event(buf, description_event) {} ~Xid_apply_log_event() {} - bool is_valid() const { return 1; } + bool is_valid() const override { return 1; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) virtual int do_commit()= 0; - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; int do_record_gtid(THD *thd, rpl_group_info *rgi, bool in_trans, void **out_hton, bool force_err= false); - enum_skip_reason do_shall_skip(rpl_group_info *rgi); + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; virtual const char* get_query()= 0; #endif }; @@ -3098,29 +3102,29 @@ public: if (direct) cache_type= Log_event::EVENT_NO_CACHE; } - const char* get_query() +#ifdef HAVE_REPLICATION + const char* get_query() override { return "COMMIT /* implicit, from Xid_log_event */"; } -#ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Xid_log_event(const uchar *buf, const Format_description_log_event *description_event); ~Xid_log_event() = default; - Log_event_type get_type_code() { return XID_EVENT;} - int get_data_size() { return sizeof(xid); } + Log_event_type get_type_code() override { return XID_EVENT;} + int get_data_size() override { return sizeof(xid); } #ifdef MYSQL_SERVER - bool write(); + bool write() override; #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - int do_commit(); + int do_commit() override; #endif }; @@ -3249,30 +3253,30 @@ public: cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif XA_prepare_log_event(const uchar *buf, const Format_description_log_event *description_event); ~XA_prepare_log_event() {} - Log_event_type get_type_code() { return XA_PREPARE_LOG_EVENT; } - bool is_valid() const { return m_xid.formatID != -1; } - int get_data_size() + Log_event_type get_type_code() override { return XA_PREPARE_LOG_EVENT; } + bool is_valid() const override { return m_xid.formatID != -1; } + int get_data_size() override { return xid_subheader_no_data + m_xid.gtrid_length + m_xid.bqual_length; } #ifdef MYSQL_SERVER - bool write(); + bool write() override; #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) char query[sizeof("XA COMMIT ONE PHASE") + 1 + ser_buf_size]; - int do_commit(); - const char* get_query() + int do_commit() override; + const char* get_query() override { sprintf(query, (one_phase ? "XA COMMIT %s ONE PHASE" : "XA PREPARE %s"), @@ -3318,17 +3322,19 @@ public: if (direct) cache_type= Log_event::EVENT_NO_CACHE; } - void pack_info(Protocol* protocol); +#ifdef HAVE_REPLICATION + void pack_info(Protocol* protocol) override; +#endif #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif User_var_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~User_var_log_event() = default; - Log_event_type get_type_code() { return USER_VAR_EVENT;} + Log_event_type get_type_code() override { return USER_VAR_EVENT;} #ifdef MYSQL_SERVER - bool write(); + bool write() override; /* Getter and setter for deferred User-event. Returns true if the event is not applied directly @@ -3340,15 +3346,17 @@ public: and the parsing time query id is stored to be used at applying time. */ void set_deferred(query_id_t qid) { deferred= true; query_id= qid; } +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } #endif - bool is_valid() const { return name != 0; } - bool is_part_of_group() { return 1; } +#endif + bool is_valid() const override { return name != 0; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -3368,7 +3376,7 @@ public: Stop_log_event() :Log_event() {} #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Stop_log_event(const uchar *buf, @@ -3376,13 +3384,13 @@ public: Log_event(buf, description_event) {} ~Stop_log_event() = default; - Log_event_type get_type_code() { return STOP_EVENT;} - bool is_valid() const { return 1; } + Log_event_type get_type_code() override { return STOP_EVENT;} + bool is_valid() const override { return 1; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi) + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override { /* Events from ourself should be skipped, but they should not @@ -3461,10 +3469,10 @@ public: uint ident_len_arg, ulonglong pos_arg, uint flags); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Rotate_log_event(const uchar *buf, uint event_len, @@ -3474,19 +3482,19 @@ public: if (flags & DUP_NAME) my_free((void*) new_log_ident); } - Log_event_type get_type_code() { return ROTATE_EVENT;} - my_off_t get_header_len(my_off_t l __attribute__((unused))) + Log_event_type get_type_code() override { return ROTATE_EVENT;} + my_off_t get_header_len(my_off_t l __attribute__((unused))) override { return LOG_EVENT_MINIMAL_HEADER_LEN; } - int get_data_size() { return ident_len + ROTATE_HEADER_LEN;} - bool is_valid() const { return new_log_ident != 0; } + int get_data_size() override { return ident_len + ROTATE_HEADER_LEN;} + bool is_valid() const override { return new_log_ident != 0; } #ifdef MYSQL_SERVER - bool write(); + bool write() override; #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -3501,21 +3509,24 @@ public: Binlog_checkpoint_log_event(const char *binlog_file_name_arg, uint binlog_file_len_arg); #ifdef HAVE_REPLICATION - void pack_info(Protocol *protocol); + void pack_info(Protocol *protocol) override; #endif #else - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif Binlog_checkpoint_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Binlog_checkpoint_log_event() { my_free(binlog_file_name); } - Log_event_type get_type_code() { return BINLOG_CHECKPOINT_EVENT;} - int get_data_size() { return binlog_file_len + BINLOG_CHECKPOINT_HEADER_LEN;} - bool is_valid() const { return binlog_file_name != 0; } + Log_event_type get_type_code() override { return BINLOG_CHECKPOINT_EVENT;} + int get_data_size() override + { return binlog_file_len + BINLOG_CHECKPOINT_HEADER_LEN;} + bool is_valid() const override { return binlog_file_name != 0; } #ifdef MYSQL_SERVER - bool write(); - enum_skip_reason do_shall_skip(rpl_group_info *rgi); + bool write() override; +#ifdef HAVE_REPLICATION + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; +#endif #endif }; @@ -3649,25 +3660,25 @@ public: uint16 flags, bool is_transactional, uint64 commit_id, bool has_xid= false, bool is_ro_1pc= false); #ifdef HAVE_REPLICATION - void pack_info(Protocol *protocol); - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + void pack_info(Protocol *protocol) override; + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif #else - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif Gtid_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Gtid_log_event() = default; - Log_event_type get_type_code() { return GTID_EVENT; } - enum_logged_status logged_status() { return LOGGED_NO_DATA; } - int get_data_size() + Log_event_type get_type_code() override { return GTID_EVENT; } + enum_logged_status logged_status() override { return LOGGED_NO_DATA; } + int get_data_size() override { return GTID_HEADER_LEN + ((flags2 & FL_GROUP_COMMIT_ID) ? 2 : 0); } - bool is_valid() const + bool is_valid() const override { /* seq_no is set to 0 if the structure of a serialized GTID event does not @@ -3677,7 +3688,7 @@ public: } #ifdef MYSQL_SERVER - bool write(); + bool write() override; static int make_compatible_event(String *packet, bool *need_dummy_event, ulong ev_offset, enum enum_binlog_checksum_alg checksum_alg); static bool peek(const uchar *event_start, size_t event_len, @@ -3775,16 +3786,16 @@ public: Gtid_list_log_event(rpl_binlog_state *gtid_set, uint32 gl_flags); Gtid_list_log_event(slave_connection_state *gtid_set, uint32 gl_flags); #ifdef HAVE_REPLICATION - void pack_info(Protocol *protocol); + void pack_info(Protocol *protocol) override; #endif #else - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif Gtid_list_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Gtid_list_log_event() { my_free(list); my_free(sub_id_list); } - Log_event_type get_type_code() { return GTID_LIST_EVENT; } - int get_data_size() { + Log_event_type get_type_code() override { return GTID_LIST_EVENT; } + int get_data_size() override { /* Replacing with dummy event, needed for older slaves, requires a minimum of 6 bytes in the body. @@ -3792,12 +3803,12 @@ public: return (count==0 ? GTID_LIST_HEADER_LEN+2 : GTID_LIST_HEADER_LEN+count*element_size); } - bool is_valid() const { return list != NULL; } + bool is_valid() const override { return list != NULL; } #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) bool to_packet(String *packet); - bool write(); - virtual int do_apply_event(rpl_group_info *rgi); - enum_skip_reason do_shall_skip(rpl_group_info *rgi); + bool write() override; + int do_apply_event(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif static bool peek(const char *event_start, size_t event_len, enum enum_binlog_checksum_alg checksum_alg, @@ -3839,10 +3850,10 @@ public: uchar* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local); #endif @@ -3854,20 +3865,20 @@ public: my_free((void*) event_buf); } - Log_event_type get_type_code() + Log_event_type get_type_code() override { return fake_base ? Load_log_event::get_type_code() : CREATE_FILE_EVENT; } - int get_data_size() + int get_data_size() override { return (fake_base ? Load_log_event::get_data_size() : Load_log_event::get_data_size() + 4 + 1 + block_len); } - bool is_valid() const { return inited_from_old || block != 0; } + bool is_valid() const override { return inited_from_old || block != 0; } #ifdef MYSQL_SERVER - bool write_data_header(); - bool write_data_body(); + bool write_data_header() override; + bool write_data_body() override; /* Cut out Create_file extensions and write it as Load event - used on the slave @@ -3877,7 +3888,7 @@ public: private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif }; @@ -3911,28 +3922,28 @@ public: Append_block_log_event(THD* thd, const char* db_arg, uchar* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Append_block_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Append_block_log_event() = default; - Log_event_type get_type_code() { return APPEND_BLOCK_EVENT;} - int get_data_size() { return block_len + APPEND_BLOCK_HEADER_LEN ;} - bool is_valid() const { return block != 0; } + Log_event_type get_type_code() override { return APPEND_BLOCK_EVENT;} + int get_data_size() override { return block_len + APPEND_BLOCK_HEADER_LEN ;} + bool is_valid() const override { return block != 0; } #ifdef MYSQL_SERVER - bool write(); - const char* get_db() { return db; } + bool write() override; + const char* get_db() override { return db; } #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif }; @@ -3952,10 +3963,10 @@ public: #ifdef MYSQL_SERVER Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local); #endif @@ -3963,17 +3974,17 @@ public: Delete_file_log_event(const uchar *buf, uint event_len, const Format_description_log_event* description_event); ~Delete_file_log_event() = default; - Log_event_type get_type_code() { return DELETE_FILE_EVENT;} - int get_data_size() { return DELETE_FILE_HEADER_LEN ;} - bool is_valid() const { return file_id != 0; } + Log_event_type get_type_code() override { return DELETE_FILE_EVENT;} + int get_data_size() override { return DELETE_FILE_HEADER_LEN ;} + bool is_valid() const override { return file_id != 0; } #ifdef MYSQL_SERVER - bool write(); - const char* get_db() { return db; } + bool write() override; + const char* get_db() override { return db; } #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif }; @@ -3993,27 +4004,27 @@ public: #ifdef MYSQL_SERVER Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; #endif Execute_load_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Execute_load_log_event() = default; - Log_event_type get_type_code() { return EXEC_LOAD_EVENT;} - int get_data_size() { return EXEC_LOAD_HEADER_LEN ;} - bool is_valid() const { return file_id != 0; } + Log_event_type get_type_code() override { return EXEC_LOAD_EVENT;} + int get_data_size() override { return EXEC_LOAD_HEADER_LEN ;} + bool is_valid() const override { return file_id != 0; } #ifdef MYSQL_SERVER - bool write(); - const char* get_db() { return db; } + bool write() override; + const char* get_db() override { return db; } #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif }; @@ -4036,17 +4047,17 @@ public: bool using_trans); #ifdef HAVE_REPLICATION Begin_load_query_log_event(THD* thd); - int get_create_or_append() const; + int get_create_or_append() const override; #endif /* HAVE_REPLICATION */ #endif Begin_load_query_log_event(const uchar *buf, uint event_len, const Format_description_log_event *description_event); ~Begin_load_query_log_event() = default; - Log_event_type get_type_code() { return BEGIN_LOAD_QUERY_EVENT; } + Log_event_type get_type_code() override { return BEGIN_LOAD_QUERY_EVENT; } private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif }; @@ -4089,10 +4100,10 @@ public: bool using_trans, bool direct, bool suppress_use, int errcode); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(Protocol* protocol) override; #endif /* HAVE_REPLICATION */ #else - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; /* Prints the query as LOAD DATA LOCAL and with rewritten filename */ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, const char *local_fname); @@ -4102,17 +4113,17 @@ public: *description_event); ~Execute_load_query_log_event() = default; - Log_event_type get_type_code() { return EXECUTE_LOAD_QUERY_EVENT; } - bool is_valid() const { return Query_log_event::is_valid() && file_id != 0; } + Log_event_type get_type_code() override { return EXECUTE_LOAD_QUERY_EVENT; } + bool is_valid() const override { return Query_log_event::is_valid() && file_id != 0; } - ulong get_post_header_size_for_derived(); + ulong get_post_header_size_for_derived() override; #ifdef MYSQL_SERVER - bool write_post_header_for_derived(); + bool write_post_header_for_derived() override; #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif }; @@ -4139,9 +4150,9 @@ public: /* constructor for hopelessly corrupted events */ Unknown_log_event(): Log_event(), what(ENCRYPTED) {} ~Unknown_log_event() = default; - bool print(FILE* file, PRINT_EVENT_INFO* print_event_info); - Log_event_type get_type_code() { return UNKNOWN_EVENT;} - bool is_valid() const { return 1; } + bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override; + Log_event_type get_type_code() override { return UNKNOWN_EVENT;} + bool is_valid() const override { return 1; } }; #endif char *str_to_hex(char *to, const char *from, size_t len); @@ -4168,30 +4179,32 @@ public: const Format_description_log_event*); ~Annotate_rows_log_event(); - virtual int get_data_size(); - virtual Log_event_type get_type_code(); - enum_logged_status logged_status() { return LOGGED_NO_DATA; } - virtual bool is_valid() const; - virtual bool is_part_of_group() { return 1; } + int get_data_size() override; + Log_event_type get_type_code() override; + enum_logged_status logged_status() override { return LOGGED_NO_DATA; } + bool is_valid() const override; #ifndef MYSQL_CLIENT - virtual bool write_data_header(); - virtual bool write_data_body(); +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } +#endif + bool write_data_header() override; + bool write_data_body() override; #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol*); + void pack_info(Protocol*) override; #endif #ifdef MYSQL_CLIENT - virtual bool print(FILE*, PRINT_EVENT_INFO*); + bool print(FILE*, PRINT_EVENT_INFO*) override; #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) private: - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info*); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info*) override; #endif private: @@ -4834,33 +4847,35 @@ public: const char *get_table_name() const { return m_tblnam; } const char *get_db_name() const { return m_dbnam; } - virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; } - virtual enum_logged_status logged_status() { return LOGGED_TABLE_MAP; } - virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ } - virtual bool is_part_of_group() { return 1; } + Log_event_type get_type_code() override { return TABLE_MAP_EVENT; } + enum_logged_status logged_status() override { return LOGGED_TABLE_MAP; } + bool is_valid() const override { return m_memory != NULL; /* we check malloc */ } - virtual int get_data_size() { return (uint) m_data_size; } + int get_data_size() override { return (uint) m_data_size; } #ifdef MYSQL_SERVER +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } +#endif virtual int save_field_metadata(); - virtual bool write_data_header(); - virtual bool write_data_body(); - virtual const char *get_db() { return m_dbnam; } + bool write_data_header() override; + bool write_data_body() override; + const char *get_db() override { return m_dbnam; } #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + void pack_info(Protocol *protocol) override; #endif #ifdef MYSQL_CLIENT - virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; #endif #ifdef MYSQL_SERVER @@ -5010,17 +5025,17 @@ public: flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; } void update_flags() { int2store(temp_buf + m_flags_pos, m_flags); } - Log_event_type get_type_code() { return m_type; } /* Specific type (_V1 etc) */ - enum_logged_status logged_status() { return LOGGED_ROW_EVENT; } + Log_event_type get_type_code() override { return m_type; } /* Specific type (_V1 etc) */ + enum_logged_status logged_status() override { return LOGGED_ROW_EVENT; } virtual Log_event_type get_general_type_code() = 0; /* General rows op type, no version */ #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + void pack_info(Protocol *protocol) override; #endif #ifdef MYSQL_CLIENT /* not for direct call, each derived has its own ::print() */ - virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0; + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override= 0; void change_to_flashback_event(PRINT_EVENT_INFO *print_event_info, uchar *rows_buff, Log_event_type ev_type); bool print_verbose(IO_CACHE *file, PRINT_EVENT_INFO *print_event_info); @@ -5045,7 +5060,7 @@ public: #endif /* Member functions to implement superclass interface */ - virtual int get_data_size(); + int get_data_size() override; MY_BITMAP const *get_cols() const { return &m_cols; } MY_BITMAP const *get_cols_ai() const { return &m_cols_ai; } @@ -5101,10 +5116,13 @@ public: #endif #ifdef MYSQL_SERVER - virtual bool write_data_header(); - virtual bool write_data_body(); + bool write_data_header() override; + bool write_data_body() override; virtual bool write_compressed(); - virtual const char *get_db() { return m_table->s->db.str; } + const char *get_db() override { return m_table->s->db.str; } +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return get_flags(STMT_END_F) != 0; } +#endif #endif /* Check that malloc() succeeded in allocating memory for the rows @@ -5112,11 +5130,10 @@ public: is valid is done in the Update_rows_log_event::is_valid() function. */ - virtual bool is_valid() const + bool is_valid() const override { return m_rows_buf && m_cols.bitmap; } - bool is_part_of_group() { return get_flags(STMT_END_F) != 0; } uint m_row_count; /* The number of rows added to the event */ @@ -5294,9 +5311,9 @@ protected: private: #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; /* Primitive to prepare for a sequence of row executions. @@ -5392,20 +5409,20 @@ public: #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - uint8 get_trg_event_map(); + uint8 get_trg_event_map() override; #endif private: - virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; } #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif }; @@ -5415,7 +5432,7 @@ public: #if defined(MYSQL_SERVER) Write_rows_compressed_log_event(THD*, TABLE*, ulonglong table_id, bool is_transactional); - virtual bool write(); + bool write() override; #endif #ifdef HAVE_REPLICATION Write_rows_compressed_log_event(const uchar *buf, uint event_len, @@ -5423,7 +5440,7 @@ public: #endif private: #if defined(MYSQL_CLIENT) - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif }; @@ -5474,26 +5491,26 @@ public: } #endif - virtual bool is_valid() const + bool is_valid() const override { return Rows_log_event::is_valid() && m_cols_ai.bitmap; } #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - uint8 get_trg_event_map(); + uint8 get_trg_event_map() override; #endif protected: - virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; } #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif /* defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) */ }; @@ -5503,7 +5520,7 @@ public: #if defined(MYSQL_SERVER) Update_rows_compressed_log_event(THD*, TABLE*, ulonglong table_id, bool is_transactional); - virtual bool write(); + bool write() override; #endif #ifdef HAVE_REPLICATION Update_rows_compressed_log_event(const uchar *buf, uint event_len, @@ -5511,7 +5528,7 @@ public: #endif private: #if defined(MYSQL_CLIENT) - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif }; @@ -5565,20 +5582,20 @@ public: #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - uint8 get_trg_event_map(); + uint8 get_trg_event_map() override; #endif protected: - virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_general_type_code() override { return (Log_event_type)TYPE_CODE; } #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif }; @@ -5588,7 +5605,7 @@ public: #if defined(MYSQL_SERVER) Delete_rows_compressed_log_event(THD*, TABLE*, ulonglong, bool is_transactional); - virtual bool write(); + bool write() override; #endif #ifdef HAVE_REPLICATION Delete_rows_compressed_log_event(const uchar *buf, uint event_len, @@ -5596,7 +5613,7 @@ public: #endif private: #if defined(MYSQL_CLIENT) - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif }; @@ -5679,10 +5696,11 @@ public: #endif #ifdef MYSQL_SERVER - void pack_info(Protocol*); - - virtual bool write_data_header(); - virtual bool write_data_body(); +#ifdef HAVE_REPLICATION + void pack_info(Protocol*) override; +#endif + bool write_data_header() override; + bool write_data_body() override; #endif Incident_log_event(const uchar *buf, uint event_len, @@ -5691,20 +5709,20 @@ public: virtual ~Incident_log_event(); #ifdef MYSQL_CLIENT - virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; #endif - virtual Log_event_type get_type_code() { return INCIDENT_EVENT; } + Log_event_type get_type_code() override { return INCIDENT_EVENT; } - virtual bool is_valid() const + bool is_valid() const override { return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT; } - virtual int get_data_size() { + int get_data_size() override { return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length; } @@ -5754,18 +5772,18 @@ public: virtual ~Ignorable_log_event(); #ifndef MYSQL_CLIENT - void pack_info(Protocol*); +#ifdef HAVE_REPLICATION + void pack_info(Protocol*) override; +#endif +#else + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif -#ifdef MYSQL_CLIENT - virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); -#endif + Log_event_type get_type_code() override { return IGNORABLE_LOG_EVENT; } - virtual Log_event_type get_type_code() { return IGNORABLE_LOG_EVENT; } + bool is_valid() const override { return 1; } - virtual bool is_valid() const { return 1; } - - virtual int get_data_size() { return IGNORABLE_HEADER_LEN; } + int get_data_size() override { return IGNORABLE_HEADER_LEN; } }; #ifdef MYSQL_CLIENT @@ -5803,8 +5821,8 @@ public: uint8 hb_flags; Heartbeat_log_event(const uchar *buf, uint event_len, const Format_description_log_event* description_event); - Log_event_type get_type_code() { return HEARTBEAT_LOG_EVENT; } - bool is_valid() const + Log_event_type get_type_code() override { return HEARTBEAT_LOG_EVENT; } + bool is_valid() const override { return (log_ident != NULL && ident_len <= FN_REFLEN-1 && log_pos >= BIN_LOG_HEADER_SIZE); diff --git a/sql/log_event_old.h b/sql/log_event_old.h index 1281cb952ae..f763bd5e5dc 100644 --- a/sql/log_event_old.h +++ b/sql/log_event_old.h @@ -111,12 +111,12 @@ public: flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + void pack_info(Protocol *protocol) override; #endif #ifdef MYSQL_CLIENT /* not for direct call, each derived has its own ::print() */ - virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0; + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override= 0; #endif #ifndef MYSQL_CLIENT @@ -127,16 +127,19 @@ public: #endif /* Member functions to implement superclass interface */ - virtual int get_data_size(); + int get_data_size() override; MY_BITMAP const *get_cols() const { return &m_cols; } size_t get_width() const { return m_width; } ulonglong get_table_id() const { return m_table_id; } #ifndef MYSQL_CLIENT - virtual bool write_data_header(); - virtual bool write_data_body(); - virtual const char *get_db() { return m_table->s->db.str; } + bool write_data_header() override; + bool write_data_body() override; + const char *get_db() override { return m_table->s->db.str; } +#ifdef HAVE_REPLICATION + bool is_part_of_group() override { return 1; } +#endif #endif /* Check that malloc() succeeded in allocating memory for the rows @@ -144,11 +147,10 @@ public: is valid is done in the Update_rows_log_event_old::is_valid() function. */ - virtual bool is_valid() const + bool is_valid() const override { return m_rows_buf && m_cols.bitmap; } - bool is_part_of_group() { return 1; } uint m_row_count; /* The number of rows added to the event */ @@ -215,9 +217,9 @@ protected: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int do_apply_event(rpl_group_info *rgi); - virtual int do_update_pos(rpl_group_info *rgi); - virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi); + int do_apply_event(rpl_group_info *rgi) override; + int do_update_pos(rpl_group_info *rgi) override; + enum_skip_reason do_shall_skip(rpl_group_info *rgi) override; /* Primitive to prepare for a sequence of row executions. @@ -379,13 +381,13 @@ public: private: #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif /********** END OF CUT & PASTE FROM Write_rows_log_event **********/ @@ -397,19 +399,19 @@ public: }; private: - virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) // use old definition of do_apply_event() - virtual int do_apply_event(rpl_group_info *rgi) + int do_apply_event(rpl_group_info *rgi) override { return Old_rows_log_event::do_apply_event(this, rgi); } // primitives for old version of do_apply_event() - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); + int do_before_row_operations(TABLE *table) override; + int do_after_row_operations(TABLE *table, int error) override; virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + uchar const *row_start, uchar const **row_end) override; + int do_exec_row(TABLE *table) override; #endif }; @@ -455,13 +457,13 @@ public: protected: #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ /********** END OF CUT & PASTE FROM Update_rows_log_event **********/ @@ -475,19 +477,19 @@ public: }; private: - virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) // use old definition of do_apply_event() - virtual int do_apply_event(rpl_group_info *rgi) + int do_apply_event(rpl_group_info *rgi) override { return Old_rows_log_event::do_apply_event(this, rgi); } // primitives for old version of do_apply_event() - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); + int do_before_row_operations(TABLE *table) override; + int do_after_row_operations(TABLE *table, int error) override; virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + uchar const *row_start, uchar const **row_end) override; + int do_exec_row(TABLE *table) override; #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ }; @@ -529,13 +531,13 @@ public: protected: #ifdef MYSQL_CLIENT - bool print(FILE *file, PRINT_EVENT_INFO *print_event_info); + bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override; #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int do_before_row_operations(const Slave_reporting_capability *const); - virtual int do_after_row_operations(const Slave_reporting_capability *const,int); - virtual int do_exec_row(rpl_group_info *); + int do_before_row_operations(const Slave_reporting_capability *const) override; + int do_after_row_operations(const Slave_reporting_capability *const,int) override; + int do_exec_row(rpl_group_info *) override; #endif /********** END CUT & PASTE FROM Delete_rows_log_event **********/ @@ -549,19 +551,19 @@ public: }; private: - virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } + Log_event_type get_type_code() override { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) // use old definition of do_apply_event() - virtual int do_apply_event(rpl_group_info *rgi) + int do_apply_event(rpl_group_info *rgi) override { return Old_rows_log_event::do_apply_event(this, rgi); } // primitives for old version of do_apply_event() - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); + int do_before_row_operations(TABLE *table) override; + int do_after_row_operations(TABLE *table, int error) override; virtual int do_prepare_row(THD*, rpl_group_info*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + uchar const *row_start, uchar const **row_end) override; + int do_exec_row(TABLE *table) override; #endif }; diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index e501336ad6d..76633fea0d9 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -8667,6 +8667,7 @@ uint8 Update_rows_log_event::get_trg_event_map() #endif +#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) void Incident_log_event::pack_info(Protocol *protocol) { char buf[256]; @@ -8679,7 +8680,7 @@ void Incident_log_event::pack_info(Protocol *protocol) m_incident, description(), m_message.str); protocol->store(buf, bytes, &my_charset_bin); } - +#endif #if defined(WITH_WSREP) /* @@ -8765,6 +8766,7 @@ Incident_log_event::write_data_body() } +#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) /* Pack info for its unrecognized ignorable event */ void Ignorable_log_event::pack_info(Protocol *protocol) { @@ -8774,7 +8776,7 @@ void Ignorable_log_event::pack_info(Protocol *protocol) number, description); protocol->store(buf, bytes, &my_charset_bin); } - +#endif #if defined(HAVE_REPLICATION) Heartbeat_log_event::Heartbeat_log_event(const uchar *buf, uint event_len, diff --git a/sql/mdl.cc b/sql/mdl.cc index b7eed48adee..6b8c8202c95 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -199,10 +199,10 @@ public: m_current_search_depth(0), m_found_deadlock(FALSE) {} - virtual bool enter_node(MDL_context *node); - virtual void leave_node(MDL_context *node); + bool enter_node(MDL_context *node) override; + void leave_node(MDL_context *node) override; - virtual bool inspect_edge(MDL_context *dest); + bool inspect_edge(MDL_context *dest) override; MDL_context *get_victim() const { return m_victim; } private: @@ -434,11 +434,11 @@ public: struct MDL_scoped_lock : public MDL_lock_strategy { MDL_scoped_lock() = default; - virtual const bitmap_t *incompatible_granted_types_bitmap() const + const bitmap_t *incompatible_granted_types_bitmap() const override { return m_granted_incompatible; } - virtual const bitmap_t *incompatible_waiting_types_bitmap() const + const bitmap_t *incompatible_waiting_types_bitmap() const override { return m_waiting_incompatible; } - virtual bool needs_notification(const MDL_ticket *ticket) const + bool needs_notification(const MDL_ticket *ticket) const override { return (ticket->get_type() == MDL_SHARED); } /** @@ -449,14 +449,14 @@ public: insert delayed. We need to kill such threads in order to get global shared lock. We do this my calling code outside of MDL. */ - virtual bool conflicting_locks(const MDL_ticket *ticket) const + bool conflicting_locks(const MDL_ticket *ticket) const override { return ticket->get_type() == MDL_INTENTION_EXCLUSIVE; } /* In scoped locks, only IX lock request would starve because of X/S. But that is practically very rare case. So just return 0 from this function. */ - virtual bitmap_t hog_lock_types_bitmap() const + bitmap_t hog_lock_types_bitmap() const override { return 0; } private: static const bitmap_t m_granted_incompatible[MDL_TYPE_END]; @@ -471,11 +471,11 @@ public: struct MDL_object_lock : public MDL_lock_strategy { MDL_object_lock() = default; - virtual const bitmap_t *incompatible_granted_types_bitmap() const + const bitmap_t *incompatible_granted_types_bitmap() const override { return m_granted_incompatible; } - virtual const bitmap_t *incompatible_waiting_types_bitmap() const + const bitmap_t *incompatible_waiting_types_bitmap() const override { return m_waiting_incompatible; } - virtual bool needs_notification(const MDL_ticket *ticket) const + bool needs_notification(const MDL_ticket *ticket) const override { return (MDL_BIT(ticket->get_type()) & (MDL_BIT(MDL_SHARED_NO_WRITE) | @@ -491,7 +491,7 @@ public: lock or some other non-MDL resource we might need to wake it up by calling code outside of MDL. */ - virtual bool conflicting_locks(const MDL_ticket *ticket) const + bool conflicting_locks(const MDL_ticket *ticket) const override { return ticket->get_type() < MDL_SHARED_UPGRADABLE; } /* @@ -499,7 +499,7 @@ public: max_write_lock_count times in a row while other lock types are waiting. */ - virtual bitmap_t hog_lock_types_bitmap() const + bitmap_t hog_lock_types_bitmap() const override { return (MDL_BIT(MDL_SHARED_NO_WRITE) | MDL_BIT(MDL_SHARED_NO_READ_WRITE) | @@ -515,11 +515,11 @@ public: struct MDL_backup_lock: public MDL_lock_strategy { MDL_backup_lock() = default; - virtual const bitmap_t *incompatible_granted_types_bitmap() const + const bitmap_t *incompatible_granted_types_bitmap() const override { return m_granted_incompatible; } - virtual const bitmap_t *incompatible_waiting_types_bitmap() const + const bitmap_t *incompatible_waiting_types_bitmap() const override { return m_waiting_incompatible; } - virtual bool needs_notification(const MDL_ticket *ticket) const + bool needs_notification(const MDL_ticket *ticket) const override { return (MDL_BIT(ticket->get_type()) & MDL_BIT(MDL_BACKUP_FTWRL1)); } @@ -529,7 +529,7 @@ public: We need to kill such threads in order to get lock for FTWRL statements. We do this by calling code outside of MDL. */ - virtual bool conflicting_locks(const MDL_ticket *ticket) const + bool conflicting_locks(const MDL_ticket *ticket) const override { return (MDL_BIT(ticket->get_type()) & (MDL_BIT(MDL_BACKUP_DML) | @@ -541,7 +541,7 @@ public: BACKUP statements. This scenario is partically useless in real world, so we just return 0 here. */ - virtual bitmap_t hog_lock_types_bitmap() const + bitmap_t hog_lock_types_bitmap() const override { return 0; } private: static const bitmap_t m_granted_incompatible[MDL_BACKUP_END]; diff --git a/sql/mdl.h b/sql/mdl.h index d1ece7979cd..fad81ce9249 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -726,8 +726,8 @@ public: bool is_incompatible_when_waiting(enum_mdl_type type) const; /** Implement MDL_wait_for_subgraph interface. */ - virtual bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor); - virtual uint get_deadlock_weight() const; + bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor) override; + uint get_deadlock_weight() const override; /** Status of lock request represented by the ticket as reflected in P_S. */ diff --git a/sql/multi_range_read.h b/sql/multi_range_read.h index 5e7879d9226..32b23c912c1 100644 --- a/sql/multi_range_read.h +++ b/sql/multi_range_read.h @@ -247,11 +247,11 @@ public: void *seq_init_param, uint n_ranges, uint mode, Key_parameters *key_par, Lifo_buffer *key_buffer, - Buffer_manager *buf_manager_arg); - int get_next(range_id_t *range_info); - int refill_buffer(bool initial) { return initial? 0: HA_ERR_END_OF_FILE; } - uchar *get_rowid_ptr() { return file->ref; } - bool skip_record(range_id_t range_id, uchar *rowid) + Buffer_manager *buf_manager_arg) override; + int get_next(range_id_t *range_info) override; + int refill_buffer(bool initial) override { return initial? 0: HA_ERR_END_OF_FILE; } + uchar *get_rowid_ptr() override { return file->ref; } + bool skip_record(range_id_t range_id, uchar *rowid) override { return (file->mrr_funcs.skip_record && file->mrr_funcs.skip_record(file->mrr_iter, range_id, rowid)); @@ -270,12 +270,12 @@ public: void *seq_init_param, uint n_ranges, uint mode, Key_parameters *key_par, Lifo_buffer *key_buffer, - Buffer_manager *buf_manager_arg); - int get_next(range_id_t *range_info); - int refill_buffer(bool initial); - uchar *get_rowid_ptr() { return file->ref; } + Buffer_manager *buf_manager_arg) override; + int get_next(range_id_t *range_info) override; + int refill_buffer(bool initial) override; + uchar *get_rowid_ptr() override { return file->ref; } - bool skip_record(range_id_t range_info, uchar *rowid) + bool skip_record(range_id_t range_info, uchar *rowid) override { return (mrr_funcs.skip_record && mrr_funcs.skip_record(mrr_iter, range_info, rowid)); @@ -292,9 +292,9 @@ public: uchar **space_start, uchar *space_end); void set_no_interruption_temp_buffer(); - void interrupt_read(); - void resume_read(); - void position(); + void interrupt_read() override; + void resume_read() override; + void position() override; private: Key_value_records_iterator kv_it; @@ -365,8 +365,8 @@ class Mrr_ordered_rndpos_reader : public Mrr_reader public: int init(handler *file, Mrr_index_reader *index_reader, uint mode, Lifo_buffer *buf, Rowid_filter *filter); - int get_next(range_id_t *range_info); - int refill_buffer(bool initial); + int get_next(range_id_t *range_info) override; + int refill_buffer(bool initial) override; private: handler *file; /* Handler to use */ diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ea0a0d70807..a37b29f6547 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2270,10 +2270,10 @@ public: TRP_RANGE(SEL_ARG *key_arg, uint idx_arg, uint mrr_flags_arg) : key(key_arg), key_idx(idx_arg), mrr_flags(mrr_flags_arg) {} - virtual ~TRP_RANGE() = default; /* Remove gcc warning */ + ~TRP_RANGE() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc) + MEM_ROOT *parent_alloc) override { DBUG_ENTER("TRP_RANGE::make_quick"); QUICK_RANGE_SELECT *quick; @@ -2286,7 +2286,7 @@ public: DBUG_RETURN(quick); } void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; void TRP_RANGE::trace_basic_info(PARAM *param, @@ -2318,9 +2318,9 @@ class TRP_ROR_INTERSECT : public TABLE_READ_PLAN { public: TRP_ROR_INTERSECT() = default; /* Remove gcc warning */ - virtual ~TRP_ROR_INTERSECT() = default; /* Remove gcc warning */ + ~TRP_ROR_INTERSECT() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc); + MEM_ROOT *parent_alloc) override; /* Array of pointers to ROR range scans used in this intersection */ struct st_ror_scan_info **first_scan; @@ -2329,7 +2329,7 @@ public: bool is_covering; /* TRUE if no row retrieval phase is necessary */ double index_scan_costs; /* SUM(cost(index_scan)) */ void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; @@ -2344,13 +2344,13 @@ class TRP_ROR_UNION : public TABLE_READ_PLAN { public: TRP_ROR_UNION() = default; /* Remove gcc warning */ - virtual ~TRP_ROR_UNION() = default; /* Remove gcc warning */ + ~TRP_ROR_UNION() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc); + MEM_ROOT *parent_alloc) override; TABLE_READ_PLAN **first_ror; /* array of ptrs to plans for merged scans */ TABLE_READ_PLAN **last_ror; /* end of the above array */ void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; void TRP_ROR_UNION::trace_basic_info(PARAM *param, @@ -2377,15 +2377,15 @@ class TRP_INDEX_INTERSECT : public TABLE_READ_PLAN { public: TRP_INDEX_INTERSECT() = default; /* Remove gcc warning */ - virtual ~TRP_INDEX_INTERSECT() = default; /* Remove gcc warning */ + ~TRP_INDEX_INTERSECT() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc); + MEM_ROOT *parent_alloc) override; TRP_RANGE **range_scans; /* array of ptrs to plans of intersected scans */ TRP_RANGE **range_scans_end; /* end of the array */ /* keys whose scans are to be filtered by cpk conditions */ key_map filtered_scans; void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; @@ -2414,13 +2414,13 @@ class TRP_INDEX_MERGE : public TABLE_READ_PLAN { public: TRP_INDEX_MERGE() = default; /* Remove gcc warning */ - virtual ~TRP_INDEX_MERGE() = default; /* Remove gcc warning */ + ~TRP_INDEX_MERGE() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc); + MEM_ROOT *parent_alloc) override; TRP_RANGE **range_scans; /* array of ptrs to plans of merged scans */ TRP_RANGE **range_scans_end; /* end of the array */ void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; void TRP_INDEX_MERGE::trace_basic_info(PARAM *param, @@ -2482,13 +2482,13 @@ public: if (key_infix_len) memcpy(this->key_infix, key_infix_arg, key_infix_len); } - virtual ~TRP_GROUP_MIN_MAX() = default; /* Remove gcc warning */ + ~TRP_GROUP_MIN_MAX() override = default; /* Remove gcc warning */ QUICK_SELECT_I *make_quick(PARAM *param, bool retrieve_full_rows, - MEM_ROOT *parent_alloc); + MEM_ROOT *parent_alloc) override; void use_index_scan() { is_index_scan= TRUE; } void trace_basic_info(PARAM *param, - Json_writer_object *trace_object) const; + Json_writer_object *trace_object) const override; }; diff --git a/sql/opt_range.h b/sql/opt_range.h index f6ffde5a6b7..b9792ad5f38 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -741,7 +741,6 @@ public: { return thd->killed || - thd->is_fatal_error || thd->is_error() || alloced_sel_args > thd->variables.optimizer_max_sel_args; } @@ -1167,28 +1166,28 @@ public: { return new QUICK_RANGE_SELECT(thd, head, index, no_alloc, parent_alloc, create_error); } - void need_sorted_output(); - int init(); - int reset(void); - int get_next(); - void range_end(); + void need_sorted_output() override; + int init() override; + int reset(void) override; + int get_next() override; + void range_end() override; int get_next_prefix(uint prefix_length, uint group_key_parts, uchar *cur_prefix); - bool reverse_sorted() { return 0; } - bool unique_key_range(); - int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc); - void save_last_pos() + bool reverse_sorted() override { return 0; } + bool unique_key_range() override; + int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc) override; + void save_last_pos() override { file->position(record); } - int get_type() { return QS_TYPE_RANGE; } - void add_keys_and_lengths(String *key_names, String *used_lengths); - Explain_quick_select *get_explain(MEM_ROOT *alloc); + int get_type() override { return QS_TYPE_RANGE; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; #ifndef DBUG_OFF - void dbug_dump(int indent, bool verbose); + void dbug_dump(int indent, bool verbose) override; #endif - virtual void replace_handler(handler *new_file) { file= new_file; } - QUICK_SELECT_I *make_reverse(uint used_key_parts_arg); + void replace_handler(handler *new_file) override { file= new_file; } + QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) override; - virtual void add_used_key_part_to_set(); + void add_used_key_part_to_set() override; private: /* Default copy ctor used by QUICK_SELECT_DESC */ @@ -1236,13 +1235,13 @@ public: :QUICK_RANGE_SELECT(thd, table, index_arg, no_alloc, parent_alloc, create_err) {}; - virtual QUICK_RANGE_SELECT *clone(bool *create_error) + QUICK_RANGE_SELECT *clone(bool *create_error) override { DBUG_ASSERT(0); return new QUICK_RANGE_SELECT_GEOM(thd, head, index, no_alloc, parent_alloc, create_error); } - virtual int get_next(); + int get_next() override; }; @@ -1318,16 +1317,16 @@ public: QUICK_INDEX_SORT_SELECT(THD *thd, TABLE *table); ~QUICK_INDEX_SORT_SELECT(); - int init(); - void need_sorted_output() { DBUG_ASSERT(0); /* Can't do it */ } - int reset(void); - bool reverse_sorted() { return false; } - bool unique_key_range() { return false; } - bool is_keys_used(const MY_BITMAP *fields); + int init() override; + void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ } + int reset(void) override; + bool reverse_sorted() override { return false; } + bool unique_key_range() override { return false; } + bool is_keys_used(const MY_BITMAP *fields) override; #ifndef DBUG_OFF - void dbug_dump(int indent, bool verbose); + void dbug_dump(int indent, bool verbose) override; #endif - Explain_quick_select *get_explain(MEM_ROOT *alloc); + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; bool push_quick_back(QUICK_RANGE_SELECT *quick_sel_range); @@ -1339,7 +1338,7 @@ public: MEM_ROOT alloc; THD *thd; - virtual bool is_valid() + bool is_valid() override { List_iterator_fast it(quick_selects); QUICK_RANGE_SELECT *quick; @@ -1358,7 +1357,7 @@ public: /* used to get rows collected in Unique */ READ_RECORD read_record; - virtual void add_used_key_part_to_set(); + void add_used_key_part_to_set() override; }; @@ -1369,31 +1368,31 @@ private: /* true if this select is currently doing a clustered PK scan */ bool doing_pk_scan; protected: - int read_keys_and_merge(); + int read_keys_and_merge() override; public: QUICK_INDEX_MERGE_SELECT(THD *thd_arg, TABLE *table) :QUICK_INDEX_SORT_SELECT(thd_arg, table) {} - int get_next(); - int get_type() { return QS_TYPE_INDEX_MERGE; } - void add_keys_and_lengths(String *key_names, String *used_lengths); + int get_next() override; + int get_type() override { return QS_TYPE_INDEX_MERGE; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; }; class QUICK_INDEX_INTERSECT_SELECT : public QUICK_INDEX_SORT_SELECT { protected: - int read_keys_and_merge(); + int read_keys_and_merge() override; public: QUICK_INDEX_INTERSECT_SELECT(THD *thd_arg, TABLE *table) :QUICK_INDEX_SORT_SELECT(thd_arg, table) {} key_map filtered_scans; - int get_next(); - int get_type() { return QS_TYPE_INDEX_INTERSECT; } - void add_keys_and_lengths(String *key_names, String *used_lengths); - Explain_quick_select *get_explain(MEM_ROOT *alloc); + int get_next() override; + int get_type() override { return QS_TYPE_INDEX_INTERSECT; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; }; @@ -1423,21 +1422,21 @@ public: MEM_ROOT *parent_alloc); ~QUICK_ROR_INTERSECT_SELECT(); - int init(); - void need_sorted_output() { DBUG_ASSERT(0); /* Can't do it */ } - int reset(void); - int get_next(); - bool reverse_sorted() { return false; } - bool unique_key_range() { return false; } - int get_type() { return QS_TYPE_ROR_INTERSECT; } - void add_keys_and_lengths(String *key_names, String *used_lengths); - Explain_quick_select *get_explain(MEM_ROOT *alloc); - bool is_keys_used(const MY_BITMAP *fields); - void add_used_key_part_to_set(); + int init() override; + void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ } + int reset(void) override; + int get_next() override; + bool reverse_sorted() override { return false; } + bool unique_key_range() override { return false; } + int get_type() override { return QS_TYPE_ROR_INTERSECT; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; + bool is_keys_used(const MY_BITMAP *fields) override; + void add_used_key_part_to_set() override; #ifndef DBUG_OFF - void dbug_dump(int indent, bool verbose); + void dbug_dump(int indent, bool verbose) override; #endif - int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc); + int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc) override; bool push_quick_back(MEM_ROOT *alloc, QUICK_RANGE_SELECT *quick_sel_range); class QUICK_SELECT_WITH_RECORD : public Sql_alloc @@ -1454,7 +1453,7 @@ public: */ List quick_selects; - virtual bool is_valid() + bool is_valid() override { List_iterator_fast it(quick_selects); QUICK_SELECT_WITH_RECORD *quick; @@ -1503,26 +1502,26 @@ public: QUICK_ROR_UNION_SELECT(THD *thd, TABLE *table); ~QUICK_ROR_UNION_SELECT(); - int init(); - void need_sorted_output() { DBUG_ASSERT(0); /* Can't do it */ } - int reset(void); - int get_next(); - bool reverse_sorted() { return false; } - bool unique_key_range() { return false; } - int get_type() { return QS_TYPE_ROR_UNION; } - void add_keys_and_lengths(String *key_names, String *used_lengths); - Explain_quick_select *get_explain(MEM_ROOT *alloc); - bool is_keys_used(const MY_BITMAP *fields); - void add_used_key_part_to_set(); + int init() override; + void need_sorted_output() override { DBUG_ASSERT(0); /* Can't do it */ } + int reset(void) override; + int get_next() override; + bool reverse_sorted() override { return false; } + bool unique_key_range() override { return false; } + int get_type() override { return QS_TYPE_ROR_UNION; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; + bool is_keys_used(const MY_BITMAP *fields) override; + void add_used_key_part_to_set() override; #ifndef DBUG_OFF - void dbug_dump(int indent, bool verbose); + void dbug_dump(int indent, bool verbose) override; #endif bool push_quick_back(QUICK_SELECT_I *quick_sel_range); List quick_selects; /* Merged quick selects */ - virtual bool is_valid() + bool is_valid() override { List_iterator_fast it(quick_selects); QUICK_SELECT_I *quick; @@ -1648,21 +1647,21 @@ public: void update_key_stat(); void adjust_prefix_ranges(); bool alloc_buffers(); - int init(); - void need_sorted_output() { /* always do it */ } - int reset(); - int get_next(); - bool reverse_sorted() { return false; } - bool unique_key_range() { return false; } - int get_type() { return QS_TYPE_GROUP_MIN_MAX; } - void add_keys_and_lengths(String *key_names, String *used_lengths); - void add_used_key_part_to_set(); + int init() override; + void need_sorted_output() override { /* always do it */ } + int reset() override; + int get_next() override; + bool reverse_sorted() override { return false; } + bool unique_key_range() override { return false; } + int get_type() override { return QS_TYPE_GROUP_MIN_MAX; } + void add_keys_and_lengths(String *key_names, String *used_lengths) override; + void add_used_key_part_to_set() override; #ifndef DBUG_OFF - void dbug_dump(int indent, bool verbose); + void dbug_dump(int indent, bool verbose) override; #endif bool is_agg_distinct() { return have_agg_distinct; } bool loose_scan_is_scanning() { return is_index_scan; } - Explain_quick_select *get_explain(MEM_ROOT *alloc); + Explain_quick_select *get_explain(MEM_ROOT *alloc) override; }; @@ -1670,18 +1669,18 @@ class QUICK_SELECT_DESC: public QUICK_RANGE_SELECT { public: QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts); - virtual QUICK_RANGE_SELECT *clone(bool *create_error) + QUICK_RANGE_SELECT *clone(bool *create_error) override { DBUG_ASSERT(0); return new QUICK_SELECT_DESC(this, used_key_parts); } - int get_next(); - bool reverse_sorted() { return 1; } - int get_type() { return QS_TYPE_RANGE_DESC; } - QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) + int get_next() override; + bool reverse_sorted() override { return 1; } + int get_type() override { return QS_TYPE_RANGE_DESC; } + QUICK_SELECT_I *make_reverse(uint used_key_parts_arg) override { return this; // is already reverse sorted } private: bool range_reads_after_key(QUICK_RANGE *range); - int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); } + int reset(void) override { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); } List rev_ranges; List_iterator rev_it; uint used_key_parts; @@ -1802,12 +1801,12 @@ public: QUICK_RANGE_SELECT (thd, table, key, 1, NULL, create_err) { (void) init(); } ~FT_SELECT() { file->ft_end(); } - virtual QUICK_RANGE_SELECT *clone(bool *create_error) + QUICK_RANGE_SELECT *clone(bool *create_error) override { DBUG_ASSERT(0); return new FT_SELECT(thd, head, index, create_error); } - int init() { return file->ft_init(); } - int reset() { return 0; } - int get_next() { return file->ha_ft_read(record); } - int get_type() { return QS_TYPE_FULLTEXT; } + int init() override { return file->ft_init(); } + int reset() override { return 0; } + int get_next() override { return file->ha_ft_read(record); } + int get_type() override { return QS_TYPE_FULLTEXT; } }; FT_SELECT *get_ft_select(THD *thd, TABLE *table, uint key); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 3e62c205a46..8690acded99 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5849,7 +5849,7 @@ public: select_value_catcher(THD *thd_arg, Item_subselect *item_arg): select_subselect(thd_arg, item_arg) {} - int send_data(List &items); + int send_data(List &items) override; int setup(List *items); bool assigned; /* TRUE <=> we've caught a value */ uint n_elements; /* How many elements we get */ diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index 03a9985708d..feafb680487 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -251,9 +251,9 @@ public: Field *field; /* Field this object is representing */ /* Iteration over unbound modules that are our dependencies */ - Iterator init_unbound_modules_iter(char *buf); + Iterator init_unbound_modules_iter(char *buf) override; Dep_module* get_next_unbound_module(Dep_analysis_context *dac, - Iterator iter); + Iterator iter) override; void make_unbound_modules_iter_skip_keys(Iterator iter); @@ -310,9 +310,9 @@ public: Dep_module_key *keys; /* Ordered list of Unique keys in this table */ /* Iteration over unbound modules that are our dependencies */ - Iterator init_unbound_modules_iter(char *buf); + Iterator init_unbound_modules_iter(char *buf) override; Dep_module* get_next_unbound_module(Dep_analysis_context *dac, - Iterator iter); + Iterator iter) override; static const size_t iterator_size; private: class Module_iter @@ -394,8 +394,8 @@ public: /* Used during condition analysis only, similar to KEYUSE::level */ uint level; - Iterator init_unbound_values_iter(char *buf); - Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter); + Iterator init_unbound_values_iter(char *buf) override; + Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter) override; static const size_t iterator_size; private: class Value_iter @@ -429,8 +429,8 @@ public: /* Unique keys form a linked list, ordered by keyno */ Dep_module_key *next_table_key; - Iterator init_unbound_values_iter(char *buf); - Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter); + Iterator init_unbound_values_iter(char *buf) override; + Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter) override; static const size_t iterator_size; private: class Value_iter @@ -459,18 +459,18 @@ public: { unbound_args= n_children; } - bool is_final() { return TRUE; } + bool is_final() override { return TRUE; } /* This is the goal module, so the running wave algorithm should terminate once it sees that this module is applicable and should never try to apply it, hence no use for unbound value iterator implementation. */ - Iterator init_unbound_values_iter(char *buf) + Iterator init_unbound_values_iter(char *buf) override { DBUG_ASSERT(0); return NULL; } - Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter) + Dep_value* get_next_unbound_value(Dep_analysis_context *dac, Iterator iter) override { DBUG_ASSERT(0); return NULL; @@ -982,7 +982,7 @@ public: Field_dependency_recorder(Dep_analysis_context *ctx_arg): ctx(ctx_arg) {} - void visit_field(Item_field *item) + void visit_field(Item_field *item) override { Field *field= item->field; Dep_value_table *tbl_dep; diff --git a/sql/parse_file.h b/sql/parse_file.h index 0589d628bfc..00132cb77a8 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -68,8 +68,8 @@ class File_parser_dummy_hook: public Unknown_key_hook { public: File_parser_dummy_hook() = default; /* Remove gcc warning */ - virtual bool process_unknown_string(const char *&unknown_key, uchar* base, - MEM_ROOT *mem_root, const char *end); + bool process_unknown_string(const char *&unknown_key, uchar* base, + MEM_ROOT *mem_root, const char *end) override; }; extern File_parser_dummy_hook file_parser_dummy_hook; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index d0285b54928..baff06d60ee 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -159,7 +159,7 @@ int THD::register_slave(uchar *packet, size_t packet_length) return 0; err: - delete si; + my_free(si); my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */ return 1; } diff --git a/sql/rowid_filter.h b/sql/rowid_filter.h index b1bf48904fc..6315302e25d 100644 --- a/sql/rowid_filter.h +++ b/sql/rowid_filter.h @@ -274,9 +274,9 @@ public: ~Range_rowid_filter(); - build_return_code build(); + build_return_code build() override; - bool check(char *elem) + bool check(char *elem) override { if (container->is_empty()) return false; @@ -373,16 +373,16 @@ public: Rowid_filter_sorted_array(uint elems, uint elem_size) : refpos_container(elems, elem_size), is_checked(false) {} - Rowid_filter_container_type get_type() + Rowid_filter_container_type get_type() override { return SORTED_ARRAY_CONTAINER; } - bool alloc() { return refpos_container.alloc(); } + bool alloc() override { return refpos_container.alloc(); } - bool add(void *ctxt, char *elem) { return refpos_container.add(elem); } + bool add(void *ctxt, char *elem) override { return refpos_container.add(elem); } - bool check(void *ctxt, char *elem); + bool check(void *ctxt, char *elem) override; - bool is_empty() { return refpos_container.is_empty(); } + bool is_empty() override { return refpos_container.is_empty(); } }; /** diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 73c61af92c9..faceeb6e325 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -483,7 +483,7 @@ file '%s')", fname); if (init_intvar_from_file(&master_log_pos, &mi->file, 4) || init_strvar_from_file(mi->host, sizeof(mi->host), &mi->file, 0) || init_strvar_from_file(mi->user, sizeof(mi->user), &mi->file, "test") || - init_strvar_from_file(mi->password, SCRAMBLED_PASSWORD_CHAR_LENGTH+1, + init_strvar_from_file(mi->password, sizeof(mi->password), &mi->file, 0) || init_intvar_from_file(&port, &mi->file, MYSQL_PORT) || init_intvar_from_file(&connect_retry, &mi->file, diff --git a/sql/session_tracker.h b/sql/session_tracker.h index 5715b5837b5..37a4e0cbe89 100644 --- a/sql/session_tracker.h +++ b/sql/session_tracker.h @@ -210,9 +210,9 @@ class Session_sysvars_tracker: public State_tracker public: void init(THD *thd); void deinit(THD *thd); - bool enable(THD *thd); - bool update(THD *thd, set_var *var); - bool store(THD *thd, String *buf); + bool enable(THD *thd) override; + bool update(THD *thd, set_var *var) override; + bool store(THD *thd, String *buf) override; void mark_as_changed(THD *thd, const sys_var *var); void deinit() { orig_list.deinit(); } /* callback */ @@ -237,8 +237,8 @@ bool sysvartrack_global_update(THD *thd, char *str, size_t len); class Current_schema_tracker: public State_tracker { public: - bool update(THD *thd, set_var *var); - bool store(THD *thd, String *buf); + bool update(THD *thd, set_var *var) override; + bool store(THD *thd, String *buf) override; }; @@ -259,8 +259,8 @@ public: class Session_state_change_tracker: public State_tracker { public: - bool update(THD *thd, set_var *var); - bool store(THD *thd, String *buf); + bool update(THD *thd, set_var *var) override; + bool store(THD *thd, String *buf) override; }; @@ -329,7 +329,7 @@ class Transaction_state_tracker : public State_tracker enum_tx_state calc_trx_state(THD *thd, thr_lock_type l, bool has_trx); public: - bool enable(THD *thd) + bool enable(THD *thd) override { m_enabled= false; tx_changed= TX_CHG_NONE; @@ -340,8 +340,8 @@ public: return State_tracker::enable(thd); } - bool update(THD *thd, set_var *var); - bool store(THD *thd, String *buf); + bool update(THD *thd, set_var *var) override; + bool store(THD *thd, String *buf) override; /** Change transaction characteristics */ void set_read_flags(THD *thd, enum enum_tx_read_flags flags); diff --git a/sql/set_var.h b/sql/set_var.h index ce1d01b9bd2..c8da3c1c169 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -326,11 +326,11 @@ public: set_var(THD *thd, enum_var_type type_arg, sys_var *var_arg, const LEX_CSTRING *base_name_arg, Item *value_arg); - virtual bool is_system() { return 1; } - int check(THD *thd); - int update(THD *thd); - int light_check(THD *thd); - virtual bool is_var_optimizer_trace() const + bool is_system() override { return 1; } + int check(THD *thd) override; + int update(THD *thd) override; + int light_check(THD *thd) override; + bool is_var_optimizer_trace() const override { extern sys_var *Sys_optimizer_trace_ptr; return var == Sys_optimizer_trace_ptr; @@ -346,9 +346,9 @@ public: set_var_user(Item_func_set_user_var *item) :user_var_item(item) {} - int check(THD *thd); - int update(THD *thd); - int light_check(THD *thd); + int check(THD *thd) override; + int update(THD *thd) override; + int light_check(THD *thd) override; }; /* For SET PASSWORD */ @@ -359,8 +359,8 @@ class set_var_password: public set_var_base public: set_var_password(LEX_USER *user_arg) :user(user_arg) {} - int check(THD *thd); - int update(THD *thd); + int check(THD *thd) override; + int update(THD *thd) override; }; /* For SET ROLE */ @@ -371,8 +371,8 @@ class set_var_role: public set_var_base privilege_t access; public: set_var_role(LEX_CSTRING role_arg) : role(role_arg), access(NO_ACL) {} - int check(THD *thd); - int update(THD *thd); + int check(THD *thd) override; + int update(THD *thd) override; }; /* For SET DEFAULT ROLE */ @@ -385,8 +385,8 @@ class set_var_default_role: public set_var_base public: set_var_default_role(LEX_USER *user_arg, LEX_CSTRING role_arg) : user(user_arg), role(role_arg) {} - int check(THD *thd); - int update(THD *thd); + int check(THD *thd) override; + int update(THD *thd) override; }; /* For SET NAMES and SET CHARACTER SET */ @@ -404,8 +404,8 @@ public: character_set_results(result_coll_arg), collation_connection(connection_coll_arg) {} - int check(THD *thd); - int update(THD *thd); + int check(THD *thd) override; + int update(THD *thd) override; }; diff --git a/sql/sp.cc b/sql/sp.cc index 72c7fd180ee..eb1dbb8b10f 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -255,7 +255,7 @@ public: load_from_db(THD *thd, const Database_qualified_name *name, TABLE *proc_tbl); public: - virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) + Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) override { return new (mem_root) Stored_routine_creation_ctx(m_client_cs, m_connection_cl, @@ -263,7 +263,7 @@ public: } protected: - virtual Object_creation_ctx *create_backup_ctx(THD *thd) const + Object_creation_ctx *create_backup_ctx(THD *thd) const override { DBUG_ENTER("Stored_routine_creation_ctx::create_backup_ctx"); DBUG_RETURN(new Stored_routine_creation_ctx(thd)); @@ -431,7 +431,7 @@ public: Proc_table_intact() : m_print_once(TRUE) { has_keys= TRUE; } protected: - void report_error(uint code, const char *fmt, ...); + void report_error(uint code, const char *fmt, ...) override; }; @@ -807,12 +807,12 @@ Sp_handler::db_find_and_cache_routine(THD *thd, struct Silence_deprecated_warning : public Internal_error_handler { public: - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; }; bool @@ -902,12 +902,12 @@ public: :m_error_caught(false) {} - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* message, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; bool error_caught() const { return m_error_caught; } @@ -1716,7 +1716,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || diff --git a/sql/sp.h b/sql/sp.h index 698b576e40e..050b56d85a9 100644 --- a/sql/sp.h +++ b/sql/sp.h @@ -249,33 +249,33 @@ public: class Sp_handler_procedure: public Sp_handler { public: - enum_sp_type type() const { return SP_TYPE_PROCEDURE; } - LEX_CSTRING type_lex_cstring() const + enum_sp_type type() const override { return SP_TYPE_PROCEDURE; } + LEX_CSTRING type_lex_cstring() const override { static LEX_CSTRING m_type_str= { STRING_WITH_LEN("PROCEDURE")}; return m_type_str; } - LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const; - const char *show_create_routine_col1_caption() const + LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override; + const char *show_create_routine_col1_caption() const override { return "Procedure"; } - const char *show_create_routine_col3_caption() const + const char *show_create_routine_col3_caption() const override { return "Create Procedure"; } - MDL_key::enum_mdl_namespace get_mdl_type() const + MDL_key::enum_mdl_namespace get_mdl_type() const override { return MDL_key::PROCEDURE; } - const Sp_handler *package_routine_handler() const; - sp_cache **get_cache(THD *) const; + const Sp_handler *package_routine_handler() const override; + sp_cache **get_cache(THD *) const override; #ifndef NO_EMBEDDED_ACCESS_CHECKS - HASH *get_priv_hash() const; + HASH *get_priv_hash() const override; #endif - ulong recursion_depth(THD *thd) const; - void recursion_level_error(THD *thd, const sp_head *sp) const; - bool add_instr_preturn(THD *thd, sp_head *sp, sp_pcontext *spcont) const; + ulong recursion_depth(THD *thd) const override; + void recursion_level_error(THD *thd, const sp_head *sp) const override; + bool add_instr_preturn(THD *thd, sp_head *sp, sp_pcontext *spcont) const override; }; @@ -283,13 +283,13 @@ class Sp_handler_package_procedure: public Sp_handler_procedure { public: int sp_cache_routine(THD *thd, const Database_qualified_name *name, - sp_head **sp) const + sp_head **sp) const override { return sp_cache_package_routine(thd, name, sp); } sp_head *sp_find_routine(THD *thd, const Database_qualified_name *name, - bool cache_only) const + bool cache_only) const override { return sp_find_package_routine(thd, name, cache_only); } @@ -299,32 +299,32 @@ public: class Sp_handler_function: public Sp_handler { public: - enum_sp_type type() const { return SP_TYPE_FUNCTION; } - LEX_CSTRING type_lex_cstring() const + enum_sp_type type() const override { return SP_TYPE_FUNCTION; } + LEX_CSTRING type_lex_cstring() const override { static LEX_CSTRING m_type_str= { STRING_WITH_LEN("FUNCTION")}; return m_type_str; } - LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const; - const char *show_create_routine_col1_caption() const + LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override; + const char *show_create_routine_col1_caption() const override { return "Function"; } - const char *show_create_routine_col3_caption() const + const char *show_create_routine_col3_caption() const override { return "Create Function"; } - MDL_key::enum_mdl_namespace get_mdl_type() const + MDL_key::enum_mdl_namespace get_mdl_type() const override { return MDL_key::FUNCTION; } - const Sp_handler *package_routine_handler() const; - sp_cache **get_cache(THD *) const; + const Sp_handler *package_routine_handler() const override; + sp_cache **get_cache(THD *) const override; #ifndef NO_EMBEDDED_ACCESS_CHECKS - HASH *get_priv_hash() const; + HASH *get_priv_hash() const override; #endif bool add_instr_freturn(THD *thd, sp_head *sp, sp_pcontext *spcont, - Item *item, LEX *lex) const; + Item *item, LEX *lex) const override; }; @@ -332,13 +332,13 @@ class Sp_handler_package_function: public Sp_handler_function { public: int sp_cache_routine(THD *thd, const Database_qualified_name *name, - sp_head **sp) const + sp_head **sp) const override { return sp_cache_package_routine(thd, name, sp); } sp_head *sp_find_routine(THD *thd, const Database_qualified_name *name, - bool cache_only) const + bool cache_only) const override { return sp_find_package_routine(thd, name, cache_only); } @@ -357,7 +357,7 @@ public: const st_sp_chistics &chistics, const AUTHID &definer, const DDL_options_st ddl_options, - sql_mode_t sql_mode) const; + sql_mode_t sql_mode) const override; }; @@ -366,34 +366,34 @@ class Sp_handler_package_spec: public Sp_handler_package public: // TODO: make it private or protected int sp_find_and_drop_routine(THD *thd, TABLE *table, const Database_qualified_name *name) - const; + const override; public: - enum_sp_type type() const { return SP_TYPE_PACKAGE; } - LEX_CSTRING type_lex_cstring() const + enum_sp_type type() const override { return SP_TYPE_PACKAGE; } + LEX_CSTRING type_lex_cstring() const override { static LEX_CSTRING m_type_str= {STRING_WITH_LEN("PACKAGE")}; return m_type_str; } - LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const + LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override { static LEX_CSTRING m_empty_body= {STRING_WITH_LEN("BEGIN END")}; return m_empty_body; } - const char *show_create_routine_col1_caption() const + const char *show_create_routine_col1_caption() const override { return "Package"; } - const char *show_create_routine_col3_caption() const + const char *show_create_routine_col3_caption() const override { return "Create Package"; } - MDL_key::enum_mdl_namespace get_mdl_type() const + MDL_key::enum_mdl_namespace get_mdl_type() const override { return MDL_key::PACKAGE_BODY; } - sp_cache **get_cache(THD *) const; + sp_cache **get_cache(THD *) const override; #ifndef NO_EMBEDDED_ACCESS_CHECKS - HASH *get_priv_hash() const; + HASH *get_priv_hash() const override; #endif }; @@ -401,32 +401,32 @@ public: class Sp_handler_package_body: public Sp_handler_package { public: - enum_sp_type type() const { return SP_TYPE_PACKAGE_BODY; } - LEX_CSTRING type_lex_cstring() const + enum_sp_type type() const override { return SP_TYPE_PACKAGE_BODY; } + LEX_CSTRING type_lex_cstring() const override { static LEX_CSTRING m_type_str= {STRING_WITH_LEN("PACKAGE BODY")}; return m_type_str; } - LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const + LEX_CSTRING empty_body_lex_cstring(sql_mode_t mode) const override { static LEX_CSTRING m_empty_body= {STRING_WITH_LEN("BEGIN END")}; return m_empty_body; } - const char *show_create_routine_col1_caption() const + const char *show_create_routine_col1_caption() const override { return "Package body"; } - const char *show_create_routine_col3_caption() const + const char *show_create_routine_col3_caption() const override { return "Create Package Body"; } - MDL_key::enum_mdl_namespace get_mdl_type() const + MDL_key::enum_mdl_namespace get_mdl_type() const override { return MDL_key::PACKAGE_BODY; } - sp_cache **get_cache(THD *) const; + sp_cache **get_cache(THD *) const override; #ifndef NO_EMBEDDED_ACCESS_CHECKS - HASH *get_priv_hash() const; + HASH *get_priv_hash() const override; #endif }; @@ -434,18 +434,18 @@ public: class Sp_handler_trigger: public Sp_handler { public: - enum_sp_type type() const { return SP_TYPE_TRIGGER; } - LEX_CSTRING type_lex_cstring() const + enum_sp_type type() const override { return SP_TYPE_TRIGGER; } + LEX_CSTRING type_lex_cstring() const override { static LEX_CSTRING m_type_str= { STRING_WITH_LEN("TRIGGER")}; return m_type_str; } - MDL_key::enum_mdl_namespace get_mdl_type() const + MDL_key::enum_mdl_namespace get_mdl_type() const override { DBUG_ASSERT(0); return MDL_key::TRIGGER; } - const Sp_handler *sp_handler_mysql_proc() const { return NULL; } + const Sp_handler *sp_handler_mysql_proc() const override { return NULL; } }; diff --git a/sql/sp_head.h b/sql/sp_head.h index e07c83f4359..6a1da290620 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -87,7 +87,7 @@ protected: { } protected: - virtual void change_env(THD *thd) const + void change_env(THD *thd) const override { thd->variables.collation_database= m_db_cl; @@ -1044,9 +1044,9 @@ public: return m_routine_implementations.check_dup_qualified(lex->sphead) || m_routine_implementations.push_back(lex, &main_mem_root); } - sp_package *get_package() { return this; } - void init_psi_share(); - bool is_invoked() const + sp_package *get_package() override { return this; } + void init_psi_share() override; + bool is_invoked() const override { /* Cannot flush a package out of the SP cache when: @@ -1081,7 +1081,7 @@ public: Query_arena(thd->lex->sphead->get_main_mem_root(), STMT_INITIALIZED_FOR_SP) { } ~sp_lex_cursor() { free_items(); } - virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override + bool cleanup_stmt(bool /*restore_set_statement_vars*/) override { return false; } Query_arena *query_arena() override { return this; } bool validate() @@ -1359,18 +1359,18 @@ public: virtual ~sp_instr_stmt() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_stmt : public sp_instr @@ -1394,11 +1394,11 @@ public: virtual ~sp_instr_set() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; protected: sp_rcontext *get_rcontext(THD *thd) const; @@ -1408,7 +1408,7 @@ protected: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_set : public sp_instr @@ -1437,9 +1437,9 @@ public: virtual ~sp_instr_set_row_field() = default; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; }; // class sp_instr_set_field : public sp_instr_set @@ -1479,9 +1479,9 @@ public: virtual ~sp_instr_set_row_field_by_name() = default; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; }; // class sp_instr_set_field_by_name : public sp_instr_set @@ -1505,11 +1505,11 @@ public: virtual ~sp_instr_set_trigger_field() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: Item_trigger_field *trigger_field; @@ -1517,7 +1517,7 @@ private: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_trigger_field : public sp_instr @@ -1551,7 +1551,7 @@ public: virtual void set_destination(uint old_dest, uint new_dest) = 0; - virtual uint get_cont_dest() const; + uint get_cont_dest() const override; protected: @@ -1577,17 +1577,17 @@ public: virtual ~sp_instr_jump() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads); + uint opt_mark(sp_head *sp, List *leads) override; - virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start); + uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override; - virtual void opt_move(uint dst, List *ibp); + void opt_move(uint dst, List *ibp) override; - virtual void backpatch(uint dest, sp_pcontext *dst_ctx) + void backpatch(uint dest, sp_pcontext *dst_ctx) override { /* Calling backpatch twice is a logic flaw in jump resolution. */ DBUG_ASSERT(m_dest == 0); @@ -1597,14 +1597,14 @@ public: /** Update the destination; used by the optimizer. */ - virtual void set_destination(uint old_dest, uint new_dest) + void set_destination(uint old_dest, uint new_dest) override { if (m_dest == old_dest) m_dest= new_dest; } public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_jump : public sp_instr_opt_meta @@ -1628,23 +1628,23 @@ public: virtual ~sp_instr_jump_if_not() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads); + uint opt_mark(sp_head *sp, List *leads) override; /** Override sp_instr_jump's shortcut; we stop here */ - virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) + uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override { return m_ip; } - virtual void opt_move(uint dst, List *ibp); + void opt_move(uint dst, List *ibp) override; - virtual void set_destination(uint old_dest, uint new_dest) + void set_destination(uint old_dest, uint new_dest) override { sp_instr_jump::set_destination(old_dest, new_dest); if (m_cont_dest == old_dest) @@ -1657,7 +1657,7 @@ private: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_jump_if_not : public sp_instr_jump @@ -1675,18 +1675,18 @@ public: virtual ~sp_instr_preturn() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads) + uint opt_mark(sp_head *sp, List *leads) override { marked= 1; return UINT_MAX; } public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_preturn : public sp_instr @@ -1706,13 +1706,13 @@ public: virtual ~sp_instr_freturn() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads) + uint opt_mark(sp_head *sp, List *leads) override { marked= 1; return UINT_MAX; @@ -1725,7 +1725,7 @@ protected: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_freturn : public sp_instr @@ -1754,19 +1754,19 @@ public: m_handler= NULL; } - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads); + uint opt_mark(sp_head *sp, List *leads) override; /** Override sp_instr_jump's shortcut; we stop here. */ - virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) + uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override { return m_ip; } - virtual void backpatch(uint dest, sp_pcontext *dst_ctx) + void backpatch(uint dest, sp_pcontext *dst_ctx) override { DBUG_ASSERT(!m_dest || !m_opt_hpop); if (!m_dest) @@ -1793,7 +1793,7 @@ private: uint m_frame; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_hpush_jump : public sp_instr_jump @@ -1816,16 +1816,16 @@ public: m_count= count; } - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: uint m_count; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_hpop : public sp_instr @@ -1844,24 +1844,24 @@ public: virtual ~sp_instr_hreturn() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; /* This instruction will not be short cut optimized. */ - virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) + uint opt_shortcut_jump(sp_head *sp, sp_instr *start) override { return m_ip; } - virtual uint opt_mark(sp_head *sp, List *leads); + uint opt_mark(sp_head *sp, List *leads) override; private: uint m_frame; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_hreturn : public sp_instr_jump @@ -1889,7 +1889,7 @@ public: cursor is closed. For now stored procedures always use materialized cursors and the call is not used. */ - virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override + bool cleanup_stmt(bool /*restore_set_statement_vars*/) override { return false; } private: @@ -1920,16 +1920,16 @@ public: m_count= count; } - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: uint m_count; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_cpop : public sp_instr @@ -1947,18 +1947,18 @@ public: virtual ~sp_instr_copen() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: uint m_cursor; ///< Stack index public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_copen : public sp_instr_stmt @@ -1983,12 +1983,12 @@ public: m_var(voffs) {} virtual ~sp_instr_cursor_copy_struct() = default; - virtual int execute(THD *thd, uint *nextp); - virtual int exec_core(THD *thd, uint *nextp); - virtual void print(String *str); + int execute(THD *thd, uint *nextp) override; + int exec_core(THD *thd, uint *nextp) override; + void print(String *str) override; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; @@ -2006,16 +2006,16 @@ public: virtual ~sp_instr_cclose() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; private: uint m_cursor; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_cclose : public sp_instr @@ -2035,9 +2035,9 @@ public: virtual ~sp_instr_cfetch() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; void add_to_varlist(sp_variable *var) { @@ -2051,7 +2051,7 @@ private: bool m_error_on_no_data; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_cfetch : public sp_instr @@ -2073,12 +2073,12 @@ public: virtual ~sp_instr_agg_cfetch() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_agg_cfetch : public sp_instr @@ -2098,11 +2098,11 @@ public: virtual ~sp_instr_error() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads) + uint opt_mark(sp_head *sp, List *leads) override { marked= 1; return UINT_MAX; @@ -2113,7 +2113,7 @@ private: int m_errcode; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_error : public sp_instr @@ -2131,17 +2131,17 @@ public: virtual ~sp_instr_set_case_expr() = default; - virtual int execute(THD *thd, uint *nextp); + int execute(THD *thd, uint *nextp) override; - virtual int exec_core(THD *thd, uint *nextp); + int exec_core(THD *thd, uint *nextp) override; - virtual void print(String *str); + void print(String *str) override; - virtual uint opt_mark(sp_head *sp, List *leads); + uint opt_mark(sp_head *sp, List *leads) override; - virtual void opt_move(uint dst, List *ibp); + void opt_move(uint dst, List *ibp) override; - virtual void set_destination(uint old_dest, uint new_dest) + void set_destination(uint old_dest, uint new_dest) override { if (m_cont_dest == old_dest) m_cont_dest= new_dest; @@ -2154,7 +2154,7 @@ private: sp_lex_keeper m_lex_keeper; public: - virtual PSI_statement_info* get_psi_info() { return & psi_info; } + PSI_statement_info* get_psi_info() override { return & psi_info; } static PSI_statement_info psi_info; }; // class sp_instr_set_case_expr : public sp_instr_opt_meta diff --git a/sql/spatial.h b/sql/spatial.h index d85bdc86af4..d775e14aea4 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -397,14 +397,14 @@ class Gis_point: public Geometry public: Gis_point() = default; /* Remove gcc warning */ virtual ~Gis_point() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; int get_xy(double *x, double *y) const { @@ -427,7 +427,7 @@ public: return 1; } - int get_x(double *x) const + int get_x(double *x) const override { if (no_data(m_data, SIZEOF_STORED_DOUBLE)) return 1; @@ -435,7 +435,7 @@ public: return 0; } - int get_y(double *y) const + int get_y(double *y) const override { const char *data= m_data; if (no_data(data, SIZEOF_STORED_DOUBLE * 2)) return 1; @@ -443,16 +443,16 @@ public: return 0; } - int geom_length(double *len, const char **end) const; - int area(double *ar, const char **end) const; - bool dimension(uint32 *dim, const char **end) const + int geom_length(double *len, const char **end) const override; + int area(double *ar, const char **end) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 0; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; double calculate_haversine(const Geometry *g, const double sphere_radius, int *error); int spherical_distance_multipoints(Geometry *g, const double r, double *result, @@ -467,29 +467,29 @@ class Gis_line_string: public Geometry public: Gis_line_string() = default; /* Remove gcc warning */ virtual ~Gis_line_string() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int geom_length(double *len, const char **end) const; - int area(double *ar, const char **end) const; - int is_closed(int *closed) const; - int num_points(uint32 *n_points) const; - int start_point(String *point) const; - int end_point(String *point) const; - int point_n(uint32 n, String *result) const; - bool dimension(uint32 *dim, const char **end) const + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int geom_length(double *len, const char **end) const override; + int area(double *ar, const char **end) const override; + int is_closed(int *closed) const override; + int num_points(uint32 *n_points) const override; + int start_point(String *point) const override; + int end_point(String *point) const override; + int point_n(uint32 n, String *result) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 1; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; }; @@ -500,29 +500,29 @@ class Gis_polygon: public Geometry public: Gis_polygon() = default; /* Remove gcc warning */ virtual ~Gis_polygon() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint res_len); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + uint init_from_opresult(String *bin, const char *opres, uint res_len) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int area(double *ar, const char **end) const; - int exterior_ring(String *result) const; - int num_interior_ring(uint32 *n_int_rings) const; - int interior_ring_n(uint32 num, String *result) const; + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int area(double *ar, const char **end) const override; + int exterior_ring(String *result) const override; + int num_interior_ring(uint32 *n_int_rings) const override; + int interior_ring_n(uint32 num, String *result) const override; int centroid_xy(double *x, double *y) const; - int centroid(String *result) const; - bool dimension(uint32 *dim, const char **end) const + int centroid(String *result) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 2; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; }; @@ -537,25 +537,25 @@ class Gis_multi_point: public Geometry public: Gis_multi_point() = default; /* Remove gcc warning */ virtual ~Gis_multi_point() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint res_len); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + uint init_from_opresult(String *bin, const char *opres, uint res_len) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int num_geometries(uint32 *num) const; - int geometry_n(uint32 num, String *result) const; - bool dimension(uint32 *dim, const char **end) const + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int num_geometries(uint32 *num) const override; + int geometry_n(uint32 num, String *result) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 0; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; int spherical_distance_multipoints(Geometry *g, const double r, double *res, int *error); }; @@ -568,27 +568,27 @@ class Gis_multi_line_string: public Geometry public: Gis_multi_line_string() = default; /* Remove gcc warning */ virtual ~Gis_multi_line_string() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint res_len); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + uint init_from_opresult(String *bin, const char *opres, uint res_len) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int num_geometries(uint32 *num) const; - int geometry_n(uint32 num, String *result) const; - int geom_length(double *len, const char **end) const; - int is_closed(int *closed) const; - bool dimension(uint32 *dim, const char **end) const + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int num_geometries(uint32 *num) const override; + int geometry_n(uint32 num, String *result) const override; + int geom_length(double *len, const char **end) const override; + int is_closed(int *closed) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 1; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; }; @@ -599,27 +599,27 @@ class Gis_multi_polygon: public Geometry public: Gis_multi_polygon() = default; /* Remove gcc warning */ virtual ~Gis_multi_polygon() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int num_geometries(uint32 *num) const; - int geometry_n(uint32 num, String *result) const; - int area(double *ar, const char **end) const; - int centroid(String *result) const; - bool dimension(uint32 *dim, const char **end) const + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int num_geometries(uint32 *num) const override; + int geometry_n(uint32 num, String *result) const override; + int area(double *ar, const char **end) const override; + int centroid(String *result) const override; + bool dimension(uint32 *dim, const char **end) const override { *dim= 2; *end= 0; /* No default end */ return 0; } - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; - uint init_from_opresult(String *bin, const char *opres, uint res_len); + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; + uint init_from_opresult(String *bin, const char *opres, uint res_len) override; }; @@ -630,22 +630,22 @@ class Gis_geometry_collection: public Geometry public: Gis_geometry_collection() = default; /* Remove gcc warning */ virtual ~Gis_geometry_collection() = default; /* Remove gcc warning */ - uint32 get_data_size() const; - bool init_from_wkt(Gis_read_stream *trs, String *wkb); - uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); - uint init_from_opresult(String *bin, const char *opres, uint res_len); - bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb); - bool get_data_as_wkt(String *txt, const char **end) const; + uint32 get_data_size() const override; + bool init_from_wkt(Gis_read_stream *trs, String *wkb) override; + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res) override; + uint init_from_opresult(String *bin, const char *opres, uint res_len) override; + bool init_from_json(json_engine_t *je, bool er_on_3D, String *wkb) override; + bool get_data_as_wkt(String *txt, const char **end) const override; bool get_data_as_json(String *txt, uint max_dec_digits, - const char **end) const; - bool get_mbr(MBR *mbr, const char **end) const; - int area(double *ar, const char **end) const; - int geom_length(double *len, const char **end) const; - int num_geometries(uint32 *num) const; - int geometry_n(uint32 num, String *result) const; - bool dimension(uint32 *dim, const char **end) const; - int store_shapes(Gcalc_shape_transporter *trn) const; - const Class_info *get_class_info() const; + const char **end) const override; + bool get_mbr(MBR *mbr, const char **end) const override; + int area(double *ar, const char **end) const override; + int geom_length(double *len, const char **end) const override; + int num_geometries(uint32 *num) const override; + int geometry_n(uint32 num, String *result) const override; + bool dimension(uint32 *dim, const char **end) const override; + int store_shapes(Gcalc_shape_transporter *trn) const override; + const Class_info *get_class_info() const override; }; struct Geometry_buffer : public diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index c5c83046c6a..49bfc6d9b8c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -962,9 +962,9 @@ class User_table_tabular: public User_table { public: - LEX_CSTRING& name() const { return MYSQL_TABLE_NAME_USER; } + LEX_CSTRING& name() const override { return MYSQL_TABLE_NAME_USER; } - int get_auth(THD *thd, MEM_ROOT *root, ACL_USER *u) const + int get_auth(THD *thd, MEM_ROOT *root, ACL_USER *u) const override { mysql_mutex_assert_owner(&acl_cache->lock); u->alloc_auth(root, 1); @@ -1007,7 +1007,7 @@ class User_table_tabular: public User_table return 0; } - bool set_auth(const ACL_USER &u) const + bool set_auth(const ACL_USER &u) const override { if (u.nauth != 1) return 1; @@ -1028,7 +1028,7 @@ class User_table_tabular: public User_table return 0; } - privilege_t get_access() const + privilege_t get_access() const override { privilege_t access(Grant_table_base::get_access()); if ((num_fields() <= 13) && (access & CREATE_ACL)) @@ -1087,7 +1087,7 @@ class User_table_tabular: public User_table return access & GLOBAL_ACLS; } - void set_access(const privilege_t rights, bool revoke) const + void set_access(const privilege_t rights, bool revoke) const override { ulonglong priv(SELECT_ACL); for (uint i= start_priv_columns; i < end_priv_columns; i++, priv <<= 1) @@ -1097,132 +1097,132 @@ class User_table_tabular: public User_table } } - SSL_type get_ssl_type () const + SSL_type get_ssl_type () const override { Field *f= get_field(end_priv_columns, MYSQL_TYPE_ENUM); return (SSL_type)(f ? f->val_int()-1 : 0); } - int set_ssl_type (SSL_type x) const + int set_ssl_type (SSL_type x) const override { if (Field *f= get_field(end_priv_columns, MYSQL_TYPE_ENUM)) return f->store(x+1, 0); else return 1; } - const char* get_ssl_cipher (MEM_ROOT *root) const + const char* get_ssl_cipher (MEM_ROOT *root) const override { Field *f= get_field(end_priv_columns + 1, MYSQL_TYPE_BLOB); return f ? ::get_field(root,f) : 0; } - int set_ssl_cipher (const char *s, size_t l) const + int set_ssl_cipher (const char *s, size_t l) const override { if (Field *f= get_field(end_priv_columns + 1, MYSQL_TYPE_BLOB)) return f->store(s, l, &my_charset_latin1); else return 1; } - const char* get_x509_issuer (MEM_ROOT *root) const + const char* get_x509_issuer (MEM_ROOT *root) const override { Field *f= get_field(end_priv_columns + 2, MYSQL_TYPE_BLOB); return f ? ::get_field(root,f) : 0; } - int set_x509_issuer (const char *s, size_t l) const + int set_x509_issuer (const char *s, size_t l) const override { if (Field *f= get_field(end_priv_columns + 2, MYSQL_TYPE_BLOB)) return f->store(s, l, &my_charset_latin1); else return 1; } - const char* get_x509_subject (MEM_ROOT *root) const + const char* get_x509_subject (MEM_ROOT *root) const override { Field *f= get_field(end_priv_columns + 3, MYSQL_TYPE_BLOB); return f ? ::get_field(root,f) : 0; } - int set_x509_subject (const char *s, size_t l) const + int set_x509_subject (const char *s, size_t l) const override { if (Field *f= get_field(end_priv_columns + 3, MYSQL_TYPE_BLOB)) return f->store(s, l, &my_charset_latin1); else return 1; } - longlong get_max_questions () const + longlong get_max_questions () const override { Field *f= get_field(end_priv_columns + 4, MYSQL_TYPE_LONG); return f ? f->val_int() : 0; } - int set_max_questions (longlong x) const + int set_max_questions (longlong x) const override { if (Field *f= get_field(end_priv_columns + 4, MYSQL_TYPE_LONG)) return f->store(x, 0); else return 1; } - longlong get_max_updates () const + longlong get_max_updates () const override { Field *f= get_field(end_priv_columns + 5, MYSQL_TYPE_LONG); return f ? f->val_int() : 0; } - int set_max_updates (longlong x) const + int set_max_updates (longlong x) const override { if (Field *f= get_field(end_priv_columns + 5, MYSQL_TYPE_LONG)) return f->store(x, 0); else return 1; } - longlong get_max_connections () const + longlong get_max_connections () const override { Field *f= get_field(end_priv_columns + 6, MYSQL_TYPE_LONG); return f ? f->val_int() : 0; } - int set_max_connections (longlong x) const + int set_max_connections (longlong x) const override { if (Field *f= get_field(end_priv_columns + 6, MYSQL_TYPE_LONG)) return f->store(x, 0); else return 1; } - longlong get_max_user_connections () const + longlong get_max_user_connections () const override { Field *f= get_field(end_priv_columns + 7, MYSQL_TYPE_LONG); return f ? f->val_int() : 0; } - int set_max_user_connections (longlong x) const + int set_max_user_connections (longlong x) const override { if (Field *f= get_field(end_priv_columns + 7, MYSQL_TYPE_LONG)) return f->store(x, 0); else return 1; } - double get_max_statement_time () const + double get_max_statement_time () const override { Field *f= get_field(end_priv_columns + 13, MYSQL_TYPE_NEWDECIMAL); return f ? f->val_real() : 0; } - int set_max_statement_time (double x) const + int set_max_statement_time (double x) const override { if (Field *f= get_field(end_priv_columns + 13, MYSQL_TYPE_NEWDECIMAL)) return f->store(x); else return 1; } - bool get_is_role () const + bool get_is_role () const override { Field *f= get_field(end_priv_columns + 11, MYSQL_TYPE_ENUM); return f ? f->val_int()-1 : 0; } - int set_is_role (bool x) const + int set_is_role (bool x) const override { if (Field *f= get_field(end_priv_columns + 11, MYSQL_TYPE_ENUM)) return f->store(x+1, 0); else return 1; } - const char* get_default_role (MEM_ROOT *root) const + const char* get_default_role (MEM_ROOT *root) const override { Field *f= get_field(end_priv_columns + 12, MYSQL_TYPE_STRING); return f ? ::get_field(root,f) : 0; } - int set_default_role (const char *s, size_t l) const + int set_default_role (const char *s, size_t l) const override { if (Field *f= get_field(end_priv_columns + 12, MYSQL_TYPE_STRING)) return f->store(s, l, system_charset_info); @@ -1232,12 +1232,12 @@ class User_table_tabular: public User_table /* On a MariaDB 10.3 user table, the account locking accessors will try to get the content of the max_statement_time column, but they will fail due to the typecheck in get_field. */ - bool get_account_locked () const + bool get_account_locked () const override { Field *f= get_field(end_priv_columns + 13, MYSQL_TYPE_ENUM); return f ? f->val_int()-1 : 0; } - int set_account_locked (bool x) const + int set_account_locked (bool x) const override { if (Field *f= get_field(end_priv_columns + 13, MYSQL_TYPE_ENUM)) return f->store(x+1, 0); @@ -1245,14 +1245,14 @@ class User_table_tabular: public User_table return 1; } - bool get_password_expired () const + bool get_password_expired () const override { uint field_num= end_priv_columns + 10; Field *f= get_field(field_num, MYSQL_TYPE_ENUM); return f ? f->val_int()-1 : 0; } - int set_password_expired (bool x) const + int set_password_expired (bool x) const override { uint field_num= end_priv_columns + 10; @@ -1260,14 +1260,14 @@ class User_table_tabular: public User_table return f->store(x+1, 0); return 1; } - my_time_t get_password_last_changed () const + my_time_t get_password_last_changed () const override { ulong unused_dec; if (Field *f= get_field(end_priv_columns + 11, MYSQL_TYPE_TIMESTAMP2)) return f->get_timestamp(&unused_dec); return 0; } - int set_password_last_changed (my_time_t x) const + int set_password_last_changed (my_time_t x) const override { if (Field *f= get_field(end_priv_columns + 11, MYSQL_TYPE_TIMESTAMP2)) { @@ -1276,7 +1276,7 @@ class User_table_tabular: public User_table } return 1; } - longlong get_password_lifetime () const + longlong get_password_lifetime () const override { if (Field *f= get_field(end_priv_columns + 12, MYSQL_TYPE_SHORT)) { @@ -1286,7 +1286,7 @@ class User_table_tabular: public User_table } return 0; } - int set_password_lifetime (longlong x) const + int set_password_lifetime (longlong x) const override { if (Field *f= get_field(end_priv_columns + 12, MYSQL_TYPE_SHORT)) { @@ -1301,7 +1301,7 @@ class User_table_tabular: public User_table return 1; } - virtual ~User_table_tabular() = default; + ~User_table_tabular() override = default; private: friend class Grant_tables; @@ -1326,7 +1326,7 @@ class User_table_tabular: public User_table return f->real_type() == type ? f : NULL; } - int setup_sysvars() const + int setup_sysvars() const override { username_char_length= MY_MIN(m_table->field[1]->char_length(), USERNAME_CHAR_LENGTH); @@ -1400,9 +1400,9 @@ class User_table_tabular: public User_table */ class User_table_json: public User_table { - LEX_CSTRING& name() const { return MYSQL_TABLE_NAME[USER_TABLE]; } + LEX_CSTRING& name() const override { return MYSQL_TABLE_NAME[USER_TABLE]; } - int get_auth(THD *thd, MEM_ROOT *root, ACL_USER *u) const + int get_auth(THD *thd, MEM_ROOT *root, ACL_USER *u) const override { size_t array_len; const char *array; @@ -1481,7 +1481,7 @@ class User_table_json: public User_table return 0; } - bool set_auth(const ACL_USER &u) const + bool set_auth(const ACL_USER &u) const override { size_t array_len; const char *array; @@ -1606,7 +1606,7 @@ class User_table_json: public User_table return access & ALL_KNOWN_ACL; } - privilege_t get_access() const + privilege_t get_access() const override { ulonglong version_id= (ulonglong) get_int_value("version_id"); ulonglong access= (ulonglong) get_int_value("access"); @@ -1633,7 +1633,7 @@ class User_table_json: public User_table return adjust_access(version_id, access) & GLOBAL_ACLS; } - void set_access(const privilege_t rights, bool revoke) const + void set_access(const privilege_t rights, bool revoke) const override { privilege_t access= get_access(); if (revoke) @@ -1646,77 +1646,77 @@ class User_table_json: public User_table const char *unsafe_str(const char *s) const { return s[0] ? s : NULL; } - SSL_type get_ssl_type () const + SSL_type get_ssl_type () const override { return (SSL_type)get_int_value("ssl_type"); } - int set_ssl_type (SSL_type x) const + int set_ssl_type (SSL_type x) const override { return set_int_value("ssl_type", x); } - const char* get_ssl_cipher (MEM_ROOT *root) const + const char* get_ssl_cipher (MEM_ROOT *root) const override { return unsafe_str(get_str_value(root, "ssl_cipher")); } - int set_ssl_cipher (const char *s, size_t l) const + int set_ssl_cipher (const char *s, size_t l) const override { return set_str_value("ssl_cipher", s, l); } - const char* get_x509_issuer (MEM_ROOT *root) const + const char* get_x509_issuer (MEM_ROOT *root) const override { return unsafe_str(get_str_value(root, "x509_issuer")); } - int set_x509_issuer (const char *s, size_t l) const + int set_x509_issuer (const char *s, size_t l) const override { return set_str_value("x509_issuer", s, l); } - const char* get_x509_subject (MEM_ROOT *root) const + const char* get_x509_subject (MEM_ROOT *root) const override { return unsafe_str(get_str_value(root, "x509_subject")); } - int set_x509_subject (const char *s, size_t l) const + int set_x509_subject (const char *s, size_t l) const override { return set_str_value("x509_subject", s, l); } - longlong get_max_questions () const + longlong get_max_questions () const override { return get_int_value("max_questions"); } - int set_max_questions (longlong x) const + int set_max_questions (longlong x) const override { return set_int_value("max_questions", x); } - longlong get_max_updates () const + longlong get_max_updates () const override { return get_int_value("max_updates"); } - int set_max_updates (longlong x) const + int set_max_updates (longlong x) const override { return set_int_value("max_updates", x); } - longlong get_max_connections () const + longlong get_max_connections () const override { return get_int_value("max_connections"); } - int set_max_connections (longlong x) const + int set_max_connections (longlong x) const override { return set_int_value("max_connections", x); } - longlong get_max_user_connections () const + longlong get_max_user_connections () const override { return get_int_value("max_user_connections"); } - int set_max_user_connections (longlong x) const + int set_max_user_connections (longlong x) const override { return set_int_value("max_user_connections", x); } - double get_max_statement_time () const + double get_max_statement_time () const override { return get_double_value("max_statement_time"); } - int set_max_statement_time (double x) const + int set_max_statement_time (double x) const override { return set_double_value("max_statement_time", x); } - bool get_is_role () const + bool get_is_role () const override { return get_bool_value("is_role"); } - int set_is_role (bool x) const + int set_is_role (bool x) const override { return set_bool_value("is_role", x); } - const char* get_default_role (MEM_ROOT *root) const + const char* get_default_role (MEM_ROOT *root) const override { return get_str_value(root, "default_role"); } - int set_default_role (const char *s, size_t l) const + int set_default_role (const char *s, size_t l) const override { return set_str_value("default_role", s, l); } - bool get_account_locked () const + bool get_account_locked () const override { return get_bool_value("account_locked"); } - int set_account_locked (bool x) const + int set_account_locked (bool x) const override { return set_bool_value("account_locked", x); } - my_time_t get_password_last_changed () const + my_time_t get_password_last_changed () const override { return static_cast(get_int_value("password_last_changed")); } - int set_password_last_changed (my_time_t x) const + int set_password_last_changed (my_time_t x) const override { return set_int_value("password_last_changed", static_cast(x)); } - int set_password_lifetime (longlong x) const + int set_password_lifetime (longlong x) const override { return set_int_value("password_lifetime", x); } - longlong get_password_lifetime () const + longlong get_password_lifetime () const override { return get_int_value("password_lifetime", -1); } /* password_last_changed=0 means the password is manually expired. In MySQL 5.7+ this state is described using the password_expired column in mysql.user */ - bool get_password_expired () const + bool get_password_expired () const override { return get_int_value("password_last_changed", -1) == 0; } - int set_password_expired (bool x) const + int set_password_expired (bool x) const override { return x ? set_password_last_changed(0) : 0; } - ~User_table_json() = default; + ~User_table_json() override = default; private: friend class Grant_tables; static const uint JSON_SIZE=1024; - int setup_sysvars() const + int setup_sysvars() const override { using_global_priv_table= true; username_char_length= MY_MIN(m_table->field[1]->char_length(), @@ -5389,8 +5389,8 @@ public: GRANT_TABLE(const char *h, const char *d,const char *u, const char *t, privilege_t p, privilege_t c); GRANT_TABLE (TABLE *form, TABLE *col_privs); - ~GRANT_TABLE(); - bool ok() { return privs != NO_ACL || cols != NO_ACL; } + ~GRANT_TABLE() override; + bool ok() override { return privs != NO_ACL || cols != NO_ACL; } void init_hash() { my_hash_init2(key_memory_acl_memex, &hash_columns, 4, system_charset_info, @@ -11658,14 +11658,14 @@ public: : is_grave(FALSE) {} - virtual ~Silence_routine_definer_errors() = default; + ~Silence_routine_definer_errors() override = default; - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; bool has_errors() { return is_grave; } diff --git a/sql/sql_acl.h b/sql/sql_acl.h index b4288b05bfb..44f3fa64b88 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -311,7 +311,7 @@ public: :m_command(command) { } bool is_revoke() const { return m_command == SQLCOM_REVOKE; } - enum_sql_command sql_command_code() const { return m_command; } + enum_sql_command sql_command_code() const override { return m_command; } }; @@ -325,7 +325,7 @@ public: Sql_cmd_grant_proxy(enum_sql_command command, privilege_t grant_option) :Sql_cmd_grant(command), m_grant_option(grant_option) { } - bool execute(THD *thd); + bool execute(THD *thd) override; }; @@ -352,7 +352,7 @@ public: Sql_cmd_grant_table(enum_sql_command command, const Grant_privilege &grant) :Sql_cmd_grant_object(command, grant) { } - bool execute(THD *thd); + bool execute(THD *thd) override; }; @@ -366,7 +366,7 @@ public: :Sql_cmd_grant_object(command, grant), m_sph(sph) { } - bool execute(THD *thd); + bool execute(THD *thd) override; }; #endif /* SQL_ACL_INCLUDED */ diff --git a/sql/sql_admin.h b/sql/sql_admin.h index 1a237d4f616..ccccef748c1 100644 --- a/sql/sql_admin.h +++ b/sql/sql_admin.h @@ -38,9 +38,9 @@ public: ~Sql_cmd_analyze_table() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ANALYZE; } @@ -61,9 +61,9 @@ public: ~Sql_cmd_check_table() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_CHECK; } @@ -83,9 +83,9 @@ public: ~Sql_cmd_optimize_table() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_OPTIMIZE; } @@ -106,9 +106,9 @@ public: ~Sql_cmd_repair_table() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_REPAIR; } diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 4bec6801147..120c51f4019 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -460,7 +460,7 @@ protected: virtual ~Sql_cmd_common_alter_table() = default; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } @@ -481,9 +481,9 @@ public: ~Sql_cmd_alter_table() = default; - Storage_engine_name *option_storage_engine_name() { return this; } + Storage_engine_name *option_storage_engine_name() override { return this; } - bool execute(THD *thd); + bool execute(THD *thd) override; }; @@ -503,11 +503,11 @@ public: ~Sql_cmd_alter_sequence() = default; - enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_SEQUENCE; } - bool execute(THD *thd); + bool execute(THD *thd) override; }; @@ -527,7 +527,7 @@ public: : m_tablespace_op(tablespace_op_arg) {} - bool execute(THD *thd); + bool execute(THD *thd) override; private: const enum_tablespace_op_type m_tablespace_op; diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index e76ff13c06e..7e3b66d024e 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -123,13 +123,13 @@ public: { init_tree(&tree, 0, 0, sizeof(String), (qsort_cmp2) sortcmp2, free_string, NULL, MYF(MY_THREAD_SPECIFIC)); }; - void add(); - void get_opt_type(String*, ha_rows); - String *get_min_arg(String *not_used __attribute__((unused))) + void add() override; + void get_opt_type(String*, ha_rows) override; + String *get_min_arg(String *not_used __attribute__((unused))) override { return &min_arg; } - String *get_max_arg(String *not_used __attribute__((unused))) + String *get_max_arg(String *not_used __attribute__((unused))) override { return &max_arg; } - String *avg(String *s, ha_rows rows) + String *avg(String *s, ha_rows rows) override { if (!(rows - nulls)) s->set_real((double) 0.0, 1,my_thd_charset); @@ -140,10 +140,10 @@ public: } friend int collect_string(String *element, element_count count, TREE_INFO *info); - tree_walk_action collect_enum() + tree_walk_action collect_enum() override { return (tree_walk_action) collect_string; } String *std(String *s __attribute__((unused)), - ha_rows rows __attribute__((unused))) + ha_rows rows __attribute__((unused))) override { return (String*) 0; } }; @@ -165,16 +165,16 @@ public: 0, (void *)&bin_size, MYF(MY_THREAD_SPECIFIC)); }; - void add(); - void get_opt_type(String*, ha_rows); - String *get_min_arg(String *); - String *get_max_arg(String *); - String *avg(String *s, ha_rows rows); + void add() override; + void get_opt_type(String*, ha_rows) override; + String *get_min_arg(String *) override; + String *get_max_arg(String *) override; + String *avg(String *s, ha_rows rows) override; friend int collect_decimal(uchar *element, element_count count, TREE_INFO *info); - tree_walk_action collect_enum() + tree_walk_action collect_enum() override { return (tree_walk_action) collect_decimal; } - String *std(String *s, ha_rows rows); + String *std(String *s, ha_rows rows) override; }; @@ -193,19 +193,19 @@ public: (qsort_cmp2) compare_double2, NULL, NULL, MYF(MY_THREAD_SPECIFIC)); } - void add(); - void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) + void add() override; + void get_opt_type(String*, ha_rows) override; + String *get_min_arg(String *s) override { s->set_real(min_arg, item->decimals, my_thd_charset); return s; } - String *get_max_arg(String *s) + String *get_max_arg(String *s) override { s->set_real(max_arg, item->decimals, my_thd_charset); return s; } - String *avg(String *s, ha_rows rows) + String *avg(String *s, ha_rows rows) override { if (!(rows - nulls)) s->set_real((double) 0.0, 1,my_thd_charset); @@ -213,7 +213,7 @@ public: s->set_real(((double)sum / (double) (rows - nulls)), item->decimals,my_thd_charset); return s; } - String *std(String *s, ha_rows rows) + String *std(String *s, ha_rows rows) override { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) @@ -226,10 +226,10 @@ public: } return s; } - uint decimals() { return item->decimals; } + uint decimals() override { return item->decimals; } friend int collect_real(double *element, element_count count, TREE_INFO *info); - tree_walk_action collect_enum() + tree_walk_action collect_enum() override { return (tree_walk_action) collect_real;} }; @@ -248,11 +248,11 @@ public: (qsort_cmp2) compare_longlong2, NULL, NULL, MYF(MY_THREAD_SPECIFIC)); } - void add(); - void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; } - String *get_max_arg(String *s) { s->set(max_arg,my_thd_charset); return s; } - String *avg(String *s, ha_rows rows) + void add() override; + void get_opt_type(String*, ha_rows) override; + String *get_min_arg(String *s) override { s->set(min_arg,my_thd_charset); return s; } + String *get_max_arg(String *s) override { s->set(max_arg,my_thd_charset); return s; } + String *avg(String *s, ha_rows rows) override { if (!(rows - nulls)) s->set_real((double) 0.0, 1,my_thd_charset); @@ -260,7 +260,7 @@ public: s->set_real(((double) sum / (double) (rows - nulls)), DEC_IN_AVG,my_thd_charset); return s; } - String *std(String *s, ha_rows rows) + String *std(String *s, ha_rows rows) override { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) @@ -275,7 +275,7 @@ public: } friend int collect_longlong(longlong *element, element_count count, TREE_INFO *info); - tree_walk_action collect_enum() + tree_walk_action collect_enum() override { return (tree_walk_action) collect_longlong;} }; @@ -293,11 +293,11 @@ public: { init_tree(&tree, 0, 0, sizeof(ulonglong), (qsort_cmp2) compare_ulonglong2, NULL, NULL, MYF(MY_THREAD_SPECIFIC)); } - void add(); - void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; } - String *get_max_arg(String *s) { s->set(max_arg,my_thd_charset); return s; } - String *avg(String *s, ha_rows rows) + void add() override; + void get_opt_type(String*, ha_rows) override; + String *get_min_arg(String *s) override { s->set(min_arg,my_thd_charset); return s; } + String *get_max_arg(String *s) override { s->set(max_arg,my_thd_charset); return s; } + String *avg(String *s, ha_rows rows) override { if (!(rows - nulls)) s->set_real((double) 0.0, 1,my_thd_charset); @@ -306,7 +306,7 @@ public: DEC_IN_AVG,my_thd_charset); return s; } - String *std(String *s, ha_rows rows) + String *std(String *s, ha_rows rows) override { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) @@ -322,7 +322,7 @@ public: } friend int collect_ulonglong(ulonglong *element, element_count count, TREE_INFO *info); - tree_walk_action collect_enum() + tree_walk_action collect_enum() override { return (tree_walk_action) collect_ulonglong; } }; @@ -354,11 +354,11 @@ public: delete (*f); } } - virtual void add() {} - virtual bool change_columns(THD *thd, List &fields); - virtual int send_row(List &field_list); - virtual void end_group(void) {} - virtual int end_of_records(void); + void add() override {} + bool change_columns(THD *thd, List &fields) override; + int send_row(List &field_list) override; + void end_group(void) override {} + int end_of_records(void) override; friend Procedure *proc_analyse_init(THD *thd, ORDER *param, select_result *result, List &field_list); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7fea9cde91b..36bd7ee0af2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -117,7 +117,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; /** Returns TRUE if there were ER_NO_SUCH_/WRONG_MRG_TABLE and there @@ -518,7 +518,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { *cond_hdl= NULL; if (sql_errno == ER_OPEN_AS_READONLY || sql_errno == ER_LOCK_WAIT_TIMEOUT) @@ -1441,14 +1441,14 @@ public: : m_ot_ctx(ot_ctx_arg), m_is_active(FALSE) {} - virtual ~MDL_deadlock_handler() = default; + ~MDL_deadlock_handler() override = default; - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; private: /** Open table context to be used for back-off request. */ @@ -3219,12 +3219,12 @@ request_backoff_action(enum_open_table_action action_arg, class MDL_deadlock_discovery_repair_handler : public Internal_error_handler { public: - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { if (sql_errno == ER_LOCK_DEADLOCK) { diff --git a/sql/sql_base.h b/sql/sql_base.h index 8b6f904af20..26b0f1b709b 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -424,13 +424,13 @@ public: class DML_prelocking_strategy : public Prelocking_strategy { public: - virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, - Sroutine_hash_entry *rt, sp_head *sp, - bool *need_prelocking); - virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); - virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); + bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, + Sroutine_hash_entry *rt, sp_head *sp, + bool *need_prelocking) override; + bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; + bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; }; @@ -441,8 +441,8 @@ public: class Lock_tables_prelocking_strategy : public DML_prelocking_strategy { - virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); + bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; }; @@ -457,13 +457,13 @@ class Lock_tables_prelocking_strategy : public DML_prelocking_strategy class Alter_table_prelocking_strategy : public Prelocking_strategy { public: - virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, - Sroutine_hash_entry *rt, sp_head *sp, - bool *need_prelocking); - virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); - virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); + bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, + Sroutine_hash_entry *rt, sp_head *sp, + bool *need_prelocking) override; + bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; + bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; }; @@ -653,7 +653,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; /** Returns TRUE if one or more ER_NO_SUCH_TABLE errors have been diff --git a/sql/sql_class.h b/sql/sql_class.h index 0f731b1b7ca..52c22b28481 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -517,7 +517,7 @@ public: Used to make a clone of this object for ALTER/CREATE TABLE @sa comment for Key_part_spec::clone */ - virtual Key *clone(MEM_ROOT *mem_root) const + Key *clone(MEM_ROOT *mem_root) const override { return new (mem_root) Foreign_key(*this, mem_root); } /* Used to validate foreign key options */ bool validate(List &table_fields); @@ -1462,7 +1462,7 @@ public: void set_n_backup_statement(Statement *stmt, Statement *backup); void restore_backup_statement(Statement *stmt, Statement *backup); /* return class type */ - virtual Type type() const; + Type type() const override; }; @@ -2021,7 +2021,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { m_unhandled_errors++; if (!first_error) @@ -2045,7 +2045,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { if (*level == Sql_condition::WARN_LEVEL_ERROR) errors++; @@ -2073,7 +2073,7 @@ public: const char* sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl); + Sql_condition ** cond_hdl) override; private: }; @@ -2094,7 +2094,7 @@ public: const char *sqlstate, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition **cond_hdl); + Sql_condition **cond_hdl) override; bool need_reopen() const { return m_need_reopen; }; void init() { m_need_reopen= FALSE; }; @@ -2107,12 +2107,12 @@ class Turn_errors_to_warnings_handler : public Internal_error_handler { public: Turn_errors_to_warnings_handler() = default; - bool handle_condition(THD *thd, - uint sql_errno, - const char* sqlstate, + bool handle_condition(THD *, + uint, + const char*, Sql_condition::enum_warning_level *level, - const char* msg, - Sql_condition ** cond_hdl) + const char*, + Sql_condition ** cond_hdl) override { *cond_hdl= NULL; if (*level == Sql_condition::WARN_LEVEL_ERROR) @@ -2124,12 +2124,12 @@ public: struct Suppress_warnings_error_handler : public Internal_error_handler { - bool handle_condition(THD *thd, - uint sql_errno, - const char *sqlstate, + bool handle_condition(THD *, + uint, + const char *, Sql_condition::enum_warning_level *level, - const char *msg, - Sql_condition **cond_hdl) + const char *, + Sql_condition **) override { return *level == Sql_condition::WARN_LEVEL_WARN; } @@ -3941,7 +3941,7 @@ public: enter_cond(mysql_cond_t *cond, mysql_mutex_t* mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, - int src_line) + int src_line) override { mysql_mutex_assert_owner(mutex); mysys_var->current_mutex = mutex; @@ -3953,7 +3953,7 @@ public: } inline void exit_cond(const PSI_stage_info *stage, const char *src_function, const char *src_file, - int src_line) + int src_line) override { /* Putting the mutex unlock in thd->exit_cond() ensures that @@ -3970,8 +3970,8 @@ public: mysql_mutex_unlock(&mysys_var->mutex); return; } - virtual int is_killed() { return killed; } - virtual THD* get_thd() { return this; } + int is_killed() override { return killed; } + THD* get_thd() override { return this; } /** A callback to the server internals that is used to address @@ -3996,8 +3996,8 @@ public: @retval TRUE if the thread was woken up @retval FALSE otherwise. */ - virtual bool notify_shared_lock(MDL_context_owner *ctx_in_use, - bool needs_thr_lock_abort); + bool notify_shared_lock(MDL_context_owner *ctx_in_use, + bool needs_thr_lock_abort) override; // End implementation of MDL_context_owner interface. @@ -5107,7 +5107,7 @@ public: public: /** Overloaded to guard query/query_length fields */ - virtual void set_statement(Statement *stmt); + void set_statement(Statement *stmt) override; inline void set_command(enum enum_server_command command) { DBUG_ASSERT(command != COM_SLEEP); @@ -6041,7 +6041,7 @@ public: TABLE *dst_table; /* table to write into */ /* The following is called in the child thread: */ - int send_data(List &items); + int send_data(List &items) override; }; @@ -6055,7 +6055,7 @@ class select_result_text_buffer : public select_result_sink { public: select_result_text_buffer(THD *thd_arg): select_result_sink(thd_arg) {} - int send_data(List &items); + int send_data(List &items) override; bool send_result_set_metadata(List &fields, uint flag); void save_to(String *res); @@ -6083,9 +6083,9 @@ public: DBUG_PRINT("enter", ("this %p", this)); DBUG_VOID_RETURN; } /* Remove gcc warning */ - uint field_count(List &fields) const { return 0; } - bool send_result_set_metadata(List &fields, uint flag) { return FALSE; } - select_result_interceptor *result_interceptor() { return this; } + uint field_count(List &fields) const override { return 0; } + bool send_result_set_metadata(List &fields, uint flag) override { return FALSE; } + select_result_interceptor *result_interceptor() override { return this; } /* Instruct the object to not call my_ok(). Client output will be handled @@ -6153,10 +6153,10 @@ private: uint get_field_count() { return field_count; } void set_spvar_list(List *vars) { spvar_list= vars; } - virtual bool send_eof() { return FALSE; } - virtual int send_data(List &items); - virtual int prepare(List &list, SELECT_LEX_UNIT *u); - virtual bool view_structure_only() const { return m_view_structure_only; } + bool send_eof() override { return FALSE; } + int send_data(List &items) override; + int prepare(List &list, SELECT_LEX_UNIT *u) override; + bool view_structure_only() const override { return m_view_structure_only; } }; public: @@ -6213,13 +6213,13 @@ class select_send :public select_result { public: select_send(THD *thd_arg): select_result(thd_arg), is_result_set_started(FALSE) {} - bool send_result_set_metadata(List &list, uint flags); - int send_data(List &items); - bool send_eof(); - virtual bool check_simple_select() const { return FALSE; } - void abort_result_set(); - virtual void cleanup(); - select_result_interceptor *result_interceptor() { return NULL; } + bool send_result_set_metadata(List &list, uint flags) override; + int send_data(List &items) override; + bool send_eof() override; + bool check_simple_select() const override { return FALSE; } + void abort_result_set() override; + void cleanup() override; + select_result_interceptor *result_interceptor() override { return NULL; } }; @@ -6231,9 +6231,9 @@ public: class select_send_analyze : public select_send { - bool send_result_set_metadata(List &list, uint flags) { return 0; } - bool send_eof() { return 0; } - void abort_result_set() {} + bool send_result_set_metadata(List &list, uint flags) override { return 0; } + bool send_eof() override { return 0; } + void abort_result_set() override {} public: select_send_analyze(THD *thd_arg): select_send(thd_arg) {} }; @@ -6252,8 +6252,8 @@ public: select_result_interceptor(thd_arg), exchange(ex), file(-1),row_count(0L) { path[0]=0; } ~select_to_file(); - bool send_eof(); - void cleanup(); + bool send_eof() override; + void cleanup() override; }; @@ -6293,16 +6293,16 @@ class select_export :public select_to_file { public: select_export(THD *thd_arg, sql_exchange *ex): select_to_file(thd_arg, ex) {} ~select_export(); - int prepare(List &list, SELECT_LEX_UNIT *u); - int send_data(List &items); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int send_data(List &items) override; }; class select_dump :public select_to_file { public: select_dump(THD *thd_arg, sql_exchange *ex): select_to_file(thd_arg, ex) {} - int prepare(List &list, SELECT_LEX_UNIT *u); - int send_data(List &items); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int send_data(List &items) override; }; @@ -6320,17 +6320,17 @@ class select_insert :public select_result_interceptor { List *update_values, enum_duplicates duplic, bool ignore, select_result *sel_ret_list); ~select_insert(); - int prepare(List &list, SELECT_LEX_UNIT *u); - virtual int prepare2(JOIN *join); - virtual int send_data(List &items); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int prepare2(JOIN *join) override; + int send_data(List &items) override; virtual bool store_values(List &values); virtual bool can_rollback_data() { return 0; } bool prepare_eof(); bool send_ok_packet(); - bool send_eof(); - virtual void abort_result_set(); + bool send_eof() override; + void abort_result_set() override; /* not implemented: select_insert is never re-used in prepared statements */ - void cleanup(); + void cleanup() override; }; @@ -6366,18 +6366,18 @@ public: bzero(&ddl_log_state_create, sizeof(ddl_log_state_create)); bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm)); } - int prepare(List &list, SELECT_LEX_UNIT *u); + int prepare(List &list, SELECT_LEX_UNIT *u) override; int binlog_show_create_table(TABLE **tables, uint count); - bool store_values(List &values); - bool send_eof(); - virtual void abort_result_set(); - virtual bool can_rollback_data() { return 1; } + bool store_values(List &values) override; + bool send_eof() override; + void abort_result_set() override; + bool can_rollback_data() override { return 1; } // Needed for access from local class MY_HOOKS in prepare(), since thd is proteted. const THD *get_thd(void) { return thd; } const HA_CREATE_INFO *get_create_info() { return create_info; }; - int prepare2(JOIN *join) { return 0; } + int prepare2(JOIN *join) override { return 0; } private: TABLE *create_table_from_items(THD *thd, @@ -6539,7 +6539,7 @@ public: init(); tmp_table_param.init(); } - int prepare(List &list, SELECT_LEX_UNIT *u); + int prepare(List &list, SELECT_LEX_UNIT *u) override; /** Do prepare() and prepare2() if they have been postponed until column type information is computed (used by select_union_direct). @@ -6550,13 +6550,13 @@ public: */ virtual bool postponed_prepare(List &types) { return false; } - int send_data(List &items); + int send_data(List &items) override; int write_record(); int update_counter(Field *counter, longlong value); int delete_record(); - bool send_eof(); + bool send_eof() override; virtual bool flush(); - void cleanup(); + void cleanup() override; virtual bool create_result_table(THD *thd, List *column_types, bool is_distinct, ulonglong options, const LEX_CSTRING *alias, @@ -6683,11 +6683,11 @@ public: curr_op_type(UNSPECIFIED) { }; - int send_data(List &items); - void change_select(); + int send_data(List &items) override; + void change_select() override; int unfold_record(ha_rows cnt); - bool send_eof(); - bool force_enable_index_if_needed() + bool send_eof() override; + bool force_enable_index_if_needed() override { is_index_enabled= true; return true; @@ -6744,15 +6744,15 @@ class select_union_recursive :public select_unit row_counter(0) { incr_table_param.init(); }; - int send_data(List &items); + int send_data(List &items) override; bool create_result_table(THD *thd, List *column_types, bool is_distinct, ulonglong options, const LEX_CSTRING *alias, bool bit_fields_as_long, bool create_table, bool keep_row_order, - uint hidden); - void cleanup(); + uint hidden) override; + void cleanup() override; }; /** @@ -6799,30 +6799,30 @@ public: done_send_result_set_metadata(false), done_initialize_tables(false), limit_found_rows(0) { send_records= 0; } - bool change_result(select_result *new_result); - uint field_count(List &fields) const + bool change_result(select_result *new_result) override; + uint field_count(List &fields) const override { // Only called for top-level select_results, usually select_send DBUG_ASSERT(false); /* purecov: inspected */ return 0; /* purecov: inspected */ } - bool postponed_prepare(List &types); - bool send_result_set_metadata(List &list, uint flags); - int send_data(List &items); - bool initialize_tables (JOIN *join); - bool send_eof(); - bool flush() { return false; } - bool check_simple_select() const + bool postponed_prepare(List &types) override; + bool send_result_set_metadata(List &list, uint flags) override; + int send_data(List &items) override; + bool initialize_tables (JOIN *join) override; + bool send_eof() override; + bool flush() override { return false; } + bool check_simple_select() const override { /* Only called for top-level select_results, usually select_send */ DBUG_ASSERT(false); /* purecov: inspected */ return false; /* purecov: inspected */ } - void abort_result_set() + void abort_result_set() override { result->abort_result_set(); /* purecov: inspected */ } - void cleanup() + void cleanup() override { send_records= 0; } @@ -6840,7 +6840,11 @@ public: // EXPLAIN should never output to a select_union_direct DBUG_ASSERT(false); /* purecov: inspected */ } +#ifdef EMBEDDED_LIBRARY + void begin_dataset() override +#else void begin_dataset() +#endif { // Only called for sp_cursor::Select_fetch_into_spvars DBUG_ASSERT(false); /* purecov: inspected */ @@ -6856,8 +6860,8 @@ protected: public: select_subselect(THD *thd_arg, Item_subselect *item_arg): select_result_interceptor(thd_arg), item(item_arg) {} - int send_data(List &items)=0; - bool send_eof() { return 0; }; + int send_data(List &items) override=0; + bool send_eof() override { return 0; }; }; /* Single value subselect interface class */ @@ -6867,7 +6871,7 @@ public: select_singlerow_subselect(THD *thd_arg, Item_subselect *item_arg): select_subselect(thd_arg, item_arg) {} - int send_data(List &items); + int send_data(List &items) override; }; @@ -6918,10 +6922,10 @@ public: bool bit_fields_as_long, bool create_table, bool keep_row_order, - uint hidden); + uint hidden) override; bool init_result_table(ulonglong select_options); - int send_data(List &items); - void cleanup(); + int send_data(List &items) override; + void cleanup() override; ha_rows get_null_count_of_col(uint idx) { DBUG_ASSERT(idx < table->s->fields); @@ -6954,8 +6958,8 @@ public: bool mx, bool all): select_subselect(thd_arg, item_arg), cache(0), fmax(mx), is_all(all) {} - void cleanup(); - int send_data(List &items); + void cleanup() override; + int send_data(List &items) override; bool cmp_real(); bool cmp_int(); bool cmp_decimal(); @@ -6970,7 +6974,7 @@ class select_exists_subselect :public select_subselect public: select_exists_subselect(THD *thd_arg, Item_subselect *item_arg): select_subselect(thd_arg, item_arg) {} - int send_data(List &items); + int send_data(List &items) override; }; @@ -7227,15 +7231,15 @@ public: public: multi_delete(THD *thd_arg, TABLE_LIST *dt, uint num_of_tables); ~multi_delete(); - int prepare(List &list, SELECT_LEX_UNIT *u); - int send_data(List &items); - bool initialize_tables (JOIN *join); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int send_data(List &items) override; + bool initialize_tables (JOIN *join) override; int do_deletes(); int do_table_deletes(TABLE *table, SORT_INFO *sort_info, bool ignore); - bool send_eof(); + bool send_eof() override; inline ha_rows num_deleted() const { return deleted; } - virtual void abort_result_set(); - void prepare_to_read_rows(); + void abort_result_set() override; + void prepare_to_read_rows() override; }; @@ -7282,17 +7286,17 @@ public: enum_duplicates handle_duplicates, bool ignore); ~multi_update(); bool init(THD *thd); - int prepare(List &list, SELECT_LEX_UNIT *u); - int send_data(List &items); - bool initialize_tables (JOIN *join); - int prepare2(JOIN *join); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int send_data(List &items) override; + bool initialize_tables (JOIN *join) override; + int prepare2(JOIN *join) override; int do_updates(); - bool send_eof(); + bool send_eof() override; inline ha_rows num_found() const { return found; } inline ha_rows num_updated() const { return updated; } - virtual void abort_result_set(); - void update_used_tables(); - void prepare_to_read_rows(); + void abort_result_set() override; + void update_used_tables() override; + void prepare_to_read_rows() override; }; class my_var_sp; @@ -7324,8 +7328,8 @@ public: m_rcontext_handler(rcontext_handler), m_type_handler(type_handler), offset(o), sp(s) { } ~my_var_sp() = default; - bool set(THD *thd, Item *val); - my_var_sp *get_my_var_sp() { return this; } + bool set(THD *thd, Item *val) override; + my_var_sp *get_my_var_sp() override { return this; } const Type_handler *type_handler() const { return m_type_handler; } sp_rcontext *get_rcontext(sp_rcontext *local_ctx) const; @@ -7346,7 +7350,7 @@ public: &type_handler_double/*Not really used*/, s), m_field_offset(field_idx) { } - bool set(THD *thd, Item *val); + bool set(THD *thd, Item *val) override; }; class my_var_user: public my_var { @@ -7354,7 +7358,7 @@ public: my_var_user(const LEX_CSTRING *j) : my_var(j, SESSION_VAR) { } ~my_var_user() = default; - bool set(THD *thd, Item *val); + bool set(THD *thd, Item *val) override; }; class select_dumpvar :public select_result_interceptor { @@ -7367,11 +7371,11 @@ public: :select_result_interceptor(thd_arg), row_count(0), m_var_sp_row(NULL) { var_list.empty(); } ~select_dumpvar() = default; - int prepare(List &list, SELECT_LEX_UNIT *u); - int send_data(List &items); - bool send_eof(); - virtual bool check_simple_select() const; - void cleanup(); + int prepare(List &list, SELECT_LEX_UNIT *u) override; + int send_data(List &items) override; + bool send_eof() override; + bool check_simple_select() const override; + void cleanup() override; }; /* Bits in sql_command_flags */ @@ -8036,10 +8040,11 @@ public: m_maybe_null(false) { } - void set_type_maybe_null(bool maybe_null_arg) { m_maybe_null= maybe_null_arg; } + void set_type_maybe_null(bool maybe_null_arg) override + { m_maybe_null= maybe_null_arg; } bool get_maybe_null() const { return m_maybe_null; } - decimal_digits_t decimal_precision() const + decimal_digits_t decimal_precision() const override { /* Type_holder is not used directly to create fields, so @@ -8051,11 +8056,11 @@ public: DBUG_ASSERT(0); return 0; } - void set_typelib(const TYPELIB *typelib) + void set_typelib(const TYPELIB *typelib) override { m_typelib= typelib; } - const TYPELIB *get_typelib() const + const TYPELIB *get_typelib() const override { return m_typelib; } diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h index 53dd6e750f8..ea518375226 100644 --- a/sql/sql_cmd.h +++ b/sql/sql_cmd.h @@ -220,9 +220,9 @@ public: :show_all_slaves_status(status_all) {} - enum_sql_command sql_command_code() const { return SQLCOM_SHOW_SLAVE_STAT; } + enum_sql_command sql_command_code() const override { return SQLCOM_SHOW_SLAVE_STAT; } - bool execute(THD *thd); + bool execute(THD *thd) override; bool is_show_all_slaves_stat() { return show_all_slaves_status; } }; @@ -231,20 +231,20 @@ class Sql_cmd_create_table_like: public Sql_cmd, public Storage_engine_name { public: - Storage_engine_name *option_storage_engine_name() { return this; } - bool execute(THD *thd); + Storage_engine_name *option_storage_engine_name() override { return this; } + bool execute(THD *thd) override; }; class Sql_cmd_create_table: public Sql_cmd_create_table_like { public: - enum_sql_command sql_command_code() const { return SQLCOM_CREATE_TABLE; } + enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_TABLE; } }; class Sql_cmd_create_sequence: public Sql_cmd_create_table_like { public: - enum_sql_command sql_command_code() const { return SQLCOM_CREATE_SEQUENCE; } + enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_SEQUENCE; } }; @@ -268,9 +268,9 @@ public: @param thd the current thread. @return false on success. */ - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_CALL; } diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index cef8ac161df..4ba082934f3 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -49,15 +49,15 @@ public: Materialized_cursor(select_result *result, TABLE *table); int send_result_set_metadata(THD *thd, List &send_result_set_metadata); - virtual bool is_open() const { return table != 0; } - virtual int open(JOIN *join __attribute__((unused))); - virtual void fetch(ulong num_rows); - virtual void close(); - bool export_structure(THD *thd, Row_definition_list *defs) + bool is_open() const override { return table != 0; } + int open(JOIN *join __attribute__((unused))) override; + void fetch(ulong num_rows) override; + void close() override; + bool export_structure(THD *thd, Row_definition_list *defs) override { return table->export_structure(thd, defs); } - virtual ~Materialized_cursor(); + ~Materialized_cursor() override; void on_table_fill_finished(); }; @@ -79,9 +79,9 @@ public: Materialized_cursor *materialized_cursor; Select_materialize(THD *thd_arg, select_result *result_arg): select_unit(thd_arg), result(result_arg), materialized_cursor(0) {} - virtual bool send_result_set_metadata(List &list, uint flags); - bool send_eof() { return false; } - bool view_structure_only() const + bool send_result_set_metadata(List &list, uint flags) override; + bool send_eof() override { return false; } + bool view_structure_only() const override { return result->view_structure_only(); } diff --git a/sql/sql_explain.h b/sql/sql_explain.h index c0783d5fad1..fc5fa15cf12 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -161,21 +161,21 @@ class Explain_table_access; class Explain_basic_join : public Explain_node { public: - enum explain_node_type get_type() { return EXPLAIN_BASIC_JOIN; } + enum explain_node_type get_type() override { return EXPLAIN_BASIC_JOIN; } Explain_basic_join(MEM_ROOT *root) : Explain_node(root), join_tabs(NULL) {} ~Explain_basic_join(); bool add_table(Explain_table_access *tab, Explain_query *query); - uint get_select_id() { return select_id; } + uint get_select_id() override { return select_id; } uint select_id; int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); + uint8 explain_flags, bool is_analyze) override; void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + bool is_analyze) override; void print_explain_json_interns(Explain_query *query, Json_writer *writer, bool is_analyze); @@ -205,7 +205,7 @@ class Explain_aggr_node; class Explain_select : public Explain_basic_join { public: - enum explain_node_type get_type() { return EXPLAIN_SELECT; } + enum explain_node_type get_type() override { return EXPLAIN_SELECT; } Explain_select(MEM_ROOT *root, bool is_analyze) : Explain_basic_join(root), @@ -260,9 +260,9 @@ public: Explain_aggr_node* aggr_tree; int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); + uint8 explain_flags, bool is_analyze) override; void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + bool is_analyze) override; Table_access_tracker *get_using_temporary_read_tracker() { @@ -299,7 +299,7 @@ class Explain_aggr_filesort : public Explain_aggr_node List sort_items; List sort_directions; public: - enum_explain_aggr_node_type get_type() { return AGGR_OP_FILESORT; } + enum_explain_aggr_node_type get_type() override { return AGGR_OP_FILESORT; } Filesort_tracker tracker; Explain_aggr_filesort(MEM_ROOT *mem_root, bool is_analyze, @@ -311,20 +311,20 @@ public: class Explain_aggr_tmp_table : public Explain_aggr_node { public: - enum_explain_aggr_node_type get_type() { return AGGR_OP_TEMP_TABLE; } + enum_explain_aggr_node_type get_type() override { return AGGR_OP_TEMP_TABLE; } }; class Explain_aggr_remove_dups : public Explain_aggr_node { public: - enum_explain_aggr_node_type get_type() { return AGGR_OP_REMOVE_DUPLICATES; } + enum_explain_aggr_node_type get_type() override { return AGGR_OP_REMOVE_DUPLICATES; } }; class Explain_aggr_window_funcs : public Explain_aggr_node { List sorts; public: - enum_explain_aggr_node_type get_type() { return AGGR_OP_WINDOW_FUNCS; } + enum_explain_aggr_node_type get_type() override { return AGGR_OP_WINDOW_FUNCS; } void print_json_members(Json_writer *writer, bool is_analyze); friend class Window_funcs_computation; @@ -351,10 +351,10 @@ public: fake_select_lex_explain(root, is_analyze) {} - enum explain_node_type get_type() { return EXPLAIN_UNION; } + enum explain_node_type get_type() override { return EXPLAIN_UNION; } unit_common_op operation; - uint get_select_id() + uint get_select_id() override { DBUG_ASSERT(union_members.elements() > 0); return union_members.at(0); @@ -377,9 +377,9 @@ public: union_members.append(select_no); } int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); + uint8 explain_flags, bool is_analyze) override; void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + bool is_analyze) override; const char *fake_select_type; bool using_filesort; @@ -914,8 +914,8 @@ public: handler_for_stats(NULL) {} - virtual enum explain_node_type get_type() { return EXPLAIN_UPDATE; } - virtual uint get_select_id() { return 1; /* always root */ } + enum explain_node_type get_type() override { return EXPLAIN_UPDATE; } + uint get_select_id() override { return 1; /* always root */ } const char *select_type; @@ -974,10 +974,10 @@ public: /* The same as Explain_table_access::handler_for_stats */ handler *handler_for_stats; - virtual int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); - virtual void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + int print_explain(Explain_query *query, select_result_sink *output, + uint8 explain_flags, bool is_analyze) override; + void print_explain_json(Explain_query *query, Json_writer *writer, + bool is_analyze) override; }; @@ -997,13 +997,13 @@ public: StringBuffer<64> table_name; - enum explain_node_type get_type() { return EXPLAIN_INSERT; } - uint get_select_id() { return 1; /* always root */ } + enum explain_node_type get_type() override { return EXPLAIN_INSERT; } + uint get_select_id() override { return 1; /* always root */ } - int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); - void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + int print_explain(Explain_query *query, select_result_sink *output, + uint8 explain_flags, bool is_analyze) override; + void print_explain_json(Explain_query *query, Json_writer *writer, + bool is_analyze) override; }; @@ -1024,13 +1024,13 @@ public: */ bool deleting_all_rows; - virtual enum explain_node_type get_type() { return EXPLAIN_DELETE; } - virtual uint get_select_id() { return 1; /* always root */ } + enum explain_node_type get_type() override { return EXPLAIN_DELETE; } + uint get_select_id() override { return 1; /* always root */ } - virtual int print_explain(Explain_query *query, select_result_sink *output, - uint8 explain_flags, bool is_analyze); - virtual void print_explain_json(Explain_query *query, Json_writer *writer, - bool is_analyze); + int print_explain(Explain_query *query, select_result_sink *output, + uint8 explain_flags, bool is_analyze) override; + void print_explain_json(Explain_query *query, Json_writer *writer, + bool is_analyze) override; }; diff --git a/sql/sql_expression_cache.h b/sql/sql_expression_cache.h index 88436837a2d..fd5dffc0e5a 100644 --- a/sql/sql_expression_cache.h +++ b/sql/sql_expression_cache.h @@ -113,19 +113,19 @@ class Expression_cache_tmptable :public Expression_cache public: Expression_cache_tmptable(THD *thd, List &dependants, Item *value); virtual ~Expression_cache_tmptable(); - virtual result check_value(Item **value); - virtual my_bool put_value(Item *value); + result check_value(Item **value) override; + my_bool put_value(Item *value) override; - void print(String *str, enum_query_type query_type); - bool is_inited() { return inited; }; - void init(); + void print(String *str, enum_query_type query_type) override; + bool is_inited() override { return inited; }; + void init() override; void set_tracker(Expression_cache_tracker *st) { tracker= st; update_tracker(); } - virtual void update_tracker() + void update_tracker() override { if (tracker) { diff --git a/sql/sql_get_diagnostics.h b/sql/sql_get_diagnostics.h index f283aa5b2c6..ccabfb8a99e 100644 --- a/sql/sql_get_diagnostics.h +++ b/sql/sql_get_diagnostics.h @@ -39,12 +39,12 @@ public: : m_info(info) {} - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_GET_DIAGNOSTICS; } - virtual bool execute(THD *thd); + bool execute(THD *thd) override; private: /** The information to be obtained. */ @@ -223,7 +223,7 @@ public: {} /** Obtain statement information in the context of a diagnostics area. */ - bool aggregate(THD *thd, const Diagnostics_area *da); + bool aggregate(THD *thd, const Diagnostics_area *da) override; private: /* List of statement information items. */ @@ -301,7 +301,7 @@ public: {} /** Obtain condition information in the context of a diagnostics area. */ - bool aggregate(THD *thd, const Diagnostics_area *da); + bool aggregate(THD *thd, const Diagnostics_area *da) override; private: /** diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 6090c64eb74..991cb2c2f72 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2308,7 +2308,7 @@ public: forced_insert_id(0), query(query_arg), time_zone(0), user(0), host(0), ip(0) {} - ~delayed_row() + ~delayed_row() override { my_free(query.str); my_free(record); @@ -2391,7 +2391,7 @@ public: TL_WRITE_LOW_PRIORITY : TL_WRITE; DBUG_VOID_RETURN; } - ~Delayed_insert() + ~Delayed_insert() override { /* The following is not really needed, but just for safety */ delayed_row *row; @@ -3072,13 +3072,13 @@ void kill_delayed_threads(void) class Delayed_prelocking_strategy : public Prelocking_strategy { public: - virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, + bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx, Sroutine_hash_entry *rt, sp_head *sp, - bool *need_prelocking); - virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); - virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, - TABLE_LIST *table_list, bool *need_prelocking); + bool *need_prelocking) override; + bool handle_table(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; + bool handle_view(THD *thd, Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list, bool *need_prelocking) override; }; @@ -4750,7 +4750,7 @@ select_create::prepare(List &_values, SELECT_LEX_UNIT *u) } private: - virtual int do_postlock(TABLE **tables, uint count) + int do_postlock(TABLE **tables, uint count) override { int error; THD *thd= const_cast(ptr->get_thd()); diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index d2d2e1a1c01..bfed7afd4fb 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -943,7 +943,7 @@ protected: } /* Get the total length of all prefixes of a record in hashed join buffer */ - uint get_prefix_length() + uint get_prefix_length() override { return base_prefix_length + get_size_of_rec_offset(); } @@ -952,13 +952,13 @@ protected: Get maximum size of the additional space per record used for the hash table with record keys */ - uint get_max_key_addon_space_per_record(); + uint get_max_key_addon_space_per_record() override; /* Calculate how much space in the buffer would not be occupied by records, key entries and additional memory for the MMR buffer. */ - size_t rem_space() + size_t rem_space() override { return MY_MAX(last_key_entry-end_pos-aux_buff_size,0); } @@ -967,25 +967,25 @@ protected: Calculate how much space is taken by allocation of the key entry for a record in the join buffer */ - uint extra_key_length() { return key_entry_length; } + uint extra_key_length() override { return key_entry_length; } /* Skip record from a hashed join buffer if its match flag is set to MATCH_FOUND */ - bool skip_if_matched(); + bool skip_if_matched() override; /* Skip record from a hashed join buffer if its match flag setting commands to do so */ - bool skip_if_not_needed_match(); + bool skip_if_not_needed_match() override; /* Search for a key in the hash table of the join buffer */ bool key_search(uchar *key, uint key_len, uchar **key_ref_ptr); /* Reallocate the join buffer of a hashed join cache */ - int realloc_buffer(); + int realloc_buffer() override; /* This constructor creates an unlinked hashed join cache. The cache is to be @@ -1006,16 +1006,16 @@ protected: public: /* Initialize a hashed join cache */ - int init(bool for_explain); + int init(bool for_explain) override; /* Reset the buffer of a hashed join cache for reading/writing */ - void reset(bool for_writing); + void reset(bool for_writing) override; /* Add a record into the buffer of a hashed join cache */ - bool put_record(); + bool put_record() override; /* Read the next record from the buffer of a hashed join cache */ - bool get_record(); + bool get_record() override; /* Shall check whether all records in a key chain have @@ -1115,13 +1115,13 @@ private: protected: - bool prepare_look_for_matches(bool skip_last); + bool prepare_look_for_matches(bool skip_last) override; - uchar *get_next_candidate_for_match(); + uchar *get_next_candidate_for_match() override; - bool skip_next_candidate_for_match(uchar *rec_ptr); + bool skip_next_candidate_for_match(uchar *rec_ptr) override; - void read_next_candidate_for_match(uchar *rec_ptr); + void read_next_candidate_for_match(uchar *rec_ptr) override; public: @@ -1142,11 +1142,11 @@ public: :JOIN_CACHE(j, tab, prev) {} /* Initialize the BNL cache */ - int init(bool for_explain); + int init(bool for_explain) override; - enum Join_algorithm get_join_alg() { return BNL_JOIN_ALG; } + enum Join_algorithm get_join_alg() override { return BNL_JOIN_ALG; } - bool is_key_access() { return FALSE; } + bool is_key_access() override { return FALSE; } }; @@ -1182,13 +1182,13 @@ protected: */ uchar *get_matching_chain_by_join_key(); - bool prepare_look_for_matches(bool skip_last); + bool prepare_look_for_matches(bool skip_last) override; - uchar *get_next_candidate_for_match(); + uchar *get_next_candidate_for_match() override; - bool skip_next_candidate_for_match(uchar *rec_ptr); + bool skip_next_candidate_for_match(uchar *rec_ptr) override; - void read_next_candidate_for_match(uchar *rec_ptr); + void read_next_candidate_for_match(uchar *rec_ptr) override; public: @@ -1209,11 +1209,11 @@ public: : JOIN_CACHE_HASHED(j, tab, prev) {} /* Initialize the BNLH cache */ - int init(bool for_explain); + int init(bool for_explain) override; - enum Join_algorithm get_join_alg() { return BNLH_JOIN_ALG; } + enum Join_algorithm get_join_alg() override { return BNLH_JOIN_ALG; } - bool is_key_access() { return TRUE; } + bool is_key_access() override { return TRUE; } }; @@ -1256,11 +1256,11 @@ public: JOIN_TAB_SCAN_MRR(JOIN *j, JOIN_TAB *tab, uint flags, RANGE_SEQ_IF rs_funcs) :JOIN_TAB_SCAN(j, tab), range_seq_funcs(rs_funcs), mrr_mode(flags) {} - uint aux_buffer_incr(size_t recno); + uint aux_buffer_incr(size_t recno) override; - int open(); + int open() override; - int next(); + int next() override; friend class JOIN_CACHE_BKA; /* it needs to add an mrr_mode flag after JOIN_CACHE::init() call */ }; @@ -1296,26 +1296,26 @@ protected: Get the number of ranges in the cache buffer passed to the MRR interface. For each record its own range is passed. */ - uint get_number_of_ranges_for_mrr() { return (uint)records; } + uint get_number_of_ranges_for_mrr() override { return (uint)records; } /* Setup the MRR buffer as the space between the last record put into the join buffer and the very end of the join buffer */ - int setup_aux_buffer(HANDLER_BUFFER &aux_buff) + int setup_aux_buffer(HANDLER_BUFFER &aux_buff) override { aux_buff.buffer= end_pos; aux_buff.buffer_end= buff+buff_size; return 0; } - bool prepare_look_for_matches(bool skip_last); + bool prepare_look_for_matches(bool skip_last) override; - uchar *get_next_candidate_for_match(); + uchar *get_next_candidate_for_match() override; - bool skip_next_candidate_for_match(uchar *rec_ptr); + bool skip_next_candidate_for_match(uchar *rec_ptr) override; - void read_next_candidate_for_match(uchar *rec_ptr); + void read_next_candidate_for_match(uchar *rec_ptr) override; public: @@ -1341,14 +1341,14 @@ public: :JOIN_CACHE(bka->join, bka->join_tab, bka->prev_cache), mrr_mode(bka->mrr_mode) {} - uchar **get_curr_association_ptr() { return &curr_association; } + uchar **get_curr_association_ptr() override { return &curr_association; } /* Initialize the BKA cache */ - int init(bool for_explain); + int init(bool for_explain) override; - enum Join_algorithm get_join_alg() { return BKA_JOIN_ALG; } + enum Join_algorithm get_join_alg() override { return BKA_JOIN_ALG; } - bool is_key_access() { return TRUE; } + bool is_key_access() override { return TRUE; } /* Get the key built over the next record from the join buffer */ uint get_next_key(uchar **key); @@ -1356,7 +1356,7 @@ public: /* Check index condition of the joined table for a record from BKA cache */ bool skip_index_tuple(range_id_t range_info); - bool save_explain_data(EXPLAIN_BKA_TYPE *explain); + bool save_explain_data(EXPLAIN_BKA_TYPE *explain) override; }; @@ -1392,21 +1392,21 @@ private: protected: - uint get_number_of_ranges_for_mrr() { return key_entries; } + uint get_number_of_ranges_for_mrr() override { return key_entries; } /* Initialize the MRR buffer allocating some space within the join buffer. The entire space between the last record put into the join buffer and the last key entry added to the hash table is used for the MRR buffer. */ - int setup_aux_buffer(HANDLER_BUFFER &aux_buff) + int setup_aux_buffer(HANDLER_BUFFER &aux_buff) override { aux_buff.buffer= end_pos; aux_buff.buffer_end= last_key_entry; return 0; } - bool prepare_look_for_matches(bool skip_last); + bool prepare_look_for_matches(bool skip_last) override; /* The implementations of the methods @@ -1441,15 +1441,15 @@ public: :JOIN_CACHE_BNLH(bkah->join, bkah->join_tab, bkah->prev_cache), mrr_mode(bkah->mrr_mode) {} - uchar **get_curr_association_ptr() { return &curr_matching_chain; } + uchar **get_curr_association_ptr() override { return &curr_matching_chain; } /* Initialize the BKAH cache */ - int init(bool for_explain); + int init(bool for_explain) override; - enum Join_algorithm get_join_alg() { return BKAH_JOIN_ALG; } + enum Join_algorithm get_join_alg() override { return BKAH_JOIN_ALG; } /* Check index condition of the joined table for a record from BKAH cache */ bool skip_index_tuple(range_id_t range_info); - bool save_explain_data(EXPLAIN_BKA_TYPE *explain); + bool save_explain_data(EXPLAIN_BKA_TYPE *explain) override; }; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 37f1dee3d55..ca9a727d35d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3655,6 +3655,15 @@ public: return (context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW); } + /** + Mark all queries in this lex structure as uncacheable for the cause given + + @param cause the reason queries are to be marked as uncacheable + + Note, any cause is sufficient for st_select_lex_unit::can_be_merged() to + disallow query merges. + */ + inline void uncacheable(uint8 cause) { safe_to_cache_query= 0; diff --git a/sql/sql_lifo_buffer.h b/sql/sql_lifo_buffer.h index 2d648271898..04496ef74b8 100644 --- a/sql/sql_lifo_buffer.h +++ b/sql/sql_lifo_buffer.h @@ -162,22 +162,22 @@ class Forward_lifo_buffer: public Lifo_buffer { uchar *pos; public: - enum_direction type() { return FORWARD; } - size_t used_size() + enum_direction type() override { return FORWARD; } + size_t used_size() override { return (size_t)(pos - start); } - void reset() + void reset() override { pos= start; } - uchar *end_of_space() { return pos; } - bool have_space_for(size_t bytes) + uchar *end_of_space() override { return pos; } + bool have_space_for(size_t bytes) override { return (pos + bytes < end); } - void write() + void write() override { write_bytes(write_ptr1, size1); if (size2) @@ -199,8 +199,8 @@ public: *position= (*position) - bytes; return *position; } - bool read() { return read(&pos, &read_ptr1, &read_ptr2); } - bool read(uchar **position, uchar **ptr1, uchar **ptr2) + bool read() override { return read(&pos, &read_ptr1, &read_ptr2); } + bool read(uchar **position, uchar **ptr1, uchar **ptr2) override { if (!have_data(*position, size1 + size2)) return TRUE; @@ -209,7 +209,7 @@ public: *ptr1= read_bytes(position, size1); return FALSE; } - void remove_unused_space(uchar **unused_start, uchar **unused_end) + void remove_unused_space(uchar **unused_start, uchar **unused_end) override { DBUG_ASSERT(0); /* Don't need this yet */ } @@ -228,9 +228,9 @@ public: end= unused_end; } /* Return pointer to start of the memory area that is occupied by the data */ - uchar *used_area() { return start; } + uchar *used_area() override { return start; } friend class Lifo_buffer_iterator; - uchar *get_pos() { return pos; } + uchar *get_pos() override { return pos; } }; @@ -254,22 +254,22 @@ class Backward_lifo_buffer: public Lifo_buffer { uchar *pos; public: - enum_direction type() { return BACKWARD; } + enum_direction type() override { return BACKWARD; } - size_t used_size() + size_t used_size() override { return (size_t)(end - pos); } - void reset() + void reset() override { pos= end; } - uchar *end_of_space() { return end; } - bool have_space_for(size_t bytes) + uchar *end_of_space() override { return end; } + bool have_space_for(size_t bytes) override { return (pos - bytes >= start); } - void write() + void write() override { if (write_ptr2) write_bytes(write_ptr2, size2); @@ -281,11 +281,11 @@ public: pos -= bytes; memcpy(pos, data, bytes); } - bool read() + bool read() override { return read(&pos, &read_ptr1, &read_ptr2); } - bool read(uchar **position, uchar **ptr1, uchar **ptr2) + bool read(uchar **position, uchar **ptr1, uchar **ptr2) override { if (!have_data(*position, size1 + size2)) return TRUE; @@ -310,7 +310,7 @@ public: @param unused_start OUT Start of the unused space @param unused_end OUT End of the unused space */ - void remove_unused_space(uchar **unused_start, uchar **unused_end) + void remove_unused_space(uchar **unused_start, uchar **unused_end) override { *unused_start= start; *unused_end= pos; @@ -321,9 +321,9 @@ public: DBUG_ASSERT(0); /* Not used for backward buffers */ } /* Return pointer to start of the memory area that is occupied by the data */ - uchar *used_area() { return pos; } + uchar *used_area() override { return pos; } friend class Lifo_buffer_iterator; - uchar *get_pos() { return pos; } + uchar *get_pos() override { return pos; } }; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 36240f16e90..14186062921 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1531,14 +1531,14 @@ class Silence_all_errors : public Internal_error_handler int error; public: Silence_all_errors():error(0) {} - virtual ~Silence_all_errors() {} + ~Silence_all_errors() override {} - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sql_state, Sql_condition::enum_warning_level *level, const char* msg, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { error= sql_errno; *cond_hdl= NULL; @@ -9303,8 +9303,12 @@ THD *find_thread_by_id(longlong id, bool query_id) @param type Type of id: thread id or query id */ -uint -kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type type) +static uint +kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type type +#ifdef WITH_WSREP + , bool &wsrep_high_priority +#endif +) { THD *tmp; uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD); @@ -9339,17 +9343,22 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from concurrent usage -#ifdef WITH_WSREP - if (((thd->security_ctx->master_access & PRIV_KILL_OTHER_USER_PROCESS) || - thd->security_ctx->user_matches(tmp->security_ctx)) && - !wsrep_thd_is_BF(tmp, false) && !tmp->wsrep_applier) -#else if ((thd->security_ctx->master_access & PRIV_KILL_OTHER_USER_PROCESS) || thd->security_ctx->user_matches(tmp->security_ctx)) -#endif /* WITH_WSREP */ { - { #ifdef WITH_WSREP + if (wsrep_thd_is_BF(tmp, false) || tmp->wsrep_applier) + { + error= ER_KILL_DENIED_ERROR; + wsrep_high_priority= true; + push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, + ER_KILL_DENIED_ERROR, + "Thread %lld is %s and cannot be killed", + tmp->thread_id, + (tmp->wsrep_applier ? "wsrep applier" : "high priority")); + } + else + { if (WSREP(tmp)) { error = wsrep_kill_thd(thd, tmp, kill_signal); @@ -9361,8 +9370,8 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type error= 0; #ifdef WITH_WSREP } -#endif /* WITH_WSREP */ } +#endif /* WITH_WSREP */ } else error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR : @@ -9461,16 +9470,32 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user, static void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type) { - uint error; - if (likely(!(error= kill_one_thread(thd, id, state, type)))) +#ifdef WITH_WSREP + bool wsrep_high_priority= false; +#endif + uint error= kill_one_thread(thd, id, state, type +#ifdef WITH_WSREP + , wsrep_high_priority +#endif + ); + + if (likely(!error)) { if (!thd->killed) my_ok(thd); else thd->send_kill_message(); } +#ifdef WITH_WSREP + else if (wsrep_high_priority) + my_printf_error(error, "This is a high priority thread/query and" + " cannot be killed without compromising" + " the consistency of the cluster", MYF(0)); +#endif else + { my_error(error, MYF(0), id); + } } diff --git a/sql/sql_partition_admin.h b/sql/sql_partition_admin.h index b50c3555bcb..eee021b5fb4 100644 --- a/sql/sql_partition_admin.h +++ b/sql/sql_partition_admin.h @@ -129,7 +129,7 @@ public: ~Sql_cmd_alter_table_exchange_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; private: bool exchange_partition(THD *thd, TABLE_LIST *, Alter_info *); @@ -151,10 +151,10 @@ public: ~Sql_cmd_alter_table_analyze_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; /* Override SQLCOM_ANALYZE, since it is an ALTER command */ - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } @@ -176,10 +176,10 @@ public: ~Sql_cmd_alter_table_check_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; /* Override SQLCOM_CHECK, since it is an ALTER command */ - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } @@ -201,10 +201,10 @@ public: ~Sql_cmd_alter_table_optimize_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; /* Override SQLCOM_OPTIMIZE, since it is an ALTER command */ - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } @@ -226,10 +226,10 @@ public: ~Sql_cmd_alter_table_repair_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; /* Override SQLCOM_REPAIR, since it is an ALTER command */ - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } @@ -249,10 +249,10 @@ public: virtual ~Sql_cmd_alter_table_truncate_partition() = default; - bool execute(THD *thd); + bool execute(THD *thd) override; /* Override SQLCOM_TRUNCATE, since it is an ALTER command */ - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_ALTER_TABLE; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 82a675d7ff1..6945941344b 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -314,22 +314,22 @@ public: sys_var_pluginvar(sys_var_chain *chain, const char *name_arg, st_plugin_int *p, st_mysql_sys_var *plugin_var_arg, const char *substitute); - sys_var_pluginvar *cast_pluginvar() { return this; } + sys_var_pluginvar *cast_pluginvar() override { return this; } uchar* real_value_ptr(THD *thd, enum_var_type type) const; TYPELIB* plugin_var_typelib(void) const; const uchar* do_value_ptr(THD *thd, enum_var_type type, const LEX_CSTRING *base) const; - const uchar* session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar* session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return do_value_ptr(thd, OPT_SESSION, base); } - const uchar* global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar* global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return do_value_ptr(thd, OPT_GLOBAL, base); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return do_value_ptr(thd, OPT_DEFAULT, 0); } - bool do_check(THD *thd, set_var *var); - virtual void session_save_default(THD *thd, set_var *var) {} - virtual void global_save_default(THD *thd, set_var *var) {} - bool session_update(THD *thd, set_var *var); - bool global_update(THD *thd, set_var *var); - bool session_is_default(THD *thd); + bool do_check(THD *thd, set_var *var) override; + void session_save_default(THD *thd, set_var *var) override {} + void global_save_default(THD *thd, set_var *var) override {} + bool session_update(THD *thd, set_var *var) override; + bool global_update(THD *thd, set_var *var) override; + bool session_is_default(THD *thd) override; }; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 821ef29a0c2..366aa6fcd25 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -144,11 +144,11 @@ class Select_fetch_protocol_binary: public select_send Protocol_binary protocol; public: Select_fetch_protocol_binary(THD *thd); - virtual bool send_result_set_metadata(List &list, uint flags); - virtual int send_data(List &items); - virtual bool send_eof(); + bool send_result_set_metadata(List &list, uint flags) override; + int send_data(List &items) override; + bool send_eof() override; #ifdef EMBEDDED_LIBRARY - void begin_dataset() + void begin_dataset() override { protocol.begin_dataset(); } @@ -209,7 +209,7 @@ public: String *expanded_query); public: Prepared_statement(THD *thd_arg); - virtual ~Prepared_statement(); + ~Prepared_statement() override; void setup_set_params(); Query_arena::Type type() const override; bool cleanup_stmt(bool restore_set_statement_vars) override; @@ -257,7 +257,7 @@ class Execute_sql_statement: public Server_runnable { public: Execute_sql_statement(LEX_STRING sql_text); - virtual bool execute_server_code(THD *thd); + bool execute_server_code(THD *thd) override; private: LEX_STRING m_sql_text; }; @@ -5691,29 +5691,33 @@ public: thd->set_binlog_bit(); } protected: - bool net_store_data(const uchar *from, size_t length); + bool net_store_data(const uchar *from, size_t length) override; bool net_store_data_cs(const uchar *from, size_t length, - CHARSET_INFO *fromcs, CHARSET_INFO *tocs); - bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count); + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override; + bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count) override; bool net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *, - bool); - bool net_send_error_packet(THD *, uint, const char *, const char *); + bool) override; + bool net_send_error_packet(THD *, uint, const char *, const char *) override; bool begin_dataset(); bool begin_dataset(THD *thd, uint numfields); - bool write(); - bool flush(); + bool write() override; + bool flush() override; bool store_field_metadata(const THD *thd, const Send_field &field, CHARSET_INFO *charset_for_protocol, uint pos); - bool send_result_set_metadata(List *list, uint flags); + bool send_result_set_metadata(List *list, uint flags) override; +#ifdef EMBEDDED_LIBRARY + void remove_last_row() override; +#else void remove_last_row(); - bool store_null(); - void prepare_for_resend(); +#endif + bool store_null() override; + void prepare_for_resend() override; bool send_list_fields(List *list, const TABLE_LIST *table_list); - enum enum_protocol_type type() { return PROTOCOL_LOCAL; }; + enum enum_protocol_type type() override { return PROTOCOL_LOCAL; }; }; static diff --git a/sql/sql_priv.h b/sql/sql_priv.h index 5ae14f7fd6b..7a7a0241ab0 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -325,7 +325,10 @@ */ /* This subquery has fields from outer query (put by user) */ #define UNCACHEABLE_DEPENDENT_GENERATED 1 -/* This subquery contains functions with random result */ +/* + This subquery contains functions with random result. + Something that is uncacheable is by default unmergeable. +*/ #define UNCACHEABLE_RAND 2 /* This subquery contains functions with side effect */ #define UNCACHEABLE_SIDEEFFECT 4 diff --git a/sql/sql_schema.cc b/sql/sql_schema.cc index 7a6c0c99398..0dcd9aa9f86 100644 --- a/sql/sql_schema.cc +++ b/sql/sql_schema.cc @@ -26,7 +26,7 @@ public: :Schema(name) { } const Type_handler *map_data_type(THD *thd, const Type_handler *src) - const + const override { if (src == &type_handler_newdate) return thd->type_handler_for_datetime(); @@ -34,7 +34,7 @@ public: } Create_func *find_native_function_builder(THD *thd, const LEX_CSTRING &name) - const + const override { return native_functions_hash_oracle.find(thd, name); } @@ -42,10 +42,10 @@ public: Item *make_item_func_replace(THD *thd, Item *subj, Item *find, - Item *replace) const; + Item *replace) const override; Item *make_item_func_substr(THD *thd, - const Lex_substring_spec_st &spec) const; - Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const; + const Lex_substring_spec_st &spec) const override; + Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const override; }; @@ -56,7 +56,7 @@ public: :Schema(name) { } const Type_handler *map_data_type(THD *thd, const Type_handler *src) - const + const override { if (src == &type_handler_timestamp || src == &type_handler_timestamp2) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e195ab31564..cf5a2983551 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1932,7 +1932,7 @@ int JOIN::optimize() the joined table. @retval false Ok - @retval true Error + @retval true Error, query should abort */ bool JOIN::make_range_rowid_filters() @@ -1985,7 +1985,7 @@ bool JOIN::make_range_rowid_filters() (ha_rows) HA_POS_ERROR, true, false, true, true, Item_func::BITMAP_EXCEPT_ANY_EQUALITY); tab->table->force_index= force_index_save; - if (rc == SQL_SELECT::ERROR || thd->is_error()) + if (rc == SQL_SELECT::ERROR || thd->is_error() || thd->check_killed()) { delete sel; DBUG_RETURN(true); /* Fatal error */ @@ -24685,6 +24685,90 @@ void compute_part_of_sort_key_for_equals(JOIN *join, TABLE *table, } +/* + @brief + This is called when switching table access to produce records + in reverse order. + + @detail + - Disable "Range checked for each record" (Is this strictly necessary + here?) + - Disable Index Condition Pushdown and Rowid Filtering. + + IndexConditionPushdownAndReverseScans, RowidFilteringAndReverseScans: + Suppose we're computing + + select * from t1 + where + key1 between 10 and 20 and extra_condition + order by key1 desc + + here the range access uses a reverse-ordered scan on (1 <= key1 <= 10) and + extra_condition is checked by either ICP or Rowid Filtering. + + Also suppose that extra_condition happens to be false for rows of t1 that + do not satisfy the "10 <= key1 <= 20" condition. + + For forward ordered range scan, the SQL layer will make these calls: + + h->read_range_first(RANGE(10 <= key1 <= 20)); + while (h->read_range_next()) { ... } + + The storage engine sees the end endpoint of "key1<=20" and can stop scanning + as soon as it encounters a row with key1>20. + + For backward-ordered range scan, the SQL layer will make these calls: + + h->index_read_map(key1=20, HA_READ_PREFIX_LAST_OR_PREV); + while (h->index_prev()) { + if (cmp_key(h->record, "key1=10" )<0) + break; // end of range + ... + } + + Note that the check whether we've walked beyond the key=10 endpoint is + made at the SQL layer. The storage engine has no information about the left + endpoint of the interval we're scanning. If all rows before that endpoint + do not satisfy ICP condition or do not pass the Rowid Filter, the storage + engine will enumerate the records until the table start. + + In MySQL, the API is extended with set_end_range() call so that the storage + engine "knows" when to stop scanning. +*/ + +static void prepare_for_reverse_ordered_access(JOIN_TAB *tab) +{ + /* Cancel "Range checked for each record" */ + if (tab->use_quick == 2) + { + tab->use_quick= 1; + tab->read_first_record= join_init_read_record; + } + /* + Cancel Pushed Index Condition, as it doesn't work for reverse scans. + */ + if (tab->select && tab->select->pre_idx_push_select_cond) + { + tab->set_cond(tab->select->pre_idx_push_select_cond); + tab->table->file->cancel_pushed_idx_cond(); + } + /* + The same with Rowid Filter: it doesn't work with reverse scans so cancel + it, too. + */ + { + /* + Rowid Filter is initialized at a later stage. It is not pushed to + the storage engine yet: + */ + DBUG_ASSERT(!tab->table->file->pushed_rowid_filter); + tab->range_rowid_filter_info= NULL; + delete tab->rowid_filter; + tab->rowid_filter= NULL; + } +} + + /** Test if we can skip the ORDER BY by using an index. @@ -25148,23 +25232,11 @@ check_reverse_order: tab->limit= 0; goto use_filesort; // Reverse sort failed -> filesort } - /* - Cancel Pushed Index Condition, as it doesn't work for reverse scans. - */ - if (tab->select && tab->select->pre_idx_push_select_cond) - { - tab->set_cond(tab->select->pre_idx_push_select_cond); - tab->table->file->cancel_pushed_idx_cond(); - } + prepare_for_reverse_ordered_access(tab); + if (select->quick == save_quick) save_quick= 0; // make_reverse() consumed it select->set_quick(tmp); - /* Cancel "Range checked for each record" */ - if (tab->use_quick == 2) - { - tab->use_quick= 1; - tab->read_first_record= join_init_read_record; - } } else if (tab->type != JT_NEXT && tab->type != JT_REF_OR_NULL && tab->ref.key >= 0 && tab->ref.key_parts <= used_key_parts) @@ -25177,20 +25249,7 @@ check_reverse_order: */ tab->read_first_record= join_read_last_key; tab->read_record.read_record_func= join_read_prev_same; - /* Cancel "Range checked for each record" */ - if (tab->use_quick == 2) - { - tab->use_quick= 1; - tab->read_first_record= join_init_read_record; - } - /* - Cancel Pushed Index Condition, as it doesn't work for reverse scans. - */ - if (tab->select && tab->select->pre_idx_push_select_cond) - { - tab->set_cond(tab->select->pre_idx_push_select_cond); - tab->table->file->cancel_pushed_idx_cond(); - } + prepare_for_reverse_ordered_access(tab); } } else if (select && select->quick) diff --git a/sql/sql_select.h b/sql/sql_select.h index 37a906b50aa..128426993ac 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -775,13 +775,13 @@ class Duplicate_weedout_picker : public Semi_join_strategy_picker bool is_used; public: - void set_empty() + void set_empty() override { dupsweedout_tables= 0; first_dupsweedout_table= MAX_TABLES; is_used= FALSE; } - void set_from_prev(POSITION *prev); + void set_from_prev(POSITION *prev) override; bool check_qep(JOIN *join, uint idx, @@ -791,9 +791,9 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *stratey, - POSITION *loose_scan_pos); + POSITION *loose_scan_pos) override; - void mark_used() { is_used= TRUE; } + void mark_used() override { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); }; @@ -821,13 +821,13 @@ class Firstmatch_picker : public Semi_join_strategy_picker bool in_firstmatch_prefix() { return (first_firstmatch_table != MAX_TABLES); } void invalidate_firstmatch_prefix() { first_firstmatch_table= MAX_TABLES; } public: - void set_empty() + void set_empty() override { invalidate_firstmatch_prefix(); is_used= FALSE; } - void set_from_prev(POSITION *prev); + void set_from_prev(POSITION *prev) override; bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -836,9 +836,9 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - POSITION *loose_scan_pos); + POSITION *loose_scan_pos) override; - void mark_used() { is_used= TRUE; } + void mark_used() override { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); }; @@ -864,13 +864,13 @@ public: uint loosescan_parts; /* Number of keyparts to be kept distinct */ bool is_used; - void set_empty() + void set_empty() override { first_loosescan_table= MAX_TABLES; is_used= FALSE; } - void set_from_prev(POSITION *prev); + void set_from_prev(POSITION *prev) override; bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -879,8 +879,8 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - POSITION *loose_scan_pos); - void mark_used() { is_used= TRUE; } + POSITION *loose_scan_pos) override; + void mark_used() override { is_used= TRUE; } friend class Loose_scan_opt; friend void best_access_path(JOIN *join, @@ -912,13 +912,13 @@ class Sj_materialization_picker : public Semi_join_strategy_picker table_map sjm_scan_need_tables; public: - void set_empty() + void set_empty() override { sjm_scan_need_tables= 0; sjm_scan_last_inner= 0; is_used= FALSE; } - void set_from_prev(POSITION *prev); + void set_from_prev(POSITION *prev) override; bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -927,8 +927,8 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - POSITION *loose_scan_pos); - void mark_used() { is_used= TRUE; } + POSITION *loose_scan_pos) override; + void mark_used() override { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); }; @@ -2039,7 +2039,7 @@ public: enum Type type() const override { return ITEM_STORE_KEY; } - const char *name() const override { return "func"; } + const char *name() const override { return "func"; } protected: enum store_key_result copy_inner() override @@ -2092,7 +2092,7 @@ public: {} enum Type type() const override { return CONST_ITEM_STORE_KEY; } - const char *name() const override { return "const"; } + const char *name() const override { return "const"; } bool store_key_is_const() override { return true; } protected: diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 44f4cd70d20..cc2fb88509a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1078,7 +1078,7 @@ public: bool handle_condition(THD *thd, uint sql_errno, const char * /* sqlstate */, Sql_condition::enum_warning_level *level, - const char *message, Sql_condition ** /* cond_hdl */) + const char *message, Sql_condition ** /* cond_hdl */) override { /* The handler does not handle the errors raised by itself. @@ -5132,7 +5132,7 @@ class Warnings_only_error_handler : public Internal_error_handler public: bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, - const char* msg, Sql_condition ** cond_hdl) + const char* msg, Sql_condition ** cond_hdl) override { if (sql_errno == ER_TRG_NO_DEFINER || sql_errno == ER_TRG_NO_CREATION_CTX || sql_errno == ER_PARSE_ERROR) @@ -10324,12 +10324,12 @@ class IS_internal_schema_access : public ACL_internal_schema_access public: IS_internal_schema_access() = default; - ~IS_internal_schema_access() = default; + ~IS_internal_schema_access() override = default; ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + privilege_t *save_priv) const override; - const ACL_internal_table_access *lookup(const char *name) const; + const ACL_internal_table_access *lookup(const char *name) const override; }; ACL_internal_access_result diff --git a/sql/sql_show.h b/sql/sql_show.h index 3d7a4d1146c..1fd2509250b 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -174,7 +174,7 @@ public: String query_str; /* Overloaded virtual function */ - void call_in_target_thread(); + void call_in_target_thread() override; }; /** diff --git a/sql/sql_signal.h b/sql/sql_signal.h index abc9905aefb..b2fe8eb69c4 100644 --- a/sql/sql_signal.h +++ b/sql/sql_signal.h @@ -85,12 +85,12 @@ public: virtual ~Sql_cmd_signal() = default; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_SIGNAL; } - virtual bool execute(THD *thd); + bool execute(THD *thd) override; }; /** @@ -111,12 +111,12 @@ public: virtual ~Sql_cmd_resignal() = default; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_RESIGNAL; } - virtual bool execute(THD *thd); + bool execute(THD *thd) override; }; #endif diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 3f4f5745565..a874f88b3d8 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1815,7 +1815,7 @@ public: tree_key_length, max_heap_table_size, 1); } - bool add() + bool add() override { longlong val= table_field->val_int(); return tree->unique_add(&val); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 3db038fdbf0..2fb2c4a4f09 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -82,7 +82,7 @@ public: :Stored_program_creation_ctx(client_cs, connection_cl, db_cl) { } - virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) + Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) override { return new (mem_root) Trigger_creation_ctx(m_client_cs, m_connection_cl, @@ -90,7 +90,7 @@ public: } protected: - virtual Object_creation_ctx *create_backup_ctx(THD *thd) const + Object_creation_ctx *create_backup_ctx(THD *thd) const override { return new Trigger_creation_ctx(thd); } @@ -282,8 +282,8 @@ public: Handle_old_incorrect_sql_modes_hook(const char *file_path) :path(file_path) {}; - virtual bool process_unknown_string(const char *&unknown_key, uchar* base, - MEM_ROOT *mem_root, const char *end); + bool process_unknown_string(const char *&unknown_key, uchar* base, + MEM_ROOT *mem_root, const char *end) override; }; @@ -294,8 +294,8 @@ public: LEX_CSTRING *trigger_table_arg) :path(file_path), trigger_table_value(trigger_table_arg) {}; - virtual bool process_unknown_string(const char *&unknown_key, uchar* base, - MEM_ROOT *mem_root, const char *end); + bool process_unknown_string(const char *&unknown_key, uchar* base, + MEM_ROOT *mem_root, const char *end) override; private: const char *path; LEX_CSTRING *trigger_table_value; @@ -322,12 +322,12 @@ public: Deprecated_trigger_syntax_handler() : m_trigger_name(NULL) {} - virtual bool handle_condition(THD *thd, + bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, const char* message, - Sql_condition ** cond_hdl) + Sql_condition ** cond_hdl) override { if (sql_errno != EE_OUTOFMEMORY && sql_errno != ER_OUT_OF_RESOURCES) diff --git a/sql/sql_truncate.h b/sql/sql_truncate.h index 5704da1dd7b..52d8e385fba 100644 --- a/sql/sql_truncate.h +++ b/sql/sql_truncate.h @@ -40,9 +40,9 @@ public: @param thd the current thread. @return false on success. */ - bool execute(THD *thd); + bool execute(THD *thd) override; - virtual enum_sql_command sql_command_code() const + enum_sql_command sql_command_code() const override { return SQLCOM_TRUNCATE; } diff --git a/sql/sql_type.h b/sql/sql_type.h index f59ab663a2f..839a47ebb83 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -3616,13 +3616,13 @@ public: class Vers_type_timestamp: public Vers_type_handler { public: - virtual vers_kind_t kind() const + vers_kind_t kind() const override { return VERS_TIMESTAMP; } bool check_sys_fields(const LEX_CSTRING &table_name, const Column_definition *row_start, - const Column_definition *row_end) const; + const Column_definition *row_end) const override; }; extern Vers_type_timestamp vers_type_timestamp; @@ -3630,13 +3630,13 @@ extern Vers_type_timestamp vers_type_timestamp; class Vers_type_trx: public Vers_type_handler { public: - virtual vers_kind_t kind() const + vers_kind_t kind() const override { return VERS_TRX_ID; } bool check_sys_fields(const LEX_CSTRING &table_name, const Column_definition *row_start, - const Column_definition *row_end) const; + const Column_definition *row_end) const override; }; extern MYSQL_PLUGIN_IMPORT Vers_type_trx vers_type_trx; diff --git a/sql/sql_type_fixedbin.h b/sql/sql_type_fixedbin.h index 1ebf559eabb..ece4453d177 100644 --- a/sql/sql_type_fixedbin.h +++ b/sql/sql_type_fixedbin.h @@ -978,9 +978,9 @@ public: public: Item_cache_fbt(THD *thd) :Item_cache(thd, singleton()) { } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy(thd, this); } - bool cache_value() + bool cache_value() override { if (!example) return false; @@ -990,54 +990,54 @@ public: &m_value, type_handler()); return true; } - String* val_str(String *to) + String* val_str(String *to) override { if (!has_value()) return NULL; Fbt_null tmp(m_value.ptr(), m_value.length()); return tmp.is_null() || tmp.to_string(to) ? NULL : to; } - my_decimal *val_decimal(my_decimal *to) + my_decimal *val_decimal(my_decimal *to) override { if (!has_value()) return NULL; my_decimal_set_zero(to); return to; } - longlong val_int() + longlong val_int() override { if (!has_value()) return 0; return 0; } - double val_real() + double val_real() override { if (!has_value()) return 0; return 0; } - longlong val_datetime_packed(THD *thd) + longlong val_datetime_packed(THD *) override { DBUG_ASSERT(0); if (!has_value()) return 0; return 0; } - longlong val_time_packed(THD *thd) + longlong val_time_packed(THD *) override { DBUG_ASSERT(0); if (!has_value()) return 0; return 0; } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *, MYSQL_TIME *ltime, date_mode_t) override { if (!has_value()) return true; set_zero_time(ltime, MYSQL_TIMESTAMP_TIME); return false; } - bool val_native(THD *thd, Native *to) + bool val_native(THD *, Native *to) override { if (!has_value()) return true; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 8617c41c522..8e70e76be38 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1696,8 +1696,8 @@ class Multiupdate_prelocking_strategy : public DML_prelocking_strategy bool done; bool has_prelocking_list; public: - void reset(THD *thd); - bool handle_end(THD *thd); + void reset(THD *thd) override; + bool handle_end(THD *thd) override; }; void Multiupdate_prelocking_strategy::reset(THD *thd) diff --git a/sql/sql_window.cc b/sql/sql_window.cc index ccdbf3d79bd..5991c027e64 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -950,7 +950,7 @@ protected: class Table_read_cursor : public Rowid_seq_cursor { public: - virtual ~Table_read_cursor() = default; + ~Table_read_cursor() override = default; void init(READ_RECORD *info) { @@ -1018,7 +1018,7 @@ public: /* This returns -1 when end of partition was reached. */ - int next() + int next() override { int res; if (end_of_partition) @@ -1308,12 +1308,12 @@ public: item_add->fix_fields(thd, &item_add); } - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); @@ -1322,19 +1322,19 @@ public: end_of_partition= false; } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { walk_till_non_peer(); } - void pre_next_row() + void pre_next_row() override { if (end_of_partition) return; range_expr->fetch_value_from(item_add); } - void next_row() + void next_row() override { if (end_of_partition) return; @@ -1346,12 +1346,12 @@ public: walk_till_non_peer(); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } - bool is_outside_computation_bounds() const + bool is_outside_computation_bounds() const override { if (end_of_partition) return true; @@ -1448,12 +1448,12 @@ public: item_add->fix_fields(thd, &item_add); } - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); @@ -1463,20 +1463,20 @@ public: added_values= false; } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { cursor.move_to(rownum); walk_till_non_peer(); } - void pre_next_row() + void pre_next_row() override { if (end_of_partition) return; range_expr->fetch_value_from(item_add); } - void next_row() + void next_row() override { if (end_of_partition) return; @@ -1488,14 +1488,14 @@ public: walk_till_non_peer(); } - bool is_outside_computation_bounds() const + bool is_outside_computation_bounds() const override { if (!added_values) return true; return false; } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { if (end_of_partition) return cursor.get_rownum(); // Cursor does not pass over partition bound. @@ -1557,13 +1557,13 @@ public: { } - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); peer_tracker.init(); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { // Save the value of the current_row peer_tracker.check_if_next_group(); @@ -1572,17 +1572,17 @@ public: add_value_to_items(); } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { walk_till_non_peer(); } - void pre_next_row() + void pre_next_row() override { dont_move= !peer_tracker.check_if_next_group(); } - void next_row() + void next_row() override { // Check if our cursor is pointing at a peer of the current row. // If not, move forward until that becomes true @@ -1597,7 +1597,7 @@ public: walk_till_non_peer(); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -1654,7 +1654,7 @@ public: move(false) {} - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { bound_tracker.init(); @@ -1662,23 +1662,23 @@ public: peer_tracker.init(); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { // Fetch the value from the first row peer_tracker.check_if_next_group(); cursor.move_to(rownum); } - void next_partition(ha_rows rownum) {} + void next_partition(ha_rows rownum) override {} - void pre_next_row() + void pre_next_row() override { // Check if the new current_row is a peer of the row that our cursor is // pointing to. move= peer_tracker.check_if_next_group(); } - void next_row() + void next_row() override { if (move) { @@ -1706,7 +1706,7 @@ public: } } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -1728,9 +1728,9 @@ public: SQL_I_List *order_list) {} - void init(READ_RECORD *info) {} + void init(READ_RECORD *info) override {} - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { /* UNBOUNDED PRECEDING frame end just stays on the first row of the @@ -1740,12 +1740,12 @@ public: curr_rownum= rownum; } - void next_row() + void next_row() override { /* Do nothing, UNBOUNDED PRECEDING frame end doesn't move. */ } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return curr_rownum; } @@ -1770,17 +1770,17 @@ public: SQL_I_List *order_list) : cursor(thd, partition_list) {} - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { cursor.on_next_partition(rownum); } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { /* Activate the first row */ cursor.fetch(); @@ -1793,12 +1793,12 @@ public: } } - void next_row() + void next_row() override { /* Do nothing, UNBOUNDED FOLLOWING frame end doesn't move */ } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -1813,7 +1813,7 @@ public: SQL_I_List *partition_list, SQL_I_List *order_list) : Frame_unbounded_following(thd, partition_list, order_list) {} - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { ha_rows num_rows_in_partition= 0; if (cursor.fetch()) @@ -1826,7 +1826,7 @@ public: set_win_funcs_row_count(num_rows_in_partition); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -1853,7 +1853,7 @@ public: { order_item= order_list->first->item[0]; } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { ha_rows num_rows_in_partition= 0; if (cursor.fetch()) @@ -1869,7 +1869,7 @@ public: set_win_funcs_row_count(num_rows_in_partition); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -1900,12 +1900,12 @@ public: is_top_bound(is_top_bound_arg), n_rows(n_rows_arg), n_rows_behind(0) {} - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { /* Position our cursor to point at the first row in the new partition @@ -1931,13 +1931,13 @@ public: } - void next_row() + void next_row() override { n_rows_behind++; move_cursor_if_possible(); } - bool is_outside_computation_bounds() const + bool is_outside_computation_bounds() const override { /* As a bottom boundary, rows have not yet been added. */ if (!is_top_bound && n_rows - n_rows_behind) @@ -1945,7 +1945,7 @@ public: return false; } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -2003,26 +2003,26 @@ public: Frame_rows_current_row_bottom() : curr_rownum(0) {} - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { add_value_to_items(); curr_rownum= rownum; } - void next_partition(ha_rows rownum) {} + void next_partition(ha_rows rownum) override {} - void pre_next_row() + void pre_next_row() override { /* Temp table's current row is current_row. Add it to the window func */ add_value_to_items(); } - void next_row() + void next_row() override { curr_rownum++; }; - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return curr_rownum; } @@ -2079,13 +2079,13 @@ public: { } - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); at_partition_end= false; } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { at_partition_end= false; @@ -2093,7 +2093,7 @@ public: } /* Move our cursor to be n_rows ahead. */ - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { if (is_top_bound) next_part_top(rownum); @@ -2101,7 +2101,7 @@ public: next_part_bottom(rownum); } - void next_row() + void next_row() override { if (is_top_bound) next_row_top(); @@ -2109,7 +2109,7 @@ public: next_row_bottom(); } - bool is_outside_computation_bounds() const + bool is_outside_computation_bounds() const override { /* The top bound can go over the current partition. In this case, @@ -2120,7 +2120,7 @@ public: return false; } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return cursor.get_rownum(); } @@ -2206,12 +2206,12 @@ public: const Frame_cursor &bottom_bound) : top_bound(top_bound), bottom_bound(bottom_bound) {} - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { /* TODO(cvicentiu) Sum functions get cleared on next partition anyway during the window function computation algorithm. Either perform this only in @@ -2221,23 +2221,23 @@ public: clear_sum_functions(); } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { compute_values_for_current_row(); } - void pre_next_row() + void pre_next_row() override { clear_sum_functions(); } - void next_row() + void next_row() override { curr_rownum++; compute_values_for_current_row(); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return curr_rownum; } @@ -2297,36 +2297,36 @@ class Frame_positional_cursor : public Frame_cursor bottom_bound(&bottom_bound), offset(&offset), negative_offset(negative_offset) {} - void init(READ_RECORD *info) + void init(READ_RECORD *info) override { cursor.init(info); } - void pre_next_partition(ha_rows rownum) + void pre_next_partition(ha_rows rownum) override { /* The offset is dependant on the current row values. We can only get * it here accurately. When fetching other rows, it changes. */ save_offset_value(); } - void next_partition(ha_rows rownum) + void next_partition(ha_rows rownum) override { save_positional_value(); } - void pre_next_row() + void pre_next_row() override { /* The offset is dependant on the current row values. We can only get * it here accurately. When fetching other rows, it changes. */ save_offset_value(); } - void next_row() + void next_row() override { save_positional_value(); } - ha_rows get_curr_rownum() const + ha_rows get_curr_rownum() const override { return position_cursor.get_curr_rownum(); } diff --git a/sql/sql_window.h b/sql/sql_window.h index 1c02740e769..6d5bc7e21c9 100644 --- a/sql/sql_window.h +++ b/sql/sql_window.h @@ -173,7 +173,7 @@ class Window_def : public Window_spec : Window_spec(win_ref, part_list, ord_list, win_frame), window_name(win_name) {} - const char *name() { return window_name->str; } + const char *name() override { return window_name->str; } }; diff --git a/sql/sys_vars.inl b/sql/sys_vars.inl index 805000b2a5f..8947d9650c0 100644 --- a/sql/sys_vars.inl +++ b/sql/sys_vars.inl @@ -198,7 +198,7 @@ public: SYSVAR_ASSERT(block_size > 0); SYSVAR_ASSERT(def_val % block_size == 0); } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { my_bool fixed= FALSE, unused; longlong v= var->value->val_int(); @@ -245,23 +245,23 @@ public: return throw_bounds_warning(thd, name.str, fixed, var->value->unsigned_flag, v); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, T)= static_cast(var->save_result.ulonglong_value); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(T)= static_cast(var->save_result.ulonglong_value); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= (ulonglong)*(T*)global_value_ptr(thd, 0); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } private: T get_max_var() { return *((T*) max_var_ptr()); } - const uchar *default_value_ptr(THD *thd) const { return (uchar*) &option.def_value; } + const uchar *default_value_ptr(THD *thd) const override { return (uchar*) &option.def_value; } }; typedef Sys_var_integer Sys_var_int; @@ -327,7 +327,7 @@ public: typelib.type_lengths= 0; // only used by Fields_enum and Field_set option.typelib= &typelib; } - bool do_check(THD *thd, set_var *var) // works for enums and my_bool + bool do_check(THD *thd, set_var *var) override // works for enums and my_bool { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -395,7 +395,7 @@ public: SYSVAR_ASSERT(size == sizeof(ulong)); } bool check_maximum(THD *thd, set_var *var, - const char *c_val, longlong i_val) + const char *c_val, longlong i_val) override { if (!max_var_ptr() || var->save_result.ulonglong_value <= get_max_var()) @@ -406,27 +406,27 @@ public: throw_bounds_warning(thd, name.str, TRUE, var->value->unsigned_flag, i_val); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, ulong)= static_cast(var->save_result.ulonglong_value); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(ulong)= static_cast(var->save_result.ulonglong_value); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= global_var(ulong); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } const uchar *valptr(THD *thd, ulong val) const { return reinterpret_cast(typelib.type_names[val]); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, ulong)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(ulong)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, (ulong)option.def_value); } ulong get_max_var() { return *((ulong *) max_var_ptr()); } @@ -460,21 +460,21 @@ public: SYSVAR_ASSERT(getopt.arg_type == OPT_ARG || getopt.id < 0); SYSVAR_ASSERT(size == sizeof(my_bool)); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, my_bool)= var->save_result.ulonglong_value != 0; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(my_bool)= var->save_result.ulonglong_value != 0; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= (ulonglong)*(my_bool *)global_value_ptr(thd, 0); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { thd->sys_var_tmp.my_bool_value=(my_bool) option.def_value; return (uchar*) &thd->sys_var_tmp.my_bool_value; @@ -518,7 +518,7 @@ public: option.var_type|= (flags & ALLOCATED) ? GET_STR_ALLOC : GET_STR; global_var(const char*)= def_val; } - void cleanup() + void cleanup() override { if (flags & ALLOCATED) { @@ -556,9 +556,9 @@ public: return false; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { return do_string_check(thd, var, charset(thd)); } - bool session_update(THD *thd, set_var *var)= 0; + bool session_update(THD *thd, set_var *var) override= 0; char *global_update_prepare(THD *thd, set_var *var) { char *new_val, *ptr= var->save_result.string_value.str; @@ -581,14 +581,14 @@ public: flags|= ALLOCATED; global_var(char*)= new_val; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { char *new_val= global_update_prepare(thd, var); global_update_finish(new_val); return (new_val == 0 && var->save_result.string_value.str != 0); } - void session_save_default(THD *thd, set_var *var)= 0; - void global_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override= 0; + void global_save_default(THD *thd, set_var *var) override { char *ptr= (char*)(intptr)option.def_value; var->save_result.string_value.str= ptr; @@ -615,12 +615,12 @@ public: SYSVAR_ASSERT(size == sizeof(char *)); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } }; @@ -649,7 +649,7 @@ public: getopt, def_val, lock, VARIABLE_NOT_IN_BINLOG, 0, 0, 0) {} - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { if (Sys_var_charptr_base::do_check(thd, var) || sysvartrack_validate_value(thd, var->save_result.string_value.str, @@ -657,7 +657,7 @@ public: return TRUE; return FALSE; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { char *new_val= global_update_prepare(thd, var); if (new_val) @@ -673,9 +673,9 @@ public: global_update_finish(new_val); return (new_val == 0 && var->save_result.string_value.str != 0); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { return thd->session_tracker.sysvars.update(thd, var); } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.string_value.str= global_var(char*); var->save_result.string_value.length= @@ -707,27 +707,27 @@ public: { option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } protected: - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return thd->security_ctx->proxy_user[0] ? (uchar *) &(thd->security_ctx->proxy_user[0]) : NULL; @@ -742,7 +742,7 @@ public: {} protected: - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return (uchar*)thd->security_ctx->external_user; } @@ -827,7 +827,7 @@ public: SYSVAR_ASSERT(size == sizeof(LEX_CSTRING)); *const_cast(&show_val_type)= SHOW_LEX_STRING; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { if (Sys_var_charptr::global_update(thd, var)) return true; @@ -861,7 +861,7 @@ public: SYSVAR_ASSERT(scope() == ONLY_SESSION) *const_cast(&show_val_type)= SHOW_LEX_STRING; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -885,7 +885,7 @@ public: } return false; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { LEX_CSTRING *tmp= &session_var(thd, LEX_CSTRING); tmp->length= var->save_result.string_value.length; @@ -893,22 +893,22 @@ public: strmake((char*) tmp->str, var->save_result.string_value.str, tmp->length); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { char *ptr= (char*)(intptr)option.def_value; var->save_result.string_value.str= ptr; var->save_result.string_value.length= strlen(ptr); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(FALSE); return NULL; @@ -945,14 +945,14 @@ public: lock, binlog_status_arg, on_check_func, on_update_func, substitute) { option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { bool rc= Sys_var_charptr::do_string_check(thd, var, charset(thd)); if (var->save_result.string_value.str == nullptr) var->save_result.string_value.str= const_cast(""); return rc; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { const char *val= var->save_result.string_value.str; if (!var->value) @@ -961,33 +961,33 @@ public: DBUG_SET(val); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { const char *val= var->save_result.string_value.str; DBUG_SET_INITIAL(val); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { char *ptr= (char*)(intptr)option.def_value; var->save_result.string_value.str= ptr; var->save_result.string_value.length= safe_strlen(ptr); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { char buf[256]; DBUG_EXPLAIN(buf, sizeof(buf)); return (uchar*) thd->strdup(buf); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { char buf[256]; DBUG_EXPLAIN_INITIAL(buf, sizeof(buf)); return (uchar*) thd->strdup(buf); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return (uchar*)""; } }; #endif @@ -1033,7 +1033,7 @@ public: offset= global_var_ptr() - (uchar*)dflt_key_cache; SYSVAR_ASSERT(scope() == GLOBAL); } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { ulonglong new_value= var->save_result.ulonglong_value; LEX_CSTRING *base_name= &var->base; @@ -1063,7 +1063,7 @@ public: return keycache_update(thd, key_cache, offset, new_value); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { KEY_CACHE *key_cache= get_key_cache(base); if (!key_cache) @@ -1197,7 +1197,7 @@ public: SYSVAR_ASSERT(max_val >= def_val); SYSVAR_ASSERT(size == sizeof(double)); } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { my_bool fixed; double v= var->value->val_real(); @@ -1205,19 +1205,19 @@ public: return throw_bounds_warning(thd, name.str, fixed, v); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, double)= var->save_result.double_value; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(double)= var->save_result.double_value; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.double_value= global_var(double); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.double_value= getopt_ulonglong2double(option.def_value); } }; @@ -1248,7 +1248,7 @@ public: lock, binlog_status_arg, on_check_func, on_update_func, substitute) { } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { if (thd->user_connect && thd->user_connect->user_resources.user_conn) return (uchar*) &(thd->user_connect->user_resources.user_conn); @@ -1294,7 +1294,7 @@ public: SYSVAR_ASSERT(strcmp(values[typelib.count-1], "default") == 0); SYSVAR_ASSERT(size == sizeof(ulonglong)); } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -1346,27 +1346,27 @@ public: return false; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, ulonglong)= var->save_result.ulonglong_value; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(ulonglong)= var->save_result.ulonglong_value; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= global_var(ulonglong); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } const uchar *valptr(THD *thd, ulonglong val) const { return (uchar*)flagset_to_string(thd, 0, val, typelib.type_names); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, ulonglong)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(ulonglong)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, option.def_value); } }; @@ -1413,7 +1413,7 @@ public: SYSVAR_ASSERT(size == sizeof(ulonglong)); } bool check_maximum(THD *thd, set_var *var, - const char *c_val, longlong i_val) + const char *c_val, longlong i_val) override { if (!max_var_ptr() || (var->save_result.ulonglong_value & ~(get_max_var())) == 0) @@ -1424,7 +1424,7 @@ public: throw_bounds_warning(thd, name.str, TRUE, var->value->unsigned_flag, i_val); } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -1470,27 +1470,27 @@ public: var->save_result.ulonglong_value= tmp; return check_maximum(thd, var, 0, tmp); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, ulonglong)= var->save_result.ulonglong_value; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(ulonglong)= var->save_result.ulonglong_value; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= global_var(ulonglong); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } const uchar *valptr(THD *thd, ulonglong val) const { return reinterpret_cast(set_to_string(thd, 0, val, typelib.type_names)); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, ulonglong)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(ulonglong)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, option.def_value); } ulonglong get_max_var() { return *((ulonglong*) max_var_ptr()); } @@ -1531,7 +1531,7 @@ public: SYSVAR_ASSERT(size == sizeof(plugin_ref)); SYSVAR_ASSERT(getopt.id < 0); // force NO_CMD_LINE } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff,sizeof(buff), system_charset_info), *res; @@ -1570,19 +1570,19 @@ public: plugin_unlock(NULL, oldval); } } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { do_update((plugin_ref*)session_var_ptr(thd), var->save_result.plugin); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { do_update((plugin_ref*)global_var_ptr(), var->save_result.plugin); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { plugin_ref plugin= global_var(plugin_ref); var->save_result.plugin= plugin ? my_plugin_lock(thd, plugin) : 0; @@ -1604,7 +1604,7 @@ public: return my_plugin_lock(thd, plugin); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.plugin= get_default(thd); } @@ -1614,11 +1614,11 @@ public: return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str, plugin_name(plugin)->length) : 0); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, plugin_ref)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(plugin_ref)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, get_default(thd)); } }; @@ -1667,7 +1667,7 @@ public: SYSVAR_ASSERT(size == sizeof(plugin_ref)); SYSVAR_ASSERT(getopt.id < 0); // force NO_CMD_LINE } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff,sizeof(buff), system_charset_info), *res; @@ -1688,19 +1688,19 @@ public: *valptr= copy_engine_list(newval); free_engine_list(oldval); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { do_update((plugin_ref**)session_var_ptr(thd), var->save_result.plugins); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { do_update((plugin_ref**)global_var_ptr(), var->save_result.plugins); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { plugin_ref* plugins= global_var(plugin_ref *); var->save_result.plugins= plugins ? temp_copy_engine_list(thd, plugins) : 0; @@ -1714,7 +1714,7 @@ public: false, true); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.plugins= get_default(thd); } @@ -1723,11 +1723,11 @@ public: { return reinterpret_cast(pretty_print_engine_list(thd, plugins)); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, plugin_ref*)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(plugin_ref*)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, get_default(thd)); } }; @@ -1757,7 +1757,7 @@ public: SYSVAR_ASSERT(scope() == ONLY_SESSION); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -1772,35 +1772,35 @@ public: } return false; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { return debug_sync_update(thd, var->save_result.string_value.str, var->save_result.string_value.length); } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.string_value.str= const_cast(""); var->save_result.string_value.length= 0; } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return debug_sync_value_ptr(thd); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(FALSE); return 0; } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return (uchar*)""; } }; #endif /* defined(ENABLED_DEBUG_SYNC) */ @@ -1858,22 +1858,22 @@ public: SYSVAR_ASSERT(def_val < 2); SYSVAR_ASSERT(size == sizeof(ulonglong)); } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { set(session_var_ptr(thd), var->save_result.ulonglong_value); return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { set(global_var_ptr(), var->save_result.ulonglong_value); return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= (reverse_semantics == !(global_var(ulonglong) & bitmask)); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.ulonglong_value= option.def_value; } uchar *valptr(THD *thd, ulonglong val) const @@ -1881,11 +1881,11 @@ public: thd->sys_var_tmp.my_bool_value= (reverse_semantics == !(val & bitmask)); return (uchar*) &thd->sys_var_tmp.my_bool_value; } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, ulonglong)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(ulonglong)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { thd->sys_var_tmp.my_bool_value= option.def_value != 0; return (uchar*) &thd->sys_var_tmp.my_bool_value; @@ -1933,28 +1933,28 @@ public: SYSVAR_ASSERT(scope() == ONLY_SESSION); SYSVAR_ASSERT(getopt.id < 0); // NO_CMD_LINE, because the offset is fake } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { return update_func(thd, var); } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->value= 0; } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { thd->sys_var_tmp.ulonglong_value= read_func(thd); return (uchar*) &thd->sys_var_tmp.ulonglong_value; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(FALSE); return 0; } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { thd->sys_var_tmp.ulonglong_value= 0; return (uchar*) &thd->sys_var_tmp.ulonglong_value; @@ -1986,7 +1986,7 @@ public: SYSVAR_ASSERT(scope() == ONLY_SESSION); SYSVAR_ASSERT(getopt.id < 0); // NO_CMD_LINE, because the offset is fake } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { if (var->value) { @@ -1997,36 +1997,36 @@ public: thd->user_time.val= 0; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - bool session_is_default(THD *thd) + bool session_is_default(THD *thd) override { return thd->user_time.val == 0; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->value= 0; } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { thd->sys_var_tmp.double_value= thd->start_time + thd->start_time_sec_part/(double)TIME_SECOND_PART_FACTOR; return (uchar*) &thd->sys_var_tmp.double_value; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(FALSE); return 0; } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { thd->sys_var_tmp.double_value= 0; return (uchar*) &thd->sys_var_tmp.double_value; } - bool on_check_access_session(THD *thd) const; + bool on_check_access_session(THD *thd) const override; }; @@ -2065,28 +2065,28 @@ public: SYSVAR_ASSERT(size == sizeof(enum SHOW_COMP_OPTION)); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) { + bool do_check(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(FALSE); return true; } - void session_save_default(THD *thd, set_var *var) { } - void global_save_default(THD *thd, set_var *var) { } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + void session_save_default(THD *thd, set_var *var) override { } + void global_save_default(THD *thd, set_var *var) override { } + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(FALSE); return 0; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return (uchar*)show_comp_option_name[global_var(enum SHOW_COMP_OPTION)]; } @@ -2137,32 +2137,32 @@ public: SYSVAR_ASSERT(getopt.id < 0); SYSVAR_ASSERT(size == sizeof(void *)); } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { return false; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, const void*)= var->save_result.ptr; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(const void*)= var->save_result.ptr; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.ptr= global_var(void*); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { void **default_value= reinterpret_cast(option.def_value); var->save_result.ptr= *default_value; } uchar *valptr(THD *thd, uchar *val) const { return val ? *(uchar**)(val+name_offset) : 0; } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, session_var(thd, uchar*)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(uchar*)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, *(uchar**)option.def_value); } }; @@ -2196,7 +2196,7 @@ public: SYSVAR_ASSERT(size == sizeof(Time_zone *)); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { char buff[MAX_TIME_ZONE_NAME_LENGTH]; String str(buff, sizeof(buff), &my_charset_latin1); @@ -2213,28 +2213,28 @@ public: } return false; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { session_var(thd, Time_zone*)= var->save_result.time_zone; return false; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { global_var(Time_zone*)= var->save_result.time_zone; return false; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { var->save_result.time_zone= global_var(Time_zone*); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { var->save_result.time_zone= *(Time_zone**)(intptr)option.def_value; } const uchar *valptr(THD *thd, Time_zone *val) const { return reinterpret_cast(val->get_name()->ptr()); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { /* This is an ugly fix for replication: we don't replicate properly queries @@ -2247,9 +2247,9 @@ public: thd->time_zone_used= 1; return valptr(thd, session_var(thd, Time_zone *)); } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return valptr(thd, global_var(Time_zone*)); } - const uchar *default_value_ptr(THD *thd) const + const uchar *default_value_ptr(THD *thd) const override { return valptr(thd, *(Time_zone**)option.def_value); } }; @@ -2275,7 +2275,7 @@ public: :Sys_var_enum(name_arg, comment, flag_args, off, size, getopt, values, def_val, lock, binlog_status_arg, on_check_func) {} - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { if (var->type == OPT_SESSION && Sys_var_enum::session_update(thd, var)) return TRUE; @@ -2336,7 +2336,7 @@ public: :Sys_var_mybool(name_arg, comment, flag_args, off, size, getopt, def_val, lock, binlog_status_arg, on_check_func) {} - virtual bool session_update(THD *thd, set_var *var); + bool session_update(THD *thd, set_var *var) override; }; /* @@ -2355,7 +2355,7 @@ public: :Sys_var_enum(name_arg, comment, flag_args, off, size, getopt, values, def_val, lock, binlog_status_arg) {} - bool global_update(THD *thd, set_var *var); + bool global_update(THD *thd, set_var *var) override; }; /* @@ -2396,16 +2396,16 @@ public: mi_accessor_func(mi_accessor_arg), update_multi_source_variable_func(on_update_func) { } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { return session_update(thd, var); } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { /* Use value given in variable declaration */ global_save_default(thd, var); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { ulonglong *tmp, res; tmp= (ulonglong*) (((uchar*)&(thd->variables)) + offset); @@ -2413,7 +2413,7 @@ public: *tmp= res; return (uchar*) tmp; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return session_value_ptr(thd, base); } @@ -2442,35 +2442,35 @@ public: SYSVAR_ASSERT(is_readonly()); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(false); return NULL; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const; + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override; }; @@ -2491,35 +2491,35 @@ public: SYSVAR_ASSERT(is_readonly()); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(false); return NULL; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const; + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override; }; @@ -2538,31 +2538,31 @@ public: { option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var); - bool session_update(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override; + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool global_update(THD *thd, set_var *var); - void session_save_default(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override; + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { /* Record the attempt to use default so we can error. */ var->value= 0; } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(false); return NULL; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const; - const uchar *default_value_ptr(THD *thd) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override; + const uchar *default_value_ptr(THD *thd) const override { return 0; } - bool on_check_access_global(THD *thd) const + bool on_check_access_global(THD *thd) const override { return check_global_access(thd, PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_SLAVE_POS); } @@ -2584,31 +2584,31 @@ public: { option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var); - bool session_update(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override; + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool global_update(THD *thd, set_var *var); - void session_save_default(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override; + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { /* Record the attempt to use default so we can error. */ var->value= 0; } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(false); return NULL; } - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const; - const uchar *default_value_ptr(THD *thd) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override; + const uchar *default_value_ptr(THD *thd) const override { return 0; } - bool on_check_access_global(THD *thd) const + bool on_check_access_global(THD *thd) const override { return check_global_access(thd, PRIV_SET_SYSTEM_GLOBAL_VAR_GTID_BINLOG_STATE); @@ -2632,31 +2632,31 @@ public: SYSVAR_ASSERT(is_readonly()); option.var_type|= GET_STR; } - bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { DBUG_ASSERT(false); return true; } - void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { DBUG_ASSERT(false); } - const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const; - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override; + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { DBUG_ASSERT(false); return NULL; @@ -2681,8 +2681,8 @@ public: option.value= (uchar**)1; // crash me, please SYSVAR_ASSERT(scope() == GLOBAL); } - bool global_update(THD *thd, set_var *var); - const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const; + bool global_update(THD *thd, set_var *var) override; + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override; }; @@ -2703,7 +2703,7 @@ public: { option.var_type= GET_STR; } - virtual bool do_check(THD *thd, set_var *var) + bool do_check(THD *thd, set_var *var) override { if (!var->value) return false; @@ -2742,26 +2742,26 @@ private: } public: - virtual bool global_update(THD *thd, set_var *var) + bool global_update(THD *thd, set_var *var) override { return update(thd, var, &global_var(vers_asof_timestamp_t)); } - virtual bool session_update(THD *thd, set_var *var) + bool session_update(THD *thd, set_var *var) override { return update(thd, var, &session_var(thd, vers_asof_timestamp_t)); } - virtual bool session_is_default(THD *thd) + bool session_is_default(THD *thd) override { const vers_asof_timestamp_t &var= session_var(thd, vers_asof_timestamp_t); return var.type == SYSTEM_TIME_UNSPECIFIED; } - virtual void session_save_default(THD *thd, set_var *var) + void session_save_default(THD *thd, set_var *var) override { save_default(var, &session_var(thd, vers_asof_timestamp_t)); } - virtual void global_save_default(THD *thd, set_var *var) + void global_save_default(THD *thd, set_var *var) override { save_default(var, &global_var(vers_asof_timestamp_t)); } @@ -2799,8 +2799,8 @@ private: } public: - virtual const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return value_ptr(thd, session_var(thd, vers_asof_timestamp_t)); } - virtual const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const + const uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base) const override { return value_ptr(thd, global_var(vers_asof_timestamp_t)); } }; diff --git a/sql/sys_vars_shared.h b/sql/sys_vars_shared.h index 508a0a70c8f..708021b4127 100644 --- a/sql/sys_vars_shared.h +++ b/sql/sys_vars_shared.h @@ -52,9 +52,9 @@ class PolyLock_mutex: public PolyLock mysql_mutex_t *mutex; public: PolyLock_mutex(mysql_mutex_t *arg): mutex(arg) {} - void rdlock() { mysql_mutex_lock(mutex); } - void wrlock() { mysql_mutex_lock(mutex); } - void unlock() { mysql_mutex_unlock(mutex); } + void rdlock() override { mysql_mutex_lock(mutex); } + void wrlock() override { mysql_mutex_lock(mutex); } + void unlock() override { mysql_mutex_unlock(mutex); } }; class PolyLock_rwlock: public PolyLock @@ -62,9 +62,9 @@ class PolyLock_rwlock: public PolyLock mysql_rwlock_t *rwlock; public: PolyLock_rwlock(mysql_rwlock_t *arg): rwlock(arg) {} - void rdlock() { mysql_rwlock_rdlock(rwlock); } - void wrlock() { mysql_rwlock_wrlock(rwlock); } - void unlock() { mysql_rwlock_unlock(rwlock); } + void rdlock() override { mysql_rwlock_rdlock(rwlock); } + void wrlock() override { mysql_rwlock_wrlock(rwlock); } + void unlock() override { mysql_rwlock_unlock(rwlock); } }; class AutoWLock diff --git a/sql/table.h b/sql/table.h index cce059879f0..74bd9625ea9 100644 --- a/sql/table.h +++ b/sql/table.h @@ -173,9 +173,9 @@ protected: CHARSET_INFO *connection_cl); protected: - virtual Object_creation_ctx *create_backup_ctx(THD *thd) const; + Object_creation_ctx *create_backup_ctx(THD *thd) const override; - virtual void change_env(THD *thd) const; + void change_env(THD *thd) const override; protected: /** @@ -566,7 +566,7 @@ public: class Table_check_intact_log_error : public Table_check_intact { protected: - void report_error(uint, const char *fmt, ...); + void report_error(uint, const char *fmt, ...) override; public: Table_check_intact_log_error() : Table_check_intact(true) {} }; @@ -592,9 +592,9 @@ public: MDL_context *get_ctx() const { return m_ctx; } - virtual bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor); + bool accept_visitor(MDL_wait_for_graph_visitor *dvisitor) override; - virtual uint get_deadlock_weight() const; + uint get_deadlock_weight() const override; /** Pointers for participating in the list of waiters for table share. @@ -2985,13 +2985,13 @@ class Field_iterator_table: public Field_iterator Field **ptr; public: Field_iterator_table() :ptr(0) {} - void set(TABLE_LIST *table) { ptr= table->table->field; } + void set(TABLE_LIST *table) override { ptr= table->table->field; } void set_table(TABLE *table) { ptr= table->field; } - void next() { ptr++; } - bool end_of_fields() { return *ptr == 0; } - LEX_CSTRING *name(); - Item *create_item(THD *thd); - Field *field() { return *ptr; } + void next() override { ptr++; } + bool end_of_fields() override { return *ptr == 0; } + LEX_CSTRING *name() override; + Item *create_item(THD *thd) override; + Field *field() override { return *ptr; } }; @@ -3003,13 +3003,13 @@ class Field_iterator_view: public Field_iterator TABLE_LIST *view; public: Field_iterator_view() :ptr(0), array_end(0) {} - void set(TABLE_LIST *table); - void next() { ptr++; } - bool end_of_fields() { return ptr == array_end; } - LEX_CSTRING *name(); - Item *create_item(THD *thd); + void set(TABLE_LIST *table) override; + void next() override { ptr++; } + bool end_of_fields() override { return ptr == array_end; } + LEX_CSTRING *name() override; + Item *create_item(THD *thd) override; Item **item_ptr() {return &ptr->item; } - Field *field() { return 0; } + Field *field() override { return 0; } inline Item *item() { return ptr->item; } Field_translator *field_translator() { return ptr; } }; @@ -3027,12 +3027,12 @@ class Field_iterator_natural_join: public Field_iterator public: Field_iterator_natural_join() :cur_column_ref(NULL) {} ~Field_iterator_natural_join() = default; - void set(TABLE_LIST *table); - void next(); - bool end_of_fields() { return !cur_column_ref; } - LEX_CSTRING *name() { return cur_column_ref->name(); } - Item *create_item(THD *thd) { return cur_column_ref->create_item(thd); } - Field *field() { return cur_column_ref->field(); } + void set(TABLE_LIST *table) override; + void next() override; + bool end_of_fields() override { return !cur_column_ref; } + LEX_CSTRING *name() override { return cur_column_ref->name(); } + Item *create_item(THD *thd) override { return cur_column_ref->create_item(thd); } + Field *field() override { return cur_column_ref->field(); } Natural_join_column *column_ref() { return cur_column_ref; } }; @@ -3063,16 +3063,16 @@ class Field_iterator_table_ref: public Field_iterator void set_field_iterator(); public: Field_iterator_table_ref() :field_it(NULL) {} - void set(TABLE_LIST *table); - void next(); - bool end_of_fields() + void set(TABLE_LIST *table) override; + void next() override; + bool end_of_fields() override { return (table_ref == last_leaf && field_it->end_of_fields()); } - LEX_CSTRING *name() { return field_it->name(); } + LEX_CSTRING *name() override { return field_it->name(); } const char *get_table_name(); const char *get_db_name(); GRANT_INFO *grant(); - Item *create_item(THD *thd) { return field_it->create_item(thd); } - Field *field() { return field_it->field(); } + Item *create_item(THD *thd) override { return field_it->create_item(thd); } + Field *field() override { return field_it->field(); } Natural_join_column *get_or_create_column_ref(THD *thd, TABLE_LIST *parent_table_ref); Natural_join_column *get_natural_column_ref(); }; diff --git a/sql/threadpool.h b/sql/threadpool.h index d815d538cde..4bae78dfddf 100644 --- a/sql/threadpool.h +++ b/sql/threadpool.h @@ -140,13 +140,13 @@ struct TP_pool struct TP_pool_win:TP_pool { TP_pool_win(); - virtual int init(); - virtual ~TP_pool_win(); - virtual TP_connection *new_connection(CONNECT *c); - virtual void add(TP_connection *); - virtual int set_max_threads(uint); - virtual int set_min_threads(uint); - void resume(TP_connection *c); + int init() override; + ~TP_pool_win() override; + TP_connection *new_connection(CONNECT *c) override; + void add(TP_connection *) override; + int set_max_threads(uint) override; + int set_min_threads(uint) override; + void resume(TP_connection *c) override; }; #endif @@ -154,13 +154,13 @@ struct TP_pool_generic :TP_pool { TP_pool_generic(); ~TP_pool_generic(); - virtual int init(); - virtual TP_connection *new_connection(CONNECT *c); - virtual void add(TP_connection *); - virtual int set_pool_size(uint); - virtual int set_stall_limit(uint); - virtual int get_idle_thread_count(); - void resume(TP_connection* c); + int init() override; + TP_connection *new_connection(CONNECT *c) override; + void add(TP_connection *) override; + int set_pool_size(uint) override; + int set_stall_limit(uint) override; + int get_idle_thread_count() override; + void resume(TP_connection* c) override; }; #endif /* HAVE_POOL_OF_THREADS */ diff --git a/sql/tztime.cc b/sql/tztime.cc index 0bca203bc93..d39a485b3fe 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1028,9 +1028,9 @@ class Time_zone_system : public Time_zone { public: Time_zone_system() = default; /* Remove gcc warning */ - virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, uint *error_code) const; - virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; - virtual const String * get_name() const; + my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, uint *error_code) const override; + void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const override; + const String * get_name() const override; }; @@ -1124,10 +1124,10 @@ class Time_zone_utc : public Time_zone { public: Time_zone_utc() = default; /* Remove gcc warning */ - virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, - uint *error_code) const; - virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; - virtual const String * get_name() const; + my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, + uint *error_code) const override; + void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const override; + const String * get_name() const override; }; @@ -1207,9 +1207,9 @@ class Time_zone_db : public Time_zone { public: Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg); - virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, uint *error_code) const; - virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; - virtual const String * get_name() const; + my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, uint *error_code) const override; + void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const override; + const String * get_name() const override; private: TIME_ZONE_INFO *tz_info; const String *tz_name; @@ -1305,10 +1305,10 @@ class Time_zone_offset : public Time_zone { public: Time_zone_offset(long tz_offset_arg); - virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, - uint *error_code) const; - virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; - virtual const String * get_name() const; + my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, + uint *error_code) const override; + void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const override; + const String * get_name() const override; /* This have to be public because we want to be able to access it from my_offset_tzs_get_key() function diff --git a/sql/wsrep_client_service.h b/sql/wsrep_client_service.h index b74c52b038f..f53d9be083d 100644 --- a/sql/wsrep_client_service.h +++ b/sql/wsrep_client_service.h @@ -36,38 +36,38 @@ class Wsrep_client_service : public wsrep::client_service public: Wsrep_client_service(THD*, Wsrep_client_state&); - bool interrupted(wsrep::unique_lock&) const; - void reset_globals(); - void store_globals(); - int prepare_data_for_replication(); - void cleanup_transaction(); - bool statement_allowed_for_streaming() const; - size_t bytes_generated() const; - int prepare_fragment_for_replication(wsrep::mutable_buffer&, size_t&); - int remove_fragments(); - void emergency_shutdown() + bool interrupted(wsrep::unique_lock&) const override; + void reset_globals() override; + void store_globals() override; + int prepare_data_for_replication() override; + void cleanup_transaction() override; + bool statement_allowed_for_streaming() const override; + size_t bytes_generated() const override; + int prepare_fragment_for_replication(wsrep::mutable_buffer&, size_t&) override; + int remove_fragments() override; + void emergency_shutdown() override { throw wsrep::not_implemented_error(); } - void will_replay(); - void signal_replayed(); - enum wsrep::provider::status replay(); - enum wsrep::provider::status replay_unordered(); - void wait_for_replayers(wsrep::unique_lock&); - enum wsrep::provider::status commit_by_xid(); - bool is_explicit_xa() + void will_replay() override; + void signal_replayed() override; + enum wsrep::provider::status replay() override; + enum wsrep::provider::status replay_unordered() override; + void wait_for_replayers(wsrep::unique_lock&) override; + enum wsrep::provider::status commit_by_xid() override; + bool is_explicit_xa() override { return false; } - bool is_prepared_xa() + bool is_prepared_xa() override { return false; } - bool is_xa_rollback() + bool is_xa_rollback() override { return false; } - void debug_sync(const char*); - void debug_crash(const char*); - int bf_rollback(); + void debug_sync(const char*) override; + void debug_crash(const char*) override; + int bf_rollback() override; private: friend class Wsrep_server_service; THD* m_thd; diff --git a/sql/wsrep_condition_variable.h b/sql/wsrep_condition_variable.h index d9798bb9548..a4a121aa662 100644 --- a/sql/wsrep_condition_variable.h +++ b/sql/wsrep_condition_variable.h @@ -31,17 +31,17 @@ public: { } ~Wsrep_condition_variable() = default; - void notify_one() + void notify_one() override { mysql_cond_signal(m_cond); } - void notify_all() + void notify_all() override { mysql_cond_broadcast(m_cond); } - void wait(wsrep::unique_lock& lock) + void wait(wsrep::unique_lock& lock) override { mysql_mutex_t* mutex= static_cast(lock.mutex()->native()); mysql_cond_wait(m_cond, mutex); diff --git a/sql/wsrep_high_priority_service.h b/sql/wsrep_high_priority_service.h index c275c352de2..33b85ec8a24 100644 --- a/sql/wsrep_high_priority_service.h +++ b/sql/wsrep_high_priority_service.h @@ -33,31 +33,31 @@ public: Wsrep_high_priority_service(THD*); ~Wsrep_high_priority_service(); int start_transaction(const wsrep::ws_handle&, - const wsrep::ws_meta&); - int next_fragment(const wsrep::ws_meta&); - const wsrep::transaction& transaction() const; - int adopt_transaction(const wsrep::transaction&); + const wsrep::ws_meta&) override; + int next_fragment(const wsrep::ws_meta&) override; + const wsrep::transaction& transaction() const override; + int adopt_transaction(const wsrep::transaction&) override; int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&, - wsrep::mutable_buffer&) = 0; + wsrep::mutable_buffer&) override = 0; int append_fragment_and_commit(const wsrep::ws_handle&, const wsrep::ws_meta&, const wsrep::const_buffer&, - const wsrep::xid&); - int remove_fragments(const wsrep::ws_meta&); - int commit(const wsrep::ws_handle&, const wsrep::ws_meta&); - int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&); + const wsrep::xid&) override; + int remove_fragments(const wsrep::ws_meta&) override; + int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) override; + int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&) override; int apply_toi(const wsrep::ws_meta&, const wsrep::const_buffer&, - wsrep::mutable_buffer&); - void store_globals(); - void reset_globals(); - void switch_execution_context(wsrep::high_priority_service&); + wsrep::mutable_buffer&) override; + void store_globals() override; + void reset_globals() override; + void switch_execution_context(wsrep::high_priority_service&) override; int log_dummy_write_set(const wsrep::ws_handle&, const wsrep::ws_meta&, - wsrep::mutable_buffer&); - void adopt_apply_error(wsrep::mutable_buffer&); + wsrep::mutable_buffer&) override; + void adopt_apply_error(wsrep::mutable_buffer&) override; virtual bool check_exit_status() const = 0; - void debug_crash(const char*); + void debug_crash(const char*) override; protected: friend Wsrep_server_service; THD* m_thd; @@ -84,12 +84,12 @@ public: Wsrep_applier_service(THD*); ~Wsrep_applier_service(); int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&, - wsrep::mutable_buffer&); + wsrep::mutable_buffer&) override; int apply_nbo_begin(const wsrep::ws_meta&, const wsrep::const_buffer& data, - wsrep::mutable_buffer& err); - void after_apply(); - bool is_replaying() const { return false; } - bool check_exit_status() const; + wsrep::mutable_buffer& err) override; + void after_apply() override; + bool is_replaying() const override { return false; } + bool check_exit_status() const override; }; class Wsrep_replayer_service : public Wsrep_high_priority_service @@ -98,21 +98,21 @@ public: Wsrep_replayer_service(THD* replayer_thd, THD* orig_thd); ~Wsrep_replayer_service(); int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&, - wsrep::mutable_buffer&); + wsrep::mutable_buffer&) override; int apply_nbo_begin(const wsrep::ws_meta&, const wsrep::const_buffer& data, - wsrep::mutable_buffer& err) + wsrep::mutable_buffer& err) override { DBUG_ASSERT(0); /* DDL should never cause replaying */ return 0; } - void after_apply() { } - bool is_replaying() const { return true; } + void after_apply() override { } + bool is_replaying() const override { return true; } void replay_status(enum wsrep::provider::status status) { m_replay_status = status; } enum wsrep::provider::status replay_status() const { return m_replay_status; } /* Replayer should never be forced to exit */ - bool check_exit_status() const { return false; } + bool check_exit_status() const override { return false; } private: THD* m_orig_thd; struct da_shadow diff --git a/sql/wsrep_mutex.h b/sql/wsrep_mutex.h index f396c1be331..456358ee85d 100644 --- a/sql/wsrep_mutex.h +++ b/sql/wsrep_mutex.h @@ -29,17 +29,17 @@ public: : m_mutex(mutex) { } - void lock() + void lock() override { mysql_mutex_lock(m_mutex); } - void unlock() + void unlock() override { mysql_mutex_unlock(m_mutex); } - void* native() + void* native() override { return m_mutex; } diff --git a/sql/wsrep_server_service.h b/sql/wsrep_server_service.h index 0fc48402024..3a7da229cd4 100644 --- a/sql/wsrep_server_service.h +++ b/sql/wsrep_server_service.h @@ -32,49 +32,49 @@ public: : m_server_state(server_state) { } - wsrep::storage_service* storage_service(wsrep::client_service&); + wsrep::storage_service* storage_service(wsrep::client_service&) override; - wsrep::storage_service* storage_service(wsrep::high_priority_service&); + wsrep::storage_service* storage_service(wsrep::high_priority_service&) override; - void release_storage_service(wsrep::storage_service*); + void release_storage_service(wsrep::storage_service*) override; wsrep::high_priority_service* - streaming_applier_service(wsrep::client_service&); + streaming_applier_service(wsrep::client_service&) override; wsrep::high_priority_service* - streaming_applier_service(wsrep::high_priority_service&); + streaming_applier_service(wsrep::high_priority_service&) override; - void release_high_priority_service(wsrep::high_priority_service*); + void release_high_priority_service(wsrep::high_priority_service*) override; void background_rollback(wsrep::unique_lock &, - wsrep::client_state &); + wsrep::client_state &) override; - void bootstrap(); - void log_message(enum wsrep::log::level, const char*); + void bootstrap() override; + void log_message(enum wsrep::log::level, const char*) override; - void log_dummy_write_set(wsrep::client_state&, const wsrep::ws_meta&) + void log_dummy_write_set(wsrep::client_state&, const wsrep::ws_meta&) override { throw wsrep::not_implemented_error(); } - void log_view(wsrep::high_priority_service*, const wsrep::view&); + void log_view(wsrep::high_priority_service*, const wsrep::view&) override; - void recover_streaming_appliers(wsrep::client_service&); - void recover_streaming_appliers(wsrep::high_priority_service&); - wsrep::view get_view(wsrep::client_service&, const wsrep::id& own_id); + void recover_streaming_appliers(wsrep::client_service&) override; + void recover_streaming_appliers(wsrep::high_priority_service&) override; + wsrep::view get_view(wsrep::client_service&, const wsrep::id& own_id) override; - wsrep::gtid get_position(wsrep::client_service&); - void set_position(wsrep::client_service&, const wsrep::gtid&); + wsrep::gtid get_position(wsrep::client_service&) override; + void set_position(wsrep::client_service&, const wsrep::gtid&) override; void log_state_change(enum wsrep::server_state::state, - enum wsrep::server_state::state); + enum wsrep::server_state::state) override; - bool sst_before_init() const; + bool sst_before_init() const override; - std::string sst_request(); - int start_sst(const std::string&, const wsrep::gtid&, bool); + std::string sst_request() override; + int start_sst(const std::string&, const wsrep::gtid&, bool) override; - int wait_committing_transactions(int); + int wait_committing_transactions(int) override; - void debug_sync(const char*); + void debug_sync(const char*) override; private: Wsrep_server_state& m_server_state; }; diff --git a/sql/wsrep_storage_service.h b/sql/wsrep_storage_service.h index f39543a89bc..e4b4402b410 100644 --- a/sql/wsrep_storage_service.h +++ b/sql/wsrep_storage_service.h @@ -28,19 +28,19 @@ class Wsrep_storage_service : public: Wsrep_storage_service(THD*); ~Wsrep_storage_service(); - int start_transaction(const wsrep::ws_handle&); - void adopt_transaction(const wsrep::transaction&); + int start_transaction(const wsrep::ws_handle&) override; + void adopt_transaction(const wsrep::transaction&) override; int append_fragment(const wsrep::id&, wsrep::transaction_id, int flags, const wsrep::const_buffer&, - const wsrep::xid&); - int update_fragment_meta(const wsrep::ws_meta&); - int remove_fragments(); - int commit(const wsrep::ws_handle&, const wsrep::ws_meta&); - int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&); - void store_globals(); - void reset_globals(); + const wsrep::xid&) override; + int update_fragment_meta(const wsrep::ws_meta&) override; + int remove_fragments() override; + int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) override; + int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&) override; + void store_globals() override; + void reset_globals() override; private: friend class Wsrep_server_service; THD* m_thd; diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 2e03ac639b5..10e1f108dce 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -88,8 +88,8 @@ class ha_archive final : public handler public: ha_archive(handlerton *hton, TABLE_SHARE *table_arg); ~ha_archive() = default; - const char *index_type(uint inx) { return "NONE"; } - ulonglong table_flags() const + const char *index_type(uint inx) override { return "NONE"; } + ulonglong table_flags() const override { return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | @@ -97,66 +97,66 @@ public: HA_HAS_RECORDS | HA_CAN_REPAIR | HA_SLOW_RND_POS | HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY); } - ulong index_flags(uint idx, uint part, bool all_parts) const + ulong index_flags(uint idx, uint part, bool all_parts) const override { return HA_ONLY_WHOLE_INDEX; } - virtual void get_auto_increment(ulonglong offset, ulonglong increment, - ulonglong nb_desired_values, - ulonglong *first_value, - ulonglong *nb_reserved_values); - uint max_supported_keys() const { return 1; } - uint max_supported_key_length() const { return sizeof(ulonglong); } - uint max_supported_key_part_length() const { return sizeof(ulonglong); } - ha_rows records() { return share->rows_recorded; } - int index_init(uint keynr, bool sorted); - virtual int index_read(uchar * buf, const uchar * key, - uint key_len, enum ha_rkey_function find_flag); - virtual int index_read_idx(uchar * buf, uint index, const uchar * key, - uint key_len, enum ha_rkey_function find_flag); - int index_next(uchar * buf); - int open(const char *name, int mode, uint test_if_locked); - int close(void); - int write_row(const uchar * buf); + void get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) override; + uint max_supported_keys() const override { return 1; } + uint max_supported_key_length() const override { return sizeof(ulonglong); } + uint max_supported_key_part_length() const override { return sizeof(ulonglong); } + ha_rows records() override { return share->rows_recorded; } + int index_init(uint keynr, bool sorted) override; + int index_read(uchar * buf, const uchar * key, + uint key_len, enum ha_rkey_function find_flag) override; + int index_read_idx(uchar * buf, uint index, const uchar * key, + uint key_len, enum ha_rkey_function find_flag); + int index_next(uchar * buf) override; + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; + int write_row(const uchar * buf) override; int real_write_row(const uchar *buf, azio_stream *writer); - int truncate(); - int rnd_init(bool scan=1); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); + int truncate() override; + int rnd_init(bool scan=1) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; int get_row(azio_stream *file_to_read, uchar *buf); int get_row_version2(azio_stream *file_to_read, uchar *buf); int get_row_version3(azio_stream *file_to_read, uchar *buf); Archive_share *get_share(const char *table_name, int *rc); int init_archive_reader(); // Always try auto_repair in case of HA_ERR_CRASHED_ON_USAGE - bool auto_repair(int error) const + bool auto_repair(int error) const override { return error == HA_ERR_CRASHED_ON_USAGE; } int read_data_header(azio_stream *file_to_read); - void position(const uchar *record); - int info(uint); - int extra(enum ha_extra_function operation); - void update_create_info(HA_CREATE_INFO *create_info); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); - int optimize(THD* thd, HA_CHECK_OPT* check_opt); - int repair(THD* thd, HA_CHECK_OPT* check_opt); - int check_for_upgrade(HA_CHECK_OPT *check_opt); - void start_bulk_insert(ha_rows rows, uint flags); - int end_bulk_insert(); - enum row_type get_row_type() const + void position(const uchar *record) override; + int info(uint) override; + int extra(enum ha_extra_function operation) override; + void update_create_info(HA_CREATE_INFO *create_info) override; + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override; + int optimize(THD* thd, HA_CHECK_OPT* check_opt) override; + int repair(THD* thd, HA_CHECK_OPT* check_opt) override; + int check_for_upgrade(HA_CHECK_OPT *check_opt) override; + void start_bulk_insert(ha_rows rows, uint flags) override; + int end_bulk_insert() override; + enum row_type get_row_type() const override { return ROW_TYPE_COMPRESSED; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); - bool is_crashed() const; - int check(THD* thd, HA_CHECK_OPT* check_opt); - bool check_and_repair(THD *thd); + enum thr_lock_type lock_type) override; + bool is_crashed() const override; + int check(THD* thd, HA_CHECK_OPT* check_opt) override; + bool check_and_repair(THD *thd) override; uint32 max_row_length(const uchar *buf); bool fix_rec_buff(unsigned int length); int unpack_row(azio_stream *file_to_read, uchar *record); unsigned int pack_row(const uchar *record, azio_stream *writer); - bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); - int external_lock(THD *thd, int lock_type); + bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override; + int external_lock(THD *thd, int lock_type) override; private: void flush_and_clear_pending_writes(); }; diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index 04ca65f2a53..287f1db6bfa 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -49,15 +49,15 @@ public: The name of the index type that will be used for display don't implement this method unless you really have indexes */ - const char *index_type(uint key_number); - ulonglong table_flags() const + const char *index_type(uint key_number) override; + ulonglong table_flags() const override { return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_CAN_ONLINE_BACKUPS | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED); } - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | @@ -67,39 +67,39 @@ public: #define BLACKHOLE_MAX_KEY MAX_KEY /* Max allowed keys */ #define BLACKHOLE_MAX_KEY_SEG 16 /* Max segments for key */ #define BLACKHOLE_MAX_KEY_LENGTH 3500 /* Like in InnoDB */ - uint max_supported_keys() const { return BLACKHOLE_MAX_KEY; } - uint max_supported_key_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } - int open(const char *name, int mode, uint test_if_locked); - int close(void); - int truncate(); - int rnd_init(bool scan); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); + uint max_supported_keys() const override { return BLACKHOLE_MAX_KEY; } + uint max_supported_key_length() const override { return BLACKHOLE_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const override { return BLACKHOLE_MAX_KEY_LENGTH; } + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; + int truncate() override; + int rnd_init(bool scan) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map, - enum ha_rkey_function find_flag); + enum ha_rkey_function find_flag) override; int index_read_idx_map(uchar * buf, uint idx, const uchar * key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_read_last_map(uchar * buf, const uchar * key, key_part_map keypart_map); - int index_next(uchar * buf); - int index_prev(uchar * buf); - int index_first(uchar * buf); - int index_last(uchar * buf); - void position(const uchar *record); - int info(uint flag); - int external_lock(THD *thd, int lock_type); + enum ha_rkey_function find_flag) override; + int index_read_last_map(uchar * buf, const uchar * key, key_part_map keypart_map) override; + int index_next(uchar * buf) override; + int index_prev(uchar * buf) override; + int index_first(uchar * buf) override; + int index_last(uchar * buf) override; + void position(const uchar *record) override; + int info(uint flag) override; + int external_lock(THD *thd, int lock_type) override; int create(const char *name, TABLE *table_arg, - HA_CREATE_INFO *create_info); + HA_CREATE_INFO *create_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); - int delete_table(const char *name) + enum thr_lock_type lock_type) override; + int delete_table(const char *name) override { return 0; } private: - virtual int write_row(const uchar *buf); - virtual int update_row(const uchar *old_data, const uchar *new_data); - virtual int delete_row(const uchar *buf); + int write_row(const uchar *buf) override; + int update_row(const uchar *old_data, const uchar *new_data) override; + int delete_row(const uchar *buf) override; }; diff --git a/storage/connect/array.h b/storage/connect/array.h index bd38344de06..af8e101594a 100644 --- a/storage/connect/array.h +++ b/storage/connect/array.h @@ -38,11 +38,11 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock //ARRAY(PGLOBAL g, PARRAY par, int k); // Implementation - virtual int GetType(void) {return TYPE_ARRAY;} - virtual int GetResultType(void) {return Type;} - virtual int GetLength(void) {return Len;} - virtual int GetLengthEx(void) {return Len;} - virtual int GetScale() {return 0;} + int GetType(void) override {return TYPE_ARRAY;} + int GetResultType(void) override {return Type;} + int GetLength(void) override {return Len;} + int GetLengthEx(void) override {return Len;} + int GetScale() override {return 0;} int GetNval(void) {return Nval;} int GetSize(void) {return Size;} // PVAL GetValp(void) {return Valp;} @@ -51,13 +51,13 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock // Methods using XOBJECT::GetIntValue; - virtual void Reset(void) {Bot = -1;} - virtual int Qcompare(int *, int *); - virtual bool Compare(PXOB) {assert(false); return false;} - virtual bool SetFormat(PGLOBAL, FORMAT&) {assert(false); return false;} + void Reset(void) override {Bot = -1;} + int Qcompare(int *, int *) override; + bool Compare(PXOB) override {assert(false); return false;} + bool SetFormat(PGLOBAL, FORMAT&) override {assert(false); return false;} //virtual int CheckSpcCol(PTDB, int) {return 0;} - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; // void Empty(void); void SetPrecision(PGLOBAL g, int p); bool AddValue(PGLOBAL g, PSZ sp); @@ -119,7 +119,7 @@ class MULAR : public CSORT, public BLOCK { // No need to be an XOBJECT void SetPars(PARRAY par, int i) {Pars[i] = par;} // Methods - virtual int Qcompare(int *i1, int *i2); // Sort compare routine + int Qcompare(int *i1, int *i2) override; // Sort compare routine bool Sort(PGLOBAL g); protected: diff --git a/storage/connect/blkfil.h b/storage/connect/blkfil.h index 27e6fd4b166..0fe5252d4c5 100644 --- a/storage/connect/blkfil.h +++ b/storage/connect/blkfil.h @@ -27,8 +27,8 @@ class DllExport BLOCKFILTER : public BLOCK { /* Block Filter */ // Methods virtual void Reset(PGLOBAL) = 0; virtual int BlockEval(PGLOBAL) = 0; - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; protected: BLOCKFILTER(void) = default; // Standard constructor not to be used @@ -50,8 +50,8 @@ class DllExport BLKFILLOG : public BLOCKFILTER { /* Logical Op Block Filter */ BLKFILLOG(PTDBDOS tdbp, int op, PBF *bfp, int n); // Methods - virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); + void Reset(PGLOBAL g) override; + int BlockEval(PGLOBAL g) override; protected: BLKFILLOG(void) = default; // Standard constructor not to be used @@ -70,8 +70,8 @@ class DllExport BLKFILARI : public BLOCKFILTER { /* Arithm. Op Block Filter */ BLKFILARI(PGLOBAL g, PTDBDOS tdbp, int op, PXOB *xp); // Methods - virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); + void Reset(PGLOBAL g) override; + int BlockEval(PGLOBAL g) override; virtual void MakeValueBitmap(void) {} protected: @@ -93,8 +93,8 @@ class DllExport BLKFILAR2 : public BLKFILARI { /* Arithm. Op Block Filter */ BLKFILAR2(PGLOBAL g, PTDBDOS tdbp, int op, PXOB *xp); // Methods - virtual int BlockEval(PGLOBAL g); - virtual void MakeValueBitmap(void); + int BlockEval(PGLOBAL g) override; + void MakeValueBitmap(void) override; protected: BLKFILAR2(void) = default; // Standard constructor not to be used @@ -114,8 +114,8 @@ class DllExport BLKFILMR2 : public BLKFILARI { /* Arithm. Op Block Filter */ BLKFILMR2(PGLOBAL g, PTDBDOS tdbp, int op, PXOB *xp); // Methods - virtual int BlockEval(PGLOBAL g); - virtual void MakeValueBitmap(void); + int BlockEval(PGLOBAL g) override; + void MakeValueBitmap(void) override; protected: BLKFILMR2(void) = default; // Standard constructor not to be used @@ -137,8 +137,8 @@ class DllExport BLKSPCARI : public BLOCKFILTER { /* Arithm. Op Block Filter */ BLKSPCARI(PTDBDOS tdbp, int op, PXOB *xp, int bsize); // Methods - virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); + void Reset(PGLOBAL g) override; + int BlockEval(PGLOBAL g) override; protected: BLKSPCARI(void) = default; // Standard constructor not to be used @@ -159,8 +159,8 @@ class DllExport BLKFILIN : public BLOCKFILTER { // With array arguments. BLKFILIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp); // Methods - virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); + void Reset(PGLOBAL g) override; + int BlockEval(PGLOBAL g) override; virtual void MakeValueBitmap(void) {} protected: @@ -181,8 +181,8 @@ class DllExport BLKFILIN2 : public BLKFILIN { // With array arguments. // Methods //virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); - virtual void MakeValueBitmap(void); + int BlockEval(PGLOBAL g) override; + void MakeValueBitmap(void) override; protected: // Member @@ -205,8 +205,8 @@ class DllExport BLKSPCIN : public BLOCKFILTER { // With array arguments. BLKSPCIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp, int bsize); // Methods - virtual void Reset(PGLOBAL g); - virtual int BlockEval(PGLOBAL g); + void Reset(PGLOBAL g) override; + int BlockEval(PGLOBAL g) override; protected: // Member diff --git a/storage/connect/cmgfam.h b/storage/connect/cmgfam.h index 9c5f91f0d23..d5c637cbdd7 100644 --- a/storage/connect/cmgfam.h +++ b/storage/connect/cmgfam.h @@ -26,18 +26,18 @@ public: CMGFAM(PCMGFAM txfp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_MGO; } + AMT GetAmType(void) override { return TYPE_AM_MGO; } virtual bool GetUseTemp(void) { return false; } virtual int GetPos(void); virtual int GetNextPos(void); void SetTdbp(PTDBDOS tdbp) { Tdbp = tdbp; } - virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) CMGFAM(this); } + PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) CMGFAM(this); } void SetLrecl(int lrecl) { Lrecl = lrecl; } // Methods virtual void Reset(void); virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); + int Cardinality(PGLOBAL g) override; virtual int MaxBlkSize(PGLOBAL g, int s); virtual bool AllocateBuffer(PGLOBAL g) { return false; } virtual int GetRowID(void); diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h index e67ba3ba3f9..4a2f572ec2d 100644 --- a/storage/connect/colblk.h +++ b/storage/connect/colblk.h @@ -27,12 +27,12 @@ class DllExport COLBLK : public XOBJECT { public: // Implementation - virtual int GetType(void) {return TYPE_COLBLK;} - virtual int GetResultType(void) {return Buf_Type;} - virtual int GetScale(void) {return Format.Prec;} + int GetType(void) override {return TYPE_COLBLK;} + int GetResultType(void) override {return Buf_Type;} + int GetScale(void) override {return Format.Prec;} virtual int GetPrecision(void) {return Precision;} - virtual int GetLength(void) {return Long;} - virtual int GetLengthEx(void); + int GetLength(void) override {return Long;} + int GetLengthEx(void) override; virtual int GetAmType() {return TYPE_AM_ERROR;} virtual void SetOk(void) {Status |= BUF_EMPTY;} virtual PTDB GetTo_Tdb(void) {return To_Tdb;} @@ -65,17 +65,17 @@ class DllExport COLBLK : public XOBJECT { void SetNullable(bool b) {Nullable = b;} void SetName(PSZ name_var) { Name= name_var; } // Methods - virtual void Reset(void); - virtual bool Compare(PXOB xp); - virtual bool SetFormat(PGLOBAL, FORMAT&); + void Reset(void) override; + bool Compare(PXOB xp) override; + bool SetFormat(PGLOBAL, FORMAT&) override; virtual bool IsSpecial(void) {return false;} - virtual bool Eval(PGLOBAL g); + bool Eval(PGLOBAL g) override; virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual void SetTo_Val(PVAL) {} virtual void ReadColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g); - virtual void Printf(PGLOBAL g, FILE *, uint); - virtual void Prints(PGLOBAL g, char *, uint); + void Printf(PGLOBAL g, FILE *, uint) override; + void Prints(PGLOBAL g, char *, uint) override; virtual bool VarSize(void) {return false;} bool InitValue(PGLOBAL g); @@ -108,13 +108,12 @@ class DllExport SPCBLK : public COLBLK { SPCBLK(PCOLUMN cp); // Implementation - virtual int GetAmType(void) = 0; virtual bool GetRnm(void) {return false;} // Methods - virtual bool IsSpecial(void) {return true;} - virtual void ReadColumn(PGLOBAL g) = 0; - virtual void WriteColumn(PGLOBAL g); + bool IsSpecial(void) override {return true;} + void ReadColumn(PGLOBAL g) override = 0; + void WriteColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -130,11 +129,11 @@ class DllExport RIDBLK : public SPCBLK { RIDBLK(PCOLUMN cp, bool rnm); // Implementation - virtual int GetAmType(void) {return TYPE_AM_ROWID;} - virtual bool GetRnm(void) {return Rnm;} + int GetAmType(void) override {return TYPE_AM_ROWID;} + bool GetRnm(void) override {return Rnm;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: bool Rnm; // False for RowID, True for RowNum @@ -149,11 +148,11 @@ class DllExport FIDBLK : public SPCBLK { FIDBLK(PCOLUMN cp, OPVAL op); // Implementation - virtual int GetAmType(void) {return TYPE_AM_FILID;} + int GetAmType(void) override {return TYPE_AM_FILID;} // Methods - virtual void Reset(void) {} // This is a pseudo constant column - virtual void ReadColumn(PGLOBAL g); + void Reset(void) override {} // This is a pseudo constant column + void ReadColumn(PGLOBAL g) override; protected: PCSZ Fn; // The current To_File of the table @@ -169,11 +168,11 @@ class DllExport TIDBLK : public SPCBLK { TIDBLK(PCOLUMN cp); // Implementation - virtual int GetAmType(void) {return TYPE_AM_TABID;} + int GetAmType(void) override {return TYPE_AM_TABID;} // Methods - virtual void Reset(void) {} // This is a pseudo constant column - virtual void ReadColumn(PGLOBAL g); + void Reset(void) override {} // This is a pseudo constant column + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -192,11 +191,11 @@ class DllExport PRTBLK : public SPCBLK { PRTBLK(PCOLUMN cp); // Implementation - virtual int GetAmType(void) {return TYPE_AM_PRTID;} + int GetAmType(void) override {return TYPE_AM_PRTID;} // Methods - virtual void Reset(void) {} // This is a pseudo constant column - virtual void ReadColumn(PGLOBAL g); + void Reset(void) override {} // This is a pseudo constant column + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -215,11 +214,11 @@ class DllExport SIDBLK : public SPCBLK { SIDBLK(PCOLUMN cp); // Implementation - virtual int GetAmType(void) {return TYPE_AM_SRVID;} + int GetAmType(void) override {return TYPE_AM_SRVID;} // Methods - virtual void Reset(void) {} // This is a pseudo constant column - virtual void ReadColumn(PGLOBAL g); + void Reset(void) override {} // This is a pseudo constant column + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used diff --git a/storage/connect/domdoc.h b/storage/connect/domdoc.h index dd8936097e2..6a25978f1af 100644 --- a/storage/connect/domdoc.h +++ b/storage/connect/domdoc.h @@ -73,7 +73,7 @@ class DOMNODE : public XMLNODE { // Methods virtual RCODE GetContent(PGLOBAL g, char *buf, int len); virtual bool SetContent(PGLOBAL g, char *txtp, int len); - virtual PXNODE Clone(PGLOBAL g, PXNODE np); + PXNODE Clone(PGLOBAL g, PXNODE np) override; virtual PXLIST GetChildElements(PGLOBAL g, char *xp, PXLIST lp); virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp); virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np); diff --git a/storage/connect/filamap.h b/storage/connect/filamap.h index 774eb8b91b3..b201b3f9903 100644 --- a/storage/connect/filamap.h +++ b/storage/connect/filamap.h @@ -24,32 +24,32 @@ class DllExport MAPFAM : public TXTFAM { MAPFAM(PMAPFAM tmfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_MAP;} - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_MAP;} + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) MAPFAM(this);} // Methods - virtual void Reset(void); - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g) {return (g) ? -1 : 0;} - virtual int MaxBlkSize(PGLOBAL g, int s) {return s;} - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual bool OpenTableFile(PGLOBAL g); - virtual bool DeferReading(void) {return false;} + void Reset(void) override; + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override {return (g) ? -1 : 0;} + int MaxBlkSize(PGLOBAL g, int s) override {return s;} + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + int SkipRecord(PGLOBAL g, bool header) override; + bool OpenTableFile(PGLOBAL g) override; + bool DeferReading(void) override {return false;} virtual int GetNext(PGLOBAL g) {return RC_EF;} - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: - virtual int InitDelete(PGLOBAL g, int fpos, int spos); + int InitDelete(PGLOBAL g, int fpos, int spos) override; // Members char *Memory; // Pointer on file mapping view. @@ -70,18 +70,18 @@ class DllExport MBKFAM : public MAPFAM { MBKFAM(PMAPFAM tmfp) : MAPFAM(tmfp) {} // Implementation - virtual PTXF Duplicate(PGLOBAL g) + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) MBKFAM(this);} // Methods - virtual void Reset(void); - virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s) + void Reset(void) override; + int Cardinality(PGLOBAL g) override; + int MaxBlkSize(PGLOBAL g, int s) override {return TXTFAM::MaxBlkSize(g, s);} - virtual int GetRowID(void); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual int ReadBuffer(PGLOBAL g); - virtual void Rewind(void); + int GetRowID(void) override; + int SkipRecord(PGLOBAL g, bool header) override; + int ReadBuffer(PGLOBAL g) override; + void Rewind(void) override; protected: // No additional members @@ -97,22 +97,22 @@ class DllExport MPXFAM : public MBKFAM { MPXFAM(PMAPFAM tmfp) : MBKFAM(tmfp) {} // Implementation - virtual int GetPos(void); - virtual PTXF Duplicate(PGLOBAL g) + int GetPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) MPXFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} - virtual int MaxBlkSize(PGLOBAL g, int s) + int Cardinality(PGLOBAL g) override {return TXTFAM::Cardinality(g);} + int MaxBlkSize(PGLOBAL g, int s) override {return TXTFAM::MaxBlkSize(g, s);} - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int GetNextPos(void) {return GetPos() + 1;} - virtual bool DeferReading(void) {return false;} - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); + bool SetPos(PGLOBAL g, int recpos) override; + int GetNextPos(void) override {return GetPos() + 1;} + bool DeferReading(void) override {return false;} + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; protected: - virtual int InitDelete(PGLOBAL g, int fpos, int spos); + int InitDelete(PGLOBAL g, int fpos, int spos) override; // No additional members }; // end of class MPXFAM diff --git a/storage/connect/filamdbf.h b/storage/connect/filamdbf.h index 6cf6331abd4..7a7a65b0236 100644 --- a/storage/connect/filamdbf.h +++ b/storage/connect/filamdbf.h @@ -55,23 +55,23 @@ class DllExport DBFFAM : public FIXFAM, public DBFBASE { DBFFAM(PDBFFAM txfp) : FIXFAM(txfp), DBFBASE((PDBF)txfp) {} // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_DBF;} - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_DBF;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) DBFFAM(this);} // Methods - virtual int GetNerr(void) {return Nerr;} - virtual int Cardinality(PGLOBAL g); - virtual bool OpenTableFile(PGLOBAL g); - virtual bool AllocateBuffer(PGLOBAL g); - virtual void ResetBuffer(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + int GetNerr(void) override {return Nerr;} + int Cardinality(PGLOBAL g) override; + bool OpenTableFile(PGLOBAL g) override; + bool AllocateBuffer(PGLOBAL g) override; + void ResetBuffer(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: - virtual bool CopyHeader(PGLOBAL g); + bool CopyHeader(PGLOBAL g) override; //virtual int InitDelete(PGLOBAL g, int fpos, int spos); // Members @@ -88,18 +88,18 @@ class DllExport DBMFAM : public MPXFAM, public DBFBASE { DBMFAM(PDBMFAM txfp) : MPXFAM(txfp), DBFBASE((PDBF)txfp) {} // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_DBF;} - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_DBF;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) DBMFAM(this);} - virtual int GetDelRows(void); + int GetDelRows(void) override; // Methods - virtual int GetNerr(void) {return Nerr;} - virtual int Cardinality(PGLOBAL g); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void Rewind(void); + int GetNerr(void) override {return Nerr;} + int Cardinality(PGLOBAL g) override; + bool AllocateBuffer(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void Rewind(void) override; protected: // Members diff --git a/storage/connect/filamfix.h b/storage/connect/filamfix.h index a99a36af232..60697acc3eb 100644 --- a/storage/connect/filamfix.h +++ b/storage/connect/filamfix.h @@ -25,28 +25,28 @@ class DllExport FIXFAM : public BLKFAM { FIXFAM(PFIXFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_FIX;} - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_FIX;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) FIXFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} - virtual int MaxBlkSize(PGLOBAL g, int s) + int Cardinality(PGLOBAL g) override {return TXTFAM::Cardinality(g);} + int MaxBlkSize(PGLOBAL g, int s) override {return TXTFAM::MaxBlkSize(g, s);} - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int GetNextPos(void) {return Fpos + 1;} - virtual bool AllocateBuffer(PGLOBAL g); - virtual void ResetBuffer(PGLOBAL g); + bool SetPos(PGLOBAL g, int recpos) override; + int GetNextPos(void) override {return Fpos + 1;} + bool AllocateBuffer(PGLOBAL g) override; + void ResetBuffer(PGLOBAL g) override; virtual int WriteModifiedBlock(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; protected: virtual bool CopyHeader(PGLOBAL g) {return false;} - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b); - virtual int InitDelete(PGLOBAL g, int fpos, int spos); + bool MoveIntermediateLines(PGLOBAL g, bool *b) override; + int InitDelete(PGLOBAL g, int fpos, int spos) override; // No additional members }; // end of class FIXFAM @@ -64,22 +64,22 @@ class BGXFAM : public FIXFAM { BGXFAM(PBGXFAM txfp); // Implementation - virtual PTXF Duplicate(PGLOBAL g) + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) BGXFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g); - virtual bool OpenTableFile(PGLOBAL g); - virtual int WriteModifiedBlock(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + int Cardinality(PGLOBAL g) override; + bool OpenTableFile(PGLOBAL g) override; + int WriteModifiedBlock(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: - virtual bool OpenTempFile(PGLOBAL g); - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); + bool OpenTempFile(PGLOBAL g) override; + bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL) override; int BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos diff --git a/storage/connect/filamgz.h b/storage/connect/filamgz.h index 7a00c0d4bc7..fd5c0d24188 100644 --- a/storage/connect/filamgz.h +++ b/storage/connect/filamgz.h @@ -28,28 +28,28 @@ class DllExport GZFAM : public TXTFAM { GZFAM(PGZFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_GZ;} - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_GZ;} + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) GZFAM(this);} // Methods - virtual void Reset(void); - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g) {return (g) ? -1 : 0;} - virtual int MaxBlkSize(PGLOBAL g, int s) {return s;} - virtual bool AllocateBuffer(PGLOBAL g); - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + void Reset(void) override; + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override {return (g) ? -1 : 0;} + int MaxBlkSize(PGLOBAL g, int s) override {return s;} + bool AllocateBuffer(PGLOBAL g) override; + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + int SkipRecord(PGLOBAL g, bool header) override; + bool OpenTableFile(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: int Zerror(PGLOBAL g); // GZ error function @@ -71,23 +71,23 @@ class DllExport ZBKFAM : public GZFAM { ZBKFAM(PZBKFAM txfp); // Implementation - virtual int GetPos(void); - virtual int GetNextPos(void) {return 0;} - virtual PTXF Duplicate(PGLOBAL g) + int GetPos(void) override; + int GetNextPos(void) override {return 0;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) ZBKFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + int Cardinality(PGLOBAL g) override; + int MaxBlkSize(PGLOBAL g, int s) override; + bool AllocateBuffer(PGLOBAL g) override; + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + int SkipRecord(PGLOBAL g, bool header) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: // Members @@ -108,15 +108,15 @@ class DllExport GZXFAM : public ZBKFAM { GZXFAM(PZIXFAM txfp) : ZBKFAM(txfp) {} // Implementation - virtual int GetNextPos(void) {return 0;} - virtual PTXF Duplicate(PGLOBAL g) + int GetNextPos(void) override {return 0;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) GZXFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + bool AllocateBuffer(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; protected: // No additional Members @@ -140,21 +140,21 @@ class DllExport ZLBFAM : public BLKFAM { ZLBFAM(PZLBFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ZLIB;} - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_ZLIB;} + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) ZLBFAM(this);} inline void SetOptimized(bool b) {Optimized = b;} // Methods - virtual int GetFileLength(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + int GetFileLength(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + bool AllocateBuffer(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: bool WriteCompressedBuffer(PGLOBAL g); diff --git a/storage/connect/filamtxt.h b/storage/connect/filamtxt.h index 353e06ad3bd..e291167fbd8 100644 --- a/storage/connect/filamtxt.h +++ b/storage/connect/filamtxt.h @@ -134,35 +134,35 @@ class DllExport DOSFAM : public TXTFAM { DOSFAM(PBLKFAM tdfp, PDOSDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_DOS;} - virtual bool GetUseTemp(void) {return UseTemp;} - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_DOS;} + bool GetUseTemp(void) override {return UseTemp;} + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) DOSFAM(this);} // Methods - virtual void Reset(void); - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + void Reset(void) override; + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override; + int MaxBlkSize(PGLOBAL g, int s) override; + bool AllocateBuffer(PGLOBAL g) override; + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + int SkipRecord(PGLOBAL g, bool header) override; + bool OpenTableFile(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: virtual bool OpenTempFile(PGLOBAL g); virtual bool MoveIntermediateLines(PGLOBAL g, bool *b); virtual int RenameTempFile(PGLOBAL g); - virtual int InitDelete(PGLOBAL g, int fpos, int spos); + int InitDelete(PGLOBAL g, int fpos, int spos) override; // Members FILE *Stream; // Points to Dos file structure @@ -183,25 +183,25 @@ class DllExport BLKFAM : public DOSFAM { BLKFAM(PBLKFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_BLK;} - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_BLK;} + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) BLKFAM(this);} // Methods - virtual void Reset(void); - virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g); - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + void Reset(void) override; + int Cardinality(PGLOBAL g) override; + int MaxBlkSize(PGLOBAL g, int s) override; + bool AllocateBuffer(PGLOBAL g) override; + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + int SkipRecord(PGLOBAL g, bool header) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: // Members @@ -222,24 +222,24 @@ public: BINFAM(PBINFAM txfp) : DOSFAM(txfp) {Recsize = txfp->Recsize;} // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_BIN;} + AMT GetAmType(void) override {return TYPE_AM_BIN;} //virtual int GetPos(void); //virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) BINFAM(this); } + PTXF Duplicate(PGLOBAL g) override { return (PTXF)new(g) BINFAM(this); } // Methods //virtual void Reset(void) {TXTFAM::Reset();} //virtual int GetFileLength(PGLOBAL g); //virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s) {return s;} - virtual bool AllocateBuffer(PGLOBAL g); + int MaxBlkSize(PGLOBAL g, int s) override {return s;} + bool AllocateBuffer(PGLOBAL g) override; //virtual int GetRowID(void); //virtual bool RecordPos(PGLOBAL g); //virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header) {return RC_OK;} + int SkipRecord(PGLOBAL g, bool header) override {return RC_OK;} //virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; //virtual int DeleteRecords(PGLOBAL g, int irc); //virtual void CloseTableFile(PGLOBAL g, bool abort); //virtual void Rewind(void); diff --git a/storage/connect/filamvct.h b/storage/connect/filamvct.h index 85982403270..2b730e5c66c 100644 --- a/storage/connect/filamvct.h +++ b/storage/connect/filamvct.h @@ -34,27 +34,27 @@ class DllExport VCTFAM : public FIXFAM { VCTFAM(PVCTFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_VCT;} - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_VCT;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) VCTFAM(this);} - virtual int GetFileLength(PGLOBAL g); + int GetFileLength(PGLOBAL g) override; // Methods - virtual void Reset(void); - virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g); + void Reset(void) override; + int MaxBlkSize(PGLOBAL g, int s) override; + bool AllocateBuffer(PGLOBAL g) override; virtual bool InitInsert(PGLOBAL g); - virtual void ResetBuffer(PGLOBAL g) {} - virtual int Cardinality(PGLOBAL g); - virtual int GetRowID(void); + void ResetBuffer(PGLOBAL g) override {} + int Cardinality(PGLOBAL g) override; + int GetRowID(void) override; // Database routines - virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + bool OpenTableFile(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; // Specific functions virtual bool ReadBlock(PGLOBAL g, PVCTCOL colp); @@ -62,9 +62,9 @@ class DllExport VCTFAM : public FIXFAM { protected: virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn); - virtual bool OpenTempFile(PGLOBAL g); + bool OpenTempFile(PGLOBAL g) override; virtual bool MoveLines(PGLOBAL g) {return false;} - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); + bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL) override; virtual bool CleanUnusedSpace(PGLOBAL g); virtual int GetBlockInfo(PGLOBAL g); virtual bool SetBlockInfo(PGLOBAL g); @@ -98,25 +98,25 @@ class DllExport VCMFAM : public VCTFAM { VCMFAM(PVCMFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_VMP;} - virtual PTXF Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_VMP;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) VCMFAM(this);} // Methods - virtual bool AllocateBuffer(PGLOBAL g); - virtual bool InitInsert(PGLOBAL g); + bool AllocateBuffer(PGLOBAL g) override; + bool InitInsert(PGLOBAL g) override; // Database routines - virtual bool OpenTableFile(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); + bool OpenTableFile(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; protected: // Specific functions - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); - virtual bool ReadBlock(PGLOBAL g, PVCTCOL colp); - virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp); + bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL) override; + bool ReadBlock(PGLOBAL g, PVCTCOL colp) override; + bool WriteBlock(PGLOBAL g, PVCTCOL colp) override; // Members char* Memory; // Pointer on file mapping view. @@ -137,29 +137,29 @@ class DllExport VECFAM : public VCTFAM { VECFAM(PVECFAM txfp); // Implementation - virtual PTXF Duplicate(PGLOBAL g) + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) VECFAM(this);} // Methods - virtual bool AllocateBuffer(PGLOBAL g); - virtual bool InitInsert(PGLOBAL g); - virtual void ResetBuffer(PGLOBAL g); + bool AllocateBuffer(PGLOBAL g) override; + bool InitInsert(PGLOBAL g) override; + void ResetBuffer(PGLOBAL g) override; // Database routines - virtual bool OpenTableFile(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); + bool OpenTableFile(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; // Specific functions - virtual bool ReadBlock(PGLOBAL g, PVCTCOL colp); - virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp); + bool ReadBlock(PGLOBAL g, PVCTCOL colp) override; + bool WriteBlock(PGLOBAL g, PVCTCOL colp) override; protected: - virtual bool OpenTempFile(PGLOBAL g); - virtual bool MoveLines(PGLOBAL g); - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); - virtual int RenameTempFile(PGLOBAL g); + bool OpenTempFile(PGLOBAL g) override; + bool MoveLines(PGLOBAL g) override; + bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL) override; + int RenameTempFile(PGLOBAL g) override; bool OpenColumnFile(PGLOBAL g, PCSZ opmode, int i); // Members @@ -184,16 +184,16 @@ class DllExport VMPFAM : public VCMFAM { VMPFAM(PVMPFAM txfp); // Implementation - virtual PTXF Duplicate(PGLOBAL g) + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) VMPFAM(this);} // Methods - virtual bool AllocateBuffer(PGLOBAL g); + bool AllocateBuffer(PGLOBAL g) override; // Database routines - virtual bool OpenTableFile(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); + bool OpenTableFile(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; protected: bool MapColumnFile(PGLOBAL g, MODE mode, int i); @@ -214,33 +214,33 @@ class BGVFAM : public VCTFAM { BGVFAM(PBGVFAM txfp); // Implementation - virtual PTXF Duplicate(PGLOBAL g) + PTXF Duplicate(PGLOBAL g) override {return (PTXF)new(g) BGVFAM(this);} // Methods - virtual bool AllocateBuffer(PGLOBAL g); + bool AllocateBuffer(PGLOBAL g) override; // Database routines - virtual bool OpenTableFile(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + bool OpenTableFile(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; // Specific functions - virtual bool ReadBlock(PGLOBAL g, PVCTCOL colp); - virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp); + bool ReadBlock(PGLOBAL g, PVCTCOL colp) override; + bool WriteBlock(PGLOBAL g, PVCTCOL colp) override; protected: bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b = false); bool BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req); - virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn); - virtual bool OpenTempFile(PGLOBAL g); - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); - virtual bool CleanUnusedSpace(PGLOBAL g); - virtual bool SetBlockInfo(PGLOBAL g); - virtual int GetBlockInfo(PGLOBAL g); + bool MakeEmptyFile(PGLOBAL g, PCSZ fn) override; + bool OpenTempFile(PGLOBAL g) override; + bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL) override; + bool CleanUnusedSpace(PGLOBAL g) override; + bool SetBlockInfo(PGLOBAL g) override; + int GetBlockInfo(PGLOBAL g) override; // Members HANDLE Hfile; // Handle to big file diff --git a/storage/connect/filamzip.h b/storage/connect/filamzip.h index 7ff1fb0a543..e46e38d320d 100644 --- a/storage/connect/filamzip.h +++ b/storage/connect/filamzip.h @@ -97,16 +97,16 @@ class DllExport UNZFAM : public MAPFAM { UNZFAM(PUNZFAM txfp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ZIP;} - virtual PTXF Duplicate(PGLOBAL g) {return (PTXF) new(g) UNZFAM(this);} + AMT GetAmType(void) override {return TYPE_AM_ZIP;} + PTXF Duplicate(PGLOBAL g) override {return (PTXF) new(g) UNZFAM(this);} // Methods - virtual int Cardinality(PGLOBAL g); - virtual int GetFileLength(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetFileLength(PGLOBAL g) override; //virtual int MaxBlkSize(PGLOBAL g, int s) {return s;} - virtual bool OpenTableFile(PGLOBAL g); - virtual bool DeferReading(void) { return false; } - virtual int GetNext(PGLOBAL g); + bool OpenTableFile(PGLOBAL g) override; + bool DeferReading(void) override { return false; } + int GetNext(PGLOBAL g) override; //virtual int ReadBuffer(PGLOBAL g); //virtual int WriteBuffer(PGLOBAL g); //virtual int DeleteRecords(PGLOBAL g, int irc); @@ -129,14 +129,14 @@ class DllExport UZXFAM : public MPXFAM { UZXFAM(PUZXFAM txfp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_ZIP; } - virtual PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UZXFAM(this); } + AMT GetAmType(void) override { return TYPE_AM_ZIP; } + PTXF Duplicate(PGLOBAL g) override { return (PTXF) new(g)UZXFAM(this); } // Methods - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual bool OpenTableFile(PGLOBAL g); - virtual int GetNext(PGLOBAL g); + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override; + bool OpenTableFile(PGLOBAL g) override; + int GetNext(PGLOBAL g) override; //virtual int ReadBuffer(PGLOBAL g); protected: @@ -156,14 +156,14 @@ public: UZDFAM(PUZDFAM txfp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_ZIP; } - virtual PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UZDFAM(this); } + AMT GetAmType(void) override { return TYPE_AM_ZIP; } + PTXF Duplicate(PGLOBAL g) override { return (PTXF) new(g)UZDFAM(this); } // Methods - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual bool OpenTableFile(PGLOBAL g); - virtual int GetNext(PGLOBAL g); + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override; + bool OpenTableFile(PGLOBAL g) override; + int GetNext(PGLOBAL g) override; //virtual int ReadBuffer(PGLOBAL g); protected: @@ -184,17 +184,17 @@ class DllExport ZIPFAM : public DOSFAM { ZIPFAM(PDOSDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ZIP;} + AMT GetAmType(void) override {return TYPE_AM_ZIP;} // Methods - virtual int Cardinality(PGLOBAL g) {return 0;} - virtual int GetFileLength(PGLOBAL g) {return g ? 0 : 1;} + int Cardinality(PGLOBAL g) override {return 0;} + int GetFileLength(PGLOBAL g) override {return g ? 0 : 1;} //virtual int MaxBlkSize(PGLOBAL g, int s) {return s;} - virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); + bool OpenTableFile(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; //virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); + void CloseTableFile(PGLOBAL g, bool abort) override; protected: // Members @@ -213,14 +213,14 @@ class DllExport ZPXFAM : public FIXFAM { ZPXFAM(PDOSDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ZIP;} + AMT GetAmType(void) override {return TYPE_AM_ZIP;} // Methods - virtual int Cardinality(PGLOBAL g) {return 0;} - virtual int GetFileLength(PGLOBAL g) {return g ? 0 : 1;} - virtual bool OpenTableFile(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual void CloseTableFile(PGLOBAL g, bool abort); + int Cardinality(PGLOBAL g) override {return 0;} + int GetFileLength(PGLOBAL g) override {return g ? 0 : 1;} + bool OpenTableFile(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + void CloseTableFile(PGLOBAL g, bool abort) override; protected: // Members diff --git a/storage/connect/filter.h b/storage/connect/filter.h index 0c3fa41046a..8f973b52cd0 100644 --- a/storage/connect/filter.h +++ b/storage/connect/filter.h @@ -34,11 +34,11 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */ FILTER(PFIL fil1); // Implementation - virtual int GetType(void) {return TYPE_FILTER;} - virtual int GetResultType(void) {return TYPE_INT;} - virtual int GetLength(void) {return 1;} - virtual int GetLengthEx(void) {assert(FALSE); return 0;} - virtual int GetScale() {return 0;}; + int GetType(void) override {return TYPE_FILTER;} + int GetResultType(void) override {return TYPE_INT;} + int GetLength(void) override {return 1;} + int GetLengthEx(void) override {assert(FALSE); return 0;} + int GetScale() override {return 0;}; PFIL GetNext(void) {return Next;} OPVAL GetOpc(void) {return Opc;} int GetOpm(void) {return Opm;} @@ -50,19 +50,19 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */ void SetNext(PFIL filp) {Next = filp;} // Methods - virtual void Reset(void); - virtual bool Compare(PXOB) {return FALSE;} // Not used yet - virtual bool Init(PGLOBAL); - virtual bool Eval(PGLOBAL); - virtual bool SetFormat(PGLOBAL, FORMAT&) {return TRUE;} // NUY + void Reset(void) override; + bool Compare(PXOB) override {return FALSE;} // Not used yet + bool Init(PGLOBAL) override; + bool Eval(PGLOBAL) override; + bool SetFormat(PGLOBAL, FORMAT&) override {return TRUE;} // NUY //virtual int CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &xp, int &ag); //virtual int RefNum(PSQL); //virtual PXOB SetSelect(PGLOBAL, PSQL, bool) {return NULL;} // NUY //virtual PXOB CheckSubQuery(PGLOBAL, PSQL); //virtual bool CheckLocal(PTDB); //virtual int CheckSpcCol(PTDB tdbp, int n); - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; // PFIL Linearize(bool nosep); // PFIL Link(PGLOBAL g, PFIL fil2); // PFIL RemoveLastSep(void); @@ -102,7 +102,7 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */ class FILTERX : public FILTER { public: // Methods - virtual bool Eval(PGLOBAL) = 0; // just to prevent direct FILTERX use + bool Eval(PGLOBAL) override = 0; // just to prevent direct FILTERX use // Fake operator new used to change a filter into a derived filter void * operator new(size_t, PFIL filp) {return filp;} @@ -123,7 +123,7 @@ class FILTERCMP : public FILTERX { FILTERCMP(PGLOBAL g); // Methods - virtual bool Eval(PGLOBAL); + bool Eval(PGLOBAL) override; }; // end of class FILTEREQ /***********************************************************************/ @@ -132,7 +132,7 @@ class FILTERCMP : public FILTERX { class FILTERAND : public FILTERX { public: // Methods - virtual bool Eval(PGLOBAL); + bool Eval(PGLOBAL) override; }; // end of class FILTERAND /***********************************************************************/ @@ -141,7 +141,7 @@ class FILTERAND : public FILTERX { class FILTEROR : public FILTERX { public: // Methods - virtual bool Eval(PGLOBAL); + bool Eval(PGLOBAL) override; }; // end of class FILTEROR /***********************************************************************/ @@ -150,7 +150,7 @@ class FILTEROR : public FILTERX { class FILTERNOT : public FILTERX { public: // Methods - virtual bool Eval(PGLOBAL); + bool Eval(PGLOBAL) override; }; // end of class FILTERNOT /***********************************************************************/ @@ -159,7 +159,7 @@ class FILTERNOT : public FILTERX { class FILTERIN : public FILTERX { public: // Methods - virtual bool Eval(PGLOBAL); + bool Eval(PGLOBAL) override; }; // end of class FILTERIN /***********************************************************************/ @@ -171,8 +171,8 @@ class FILTERTRUE : public FILTERX { FILTERTRUE(PVAL valp) {Value = valp; Value->SetValue_bool(TRUE);} // Methods - virtual void Reset(void); - virtual bool Eval(PGLOBAL); + void Reset(void) override; + bool Eval(PGLOBAL) override; }; // end of class FILTERTRUE #endif // __FILTER__ diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 71ceb7974ba..b6453aad0cc 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -224,13 +224,13 @@ public: /** @brief The name that will be used for display purposes. */ - const char *table_type() const {return "CONNECT";} + const char *table_type() const override {return "CONNECT";} /** @brief The name of the index type that will be used for display. Don't implement this method unless you really have indexes. */ - const char *index_type(uint inx); + const char *index_type(uint inx) override; /** @brief The file extensions. @@ -241,15 +241,15 @@ public: Check if a storage engine supports a particular alter table in-place @note Called without holding thr_lock.c lock. */ - virtual enum_alter_inplace_result + enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, - Alter_inplace_info *ha_alter_info); + Alter_inplace_info *ha_alter_info) override; /** @brief This is a list of flags that indicate what functionality the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const; + ulonglong table_flags() const override; /** @brief This is a bitmap of flags that indicates how the storage engine @@ -261,7 +261,7 @@ public: If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ - ulong index_flags(uint inx, uint part, bool all_parts) const; + ulong index_flags(uint inx, uint part, bool all_parts) const override; /** @brief unireg.cc will call max_supported_record_length(), max_supported_keys(), @@ -270,7 +270,7 @@ public: send. Return *real* limits of your storage engine here; MySQL will do min(your_limits, MySQL_limits) automatically. */ - uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_record_length() const override { return HA_MAX_REC_LENGTH; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -281,7 +281,7 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_keys() const { return 10; } + uint max_supported_keys() const override { return 10; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -292,7 +292,7 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_key_parts() const { return 10; } + uint max_supported_key_parts() const override { return 10; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -303,17 +303,17 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_key_length() const { return 255; } + uint max_supported_key_length() const override { return 255; } /** @brief Called in test_quick_select to determine if indexes should be used. */ - virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; } + double scan_time() override { return (double) (stats.records+stats.deleted) / 20.0+10; } /** @brief This method will never be called if you do not implement indexes. */ - virtual double read_time(uint, uint, ha_rows rows) + double read_time(uint, uint, ha_rows rows) override { return (double) rows / 20.0+1; } /* @@ -322,7 +322,7 @@ public: Most of these methods are not obligatory, skip them and MySQL will treat them as not implemented */ - virtual bool get_error_message(int error, String *buf); + bool get_error_message(int error, String *buf) override; /** Push condition down to the table handler. @@ -346,27 +346,27 @@ public: Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the condition stack. */ -virtual const COND *cond_push(const COND *cond); +const COND *cond_push(const COND *cond) override; PCFIL CheckCond(PGLOBAL g, PCFIL filp, const Item *cond); const char *GetValStr(OPVAL vop, bool neg); PFIL CondFilter(PGLOBAL g, Item *cond); //PFIL CheckFilter(PGLOBAL g); /** admin commands - called from mysql_admin_table */ -virtual int check(THD* thd, HA_CHECK_OPT* check_opt); +int check(THD* thd, HA_CHECK_OPT* check_opt) override; /** Number of rows in table. It will only be called if (table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0 */ - virtual ha_rows records(); + ha_rows records() override; /** Type of table for caching query CONNECT should not use caching because its tables are external data prone to me modified out of MariaDB */ - virtual uint8 table_cache_type(void) + uint8 table_cache_type(void) override { #if defined(MEMORY_TRACE) // Temporary until bug MDEV-4771 is fixed @@ -379,37 +379,37 @@ virtual int check(THD* thd, HA_CHECK_OPT* check_opt); /** @brief We implement this in ha_connect.cc; it's a required method. */ - int open(const char *name, int mode, uint test_if_locked); // required + int open(const char *name, int mode, uint test_if_locked) override; // required /** @brief We implement this in ha_connect.cc; it's a required method. */ - int close(void); // required + int close(void) override; // required /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int write_row(const uchar *buf); + int write_row(const uchar *buf) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int update_row(const uchar *old_data, const uchar *new_data); + int update_row(const uchar *old_data, const uchar *new_data) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int delete_row(const uchar *buf); + int delete_row(const uchar *buf) override; // Added to the connect handler - int index_init(uint idx, bool sorted); - int index_end(); + int index_init(uint idx, bool sorted) override; + int index_end() override; int index_read(uchar * buf, const uchar * key, uint key_len, - enum ha_rkey_function find_flag); - int index_next_same(uchar *buf, const uchar *key, uint keylen); + enum ha_rkey_function find_flag) override; + int index_next_same(uchar *buf, const uchar *key, uint keylen) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; @@ -422,25 +422,25 @@ virtual int check(THD* thd, HA_CHECK_OPT* check_opt); We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_next(uchar *buf); + int index_next(uchar *buf) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ -int index_prev(uchar *buf); +int index_prev(uchar *buf) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_first(uchar *buf); + int index_first(uchar *buf) override; /** @brief We implement this in ha_connect.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_last(uchar *buf); + int index_last(uchar *buf) override; /* Index condition pushdown implementation */ //Item *idx_cond_push(uint keyno, Item* idx_cond); @@ -453,57 +453,57 @@ int index_prev(uchar *buf); cursor to the start of the table; no need to deallocate and allocate it again. This is a required method. */ - int rnd_init(bool scan); //required - int rnd_end(); - int rnd_next(uchar *buf); ///< required - int rnd_pos(uchar *buf, uchar *pos); ///< required - void position(const uchar *record); ///< required - int info(uint); ///< required - int extra(enum ha_extra_function operation); - int start_stmt(THD *thd, thr_lock_type lock_type); - int external_lock(THD *thd, int lock_type); ///< required - int delete_all_rows(void); + int rnd_init(bool scan) override; //required + int rnd_end() override; + int rnd_next(uchar *buf) override; ///< required + int rnd_pos(uchar *buf, uchar *pos) override; ///< required + void position(const uchar *record) override; ///< required + int info(uint) override; ///< required + int extra(enum ha_extra_function operation) override; + int start_stmt(THD *thd, thr_lock_type lock_type) override; + int external_lock(THD *thd, int lock_type) override; ///< required + int delete_all_rows(void) override; ha_rows records_in_range(uint inx, const key_range *start_key, - const key_range *end_key, page_range *pages); + const key_range *end_key, page_range *pages) override; /** These methods can be overridden, but their default implementation provide useful functionality. */ - int rename_table(const char *from, const char *to); + int rename_table(const char *from, const char *to) override; /** Delete a table in the engine. Called for base as well as temporary tables. */ - int delete_table(const char *name); + int delete_table(const char *name) override; /** Called by delete_table and rename_table */ int delete_or_rename_table(const char *from, const char *to); int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); ///< required + HA_CREATE_INFO *create_info) override; ///< required bool check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes); + uint table_changes) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); ///< required - int optimize(THD* thd, HA_CHECK_OPT* check_opt); + enum thr_lock_type lock_type) override; ///< required + int optimize(THD* thd, HA_CHECK_OPT* check_opt) override; /** * Multi Range Read interface */ int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, - uint n_ranges, uint mode, HANDLER_BUFFER *buf); - int multi_range_read_next(range_id_t *range_info); + uint n_ranges, uint mode, HANDLER_BUFFER *buf) override; + int multi_range_read_next(range_id_t *range_info) override; ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, - uint *flags, Cost_estimate *cost); + uint *flags, Cost_estimate *cost) override; ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, uint key_parts, uint *bufsz, - uint *flags, Cost_estimate *cost); - int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size); + uint *flags, Cost_estimate *cost) override; + int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) override; - int reset(void) {ds_mrr.dsmrr_close(); return 0;} + int reset(void) override {ds_mrr.dsmrr_close(); return 0;} /* Index condition pushdown implementation */ // Item *idx_cond_push(uint keyno, Item* idx_cond); diff --git a/storage/connect/jdbconn.h b/storage/connect/jdbconn.h index 0c36cccadcf..48734caba93 100644 --- a/storage/connect/jdbconn.h +++ b/storage/connect/jdbconn.h @@ -23,7 +23,7 @@ public: // Constructor JDBConn(PGLOBAL g, PCSZ wrapper); - virtual void AddJars(PSTRG jpop, char sep); + void AddJars(PSTRG jpop, char sep) override; PQRYRES AllocateResult(PGLOBAL g, PTDB tdbp); // Attributes @@ -34,9 +34,9 @@ public: public: // Operations - virtual bool Connect(PJPARM sop); - virtual bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, - PCSZ filter, bool pipe) {return true;} + bool Connect(PJPARM sop) override; + bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, + PCSZ filter, bool pipe) override {return true;} virtual int GetResultSize(PCSZ sql, PCOL colp); virtual int ExecuteCommand(PCSZ sql); virtual int ExecuteQuery(PCSZ sql); diff --git a/storage/connect/jmgfam.h b/storage/connect/jmgfam.h index c5d9d1f57e6..818422edfee 100644 --- a/storage/connect/jmgfam.h +++ b/storage/connect/jmgfam.h @@ -31,35 +31,35 @@ public: JMGFAM(PJMGFAM txfp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_MGO; } - virtual bool GetUseTemp(void) { return false; } - virtual int GetPos(void); - virtual int GetNextPos(void); - virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) JMGFAM(this); } + AMT GetAmType(void) override { return TYPE_AM_MGO; } + bool GetUseTemp(void) override { return false; } + int GetPos(void) override; + int GetNextPos(void) override; + PTXF Duplicate(PGLOBAL g) override { return (PTXF)new(g) JMGFAM(this); } void SetLrecl(int lrecl) { Lrecl = lrecl; } // Methods - virtual void Reset(void); - virtual int GetFileLength(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g) { return false; } - virtual int GetRowID(void); - virtual bool RecordPos(PGLOBAL g); - virtual bool SetPos(PGLOBAL g, int recpos); - virtual int SkipRecord(PGLOBAL g, bool header); - virtual bool OpenTableFile(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); - virtual int WriteBuffer(PGLOBAL g); - virtual int DeleteRecords(PGLOBAL g, int irc); - virtual void CloseTableFile(PGLOBAL g, bool abort); - virtual void Rewind(void); + void Reset(void) override; + int GetFileLength(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override; + int MaxBlkSize(PGLOBAL g, int s) override; + bool AllocateBuffer(PGLOBAL g) override { return false; } + int GetRowID(void) override; + bool RecordPos(PGLOBAL g) override; + bool SetPos(PGLOBAL g, int recpos) override; + int SkipRecord(PGLOBAL g, bool header) override; + bool OpenTableFile(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; + int WriteBuffer(PGLOBAL g) override; + int DeleteRecords(PGLOBAL g, int irc) override; + void CloseTableFile(PGLOBAL g, bool abort) override; + void Rewind(void) override; protected: - virtual bool OpenTempFile(PGLOBAL g) { return false; } - virtual bool MoveIntermediateLines(PGLOBAL g, bool *b) { return false; } - virtual int RenameTempFile(PGLOBAL g) { return RC_OK; } - virtual int InitDelete(PGLOBAL g, int fpos, int spos); + bool OpenTempFile(PGLOBAL g) override { return false; } + bool MoveIntermediateLines(PGLOBAL g, bool *b) override { return false; } + int RenameTempFile(PGLOBAL g) override { return RC_OK; } + int InitDelete(PGLOBAL g, int fpos, int spos) override; bool Init(PGLOBAL g); //bool MakeCursor(PGLOBAL g); diff --git a/storage/connect/jmgoconn.h b/storage/connect/jmgoconn.h index 9fed1907abc..184ff18e0f3 100644 --- a/storage/connect/jmgoconn.h +++ b/storage/connect/jmgoconn.h @@ -61,9 +61,9 @@ public: // Implementation public: - virtual void AddJars(PSTRG jpop, char sep); - virtual bool Connect(PJPARM sop); - virtual bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, PCSZ filter, bool pipe); + void AddJars(PSTRG jpop, char sep) override; + bool Connect(PJPARM sop) override; + bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, PCSZ filter, bool pipe) override; // PQRYRES AllocateResult(PGLOBAL g, TDBEXT *tdbp, int n); // Attributes diff --git a/storage/connect/json.h b/storage/connect/json.h index 53fc5f65e7b..eeca4780baf 100644 --- a/storage/connect/json.h +++ b/storage/connect/json.h @@ -142,14 +142,14 @@ public: JOBJECT(int i) : JSON(i) {} // Methods - virtual void Clear(void) {First = Last = NULL;} + void Clear(void) override {First = Last = NULL;} //virtual JTYP GetValType(void) {return TYPE_JOB;} - virtual PJPR GetFirst(void) {return First;} - virtual int GetSize(bool b); - virtual PJOB GetObject(void) {return this;} - virtual PSZ GetText(PGLOBAL g, PSTRG text); - virtual bool Merge(PGLOBAL g, PJSON jsp); - virtual bool IsNull(void); + PJPR GetFirst(void) override {return First;} + int GetSize(bool b) override; + PJOB GetObject(void) override {return this;} + PSZ GetText(PGLOBAL g, PSTRG text) override; + bool Merge(PGLOBAL g, PJSON jsp) override; + bool IsNull(void) override; // Specific PJPR AddPair(PGLOBAL g, PCSZ key); @@ -174,15 +174,15 @@ class JARRAY : public JSON { JARRAY(int i) : JSON(i) {} // Methods - virtual void Clear(void) {First = Last = NULL; Size = 0;} - virtual int size(void) { return Size; } - virtual PJAR GetArray(void) {return this;} - virtual int GetSize(bool b); - virtual PJVAL GetArrayValue(int i); - virtual PSZ GetText(PGLOBAL g, PSTRG text); - virtual bool Merge(PGLOBAL g, PJSON jsp); - virtual bool DeleteValue(int n); - virtual bool IsNull(void); + void Clear(void) override {First = Last = NULL; Size = 0;} + int size(void) override { return Size; } + PJAR GetArray(void) override {return this;} + int GetSize(bool b) override; + PJVAL GetArrayValue(int i) override; + PSZ GetText(PGLOBAL g, PSTRG text) override; + bool Merge(PGLOBAL g, PJSON jsp) override; + bool DeleteValue(int n) override; + bool IsNull(void) override; // Specific PJVAL AddArrayValue(PGLOBAL g, PJVAL jvp = NULL, int* x = NULL); @@ -221,14 +221,14 @@ public: //using JSON::SetVal; // Methods - virtual void Clear(void); + void Clear(void) override; //virtual JTYP GetType(void) {return TYPE_JVAL;} virtual JTYP GetValType(void); - virtual PJOB GetObject(void); - virtual PJAR GetArray(void); - virtual PJSON GetJsp(void) {return (DataType == TYPE_JSON ? Jsp : NULL);} - virtual PSZ GetText(PGLOBAL g, PSTRG text); - virtual bool IsNull(void); + PJOB GetObject(void) override; + PJAR GetArray(void) override; + PJSON GetJsp(void) override {return (DataType == TYPE_JSON ? Jsp : NULL);} + PSZ GetText(PGLOBAL g, PSTRG text) override; + bool IsNull(void) override; // Specific //inline PVL GetVal(void) { return Val; } @@ -239,7 +239,7 @@ public: long long GetBigint(void); double GetFloat(void); PVAL GetValue(PGLOBAL g); - void SetValue(PJSON jsp); + void SetValue(PJSON jsp) override; void SetValue(PGLOBAL g, PVAL valp); void SetString(PGLOBAL g, PSZ s, int ci = 0); void SetInteger(PGLOBAL g, int n); @@ -288,9 +288,9 @@ class JOUTSTR : public JOUT { public: JOUTSTR(PGLOBAL g); - virtual bool WriteStr(const char* s); - virtual bool WriteChr(const char c); - virtual bool Escape(const char* s); + bool WriteStr(const char* s) override; + bool WriteChr(const char c) override; + bool Escape(const char* s) override; // Member char* Strp; // The serialized string @@ -305,9 +305,9 @@ class JOUTFILE : public JOUT { public: JOUTFILE(PGLOBAL g, FILE* str, int pty) : JOUT(g) { Stream = str; Pretty = pty; } - virtual bool WriteStr(const char* s); - virtual bool WriteChr(const char c); - virtual bool Escape(const char* s); + bool WriteStr(const char* s) override; + bool WriteChr(const char c) override; + bool Escape(const char* s) override; // Member FILE* Stream; @@ -320,8 +320,8 @@ class JOUTPRT : public JOUTFILE { public: JOUTPRT(PGLOBAL g, FILE* str) : JOUTFILE(g, str, 2) { M = 0; B = false; } - virtual bool WriteStr(const char* s); - virtual bool WriteChr(const char c); + bool WriteStr(const char* s) override; + bool WriteChr(const char c) override; // Member int M; diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp index 01b38366d63..d8e8232567b 100644 --- a/storage/connect/libdoc.cpp +++ b/storage/connect/libdoc.cpp @@ -63,23 +63,23 @@ class LIBXMLDOC : public XMLDOCUMENT { LIBXMLDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp); // Properties - virtual short GetDocType(void) {return TYPE_FB_XML2;} - virtual void *GetDocPtr(void) {return Docp;} - virtual void SetNofree(bool b) {Nofreelist = b;} + short GetDocType(void) override {return TYPE_FB_XML2;} + void *GetDocPtr(void) override {return Docp;} + void SetNofree(bool b) override {Nofreelist = b;} // Methods - virtual bool Initialize(PGLOBAL g, PCSZ entry, bool zipped); - virtual bool ParseFile(PGLOBAL g, char *fn); - virtual bool NewDoc(PGLOBAL g, PCSZ ver); - virtual void AddComment(PGLOBAL g, char *com); - virtual PXNODE GetRoot(PGLOBAL g); - virtual PXNODE NewRoot(PGLOBAL g, char *name); - virtual PXNODE NewPnode(PGLOBAL g, char *name); - virtual PXATTR NewPattr(PGLOBAL g); - virtual PXLIST NewPlist(PGLOBAL g); - virtual int DumpDoc(PGLOBAL g, char *ofn); - virtual void CloseDoc(PGLOBAL g, PFBLOCK xp); - virtual PFBLOCK LinkXblock(PGLOBAL g, MODE m, int rc, char *fn); + bool Initialize(PGLOBAL g, PCSZ entry, bool zipped) override; + bool ParseFile(PGLOBAL g, char *fn) override; + bool NewDoc(PGLOBAL g, PCSZ ver) override; + void AddComment(PGLOBAL g, char *com) override; + PXNODE GetRoot(PGLOBAL g) override; + PXNODE NewRoot(PGLOBAL g, char *name) override; + PXNODE NewPnode(PGLOBAL g, char *name) override; + PXATTR NewPattr(PGLOBAL g) override; + PXLIST NewPlist(PGLOBAL g) override; + int DumpDoc(PGLOBAL g, char *ofn) override; + void CloseDoc(PGLOBAL g, PFBLOCK xp) override; + PFBLOCK LinkXblock(PGLOBAL g, MODE m, int rc, char *fn) override; protected: // bool CheckDocument(FILE *of, xmlNodePtr np); @@ -105,23 +105,23 @@ class XML2NODE : public XMLNODE { friend class XML2NODELIST; public: // Properties - virtual char *GetName(PGLOBAL g) {return (char*)Nodep->name;} - virtual int GetType(void); - virtual PXNODE GetNext(PGLOBAL g); - virtual PXNODE GetChild(PGLOBAL g); + char *GetName(PGLOBAL g) override {return (char*)Nodep->name;} + int GetType(void) override; + PXNODE GetNext(PGLOBAL g) override; + PXNODE GetChild(PGLOBAL g) override; // Methods - virtual RCODE GetContent(PGLOBAL g, char *buf, int len); - virtual bool SetContent(PGLOBAL g, char *txtp, int len); - virtual PXNODE Clone(PGLOBAL g, PXNODE np); - virtual PXLIST GetChildElements(PGLOBAL g, char *xp, PXLIST lp); - virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp); - virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np); - virtual PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap); - virtual PXNODE AddChildNode(PGLOBAL g, PCSZ name, PXNODE np); - virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap); - virtual void AddText(PGLOBAL g, PCSZ txtp); - virtual void DeleteChild(PGLOBAL g, PXNODE dnp); + RCODE GetContent(PGLOBAL g, char *buf, int len) override; + bool SetContent(PGLOBAL g, char *txtp, int len) override; + PXNODE Clone(PGLOBAL g, PXNODE np) override; + PXLIST GetChildElements(PGLOBAL g, char *xp, PXLIST lp) override; + PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp) override; + PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np) override; + PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap) override; + PXNODE AddChildNode(PGLOBAL g, PCSZ name, PXNODE np) override; + PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap) override; + void AddText(PGLOBAL g, PCSZ txtp) override; + void DeleteChild(PGLOBAL g, PXNODE dnp) override; protected: // Constructor @@ -141,9 +141,9 @@ class XML2NODELIST : public XMLNODELIST { friend class XML2NODE; public: // Methods - virtual int GetLength(void); - virtual PXNODE GetItem(PGLOBAL g, int n, PXNODE np); - virtual bool DropItem(PGLOBAL g, int n); + int GetLength(void) override; + PXNODE GetItem(PGLOBAL g, int n, PXNODE np) override; + bool DropItem(PGLOBAL g, int n) override; protected: // Constructor @@ -161,12 +161,12 @@ class XML2ATTR : public XMLATTRIBUTE { friend class XML2NODE; public: // Properties - virtual char *GetName(PGLOBAL g) {return (char*)Atrp->name;} - virtual PXATTR GetNext(PGLOBAL g); + char *GetName(PGLOBAL g) override {return (char*)Atrp->name;} + PXATTR GetNext(PGLOBAL g) override; // Methods - virtual RCODE GetText(PGLOBAL g, char *bufp, int len); - virtual bool SetText(PGLOBAL g, char *txtp, int len); + RCODE GetText(PGLOBAL g, char *bufp, int len) override; + bool SetText(PGLOBAL g, char *txtp, int len) override; protected: // Constructor diff --git a/storage/connect/mongo.h b/storage/connect/mongo.h index 7e92a7dc8e9..57652dc534e 100644 --- a/storage/connect/mongo.h +++ b/storage/connect/mongo.h @@ -69,11 +69,11 @@ public: MGODEF(void); // Implementation - virtual const char *GetType(void) { return "MONGO"; } + const char *GetType(void) override { return "MONGO"; } // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h index 147148f4a57..ab93aa051c6 100644 --- a/storage/connect/mycat.h +++ b/storage/connect/mycat.h @@ -101,13 +101,13 @@ class MYCAT : public CATALOG { void SetHandler(PHC hc) {Hc= hc;} // Methods - void Reset(void); + void Reset(void) override; bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary PTABDEF GetTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR type, PRELDEF *prp = NULL); PTDB GetTable(PGLOBAL g, PTABLE tablep, - MODE mode = MODE_READ, LPCSTR type = NULL); - void ClearDB(PGLOBAL g); + MODE mode = MODE_READ, LPCSTR type = NULL) override; + void ClearDB(PGLOBAL g) override; protected: PTABDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am); diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h index 1b81ae9e3b3..64f3a5e0022 100644 --- a/storage/connect/reldef.h +++ b/storage/connect/reldef.h @@ -91,20 +91,20 @@ public: RECFM GetTableFormat(const char* type); bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);} bool IsReadOnly(void) {return Read_Only;} - virtual AMT GetDefType(void) {return TYPE_AM_TAB;} + AMT GetDefType(void) override {return TYPE_AM_TAB;} virtual PIXDEF GetIndx(void) {return NULL;} virtual void SetIndx(PIXDEF) {} virtual bool IsHuge(void) {return false;} const CHARSET_INFO *data_charset() {return m_data_charset;} - const char *GetCsName(void) {return csname;} + const char *GetCsName(void) {return csname;} // Methods - int GetColCatInfo(PGLOBAL g); - void SetIndexInfo(void); - bool DropTable(PGLOBAL g, PSZ name); - virtual bool Define(PGLOBAL g, PCATLG cat, - LPCSTR name, LPCSTR schema, LPCSTR am); - virtual bool DefineAM(PGLOBAL, LPCSTR, int) = 0; + int GetColCatInfo(PGLOBAL g); + void SetIndexInfo(void); + bool DropTable(PGLOBAL g, PSZ name); + bool Define(PGLOBAL g, PCATLG cat, + LPCSTR name, LPCSTR schema, LPCSTR am) override; + virtual bool DefineAM(PGLOBAL, LPCSTR, int) = 0; protected: // Members @@ -135,12 +135,12 @@ class DllExport OEMDEF : public TABDEF { /* OEM table */ OEMDEF(void) {Hdll = NULL; Pxdef = NULL; Module = Subtype = NULL;} // Implementation - virtual const char *GetType(void) {return "OEM";} - virtual AMT GetDefType(void) {return TYPE_AM_OEM;} + const char *GetType(void) override {return "OEM";} + AMT GetDefType(void) override {return TYPE_AM_OEM;} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; protected: PTABDEF GetXdef(PGLOBAL g); diff --git a/storage/connect/tabbson.h b/storage/connect/tabbson.h index 9d5a8b7daf5..3694d05a199 100644 --- a/storage/connect/tabbson.h +++ b/storage/connect/tabbson.h @@ -71,11 +71,11 @@ public: BSONDEF(void); // Implementation - virtual const char* GetType(void) { return "BSON"; } + const char* GetType(void) override { return "BSON"; } // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -170,30 +170,30 @@ public: TDBBSN(TDBBSN* tdbp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_JSN; } - virtual bool SkipHeader(PGLOBAL g); - virtual PTDB Duplicate(PGLOBAL g) { return (PTDB)new(g) TDBBSN(this); } + AMT GetAmType(void) override { return TYPE_AM_JSN; } + bool SkipHeader(PGLOBAL g) override; + PTDB Duplicate(PGLOBAL g) override { return (PTDB)new(g) TDBBSN(this); } PBVAL GetRow(void) { return Row; } // Methods - virtual PTDB Clone(PTABS t); - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PCOL colp); - virtual int RowNumber(PGLOBAL g, bool b = FALSE) {return (b) ? M : N;} - virtual bool CanBeFiltered(void) + PTDB Clone(PTABS t) override; + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + PCOL InsertSpecialColumn(PCOL colp) override; + int RowNumber(PGLOBAL g, bool b = FALSE) override {return (b) ? M : N;} + bool CanBeFiltered(void) override {return Txfp->GetAmType() == TYPE_AM_MGO || !Xcol;} // Database routines - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual bool PrepareWriting(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual void CloseDB(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + bool PrepareWriting(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + void CloseDB(PGLOBAL g) override; // Specific routine - virtual int EstimatedLength(void); + int EstimatedLength(void) override; protected: PBVAL FindRow(PGLOBAL g); @@ -242,15 +242,15 @@ public: BSONCOL(BSONCOL* colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) { return Tbp->GetAmType(); } - virtual bool Stringify(void) { return Sgfy; } + int GetAmType(void) override { return Tbp->GetAmType(); } + bool Stringify(void) override { return Sgfy; } // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; bool ParseJpath(PGLOBAL g); - virtual PSZ GetJpath(PGLOBAL g, bool proj); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + PSZ GetJpath(PGLOBAL g, bool proj) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: bool CheckExpand(PGLOBAL g, int i, PSZ nm, bool b); @@ -288,30 +288,30 @@ public: TDBBSON(PBTDB tdbp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_JSON; } - virtual PTDB Duplicate(PGLOBAL g) { return (PTDB)new(g) TDBBSON(this); } + AMT GetAmType(void) override { return TYPE_AM_JSON; } + PTDB Duplicate(PGLOBAL g) override { return (PTDB)new(g) TDBBSON(this); } PBVAL GetDoc(void) { return Docp; } // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; // Database routines - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual void ResetSize(void); - virtual int GetProgCur(void) { return N; } - virtual int GetRecpos(void); - virtual bool SetRecpos(PGLOBAL g, int recpos); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual bool PrepareWriting(PGLOBAL g) { return false; } - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + void ResetSize(void) override; + int GetProgCur(void) override { return N; } + int GetRecpos(void) override; + bool SetRecpos(PGLOBAL g, int recpos) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + bool PrepareWriting(PGLOBAL g) override { return false; } + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; int MakeDocument(PGLOBAL g); // Optimization routines - virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); + int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) override; protected: int MakeNewDoc(PGLOBAL g); @@ -335,7 +335,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabcmg.h b/storage/connect/tabcmg.h index 9effe714fdd..a40c0c9e24a 100644 --- a/storage/connect/tabcmg.h +++ b/storage/connect/tabcmg.h @@ -17,9 +17,9 @@ public: CMGDISC(PGLOBAL g, int *lg) : MGODISC(g, lg) { drv = "C"; } // Methods - virtual void GetDoc(void); -//virtual bool Find(PGLOBAL g, int i, int k, bool b); - virtual bool Find(PGLOBAL g); + void GetDoc(void) override; +//bool Find(PGLOBAL g, int i, int k, bool b) override; + bool Find(PGLOBAL g) override; // BSON Function //bool FindInDoc(PGLOBAL g, bson_iter_t *iter, const bson_t *doc, @@ -49,24 +49,24 @@ public: TDBCMG(TDBCMG *tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_MGO;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBCMG(this);} + AMT GetAmType(void) override {return TYPE_AM_MGO;} + PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBCMG(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PCOL colp); - virtual int RowNumber(PGLOBAL g, bool b = FALSE) {return N;} + PTDB Clone(PTABS t) override; + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + PCOL InsertSpecialColumn(PCOL colp) override; + int RowNumber(PGLOBAL g, bool b = FALSE) override {return N;} // Database routines - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) override; protected: bool Init(PGLOBAL g); @@ -96,13 +96,13 @@ public: MGOCOL(MGOCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) { return Tmgp->GetAmType(); } - virtual bool Stringify(void) { return Sgfy; } + int GetAmType(void) override { return Tmgp->GetAmType(); } + bool Stringify(void) override { return Sgfy; } // Methods - virtual PSZ GetJpath(PGLOBAL g, bool proj); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + PSZ GetJpath(PGLOBAL g, bool proj) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -124,7 +124,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabcol.h b/storage/connect/tabcol.h index e4657e2f261..973749c18c3 100644 --- a/storage/connect/tabcol.h +++ b/storage/connect/tabcol.h @@ -38,8 +38,8 @@ class DllExport XTAB: public BLOCK { // Table Name-Schema-Srcdef block. // Methods PTABLE Link(PTABLE); - void Printf(PGLOBAL g, FILE *f, uint n); - void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; protected: // Members @@ -64,11 +64,11 @@ class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block. COLUMN(LPCSTR name); // Implementation - virtual int GetType(void) {return TYPE_COLUMN;} - virtual int GetResultType(void) {assert(false); return TYPE_VOID;} - virtual int GetLength(void) {assert(false); return 0;} - virtual int GetLengthEx(void) {assert(false); return 0;} - virtual int GetScale() {assert(false); return 0;}; + int GetType(void) override {return TYPE_COLUMN;} + int GetResultType(void) override {assert(false); return TYPE_VOID;} + int GetLength(void) override {assert(false); return 0;} + int GetLengthEx(void) override {assert(false); return 0;} + int GetScale() override {assert(false); return 0;}; LPCSTR GetName(void) {return Name;} LPCSTR GetQualifier(void) {return Qualifier;} PTABLE GetTo_Table(void) {return To_Table;} @@ -78,13 +78,13 @@ class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block. void SetTo_Col(PCOL colp) {To_Col = colp;} // Methods - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; // All methods below should never be used for COLUMN's - virtual void Reset(void) {assert(false);} - virtual bool Compare(PXOB) {assert(false); return false;} - virtual bool SetFormat(PGLOBAL, FORMAT&); - virtual bool Eval(PGLOBAL) {assert(false); return true;} + void Reset(void) override {assert(false);} + bool Compare(PXOB) override {assert(false); return false;} + bool SetFormat(PGLOBAL, FORMAT&) override; + bool Eval(PGLOBAL) override {assert(false); return true;} private: // Members diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 22bb5c63ce3..346aad2dba5 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -36,11 +36,11 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ DOSDEF(void); // Implementation - virtual AMT GetDefType(void) {return TYPE_AM_DOS;} - virtual const char *GetType(void) {return "DOS";} - virtual PIXDEF GetIndx(void) {return To_Indx;} - virtual void SetIndx(PIXDEF xdp) {To_Indx = xdp;} - virtual bool IsHuge(void) {return Huge;} + AMT GetDefType(void) override {return TYPE_AM_DOS;} + const char *GetType(void) override {return "DOS";} + PIXDEF GetIndx(void) override {return To_Indx;} + void SetIndx(PIXDEF xdp) override {To_Indx = xdp;} + bool IsHuge(void) override {return Huge;} PCSZ GetFn(void) {return Fn;} PCSZ GetOfn(void) {return Ofn;} PCSZ GetEntry(void) {return Entry;} @@ -63,11 +63,11 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ int *GetTo_Pos(void) {return To_Pos;} // Methods - virtual int Indexable(void) + int Indexable(void) override {return (!Multiple && !Mulentries && Compressed != 1) ? 1 : 0;} virtual bool DeleteIndexFile(PGLOBAL g, PIXDEF pxdf); - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; bool InvalidateIndex(PGLOBAL g); bool GetOptFileName(PGLOBAL g, char *filename); void RemoveOptValues(PGLOBAL g); @@ -133,62 +133,62 @@ class DllExport TDBDOS : public TDBASE { inline PXOB *GetLink(void) {return To_Link;} // Implementation - virtual AMT GetAmType(void) {return Txfp->GetAmType();} - virtual PCSZ GetFile(PGLOBAL) {return Txfp->To_File;} - virtual void SetFile(PGLOBAL, PCSZ fn) {Txfp->To_File = fn;} - virtual void SetAbort(bool b) {Abort = b;} - virtual RECFM GetFtype(void) {return Ftype;} + AMT GetAmType(void) override {return Txfp->GetAmType();} + PCSZ GetFile(PGLOBAL) override {return Txfp->To_File;} + void SetFile(PGLOBAL, PCSZ fn) override {Txfp->To_File = fn;} + void SetAbort(bool b) override {Abort = b;} + RECFM GetFtype(void) override {return Ftype;} virtual bool SkipHeader(PGLOBAL) {return false;} - virtual void RestoreNrec(void) {Txfp->SetNrec(1);} - virtual PTDB Duplicate(PGLOBAL g) + void RestoreNrec(void) override {Txfp->SetNrec(1);} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBDOS(g, this);} // Methods - virtual PTDB Clone(PTABS t); - virtual void ResetDB(void) {Txfp->Reset();} - virtual bool IsUsingTemp(PGLOBAL g); - virtual bool IsIndexed(void) {return Indxd;} - virtual void ResetSize(void) {MaxSize = Cardinal = -1;} - virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); + PTDB Clone(PTABS t) override; + void ResetDB(void) override {Txfp->Reset();} + bool IsUsingTemp(PGLOBAL g) override; + bool IsIndexed(void) override {return Indxd;} + void ResetSize(void) override {MaxSize = Cardinal = -1;} + int ResetTableOpt(PGLOBAL g, bool dop, bool dox) override; virtual int MakeBlockValues(PGLOBAL g); virtual bool SaveBlockValues(PGLOBAL g); - virtual bool GetBlockValues(PGLOBAL g); + bool GetBlockValues(PGLOBAL g) override; virtual PBF InitBlockFilter(PGLOBAL g, PFIL filp); //virtual PBX InitBlockIndex(PGLOBAL g); virtual int TestBlock(PGLOBAL g); - virtual void PrintAM(FILE *f, char *m); + void PrintAM(FILE *f, char *m) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; virtual char *GetOpenMode(PGLOBAL, char*) {return NULL;} virtual int GetFileLength(PGLOBAL g) {return Txfp->GetFileLength(g);} - virtual int GetProgMax(PGLOBAL g); - virtual int GetProgCur(void); + int GetProgMax(PGLOBAL g) override; + int GetProgCur(void) override; //virtual int GetAffectedRows(void) {return Txfp->GetDelRows();} - virtual int GetRecpos(void) {return Txfp->GetPos();} - virtual bool SetRecpos(PGLOBAL g, int recpos) + int GetRecpos(void) override {return Txfp->GetPos();} + bool SetRecpos(PGLOBAL g, int recpos) override {return Txfp->SetPos(g, recpos);} - virtual int RowNumber(PGLOBAL g, bool b = false); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + int RowNumber(PGLOBAL g, bool b = false) override; + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; virtual int ReadBuffer(PGLOBAL g) {return Txfp->ReadBuffer(g);} // Specific routine virtual int EstimatedLength(void); // Optimization routines - virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); + int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) override; bool InitialyzeIndex(PGLOBAL g, PIXDEF xdp, bool sorted); void ResetBlockFilter(PGLOBAL g); bool GetDistinctColumnValues(PGLOBAL g, int nrec); protected: - virtual bool PrepareWriting(PGLOBAL g); + bool PrepareWriting(PGLOBAL g) override; PBF CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv); // Members @@ -219,10 +219,10 @@ class DllExport DOSCOL : public COLBLK { DOSCOL(DOSCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_DOS;} - virtual void SetTo_Val(PVAL valp) {To_Val = valp;} - virtual int GetClustered(void) {return Clustered;} - virtual int IsClustered(void) {return (Clustered && + int GetAmType(void) override {return TYPE_AM_DOS;} + void SetTo_Val(PVAL valp) override {To_Val = valp;} + int GetClustered(void) override {return Clustered;} + int IsClustered(void) override {return (Clustered && ((PDOSDEF)(((PTDBDOS)To_Tdb)->To_Def))->IsOptimized());} virtual int IsSorted(void) {return Sorted;} virtual PVBLK GetMin(void) {return Min;} @@ -233,10 +233,10 @@ class DllExport DOSCOL : public COLBLK { virtual PVBLK GetDval(void) {return Dval;} // Methods - virtual bool VarSize(void); - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + bool VarSize(void) override; + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: virtual bool SetMinMax(PGLOBAL g); diff --git a/storage/connect/tabext.h b/storage/connect/tabext.h index 8a0d6c784a5..01af43c5a4d 100644 --- a/storage/connect/tabext.h +++ b/storage/connect/tabext.h @@ -59,7 +59,7 @@ public: EXTDEF(void); // Constructor // Implementation - virtual const char *GetType(void) { return "EXT"; } + const char *GetType(void) override { return "EXT"; } inline PCSZ GetTabname(void) { return Tabname; } inline PCSZ GetTabschema(void) { return Tabschema; } inline PCSZ GetUsername(void) { return Username; }; @@ -72,8 +72,8 @@ public: inline int GetOptions(void) { return Options; } // Methods - virtual int Indexable(void) { return 2; } - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); + int Indexable(void) override { return 2; } + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; protected: // Members @@ -115,15 +115,15 @@ public: // Implementation // Properties - virtual bool IsRemote(void) { return true; } + bool IsRemote(void) override { return true; } // Methods - virtual PCSZ GetServer(void) { return "Remote"; } - virtual int GetRecpos(void); + PCSZ GetServer(void) override { return "Remote"; } + int GetRecpos(void) override; // Database routines - virtual int GetMaxSize(PGLOBAL g); - virtual int GetProgMax(PGLOBAL g); + int GetMaxSize(PGLOBAL g) override; + int GetProgMax(PGLOBAL g) override; protected: // Internal functions @@ -185,9 +185,9 @@ public: inline void SetCrp(PCOLRES crp) { Crp = crp; } // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL) = 0; - virtual void WriteColumn(PGLOBAL) = 0; + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void ReadColumn(PGLOBAL) override = 0; + void WriteColumn(PGLOBAL) override = 0; protected: // Constructor for count(*) column diff --git a/storage/connect/tabfix.h b/storage/connect/tabfix.h index 1a0d756bfcf..7f3bb929b50 100644 --- a/storage/connect/tabfix.h +++ b/storage/connect/tabfix.h @@ -28,30 +28,30 @@ class DllExport TDBFIX : public TDBDOS { TDBFIX(PGLOBAL g, PTDBFIX tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_FIX;} - virtual void RestoreNrec(void); - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_FIX;} + void RestoreNrec(void) override; + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBFIX(g, this);} // Methods - virtual PTDB Clone(PTABS t); - virtual void ResetDB(void); - virtual bool IsUsingTemp(PGLOBAL g); - virtual int RowNumber(PGLOBAL g, bool b = false); - virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); - virtual void ResetSize(void); - virtual int GetBadLines(void) {return Txfp->GetNerr();} + PTDB Clone(PTABS t) override; + void ResetDB(void) override; + bool IsUsingTemp(PGLOBAL g) override; + int RowNumber(PGLOBAL g, bool b = false) override; + int ResetTableOpt(PGLOBAL g, bool dop, bool dox) override; + void ResetSize(void) override; + int GetBadLines(void) override {return Txfp->GetNerr();} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int GetProgMax(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int GetProgMax(PGLOBAL g) override; + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; protected: - virtual bool PrepareWriting(PGLOBAL g) {return false;} + bool PrepareWriting(PGLOBAL g) override {return false;} // Members char Teds; /* Binary table default endian setting */ @@ -69,14 +69,14 @@ class DllExport BINCOL : public DOSCOL { BINCOL(BINCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_BIN;} + int GetAmType(void) override {return TYPE_AM_BIN;} int GetDeplac(void) {return Deplac;} int GetFileSize(void) {return N ? N : GetTypeSize(Buf_Type, Long);} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; // Static static void SetEndian(void); @@ -105,7 +105,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g) + PQRYRES GetResult(PGLOBAL g) override {return DBFColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, Topt, false);} // Members diff --git a/storage/connect/tabfmt.h b/storage/connect/tabfmt.h index 268d00b1724..e71ca998ae7 100644 --- a/storage/connect/tabfmt.h +++ b/storage/connect/tabfmt.h @@ -27,13 +27,13 @@ public: CSVDEF(void); // Implementation - virtual const char *GetType(void) {return "CSV";} + const char *GetType(void) override {return "CSV";} char GetSep(void) {return Sep;} char GetQot(void) {return Qot;} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; protected: // Members @@ -60,29 +60,29 @@ public: TDBCSV(PGLOBAL g, PTDBCSV tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_CSV;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_CSV;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBCSV(g, this);} // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; //virtual bool IsUsingTemp(PGLOBAL g); - virtual int GetBadLines(void) {return (int)Nerr;} + int GetBadLines(void) override {return (int)Nerr;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual bool OpenDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int CheckWrite(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); // Physical file read + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + bool OpenDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int CheckWrite(PGLOBAL g) override; + int ReadBuffer(PGLOBAL g) override; // Physical file read // Specific routines - virtual int EstimatedLength(void); - virtual bool SkipHeader(PGLOBAL g); + int EstimatedLength(void) override; + bool SkipHeader(PGLOBAL g) override; virtual bool CheckErr(void); protected: - virtual bool PrepareWriting(PGLOBAL g); + bool PrepareWriting(PGLOBAL g) override; // Members PSZ *Field; // Field to write to current line @@ -112,12 +112,12 @@ class DllExport CSVCOL : public DOSCOL { CSVCOL(CSVCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType() {return TYPE_AM_CSV;} + int GetAmType() override {return TYPE_AM_CSV;} // Methods - virtual bool VarSize(void); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + bool VarSize(void) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -143,26 +143,26 @@ class DllExport TDBFMT : public TDBCSV { TDBFMT(PGLOBAL g, PTDBFMT tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_FMT;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_FMT;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBFMT(g, this);} // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); -//virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; +//int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; //virtual int CheckWrite(PGLOBAL g); - virtual int ReadBuffer(PGLOBAL g); // Physical file read + int ReadBuffer(PGLOBAL g) override; // Physical file read // Specific routines - virtual int EstimatedLength(void); + int EstimatedLength(void) override; protected: - virtual bool PrepareWriting(PGLOBAL g) + bool PrepareWriting(PGLOBAL g) override {snprintf(g->Message, sizeof(g->Message), MSG(TABLE_READ_ONLY), "FMT"); return true;} // Members @@ -182,7 +182,7 @@ class DllExport TDBCCL : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabjdbc.h b/storage/connect/tabjdbc.h index 078129a14e3..8e90ada9a7f 100644 --- a/storage/connect/tabjdbc.h +++ b/storage/connect/tabjdbc.h @@ -29,11 +29,11 @@ public: JDBCDEF(void); // Implementation - virtual const char *GetType(void) { return "JDBC"; } + const char *GetType(void) override { return "JDBC"; } // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; int ParseURL(PGLOBAL g, char *url, bool b = true); bool SetParms(PJPARM sjp); @@ -60,25 +60,25 @@ public: TDBJDBC(PTDBJDBC tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_JDBC;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJDBC(this);} + AMT GetAmType(void) override {return TYPE_AM_JDBC;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBJDBC(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual bool SetRecpos(PGLOBAL g, int recpos); - virtual void ResetSize(void); - virtual PCSZ GetServer(void) { return "JDBC"; } + PTDB Clone(PTABS t) override; + bool SetRecpos(PGLOBAL g, int recpos) override; + void ResetSize(void) override; + PCSZ GetServer(void) override { return "JDBC"; } virtual int Indexable(void) { return 2; } // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) override; protected: // Internal functions @@ -108,12 +108,12 @@ public: JDBCCOL(JDBCCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) { return TYPE_AM_JDBC; } + int GetAmType(void) override { return TYPE_AM_JDBC; } // Methods //virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Constructor for count(*) column @@ -135,19 +135,19 @@ public: TDBXJDC(PJDBCDEF tdp = NULL); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_XDBC;} + AMT GetAmType(void) override {return TYPE_AM_XDBC;} // Methods // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; //virtual int GetProgMax(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - //virtual void CloseDB(PGLOBAL g); + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + //void CloseDB(PGLOBAL g) override; protected: // Internal functions @@ -170,11 +170,11 @@ public: JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "JDBC"); // Implementation - virtual int GetAmType(void) {return TYPE_AM_JDBC;} + int GetAmType(void) override {return TYPE_AM_JDBC;} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Members @@ -192,7 +192,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members int Maxres; // Returned lines limit @@ -208,7 +208,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members PCSZ Schema; // Points to schema name or NULL @@ -227,7 +227,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members PCSZ Colpat; // Points to catalog column pattern diff --git a/storage/connect/tabjmg.h b/storage/connect/tabjmg.h index 06c1462d103..6036e73c69f 100644 --- a/storage/connect/tabjmg.h +++ b/storage/connect/tabjmg.h @@ -18,9 +18,9 @@ public: JMGDISC(PGLOBAL g, int *lg); // Methods - virtual bool Init(PGLOBAL g); - virtual void GetDoc(void) {} - virtual bool Find(PGLOBAL g); + bool Init(PGLOBAL g) override; + void GetDoc(void) override {} + bool Find(PGLOBAL g) override; protected: // Function @@ -51,25 +51,25 @@ public: TDBJMG(TDBJMG *tdbp); // Implementation - virtual AMT GetAmType(void) { return TYPE_AM_MGO; } - virtual PTDB Duplicate(PGLOBAL g) { return (PTDB)new(g) TDBJMG(this); } + AMT GetAmType(void) override { return TYPE_AM_MGO; } + PTDB Duplicate(PGLOBAL g) override { return (PTDB)new(g) TDBJMG(this); } // Methods - virtual PTDB Clone(PTABS t); - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PCOL colp); + PTDB Clone(PTABS t) override; + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + PCOL InsertSpecialColumn(PCOL colp) override; //virtual void SetFilter(PFIL fp); - virtual int RowNumber(PGLOBAL g, bool b = FALSE) { return N; } + int RowNumber(PGLOBAL g, bool b = FALSE) override { return N; } // Database routines - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) override; protected: bool Init(PGLOBAL g); @@ -106,14 +106,14 @@ public: JMGCOL(JMGCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return Tmgp->GetAmType();} - virtual bool Stringify(void) { return Sgfy; } + int GetAmType(void) override {return Tmgp->GetAmType();} + bool Stringify(void) override { return Sgfy; } // Methods //virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual PSZ GetJpath(PGLOBAL g, bool proj); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + PSZ GetJpath(PGLOBAL g, bool proj) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; //bool AddValue(PGLOBAL g, bson_t *doc, char *key, bool upd); protected: @@ -138,7 +138,7 @@ public: protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index dcf40620dae..c3328261195 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -93,11 +93,11 @@ public: JSONDEF(void); // Implementation - virtual const char *GetType(void) {return "JSON";} + const char *GetType(void) override {return "JSON";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -141,32 +141,32 @@ public: TDBJSN(TDBJSN *tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_JSN;} - virtual bool SkipHeader(PGLOBAL g); - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSN(this);} + AMT GetAmType(void) override {return TYPE_AM_JSN;} + bool SkipHeader(PGLOBAL g) override; + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBJSN(this);} PJSON GetRow(void) {return Row;} void SetG(PGLOBAL g) {G = g;} // Methods - virtual PTDB Clone(PTABS t); - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PCOL colp); - virtual int RowNumber(PGLOBAL g, bool b = FALSE) + PTDB Clone(PTABS t) override; + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + PCOL InsertSpecialColumn(PCOL colp) override; + int RowNumber(PGLOBAL g, bool b = FALSE) override {return (b) ? M : N;} - virtual bool CanBeFiltered(void) + bool CanBeFiltered(void) override {return Txfp->GetAmType() == TYPE_AM_MGO || !Xcol;} // Database routines - //virtual int Cardinality(PGLOBAL g); - //virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual bool PrepareWriting(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual void CloseDB(PGLOBAL g); + //int Cardinality(PGLOBAL g) override; + //int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + bool PrepareWriting(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + void CloseDB(PGLOBAL g) override; // Specific routine - virtual int EstimatedLength(void); + int EstimatedLength(void) override; protected: PJSON FindRow(PGLOBAL g); @@ -216,15 +216,15 @@ public: JSONCOL(JSONCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return Tjp->GetAmType();} - virtual bool Stringify(void) { return Sgfy; } + int GetAmType(void) override {return Tjp->GetAmType();} + bool Stringify(void) override { return Sgfy; } // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; bool ParseJpath(PGLOBAL g); - virtual PSZ GetJpath(PGLOBAL g, bool proj); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + PSZ GetJpath(PGLOBAL g, bool proj) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: bool CheckExpand(PGLOBAL g, int i, PSZ nm, bool b); @@ -269,30 +269,30 @@ class DllExport TDBJSON : public TDBJSN { TDBJSON(PJTDB tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_JSON;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSON(this);} + AMT GetAmType(void) override {return TYPE_AM_JSON;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBJSON(this);} PJAR GetDoc(void) {return Doc;} // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; // Database routines - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual void ResetSize(void); - virtual int GetProgCur(void) {return N;} - virtual int GetRecpos(void); - virtual bool SetRecpos(PGLOBAL g, int recpos); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual bool PrepareWriting(PGLOBAL g) {return false;} - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + void ResetSize(void) override; + int GetProgCur(void) override {return N;} + int GetRecpos(void) override; + bool SetRecpos(PGLOBAL g, int recpos) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + bool PrepareWriting(PGLOBAL g) override {return false;} + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; int MakeDocument(PGLOBAL g); // Optimization routines - virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); + int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) override; protected: int MakeNewDoc(PGLOBAL g); @@ -314,7 +314,7 @@ class DllExport TDBJCL : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabmac.h b/storage/connect/tabmac.h index 68135edb95f..8ff8fad47bb 100644 --- a/storage/connect/tabmac.h +++ b/storage/connect/tabmac.h @@ -48,23 +48,23 @@ class TDBMAC : public TDBASE { //TDBMAC(PGLOBAL g, PTDBMAC tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_MAC;} -//virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMAC(g, this);} + AMT GetAmType(void) override {return TYPE_AM_MAC;} +// PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBMAC(g, this);} // Methods -//virtual PTDB Clone(PTABS t); +//PTDB Clone(PTABS t) override; virtual int GetRecpos(void) {return N;} - virtual int RowNumber(PGLOBAL g, bool b = false) {return N;} + int RowNumber(PGLOBAL g, bool b = false) override {return N;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g) {return GetMaxSize(g);} - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g) {} + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override {return GetMaxSize(g);} + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override {} protected: // Specific routines @@ -94,10 +94,10 @@ class MACCOL : public COLBLK { //MACCOL(MACCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_MAC;} + int GetAmType(void) override {return TYPE_AM_MAC;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: MACCOL(void) {} // Default constructor not to be used diff --git a/storage/connect/tabmul.h b/storage/connect/tabmul.h index a01e4e7fdf2..e1c42b46658 100644 --- a/storage/connect/tabmul.h +++ b/storage/connect/tabmul.h @@ -32,31 +32,31 @@ class DllExport TDBMUL : public TDBASE { TDBMUL(PTDBMUL tdbp); // Implementation - virtual AMT GetAmType(void) {return Tdbp->GetAmType();} - virtual PTDB Duplicate(PGLOBAL g); + AMT GetAmType(void) override {return Tdbp->GetAmType();} + PTDB Duplicate(PGLOBAL g) override; // Methods - virtual void ResetDB(void); - virtual PTDB Clone(PTABS t); - virtual bool IsSame(PTDB tp) {return tp == (PTDB)Tdbp;} - virtual PCSZ GetFile(PGLOBAL g) {return Tdbp->GetFile(g);} - virtual int GetRecpos(void) {return 0;} - virtual PCOL ColDB(PGLOBAL g, PSZ name, int num); + void ResetDB(void) override; + PTDB Clone(PTABS t) override; + bool IsSame(PTDB tp) override {return tp == (PTDB)Tdbp;} + PCSZ GetFile(PGLOBAL g) override {return Tdbp->GetFile(g);} + int GetRecpos(void) override {return 0;} + PCOL ColDB(PGLOBAL g, PSZ name, int num) override; bool InitFileNames(PGLOBAL g); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override {strcpy(g->Message, MSG(MUL_MAKECOL_ERR)); return NULL;} - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual int GetProgMax(PGLOBAL g); - virtual int GetProgCur(void); - virtual int RowNumber(PGLOBAL g, bool b = false); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + int GetProgMax(PGLOBAL g) override; + int GetProgCur(void) override; + int RowNumber(PGLOBAL g, bool b = false) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: @@ -83,10 +83,10 @@ public: TDBMSD(PTDBMSD tdbp) : TDBMUL(tdbp) {} // Implementation - virtual PTDB Duplicate(PGLOBAL g); + PTDB Duplicate(PGLOBAL g); // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; bool InitFileNames(PGLOBAL g); // Database routines @@ -108,11 +108,11 @@ class DllExport DIRDEF : public TABDEF { /* Directory listing table */ DIRDEF(void) {Fn = NULL; Incl = false; Huge = false;} // Implementation - virtual const char *GetType(void) {return "DIR";} + const char *GetType(void) override {return "DIR";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -137,21 +137,21 @@ public: TDBDIR(PSZ fpat); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_DIR;} + AMT GetAmType(void) override {return TYPE_AM_DIR;} // Methods - virtual int GetRecpos(void) {return iFile;} + int GetRecpos(void) override {return iFile;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int GetMaxSize(PGLOBAL g); - virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} - virtual int GetProgCur(void) {return iFile;} - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int GetMaxSize(PGLOBAL g) override; + int GetProgMax(PGLOBAL g) override {return GetMaxSize(g);} + int GetProgCur(void) override {return iFile;} + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: void Init(void); @@ -195,11 +195,11 @@ class TDBSDR : public TDBDIR { TDBSDR(PSZ fpat) : TDBDIR(fpat) {Sub = NULL;} // Database routines - virtual int GetMaxSize(PGLOBAL g); - virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); -//virtual void CloseDB(PGLOBAL g); + int GetMaxSize(PGLOBAL g) override; + int GetProgMax(PGLOBAL g) override {return GetMaxSize(g);} + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; +//void CloseDB(PGLOBAL g) override; protected: int FindInDir(PGLOBAL g); @@ -230,10 +230,10 @@ class DIRCOL : public COLBLK { DIRCOL(DIRCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_DIR;} + int GetAmType(void) override {return TYPE_AM_DIR;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used diff --git a/storage/connect/tabmysql.h b/storage/connect/tabmysql.h index b5af77de50b..7f77eeabcbb 100644 --- a/storage/connect/tabmysql.h +++ b/storage/connect/tabmysql.h @@ -28,7 +28,7 @@ class MYSQLDEF : public EXTDEF {/* Logical table description */ MYSQLDEF(void); // Implementation - virtual const char *GetType(void) {return "MYSQL";} + const char *GetType(void) override {return "MYSQL";} inline PSZ GetHostname(void) {return Hostname;}; //inline PSZ GetDatabase(void) {return Tabschema;}; //inline PSZ GetTabname(void) {return Tabname;} @@ -39,8 +39,8 @@ class MYSQLDEF : public EXTDEF {/* Logical table description */ // Methods //virtual int Indexable(void) {return 2;} - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; bool ParseURL(PGLOBAL g, char *url, bool b = true); bool GetServerInfo(PGLOBAL g, const char *server_name); @@ -77,30 +77,30 @@ class TDBMYSQL : public TDBEXT { TDBMYSQL(PTDBMY tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_MYSQL;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYSQL(this);} + AMT GetAmType(void) override {return TYPE_AM_MYSQL;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBMYSQL(this);} // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; //virtual int GetAffectedRows(void) {return AftRows;} - virtual int GetRecpos(void) {return N;} - virtual int GetProgMax(PGLOBAL g); - virtual void ResetDB(void) {N = 0;} - virtual int RowNumber(PGLOBAL g, bool b = false); - virtual bool IsView(void) {return Isview;} - virtual PCSZ GetServer(void) {return Server;} + int GetRecpos(void) override {return N;} + int GetProgMax(PGLOBAL g) override; + void ResetDB(void) override {N = 0;} + int RowNumber(PGLOBAL g, bool b = false) override; + bool IsView(void) override {return Isview;} + PCSZ GetServer(void) override {return Server;} void SetDatabase(LPCSTR db) {Schema = (char*)db;} // Schema routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); -//virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; +//int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) override; // Specific routines bool SetColumnRanks(PGLOBAL g); @@ -112,7 +112,7 @@ class TDBMYSQL : public TDBEXT { bool MakeSelect(PGLOBAL g, bool mx); bool MakeInsert(PGLOBAL g); int BindColumns(PGLOBAL g __attribute__((unused))); - virtual bool MakeCommand(PGLOBAL g); + bool MakeCommand(PGLOBAL g) override; //int MakeUpdate(PGLOBAL g); //int MakeDelete(PGLOBAL g); int SendCommand(PGLOBAL g); @@ -154,13 +154,13 @@ class MYSQLCOL : public COLBLK { MYSQLCOL(MYSQLCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_MYSQL;} + int GetAmType(void) override {return TYPE_AM_MYSQL;} void InitBind(PGLOBAL g); // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; bool FindRank(PGLOBAL g); protected: @@ -182,19 +182,19 @@ class TDBMYEXC : public TDBMYSQL { TDBMYEXC(PTDBMYX tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_MYX;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(this);} + AMT GetAmType(void) override {return TYPE_AM_MYX;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBMYEXC(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual bool IsView(void) {return Isview;} + PTDB Clone(PTABS t) override; + bool IsView(void) override {return Isview;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; protected: // Internal functions @@ -223,8 +223,8 @@ class MYXCOL : public MYSQLCOL { MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Members @@ -242,7 +242,7 @@ class TDBMCL : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PCSZ Host; // Host machine to use diff --git a/storage/connect/taboccur.h b/storage/connect/taboccur.h index 8cd507acb7d..6f3a809174e 100644 --- a/storage/connect/taboccur.h +++ b/storage/connect/taboccur.h @@ -26,11 +26,11 @@ class OCCURDEF : public PRXDEF { /* Logical table description */ OCCURDEF(void) {Pseudo = 3; Colist = Xcol = NULL;} // Implementation - virtual const char *GetType(void) {return "OCCUR";} + const char *GetType(void) override {return "OCCUR";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -50,21 +50,21 @@ class TDBOCCUR : public TDBPRX { TDBOCCUR(POCCURDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_OCCUR;} + AMT GetAmType(void) override {return TYPE_AM_OCCUR;} void SetTdbp(PTDBASE tdbp) {Tdbp = tdbp;} // Methods - virtual void ResetDB(void) {N = 0; Tdbp->ResetDB();} - virtual int RowNumber(PGLOBAL g, bool b = FALSE); + void ResetDB(void) override {N = 0; Tdbp->ResetDB();} + int RowNumber(PGLOBAL g, bool b = FALSE) override; bool MakeColumnList(PGLOBAL g); bool ViewColumnList(PGLOBAL g); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual bool InitTable(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + bool InitTable(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; protected: // Members @@ -89,12 +89,12 @@ class OCCURCOL : public COLBLK { OCCURCOL(PCOLDEF cdp, PTDBOCCUR tdbp, int n); // Implementation - virtual int GetAmType(void) {return TYPE_AM_OCCUR;} + int GetAmType(void) override {return TYPE_AM_OCCUR;} int GetI(void) {return I;} // Methods - virtual void Reset(void) {} // Evaluated only by TDBOCCUR - virtual void ReadColumn(PGLOBAL g); + void Reset(void) override {} // Evaluated only by TDBOCCUR + void ReadColumn(PGLOBAL g) override; void Xreset(void) {I = 0;}; protected: @@ -114,10 +114,10 @@ class RANKCOL : public COLBLK { RANKCOL(PCOLDEF cdp, PTDBOCCUR tdbp, int n) : COLBLK(cdp, tdbp, n) {} // Implementation - virtual int GetAmType(void) {return TYPE_AM_OCCUR;} + int GetAmType(void) override {return TYPE_AM_OCCUR;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used diff --git a/storage/connect/tabodbc.h b/storage/connect/tabodbc.h index cedcf0f5f77..e196de8b4df 100644 --- a/storage/connect/tabodbc.h +++ b/storage/connect/tabodbc.h @@ -31,14 +31,14 @@ public: ODBCDEF(void); // Implementation - virtual const char *GetType(void) {return "ODBC";} + const char *GetType(void) override {return "ODBC";} PSZ GetConnect(void) {return Connect;} int GetCatver(void) {return Catver;} // Methods - virtual int Indexable(void) {return 2;} - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + int Indexable(void) override {return 2;} + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -63,28 +63,28 @@ class TDBODBC : public TDBEXT { TDBODBC(PTDBODBC tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ODBC;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_ODBC;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBODBC(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual bool SetRecpos(PGLOBAL g, int recpos); - virtual PCSZ GetFile(PGLOBAL g); - virtual void SetFile(PGLOBAL g, PCSZ fn); - virtual void ResetSize(void); - virtual PCSZ GetServer(void) {return "ODBC";} + PTDB Clone(PTABS t) override; + bool SetRecpos(PGLOBAL g, int recpos) override; + PCSZ GetFile(PGLOBAL g) override; + void SetFile(PGLOBAL g, PCSZ fn) override; + void ResetSize(void) override; + PCSZ GetServer(void) override {return "ODBC";} virtual int Indexable(void) {return 2;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) override; protected: // Internal functions @@ -109,16 +109,16 @@ class ODBCCOL : public EXTCOL { public: // Constructors ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "ODBC"); - ODBCCOL(ODBCCOL *colp, PTDB tdbp); // Constructor used in copy process + ODBCCOL(ODBCCOL *colp, PTDB tdbp); // Constructor used in opy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_ODBC;} - SQLLEN *GetStrLen(void) {return StrLen;} + int GetAmType(void) override {return TYPE_AM_ODBC;} + SQLLEN *GetStrLen(void) {return StrLen;} // Methods //virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; void AllocateBuffers(PGLOBAL g, int rows); void *GetBuffer(DWORD rows); SWORD GetBuflen(void); @@ -146,20 +146,20 @@ class TDBXDBC : public TDBODBC { TDBXDBC(PTDBXDBC tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_XDBC;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_XDBC;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBXDBC(this);} // Methods - virtual PTDB Clone(PTABS t); + PTDB Clone(PTABS t) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; protected: // Internal functions @@ -185,8 +185,8 @@ class XSRCCOL : public ODBCCOL { // Implementation // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Members @@ -203,8 +203,8 @@ class TDBDRV : public TDBCAT { TDBDRV(PODEF tdp) : TDBCAT(tdp) {Maxres = tdp->Maxres;} protected: - // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + // Specific routines + PQRYRES GetResult(PGLOBAL g) override; // Members int Maxres; // Returned lines limit @@ -219,8 +219,8 @@ class TDBSRC : public TDBDRV { TDBSRC(PODEF tdp) : TDBDRV(tdp) {} protected: - // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + // Specific routines + PQRYRES GetResult(PGLOBAL g) override; // No additional Members }; // end of class TDBSRC @@ -234,8 +234,8 @@ class TDBOTB : public TDBDRV { TDBOTB(PODEF tdp); protected: - // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + // Specific routines + PQRYRES GetResult(PGLOBAL g) override; // Members PCSZ Dsn; // Points to connection string @@ -254,8 +254,8 @@ class TDBOCL : public TDBOTB { TDBOCL(PODEF tdp); protected: - // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + // Specific routines + PQRYRES GetResult(PGLOBAL g) override; // Members char *Colpat; // Points to column pattern diff --git a/storage/connect/tabpivot.h b/storage/connect/tabpivot.h index 0a37804ff87..71964d74972 100644 --- a/storage/connect/tabpivot.h +++ b/storage/connect/tabpivot.h @@ -27,7 +27,7 @@ class PIVAID : public CSORT { bool SkipColumn(PCOLRES crp, char *skc); // The sorting function - virtual int Qcompare(int *, int *); + int Qcompare(int *, int *) override; protected: // Members @@ -64,11 +64,11 @@ class PIVOTDEF : public PRXDEF { /* Logical table description */ PIVOTDEF(void); // Implementation - virtual const char *GetType(void) {return "PIVOT";} + const char *GetType(void) override {return "PIVOT";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -96,22 +96,22 @@ class TDBPIVOT : public TDBPRX { TDBPIVOT(PPIVOTDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_PIVOT;} + AMT GetAmType(void) override {return TYPE_AM_PIVOT;} // Methods - virtual int GetRecpos(void) {return N;} - virtual void ResetDB(void) {N = 0;} - virtual int RowNumber(PGLOBAL g, bool b = FALSE); + int GetRecpos(void) override {return N;} + void ResetDB(void) override {N = 0;} + int RowNumber(PGLOBAL g, bool b = FALSE) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g) {return (g) ? 10 : 0;} - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override {return (g) ? 10 : 0;} + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: // Internal routines @@ -154,10 +154,10 @@ class FNCCOL : public COLBLK { FNCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i); // Implementation - virtual int GetAmType(void) {return TYPE_AM_FNC;} + int GetAmType(void) override {return TYPE_AM_FNC;} // Methods - virtual void Reset(void) {} + void Reset(void) override {} bool InitColumn(PGLOBAL g); bool CompareColumn(void); @@ -177,13 +177,13 @@ class SRCCOL : public PRXCOL { SRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int n); // Implementation - virtual int GetAmType(void) {return TYPE_AM_SRC;} + int GetAmType(void) override {return TYPE_AM_SRC;} // Methods using PRXCOL::Init; - virtual void Reset(void) {} + void Reset(void) override {} void SetColumn(void); - virtual bool Init(PGLOBAL g, PTDB tp); + bool Init(PGLOBAL g, PTDB tp) override; bool CompareLast(void); protected: diff --git a/storage/connect/tabrest.h b/storage/connect/tabrest.h index 901d9102e95..a04117ca82d 100644 --- a/storage/connect/tabrest.h +++ b/storage/connect/tabrest.h @@ -33,11 +33,11 @@ public: RESTDEF(void) { Tdp = NULL; Http = Uri = Fn = NULL; } // Implementation - virtual const char *GetType(void) { return "REST"; } + const char *GetType(void) override { return "REST"; } // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members diff --git a/storage/connect/tabsys.h b/storage/connect/tabsys.h index 0a427b12dae..58f0b5677ec 100644 --- a/storage/connect/tabsys.h +++ b/storage/connect/tabsys.h @@ -27,11 +27,11 @@ class DllExport INIDEF : public TABDEF { /* INI table description */ INIDEF(void); // Implementation - virtual const char *GetType(void) {return "INI";} + const char *GetType(void) override {return "INI";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -53,30 +53,30 @@ class TDBINI : public TDBASE { TDBINI(PTDBINI tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_INI;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBINI(this);} + AMT GetAmType(void) override {return TYPE_AM_INI;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBINI(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual int GetRecpos(void) {return N;} - virtual int GetProgCur(void) {return N;} + PTDB Clone(PTABS t) override; + int GetRecpos(void) override {return N;} + int GetProgCur(void) override {return N;} //virtual int GetAffectedRows(void) {return 0;} - virtual PCSZ GetFile(PGLOBAL g) {return Ifile;} - virtual void SetFile(PGLOBAL g, PCSZ fn) {Ifile = fn;} - virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;} - virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;} - virtual int RowNumber(PGLOBAL g, bool b = false) {return N;} + PCSZ GetFile(PGLOBAL g) override {return Ifile;} + void SetFile(PGLOBAL g, PCSZ fn) override {Ifile = fn;} + void ResetDB(void) override {Seclist = Section = NULL; N = 0;} + void ResetSize(void) override {MaxSize = -1; Seclist = NULL;} + int RowNumber(PGLOBAL g, bool b = false) override {return N;} char *GetSeclist(PGLOBAL g); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: // Members @@ -97,13 +97,13 @@ class INICOL : public COLBLK { INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_INI;} - virtual void SetTo_Val(PVAL valp) {To_Val = valp;} + int GetAmType(void) override {return TYPE_AM_INI;} + void SetTo_Val(PVAL valp) override {To_Val = valp;} // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; virtual void AllocBuf(PGLOBAL g); protected: @@ -132,24 +132,24 @@ class TDBXIN : public TDBINI { TDBXIN(PTDBXIN tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_INI;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBXIN(this);} + AMT GetAmType(void) override {return TYPE_AM_INI;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBXIN(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual int GetRecpos(void); - virtual bool SetRecpos(PGLOBAL g, int recpos); - virtual void ResetDB(void) + PTDB Clone(PTABS t) override; + int GetRecpos(void) override; + bool SetRecpos(PGLOBAL g, int recpos) override; + void ResetDB(void) override {Seclist = Section = Keycur = NULL; N = 0; Oldsec = -1;} char *GetKeylist(PGLOBAL g, char *sec); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; protected: // Members @@ -171,8 +171,8 @@ class XINCOL : public INICOL { // Implementation // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; protected: // Default constructor not to be used diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h index e7a84395787..6e6c8cb438e 100644 --- a/storage/connect/tabtbl.h +++ b/storage/connect/tabtbl.h @@ -24,11 +24,11 @@ class DllExport TBLDEF : public PRXDEF { /* Logical table description */ TBLDEF(void); // Implementation - virtual const char *GetType(void) {return "TBL";} + const char *GetType(void) override {return "TBL";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -48,21 +48,21 @@ class DllExport TDBTBL : public TDBPRX { TDBTBL(PTBLDEF tdp = NULL); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_TBL;} + AMT GetAmType(void) override {return TYPE_AM_TBL;} // Methods - virtual void ResetDB(void); - virtual int GetRecpos(void) {return Rows;} - virtual int GetBadLines(void) {return (int)Nbc;} + void ResetDB(void) override; + int GetRecpos(void) override {return Rows;} + int GetBadLines(void) override {return (int)Nbc;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual int RowNumber(PGLOBAL g, bool b = FALSE); - virtual PCOL InsertSpecialColumn(PCOL scp); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + int RowNumber(PGLOBAL g, bool b = FALSE) override; + PCOL InsertSpecialColumn(PCOL scp) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; protected: // Internal functions @@ -89,7 +89,7 @@ class TBTBLK : public TIDBLK { TBTBLK(PVAL valp) {Value = valp;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; // Fake operator new used to change TIDBLK into SDTBLK void * operator new(size_t size, TIDBLK *sp) {return sp;} @@ -143,11 +143,11 @@ class DllExport TDBTBM : public TDBTBL { virtual void ResetDB(void); // Database routines - virtual int Cardinality(PGLOBAL g) { return 10; } - virtual int GetMaxSize(PGLOBAL g) { return 10; } // Temporary - virtual int RowNumber(PGLOBAL g, bool b = FALSE); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); + int Cardinality(PGLOBAL g) override { return 10; } + int GetMaxSize(PGLOBAL g) override { return 10; } // Temporary + int RowNumber(PGLOBAL g, bool b = FALSE) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; protected: // Internal functions diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h index 6cf2b11632b..fc0cef8d6e1 100644 --- a/storage/connect/tabutil.h +++ b/storage/connect/tabutil.h @@ -40,11 +40,11 @@ class DllExport PRXDEF : public TABDEF { /* Logical table description */ PRXDEF(void); // Implementation - virtual const char *GetType(void) {return "PRX";} + const char *GetType(void) override {return "PRX";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; protected: // Members @@ -63,27 +63,27 @@ class DllExport TDBPRX : public TDBASE { TDBPRX(PTDBPRX tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_PRX;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_PRX;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBPRX(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual int GetRecpos(void) {return Tdbp->GetRecpos();} - virtual void ResetDB(void) {Tdbp->ResetDB();} - virtual int RowNumber(PGLOBAL g, bool b = FALSE); - virtual PCSZ GetServer(void) {return (Tdbp) ? Tdbp->GetServer() : (PSZ)"?";} + PTDB Clone(PTABS t) override; + int GetRecpos(void) override {return Tdbp->GetRecpos();} + void ResetDB(void) override {Tdbp->ResetDB();} + int RowNumber(PGLOBAL g, bool b = FALSE) override; + PCSZ GetServer(void) override {return (Tdbp) ? Tdbp->GetServer() : (PSZ)"?";} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; virtual bool InitTable(PGLOBAL g); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g) {if (Tdbp) Tdbp->CloseDB(g);} + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override {if (Tdbp) Tdbp->CloseDB(g);} PTDB GetSubTable(PGLOBAL g, PTABLE tabp, bool b = false); void RemoveNext(PTABLE tp); @@ -106,16 +106,16 @@ class DllExport PRXCOL : public COLBLK { PRXCOL(PRXCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_PRX;} + int GetAmType(void) override {return TYPE_AM_PRX;} // Methods using COLBLK::Init; - virtual void Reset(void); - virtual bool IsSpecial(void) {return Pseudo;} - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) + void Reset(void) override; + bool IsSpecial(void) override {return Pseudo;} + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override {return false;} - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; virtual bool Init(PGLOBAL g, PTDB tp); protected: @@ -141,7 +141,7 @@ class TDBTBC : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PSZ Db; // Database of the table diff --git a/storage/connect/tabvct.h b/storage/connect/tabvct.h index 06ccde71bcb..cd16c16d5e5 100644 --- a/storage/connect/tabvct.h +++ b/storage/connect/tabvct.h @@ -29,12 +29,12 @@ class DllExport VCTDEF : public DOSDEF { /* Logical table description */ VCTDEF(void) {Split = false; Estimate = Header = 0;} // Implementation - virtual const char *GetType(void) {return "VCT";} + const char *GetType(void) override {return "VCT";} int GetEstimate(void) {return Estimate;} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; protected: int MakeFnPattern(char *fpat); @@ -62,20 +62,20 @@ class DllExport TDBVCT : public TDBFIX { TDBVCT(PGLOBAL g, PTDBVCT tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_VCT;} - virtual PTDB Duplicate(PGLOBAL g) + AMT GetAmType(void) override {return TYPE_AM_VCT;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBVCT(g, this);} bool IsSplit(void) {return ((VCTDEF*)To_Def)->Split;} // Methods - virtual PTDB Clone(PTABS t); - virtual bool IsUsingTemp(PGLOBAL g); + PTDB Clone(PTABS t) override; + bool IsUsingTemp(PGLOBAL g) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + void CloseDB(PGLOBAL g) override; protected: // Members @@ -98,13 +98,13 @@ class DllExport VCTCOL : public DOSCOL { VCTCOL(VCTCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_VCT;} + int GetAmType(void) override {return TYPE_AM_VCT;} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void SetOk(void); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void SetOk(void) override; protected: virtual void ReadBlock(PGLOBAL g); diff --git a/storage/connect/tabvir.h b/storage/connect/tabvir.h index b92ca0c50f8..31bbed27c63 100644 --- a/storage/connect/tabvir.h +++ b/storage/connect/tabvir.h @@ -24,12 +24,12 @@ class DllExport VIRDEF : public TABDEF { /* Logical table description */ VIRDEF(void) = default; // Implementation - virtual const char *GetType(void) {return "VIRTUAL";} + const char *GetType(void) override {return "VIRTUAL";} // Methods - virtual bool DefineAM(PGLOBAL, LPCSTR, int) {Pseudo = 3; return false;} - virtual int Indexable(void) {return 3;} - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL, LPCSTR, int) override {Pseudo = 3; return false;} + int Indexable(void) override {return 3;} + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -44,24 +44,24 @@ class DllExport TDBVIR : public TDBASE { TDBVIR(PVIRDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_VIR;} + AMT GetAmType(void) override {return TYPE_AM_VIR;} // Methods - virtual int GetRecpos(void) {return N;} - virtual bool SetRecpos(PGLOBAL g, int recpos) + int GetRecpos(void) override {return N;} + bool SetRecpos(PGLOBAL g, int recpos) override {N = recpos - 2; return false;} - virtual int RowNumber(PGLOBAL g, bool b = false) {return N + 1;} + int RowNumber(PGLOBAL g, bool b = false) override {return N + 1;} int TestFilter(PFIL filp, bool nop); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g) {return (g) ? Size : 1;} - virtual int GetMaxSize(PGLOBAL g) {return Size;} - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g) {} + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override {return (g) ? Size : 1;} + int GetMaxSize(PGLOBAL g) override {return Size;} + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override {} protected: // Members @@ -79,10 +79,10 @@ class VIRCOL : public COLBLK { VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "VIRTUAL"); // Implementation - virtual int GetAmType(void) {return TYPE_AM_VIR;} + int GetAmType(void) override {return TYPE_AM_VIR;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used @@ -100,11 +100,11 @@ class TDBVICL : public TDBCAT { TDBVICL(PVIRDEF tdp) : TDBCAT(tdp) {} // Methods - virtual int Cardinality(PGLOBAL g) {return 2;} // Avoid DBUG_ASSERT + int Cardinality(PGLOBAL g) override {return 2;} // Avoid DBUG_ASSERT protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members }; // end of class TDBVICL diff --git a/storage/connect/tabwmi.h b/storage/connect/tabwmi.h index 7a18453374e..a43e5c9ff52 100644 --- a/storage/connect/tabwmi.h +++ b/storage/connect/tabwmi.h @@ -66,22 +66,22 @@ class TDBWMI : public TDBASE { TDBWMI(PWMIDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_WMI;} + AMT GetAmType(void) override {return TYPE_AM_WMI;} // Methods virtual int GetRecpos(void); virtual int GetProgCur(void) {return N;} - virtual int RowNumber(PGLOBAL g, bool b = false) {return N + 1;} + int RowNumber(PGLOBAL g, bool b = false) override {return N + 1;} // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g) {return GetMaxSize(g);} - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override {return GetMaxSize(g);} + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: // Specific routines @@ -118,10 +118,10 @@ class WMICOL : public COLBLK { WMICOL(PCOLDEF cdp, PTDB tdbp, int n); // Implementation - virtual int GetAmType(void) {return TYPE_AM_WMI;} + int GetAmType(void) override {return TYPE_AM_WMI;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: WMICOL(void) {} // Default constructor not to be used @@ -143,7 +143,7 @@ class TDBWCL : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + virtual PQRYRES GetResult(PGLOBAL g) override; // Members char *Nsp; // Name space diff --git a/storage/connect/tabxcl.h b/storage/connect/tabxcl.h index 08beb5fe6ac..b2b7eb795a0 100644 --- a/storage/connect/tabxcl.h +++ b/storage/connect/tabxcl.h @@ -29,11 +29,11 @@ class XCLDEF : public PRXDEF { /* Logical table description */ XCLDEF(void); // Implementation - virtual const char *GetType(void) {return "XCL";} + const char *GetType(void) override {return "XCL";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE mode); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE mode) override; protected: // Members @@ -54,17 +54,17 @@ class TDBXCL : public TDBPRX { TDBXCL(PXCLDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_XCOL;} + AMT GetAmType(void) override {return TYPE_AM_XCOL;} // Methods - virtual void ResetDB(void) {N = 0; Tdbp->ResetDB();} - virtual int RowNumber(PGLOBAL g, bool b = FALSE); + void ResetDB(void) override {N = 0; Tdbp->ResetDB();} + int RowNumber(PGLOBAL g, bool b = FALSE) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; protected: // Members @@ -89,9 +89,9 @@ class XCLCOL : public PRXCOL { // Methods using PRXCOL::Init; - virtual void Reset(void) {} // Evaluated only by TDBXCL - virtual void ReadColumn(PGLOBAL g); - virtual bool Init(PGLOBAL g, PTDB tp = NULL); + void Reset(void) override {} // Evaluated only by TDBXCL + void ReadColumn(PGLOBAL g) override; + bool Init(PGLOBAL g, PTDB tp = NULL) override; protected: // Default constructor not to be used diff --git a/storage/connect/tabxml.h b/storage/connect/tabxml.h index 42dbb038b47..252d2f74d85 100644 --- a/storage/connect/tabxml.h +++ b/storage/connect/tabxml.h @@ -25,11 +25,11 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */ XMLDEF(void); // Implementation - virtual const char *GetType(void) {return "XML";} + const char *GetType(void) override {return "XML";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -72,18 +72,18 @@ class DllExport TDBXML : public TDBASE { TDBXML(PTDBXML tdbp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_XML;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBXML(this);} + AMT GetAmType(void) override {return TYPE_AM_XML;} + PTDB Duplicate(PGLOBAL g) override {return (PTDB)new(g) TDBXML(this);} // Methods - virtual PTDB Clone(PTABS t); - virtual int GetRecpos(void); - virtual int GetProgCur(void) {return N;} - virtual PCSZ GetFile(PGLOBAL g) {return Xfile;} - virtual void SetFile(PGLOBAL g, PCSZ fn) {Xfile = fn;} - virtual void ResetDB(void) {N = 0;} - virtual void ResetSize(void) {MaxSize = -1;} - virtual int RowNumber(PGLOBAL g, bool b = false); + PTDB Clone(PTABS t) override; + int GetRecpos(void) override; + int GetProgCur(void) override {return N;} + PCSZ GetFile(PGLOBAL g) override {return Xfile;} + void SetFile(PGLOBAL g, PCSZ fn) override {Xfile = fn;} + void ResetDB(void) override {N = 0;} + void ResetSize(void) override {MaxSize = -1;} + int RowNumber(PGLOBAL g, bool b = false) override; int LoadTableFile(PGLOBAL g, char *filename); bool Initialize(PGLOBAL g); bool SetTabNode(PGLOBAL g); @@ -91,19 +91,19 @@ class DllExport TDBXML : public TDBASE { bool CheckRow(PGLOBAL g, bool b); // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PCOL colp); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + PCOL InsertSpecialColumn(PCOL colp) override; //virtual int GetMaxSame(PGLOBAL g) {return (Xpand) ? Limit : 1;} - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; //virtual bool NeedIndexing(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); - virtual int CheckWrite(PGLOBAL g) {Checked = true; return 0;} - virtual const CHARSET_INFO *data_charset(); + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; + int CheckWrite(PGLOBAL g) override {Checked = true; return 0;} + const CHARSET_INFO *data_charset() override; protected: // Members @@ -164,14 +164,14 @@ class XMLCOL : public COLBLK { XMLCOL(XMLCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_XML;} - virtual void SetTo_Val(PVAL valp) {To_Val = valp;} + int GetAmType(void) override {return TYPE_AM_XML;} + void SetTo_Val(PVAL valp) override {To_Val = valp;} bool ParseXpath(PGLOBAL g, bool mode); // Methods - virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) override; + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; bool AllocBuf(PGLOBAL g, bool mode); void AllocNodes(PGLOBAL g, PXDOC dp); @@ -234,8 +234,8 @@ class XMULCOL : public XMLCOLX { XMULCOL(PVAL valp) {Value = valp; Mul = true;} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; }; // end of class XMULCOL /***********************************************************************/ @@ -248,8 +248,8 @@ class XPOSCOL : public XMLCOLX { XPOSCOL(PVAL valp) {Value = valp;} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; + void WriteColumn(PGLOBAL g) override; }; // end of class XPOSCOL /***********************************************************************/ @@ -262,7 +262,7 @@ class TDBXCT : public TDBCAT { protected: // Specific routines - virtual PQRYRES GetResult(PGLOBAL g); + PQRYRES GetResult(PGLOBAL g) override; // Members PTOS Topt; diff --git a/storage/connect/tabzip.h b/storage/connect/tabzip.h index 3c16fae99bc..16ad9db7c4a 100644 --- a/storage/connect/tabzip.h +++ b/storage/connect/tabzip.h @@ -26,11 +26,11 @@ public: ZIPDEF(void) = default; // Implementation - virtual const char *GetType(void) {return "ZIP";} + const char *GetType(void) override {return "ZIP";} // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); + bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override; + PTDB GetTable(PGLOBAL g, MODE m) override; protected: // Members @@ -47,22 +47,22 @@ public: TDBZIP(PZIPDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_ZIP;} - virtual PCSZ GetFile(PGLOBAL) {return zfn;} - virtual void SetFile(PGLOBAL, PCSZ fn) {zfn = fn;} + AMT GetAmType(void) override {return TYPE_AM_ZIP;} + PCSZ GetFile(PGLOBAL) override {return zfn;} + void SetFile(PGLOBAL, PCSZ fn) override {zfn = fn;} // Methods - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL g); - virtual int GetMaxSize(PGLOBAL g); - virtual int GetRecpos(void) {return 0;} + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL g) override; + int GetMaxSize(PGLOBAL g) override; + int GetRecpos(void) override {return 0;} // Database routines - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: bool open(PGLOBAL g, const char *filename); @@ -87,10 +87,10 @@ public: ZIPCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "ZIP"); // Implementation - virtual int GetAmType(void) { return TYPE_AM_ZIP; } + int GetAmType(void) override { return TYPE_AM_ZIP; } // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: // Default constructor not to be used diff --git a/storage/connect/valblk.h b/storage/connect/valblk.h index 537e838c99f..6ac293b734a 100644 --- a/storage/connect/valblk.h +++ b/storage/connect/valblk.h @@ -149,54 +149,54 @@ class TYPBLK : public VALBLK { TYPBLK(void *mp, int size, int type, int prec = 0, bool un = false); // Implementation - virtual bool Init(PGLOBAL g, bool check); - virtual int GetVlen(void) {return sizeof(TYPE);} + bool Init(PGLOBAL g, bool check) override; + int GetVlen(void) override {return sizeof(TYPE);} - virtual char GetTinyValue(int n) {return (char)UnalignedRead(n);} - virtual uchar GetUTinyValue(int n) {return (uchar)UnalignedRead(n);} - virtual short GetShortValue(int n) {return (short)UnalignedRead(n);} - virtual ushort GetUShortValue(int n) {return (ushort)UnalignedRead(n);} - virtual int GetIntValue(int n) {return (int)UnalignedRead(n);} - virtual uint GetUIntValue(int n) {return (uint)UnalignedRead(n);} - virtual longlong GetBigintValue(int n) {return (longlong)UnalignedRead(n);} - virtual ulonglong GetUBigintValue(int n) {return (ulonglong)UnalignedRead(n);} - virtual double GetFloatValue(int n) {return (double)UnalignedRead(n);} - virtual char *GetCharString(char *p, int n); - virtual void Reset(int n) {UnalignedWrite(n, 0);} + char GetTinyValue(int n) override {return (char)UnalignedRead(n);} + uchar GetUTinyValue(int n) override {return (uchar)UnalignedRead(n);} + short GetShortValue(int n) override {return (short)UnalignedRead(n);} + ushort GetUShortValue(int n) override {return (ushort)UnalignedRead(n);} + int GetIntValue(int n) override {return (int)UnalignedRead(n);} + uint GetUIntValue(int n) override {return (uint)UnalignedRead(n);} + longlong GetBigintValue(int n) override {return (longlong)UnalignedRead(n);} + ulonglong GetUBigintValue(int n) override {return (ulonglong)UnalignedRead(n);} + double GetFloatValue(int n) override {return (double)UnalignedRead(n);} + char *GetCharString(char *p, int n) override; + void Reset(int n) override {UnalignedWrite(n, 0);} // Methods using VALBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); - virtual void SetValue(const char *sp, uint len, int n); - virtual void SetValue(short sval, int n) + void SetValue(PCSZ sp, int n) override; + void SetValue(const char *sp, uint len, int n) override; + void SetValue(short sval, int n) override {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(ushort sval, int n) + void SetValue(ushort sval, int n) override {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(int lval, int n) + void SetValue(int lval, int n) override {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(uint lval, int n) + void SetValue(uint lval, int n) override {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(longlong lval, int n) + void SetValue(longlong lval, int n) override {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(ulonglong lval, int n) + void SetValue(ulonglong lval, int n) override {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(double fval, int n) + void SetValue(double fval, int n) override {UnalignedWrite(n, (TYPE)fval); SetNull(n, false);} - virtual void SetValue(char cval, int n) + void SetValue(char cval, int n) override {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(uchar cval, int n) + void SetValue(uchar cval, int n) override {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(PVAL valp, int n); - virtual void SetValue(PVBLK pv, int n1, int n2); - virtual void SetMin(PVAL valp, int n); - virtual void SetMax(PVAL valp, int n); - virtual void Move(int i, int j); - virtual int CompVal(PVAL vp, int n); - virtual int CompVal(int i1, int i2); - virtual void *GetValPtr(int n); - virtual void *GetValPtrEx(int n); - virtual int Find(PVAL vp); - virtual int GetMaxLength(void); + void SetValue(PVAL valp, int n) override; + void SetValue(PVBLK pv, int n1, int n2) override; + void SetMin(PVAL valp, int n) override; + void SetMax(PVAL valp, int n) override; + void Move(int i, int j) override; + int CompVal(PVAL vp, int n) override; + int CompVal(int i1, int i2) override; + void *GetValPtr(int n) override; + void *GetValPtrEx(int n) override; + int Find(PVAL vp) override; + int GetMaxLength(void) override; protected: // Specialized functions @@ -229,38 +229,38 @@ class CHRBLK : public VALBLK { CHRBLK(void *mp, int size, int type, int len, int prec, bool b); // Implementation - virtual bool Init(PGLOBAL g, bool check); - virtual int GetVlen(void) {return Long;} - virtual PSZ GetCharValue(int n); - virtual char GetTinyValue(int n); - virtual uchar GetUTinyValue(int n); - virtual short GetShortValue(int n); - virtual ushort GetUShortValue(int n); - virtual int GetIntValue(int n); - virtual uint GetUIntValue(int n); - virtual longlong GetBigintValue(int n); - virtual ulonglong GetUBigintValue(int n); - virtual double GetFloatValue(int n); - virtual char *GetCharString(char *p, int n); - virtual void Reset(int n); - virtual void SetPrec(int p) {Ci = (p != 0);} - virtual bool IsCi(void) {return Ci;} + bool Init(PGLOBAL g, bool check) override; + int GetVlen(void) override {return Long;} + PSZ GetCharValue(int n) override; + char GetTinyValue(int n) override; + uchar GetUTinyValue(int n) override; + short GetShortValue(int n) override; + ushort GetUShortValue(int n) override; + int GetIntValue(int n) override; + uint GetUIntValue(int n) override; + longlong GetBigintValue(int n) override; + ulonglong GetUBigintValue(int n) override; + double GetFloatValue(int n) override; + char *GetCharString(char *p, int n) override; + void Reset(int n) override; + void SetPrec(int p) override {Ci = (p != 0);} + bool IsCi(void) override {return Ci;} // Methods using VALBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); - virtual void SetValue(const char *sp, uint len, int n); - virtual void SetValue(PVAL valp, int n); - virtual void SetValue(PVBLK pv, int n1, int n2); - virtual void SetMin(PVAL valp, int n); - virtual void SetMax(PVAL valp, int n); - virtual void Move(int i, int j); - virtual int CompVal(PVAL vp, int n); - virtual int CompVal(int i1, int i2); - virtual void *GetValPtr(int n); - virtual void *GetValPtrEx(int n); - virtual int Find(PVAL vp); - virtual int GetMaxLength(void); + void SetValue(PCSZ sp, int n) override; + void SetValue(const char *sp, uint len, int n) override; + void SetValue(PVAL valp, int n) override; + void SetValue(PVBLK pv, int n1, int n2) override; + void SetMin(PVAL valp, int n) override; + void SetMax(PVAL valp, int n) override; + void Move(int i, int j) override; + int CompVal(PVAL vp, int n) override; + int CompVal(int i1, int i2) override; + void *GetValPtr(int n) override; + void *GetValPtrEx(int n) override; + int Find(PVAL vp) override; + int GetMaxLength(void) override; protected: // Members @@ -282,39 +282,39 @@ class STRBLK : public VALBLK { STRBLK(PGLOBAL g, void *mp, int size, int type); // Implementation - virtual void SetNull(int n, bool b) {if (b) {Strp[n] = NULL;}} - virtual bool IsNull(int n) {return Strp[n] == NULL;} - virtual void SetNullable(bool) {} // Always nullable - virtual bool Init(PGLOBAL g, bool check); - virtual int GetVlen(void) {return sizeof(PSZ);} - virtual PSZ GetCharValue(int n) {return Strp[n];} - virtual char GetTinyValue(int n); - virtual uchar GetUTinyValue(int n); - virtual short GetShortValue(int n); - virtual ushort GetUShortValue(int n); - virtual int GetIntValue(int n); - virtual uint GetUIntValue(int n); - virtual longlong GetBigintValue(int n); - virtual ulonglong GetUBigintValue(int n); - virtual double GetFloatValue(int n) {return atof(Strp[n]);} - virtual char *GetCharString(char *, int n) {return Strp[n];} - virtual void Reset(int n) {Strp[n] = NULL;} + void SetNull(int n, bool b) override {if (b) {Strp[n] = NULL;}} + bool IsNull(int n) override {return Strp[n] == NULL;} + void SetNullable(bool) override {} // Always nullable + bool Init(PGLOBAL g, bool check) override; + int GetVlen(void) override {return sizeof(PSZ);} + PSZ GetCharValue(int n) override {return Strp[n];} + char GetTinyValue(int n) override; + uchar GetUTinyValue(int n) override; + short GetShortValue(int n) override; + ushort GetUShortValue(int n) override; + int GetIntValue(int n) override; + uint GetUIntValue(int n) override; + longlong GetBigintValue(int n) override; + ulonglong GetUBigintValue(int n) override; + double GetFloatValue(int n) override {return atof(Strp[n]);} + char *GetCharString(char *, int n) override {return Strp[n];} + void Reset(int n) override {Strp[n] = NULL;} // Methods using VALBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); - virtual void SetValue(const char *sp, uint len, int n); - virtual void SetValue(PVAL valp, int n); - virtual void SetValue(PVBLK pv, int n1, int n2); - virtual void SetMin(PVAL valp, int n); - virtual void SetMax(PVAL valp, int n); - virtual void Move(int i, int j); - virtual int CompVal(PVAL vp, int n); - virtual int CompVal(int i1, int i2); - virtual void *GetValPtr(int n); - virtual void *GetValPtrEx(int n); - virtual int Find(PVAL vp); - virtual int GetMaxLength(void); + void SetValue(PCSZ sp, int n) override; + void SetValue(const char *sp, uint len, int n) override; + void SetValue(PVAL valp, int n) override; + void SetValue(PVBLK pv, int n1, int n2) override; + void SetMin(PVAL valp, int n) override; + void SetMax(PVAL valp, int n) override; + void Move(int i, int j) override; + int CompVal(PVAL vp, int n) override; + int CompVal(int i1, int i2) override; + void *GetValPtr(int n) override; + void *GetValPtrEx(int n) override; + int Find(PVAL vp) override; + int GetMaxLength(void) override; // Specific void SetSorted(bool b) {Sorted = b;} @@ -334,12 +334,12 @@ class DATBLK : public TYPBLK { DATBLK(void *mp, int size); // Implementation - virtual bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0); - virtual char *GetCharString(char *p, int n); + bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0) override; + char *GetCharString(char *p, int n) override; // Methods using TYPBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); + void SetValue(PCSZ sp, int n) override; protected: // Members @@ -364,8 +364,8 @@ class PTRBLK : public STRBLK { // Methods using STRBLK::SetValue; using STRBLK::CompVal; - virtual void SetValue(PCSZ p, int n) {Strp[n] = (char*)p;} - virtual int CompVal(int i1, int i2); + void SetValue(PCSZ p, int n) override {Strp[n] = (char*)p;} + int CompVal(int i1, int i2) override; protected: // Members diff --git a/storage/connect/value.h b/storage/connect/value.h index 7eb0dec29f2..8145559f2cb 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -123,8 +123,8 @@ public: virtual bool IsEqual(PVAL vp, bool chktype) = 0; virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); virtual bool FormatValue(PVAL vp, PCSZ fmt) = 0; - virtual void Printf(PGLOBAL g, FILE *, uint); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *, uint) override; + void Prints(PGLOBAL g, char *ps, uint z) override; /** Set value from a non-aligned in-memory value in the machine byte order. @@ -194,48 +194,48 @@ class DllExport TYPVAL : public VALUE { TYPVAL(TYPE n, int type, int prec = 0, bool un = false); // Implementation - virtual bool IsTypeNum(void) {return true;} - virtual bool IsZero(void) {return Tval == 0;} - virtual void Reset(void) {Tval = 0;} - virtual int GetValLen(void); - virtual int GetValPrec() {return Prec;} - virtual int GetSize(void) {return sizeof(TYPE);} + bool IsTypeNum(void) override {return true;} + bool IsZero(void) override {return Tval == 0;} + void Reset(void) override {Tval = 0;} + int GetValLen(void) override; + int GetValPrec() override {return Prec;} + int GetSize(void) override {return sizeof(TYPE);} //virtual PSZ GetCharValue(void) {return VALUE::GetCharValue();} - virtual char GetTinyValue(void) {return (char)Tval;} - virtual uchar GetUTinyValue(void) {return (uchar)Tval;} - virtual short GetShortValue(void) {return (short)Tval;} - virtual ushort GetUShortValue(void) {return (ushort)Tval;} - virtual int GetIntValue(void) {return (int)Tval;} - virtual uint GetUIntValue(void) {return (uint)Tval;} - virtual longlong GetBigintValue(void) {return (longlong)Tval;} - virtual ulonglong GetUBigintValue(void) {return (ulonglong)Tval;} - virtual double GetFloatValue(void) {return (double)Tval;} - virtual void *GetTo_Val(void) {return &Tval;} + char GetTinyValue(void) override {return (char)Tval;} + uchar GetUTinyValue(void) override {return (uchar)Tval;} + short GetShortValue(void) override {return (short)Tval;} + ushort GetUShortValue(void) override {return (ushort)Tval;} + int GetIntValue(void) override {return (int)Tval;} + uint GetUIntValue(void) override {return (uint)Tval;} + longlong GetBigintValue(void) override {return (longlong)Tval;} + ulonglong GetUBigintValue(void) override {return (ulonglong)Tval;} + double GetFloatValue(void) override {return (double)Tval;} + void *GetTo_Val(void) override {return &Tval;} // Methods - virtual bool SetValue_pval(PVAL valp, bool chktype); - virtual bool SetValue_char(const char *p, int n); - virtual void SetValue_psz(PCSZ s); - virtual void SetValue_bool(bool b) {Tval = (b) ? 1 : 0;} - virtual int CompareValue(PVAL vp); - virtual void SetValue(char c) {Tval = (TYPE)c; Null = false;} - virtual void SetValue(uchar c) {Tval = (TYPE)c; Null = false;} - virtual void SetValue(short i) {Tval = (TYPE)i; Null = false;} - virtual void SetValue(ushort i) {Tval = (TYPE)i; Null = false;} - virtual void SetValue(int n) {Tval = (TYPE)n; Null = false;} - virtual void SetValue(uint n) {Tval = (TYPE)n; Null = false;} - virtual void SetValue(longlong n) {Tval = (TYPE)n; Null = false;} - virtual void SetValue(ulonglong n) {Tval = (TYPE)n; Null = false;} - virtual void SetValue(double f) {Tval = (TYPE)f; Null = false;} - virtual void SetValue_pvblk(PVBLK blk, int n); - virtual void SetBinValue(void *p); - virtual bool GetBinValue(void *buf, int buflen, bool go); - virtual int ShowValue(char *buf, int len); - virtual char *GetCharString(char *p); - virtual bool IsEqual(PVAL vp, bool chktype); - virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); - virtual bool SetConstFormat(PGLOBAL, FORMAT&); - virtual bool FormatValue(PVAL vp, PCSZ fmt); + bool SetValue_pval(PVAL valp, bool chktype) override; + bool SetValue_char(const char *p, int n) override; + void SetValue_psz(PCSZ s) override; + void SetValue_bool(bool b) override {Tval = (b) ? 1 : 0;} + int CompareValue(PVAL vp) override; + void SetValue(char c) override {Tval = (TYPE)c; Null = false;} + void SetValue(uchar c) override {Tval = (TYPE)c; Null = false;} + void SetValue(short i) override {Tval = (TYPE)i; Null = false;} + void SetValue(ushort i) override {Tval = (TYPE)i; Null = false;} + void SetValue(int n) override {Tval = (TYPE)n; Null = false;} + void SetValue(uint n) override {Tval = (TYPE)n; Null = false;} + void SetValue(longlong n) override {Tval = (TYPE)n; Null = false;} + void SetValue(ulonglong n) override {Tval = (TYPE)n; Null = false;} + void SetValue(double f) override {Tval = (TYPE)f; Null = false;} + void SetValue_pvblk(PVBLK blk, int n) override; + void SetBinValue(void *p) override; + bool GetBinValue(void *buf, int buflen, bool go) override; + int ShowValue(char *buf, int len) override; + char *GetCharString(char *p) override; + bool IsEqual(PVAL vp, bool chktype) override; + bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) override; + bool SetConstFormat(PGLOBAL, FORMAT&) override; + bool FormatValue(PVAL vp, PCSZ fmt) override; protected: static TYPE MinMaxVal(bool b); @@ -268,49 +268,49 @@ public: TYPVAL(PGLOBAL g, PSZ s, int n, int c); // Implementation - virtual bool IsTypeNum(void) {return false;} - virtual bool IsZero(void) {return *Strp == 0;} - virtual void Reset(void) {*Strp = 0;} - virtual int GetValLen(void) {return Len;}; - virtual int GetValPrec() {return (Ci) ? 1 : 0;} - virtual int GetSize(void) {return (Strp) ? (int)strlen(Strp) : 0;} - virtual PSZ GetCharValue(void) {return Strp;} - virtual char GetTinyValue(void); - virtual uchar GetUTinyValue(void); - virtual short GetShortValue(void); - virtual ushort GetUShortValue(void); - virtual int GetIntValue(void); - virtual uint GetUIntValue(void); - virtual longlong GetBigintValue(void); - virtual ulonglong GetUBigintValue(void); - virtual double GetFloatValue(void) {return atof(Strp);} - virtual void *GetTo_Val(void) {return Strp;} - virtual void SetPrec(int prec) {Ci = prec != 0;} + bool IsTypeNum(void) override {return false;} + bool IsZero(void) override {return *Strp == 0;} + void Reset(void) override {*Strp = 0;} + int GetValLen(void) override {return Len;}; + int GetValPrec() override {return (Ci) ? 1 : 0;} + int GetSize(void) override {return (Strp) ? (int)strlen(Strp) : 0;} + PSZ GetCharValue(void) override {return Strp;} + char GetTinyValue(void) override; + uchar GetUTinyValue(void) override; + short GetShortValue(void) override; + ushort GetUShortValue(void) override; + int GetIntValue(void) override; + uint GetUIntValue(void) override; + longlong GetBigintValue(void) override; + ulonglong GetUBigintValue(void) override; + double GetFloatValue(void) override {return atof(Strp);} + void *GetTo_Val(void) override {return Strp;} + void SetPrec(int prec) override {Ci = prec != 0;} // Methods - virtual bool SetValue_pval(PVAL valp, bool chktype); - virtual bool SetValue_char(const char *p, int n); - virtual void SetValue_psz(PCSZ s); - virtual void SetValue_pvblk(PVBLK blk, int n); - virtual void SetValue(char c); - virtual void SetValue(uchar c); - virtual void SetValue(short i); - virtual void SetValue(ushort i); - virtual void SetValue(int n); - virtual void SetValue(uint n); - virtual void SetValue(longlong n); - virtual void SetValue(ulonglong n); - virtual void SetValue(double f); - virtual void SetBinValue(void *p); - virtual int CompareValue(PVAL vp); - virtual bool GetBinValue(void *buf, int buflen, bool go); - virtual int ShowValue(char *buf, int len); - virtual char *GetCharString(char *p); - virtual bool IsEqual(PVAL vp, bool chktype); - virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); - virtual bool FormatValue(PVAL vp, PCSZ fmt); - virtual bool SetConstFormat(PGLOBAL, FORMAT&); - virtual void Prints(PGLOBAL g, char *ps, uint z); + bool SetValue_pval(PVAL valp, bool chktype) override; + bool SetValue_char(const char *p, int n) override; + void SetValue_psz(PCSZ s) override; + void SetValue_pvblk(PVBLK blk, int n) override; + void SetValue(char c) override; + void SetValue(uchar c) override; + void SetValue(short i) override; + void SetValue(ushort i) override; + void SetValue(int n) override; + void SetValue(uint n) override; + void SetValue(longlong n) override; + void SetValue(ulonglong n) override; + void SetValue(double f) override; + void SetBinValue(void *p) override; + int CompareValue(PVAL vp) override; + bool GetBinValue(void *buf, int buflen, bool go) override; + int ShowValue(char *buf, int len) override; + char *GetCharString(char *p) override; + bool IsEqual(PVAL vp, bool chktype) override; + bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) override; + bool FormatValue(PVAL vp, PCSZ fmt) override; + bool SetConstFormat(PGLOBAL, FORMAT&) override; + void Prints(PGLOBAL g, char *ps, uint z) override; protected: // Members @@ -329,16 +329,16 @@ class DllExport DECVAL: public TYPVAL { DECVAL(PGLOBAL g, PSZ s, int n, int prec, bool uns); // Implementation - virtual bool IsTypeNum(void) {return true;} - virtual bool IsZero(void); - virtual void Reset(void); - virtual int GetValPrec() {return Prec;} + bool IsTypeNum(void) override {return true;} + bool IsZero(void) override; + void Reset(void) override; + int GetValPrec() override {return Prec;} // Methods - virtual bool GetBinValue(void *buf, int buflen, bool go); - virtual int ShowValue(char *buf, int len); - virtual bool IsEqual(PVAL vp, bool chktype); - virtual int CompareValue(PVAL vp); + bool GetBinValue(void *buf, int buflen, bool go) override; + int ShowValue(char *buf, int len) override; + bool IsEqual(PVAL vp, bool chktype) override; + int CompareValue(PVAL vp) override; protected: // Members @@ -355,47 +355,47 @@ public: BINVAL(PGLOBAL g, void *p, int cl, int n); // Implementation - virtual bool IsTypeNum(void) {return false;} - virtual bool IsZero(void); - virtual void Reset(void); - virtual int GetValLen(void) {return Clen;}; - virtual int GetValPrec() {return 0;} - virtual int GetSize(void) {return Len;} - virtual PSZ GetCharValue(void) {return (PSZ)Binp;} - virtual char GetTinyValue(void); - virtual uchar GetUTinyValue(void); - virtual short GetShortValue(void); - virtual ushort GetUShortValue(void); - virtual int GetIntValue(void); - virtual uint GetUIntValue(void); - virtual longlong GetBigintValue(void); - virtual ulonglong GetUBigintValue(void); - virtual double GetFloatValue(void); - virtual void *GetTo_Val(void) {return Binp;} + bool IsTypeNum(void) override {return false;} + bool IsZero(void) override; + void Reset(void) override; + int GetValLen(void) override {return Clen;}; + int GetValPrec() override {return 0;} + int GetSize(void) override {return Len;} + PSZ GetCharValue(void) override {return (PSZ)Binp;} + char GetTinyValue(void) override; + uchar GetUTinyValue(void) override; + short GetShortValue(void) override; + ushort GetUShortValue(void) override; + int GetIntValue(void) override; + uint GetUIntValue(void) override; + longlong GetBigintValue(void) override; + ulonglong GetUBigintValue(void) override; + double GetFloatValue(void) override; + void *GetTo_Val(void) override {return Binp;} // Methods - virtual bool SetValue_pval(PVAL valp, bool chktype); - virtual bool SetValue_char(const char *p, int n); - virtual void SetValue_psz(PCSZ s); - virtual void SetValue_pvblk(PVBLK blk, int n); - virtual void SetValue(char c); - virtual void SetValue(uchar c); - virtual void SetValue(short i); - virtual void SetValue(ushort i); - virtual void SetValue(int n); - virtual void SetValue(uint n); - virtual void SetValue(longlong n); - virtual void SetValue(ulonglong n); - virtual void SetValue(double f); - virtual void SetBinValue(void *p); + bool SetValue_pval(PVAL valp, bool chktype) override; + bool SetValue_char(const char *p, int n) override; + void SetValue_psz(PCSZ s) override; + void SetValue_pvblk(PVBLK blk, int n) override; + void SetValue(char c) override; + void SetValue(uchar c) override; + void SetValue(short i) override; + void SetValue(ushort i) override; + void SetValue(int n) override; + void SetValue(uint n) override; + void SetValue(longlong n) override; + void SetValue(ulonglong n) override; + void SetValue(double f) override; + void SetBinValue(void *p) override; virtual void SetBinValue(void* p, ulong len); - virtual bool GetBinValue(void *buf, int buflen, bool go); - virtual int CompareValue(PVAL) {assert(false); return 0;} - virtual int ShowValue(char *buf, int len); - virtual char *GetCharString(char *p); - virtual bool IsEqual(PVAL vp, bool chktype); - virtual bool FormatValue(PVAL vp, PCSZ fmt); - virtual bool SetConstFormat(PGLOBAL, FORMAT&); + bool GetBinValue(void *buf, int buflen, bool go) override; + int CompareValue(PVAL) override {assert(false); return 0;} + int ShowValue(char *buf, int len) override; + char *GetCharString(char *p) override; + bool IsEqual(PVAL vp, bool chktype) override; + bool FormatValue(PVAL vp, PCSZ fmt) override; + bool SetConstFormat(PGLOBAL, FORMAT&) override; protected: // Members @@ -415,15 +415,15 @@ class DllExport DTVAL : public TYPVAL { using TYPVAL::SetValue; // Implementation - virtual bool SetValue_pval(PVAL valp, bool chktype); - virtual bool SetValue_char(const char *p, int n); - virtual void SetValue_psz(PCSZ s); - virtual void SetValue_pvblk(PVBLK blk, int n); - virtual void SetValue(int n); - virtual PSZ GetCharValue(void) { return Sdate; } - virtual char *GetCharString(char *p); - virtual int ShowValue(char *buf, int len); - virtual bool FormatValue(PVAL vp, PCSZ fmt); + bool SetValue_pval(PVAL valp, bool chktype) override; + bool SetValue_char(const char *p, int n) override; + void SetValue_psz(PCSZ s) override; + void SetValue_pvblk(PVBLK blk, int n) override; + void SetValue(int n) override; + PSZ GetCharValue(void) override { return Sdate; } + char *GetCharString(char *p) override; + int ShowValue(char *buf, int len) override; + bool FormatValue(PVAL vp, PCSZ fmt) override; bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0); bool SetFormat(PGLOBAL g, PVAL valp); bool IsFormatted(void) {return Pdtp != NULL;} diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index ce62f0591c1..dcd98582e2d 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -200,8 +200,8 @@ class DllExport XXBASE : public CSORT, public BLOCK { void FreeIndex(void) {PlgDBfree(Index);} // Methods - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; virtual bool Init(PGLOBAL g) = 0; virtual bool Make(PGLOBAL g, PIXDEF sxp) = 0; #if defined(XMAP) @@ -214,7 +214,7 @@ class DllExport XXBASE : public CSORT, public BLOCK { virtual int FastFind(void) = 0; virtual bool Reorder(PGLOBAL) {return true;} virtual int Range(PGLOBAL, int = 0, bool = true) {return -1;} // Means error - virtual int Qcompare(int *, int *) = 0; + int Qcompare(int *, int *) override = 0; virtual int GroupSize(void) {return 1;} virtual void Close(void) = 0; @@ -254,32 +254,32 @@ class DllExport XINDEX : public XXBASE { PCOL *cp, PXOB *xp = NULL, int k = 0); // Implementation - virtual IDT GetType(void) {return TYPE_IDX_INDX;} - virtual bool IsMul(void) {return (Nval < Nk) ? true : Mul;} + IDT GetType(void) override {return TYPE_IDX_INDX;} + bool IsMul(void) override {return (Nval < Nk) ? true : Mul;} //virtual bool HaveSame(void) {return Op == OP_SAME;} - virtual int GetCurPos(void) {return (Pex) ? Pex[Cur_K] : Cur_K;} - virtual void SetNval(int n) {Nval = n;} + int GetCurPos(void) override {return (Pex) ? Pex[Cur_K] : Cur_K;} + void SetNval(int n) override {Nval = n;} int GetMaxSame(void) {return MaxSame;} // Methods - virtual void Reset(void); - virtual bool Init(PGLOBAL g); + void Reset(void) override; + bool Init(PGLOBAL g) override; #if defined(XMAP) - virtual bool MapInit(PGLOBAL g); + bool MapInit(PGLOBAL g) override; #endif // XMAP - virtual int Qcompare(int *, int *); - virtual int Fetch(PGLOBAL g); - virtual int FastFind(void); - virtual int GroupSize(void); - virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); - virtual int MaxRange(void) {return MaxSame;} + int Qcompare(int *, int *) override; + int Fetch(PGLOBAL g) override; + int FastFind(void) override; + int GroupSize(void) override; + int Range(PGLOBAL g, int limit = 0, bool incl = true) override; + int MaxRange(void) override {return MaxSame;} virtual int ColMaxSame(PXCOL kp); - virtual void Close(void); - virtual bool NextVal(bool eq); - virtual bool PrevVal(void); - virtual bool Make(PGLOBAL g, PIXDEF sxp); + void Close(void) override; + bool NextVal(bool eq) override; + bool PrevVal(void) override; + bool Make(PGLOBAL g, PIXDEF sxp) override; virtual bool SaveIndex(PGLOBAL g, PIXDEF sxp); - virtual bool Reorder(PGLOBAL g); + bool Reorder(PGLOBAL g) override; bool GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk); protected: @@ -310,16 +310,16 @@ class DllExport XINDXS : public XINDEX { XINDXS(PTDBDOS tdbp, PIXDEF xdp, PXLOAD pxp, PCOL *cp, PXOB *xp = NULL); // Implementation - virtual void SetNval(int n) {assert(n == 1);} + void SetNval(int n) override {assert(n == 1);} // Methods - virtual int Qcompare(int *, int *); - virtual int Fetch(PGLOBAL g); - virtual int FastFind(void); - virtual bool NextVal(bool eq); - virtual bool PrevVal(void); - virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); - virtual int GroupSize(void); + int Qcompare(int *, int *) override; + int Fetch(PGLOBAL g) override; + int FastFind(void) override; + bool NextVal(bool eq) override; + bool PrevVal(void) override; + int Range(PGLOBAL g, int limit = 0, bool incl = true) override; + int GroupSize(void) override; protected: // Members @@ -367,14 +367,14 @@ class DllExport XFILE : public XLOAD { XFILE(void); // Methods - virtual bool Open(PGLOBAL g, char *filename, int id, MODE mode); - virtual bool Seek(PGLOBAL g, int low, int high, int origin); - virtual bool Read(PGLOBAL g, void *buf, int n, int size); - virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc); - virtual void Close(char *fn, int id); - virtual void Close(void); + bool Open(PGLOBAL g, char *filename, int id, MODE mode) override; + bool Seek(PGLOBAL g, int low, int high, int origin) override; + bool Read(PGLOBAL g, void *buf, int n, int size) override; + int Write(PGLOBAL g, void *buf, int n, int size, bool& rc) override; + void Close(char *fn, int id) override; + void Close(void) override; #if defined(XMAP) - virtual void *FileView(PGLOBAL g, char *fn); + void *FileView(PGLOBAL g, char *fn) override; #endif // XMAP protected: @@ -395,13 +395,13 @@ class DllExport XHUGE : public XLOAD { // Methods using XLOAD::Close; - virtual bool Open(PGLOBAL g, char *filename, int id, MODE mode); - virtual bool Seek(PGLOBAL g, int low, int high, int origin); - virtual bool Read(PGLOBAL g, void *buf, int n, int size); - virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc); - virtual void Close(char *fn, int id); + bool Open(PGLOBAL g, char *filename, int id, MODE mode) override; + bool Seek(PGLOBAL g, int low, int high, int origin) override; + bool Read(PGLOBAL g, void *buf, int n, int size) override; + int Write(PGLOBAL g, void *buf, int n, int size, bool& rc) override; + void Close(char *fn, int id) override; #if defined(XMAP) - virtual void *FileView(PGLOBAL g, char *fn); + void *FileView(PGLOBAL g, char *fn) override; #endif // XMAP protected: @@ -418,21 +418,21 @@ class DllExport XXROW : public XXBASE { XXROW(PTDBDOS tbxp); // Implementation - virtual IDT GetType(void) {return TYPE_IDX_XROW;} - virtual void Reset(void); + IDT GetType(void) override {return TYPE_IDX_XROW;} + void Reset(void) override; // Methods - virtual bool Init(PGLOBAL g); + bool Init(PGLOBAL g) override; #if defined(XMAP) - virtual bool MapInit(PGLOBAL) {return true;} + bool MapInit(PGLOBAL) override {return true;} #endif // XMAP - virtual int Fetch(PGLOBAL g); - virtual int FastFind(void); - virtual int MaxRange(void) {return 1;} - virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); - virtual int Qcompare(int *, int *) {assert(false); return 0;} - virtual bool Make(PGLOBAL, PIXDEF) {return false;} - virtual void Close(void) {} + int Fetch(PGLOBAL g) override; + int FastFind(void) override; + int MaxRange(void) override {return 1;} + int Range(PGLOBAL g, int limit = 0, bool incl = true) override; + int Qcompare(int *, int *) override {assert(false); return 0;} + bool Make(PGLOBAL, PIXDEF) override {return false;} + void Close(void) override {} protected: // Members diff --git a/storage/connect/xobject.h b/storage/connect/xobject.h index 5b50e9320f5..9d8651a3b87 100644 --- a/storage/connect/xobject.h +++ b/storage/connect/xobject.h @@ -75,17 +75,17 @@ class DllExport XVOID : public XOBJECT { XVOID(void) {Constant = true;} // Implementation - virtual int GetType(void) {return TYPE_VOID;} - virtual int GetLength(void) {return 0;} - virtual int GetLengthEx(void) {return 0;} - virtual PSZ GetCharValue(void) {return NULL;} - virtual int GetIntValue(void) {return 0;} - virtual double GetFloatValue(void) {return 0.0;} - virtual int GetScale() {return 0;} + int GetType(void) override {return TYPE_VOID;} + int GetLength(void) override {return 0;} + int GetLengthEx(void) override {return 0;} + PSZ GetCharValue(void) override {return NULL;} + int GetIntValue(void) override {return 0;} + double GetFloatValue(void) override {return 0.0;} + int GetScale() override {return 0;} // Methods - virtual bool Compare(PXOB xp) {return xp->GetType() == TYPE_VOID;} - virtual bool SetFormat(PGLOBAL, FORMAT&) {return true;} + bool Compare(PXOB xp) override {return xp->GetType() == TYPE_VOID;} + bool SetFormat(PGLOBAL, FORMAT&) override {return true;} }; // end of class XVOID @@ -100,20 +100,20 @@ class DllExport CONSTANT : public XOBJECT { CONSTANT(PVAL valp) {Value = valp; Constant = true;} // Implementation - virtual int GetType(void) {return TYPE_CONST;} - virtual int GetResultType(void) {return Value->Type;} - virtual int GetLength(void) {return Value->GetValLen();} - virtual int GetScale() {return Value->GetValPrec();} - virtual int GetLengthEx(void); + int GetType(void) override {return TYPE_CONST;} + int GetResultType(void) override {return Value->Type;} + int GetLength(void) override {return Value->GetValLen();} + int GetScale() override {return Value->GetValPrec();} + int GetLengthEx(void) override; // Methods - virtual bool Compare(PXOB xp); - virtual bool SetFormat(PGLOBAL g, FORMAT& fmt) + bool Compare(PXOB xp) override; + bool SetFormat(PGLOBAL g, FORMAT& fmt) override {return Value->SetConstFormat(g, fmt);} void Convert(PGLOBAL g, int newtype); void SetValue(PVAL vp) {Value = vp;} - virtual void Printf(PGLOBAL g, FILE *, uint); - virtual void Prints(PGLOBAL g, char *, uint); + void Printf(PGLOBAL g, FILE *, uint) override; + void Prints(PGLOBAL g, char *, uint) override; }; // end of class CONSTANT /***********************************************************************/ diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h index 58acf550a0b..a96b5c6b3c6 100644 --- a/storage/connect/xtable.h +++ b/storage/connect/xtable.h @@ -109,8 +109,8 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block. virtual PTDB Copy(PTABS t); virtual void PrintAM(FILE *f, char *m) {fprintf(f, "%s AM(%d)\n", m, GetAmType());} - virtual void Printf(PGLOBAL g, FILE *f, uint n); - virtual void Prints(PGLOBAL g, char *ps, uint z); + void Printf(PGLOBAL g, FILE *f, uint n) override; + void Prints(PGLOBAL g, char *ps, uint z) override; virtual PCSZ GetServer(void) = 0; virtual int GetBadLines(void) {return 0;} virtual CHARSET_INFO *data_charset(void); @@ -173,7 +173,7 @@ class DllExport TDBASE : public TDB { inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;} // Properties - PKXBASE GetKindex(void) {return To_Kindex;} + PKXBASE GetKindex(void) override {return To_Kindex;} PXOB *GetLink(void) {return To_Link;} PIXDEF GetXdp(void) {return To_Xdp;} void ResetKindex(PGLOBAL g, PKXBASE kxp); @@ -182,17 +182,17 @@ class DllExport TDBASE : public TDB { // Methods virtual bool IsUsingTemp(PGLOBAL) {return false;} - virtual PCATLG GetCat(void); - virtual void PrintAM(FILE *f, char *m); - virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} + PCATLG GetCat(void) override; + void PrintAM(FILE *f, char *m) override; + int GetProgMax(PGLOBAL g) override {return GetMaxSize(g);} virtual void RestoreNrec(void) {} virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); - virtual PCSZ GetServer(void) {return "Current";} + PCSZ GetServer(void) override {return "Current";} // Database routines virtual int MakeIndex(PGLOBAL g, PIXDEF, bool) {strcpy(g->Message, "Remote index"); return RC_INFO;} - virtual bool ReadKey(PGLOBAL, OPVAL, const key_range *) + bool ReadKey(PGLOBAL, OPVAL, const key_range *) override {assert(false); return true;} protected: @@ -218,23 +218,23 @@ class DllExport TDBCAT : public TDBASE { TDBCAT(PTABDEF tdp); // Implementation - virtual AMT GetAmType(void) {return TYPE_AM_CAT;} + AMT GetAmType(void) override {return TYPE_AM_CAT;} // Methods - virtual int GetRecpos(void) {return N;} - virtual int GetProgCur(void) {return N;} - virtual int RowNumber(PGLOBAL, bool = false) {return N + 1;} - virtual bool SetRecpos(PGLOBAL g, int recpos); + int GetRecpos(void) override {return N;} + int GetProgCur(void) override {return N;} + int RowNumber(PGLOBAL, bool = false) override {return N + 1;} + bool SetRecpos(PGLOBAL g, int recpos) override; // Database routines - virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual int Cardinality(PGLOBAL) {return 10;} // To avoid assert - virtual int GetMaxSize(PGLOBAL g); - virtual bool OpenDB(PGLOBAL g); - virtual int ReadDB(PGLOBAL g); - virtual int WriteDB(PGLOBAL g); - virtual int DeleteDB(PGLOBAL g, int irc); - virtual void CloseDB(PGLOBAL g); + PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; + int Cardinality(PGLOBAL) override {return 10;} // To avoid assert + int GetMaxSize(PGLOBAL g) override; + bool OpenDB(PGLOBAL g) override; + int ReadDB(PGLOBAL g) override; + int WriteDB(PGLOBAL g) override; + int DeleteDB(PGLOBAL g, int irc) override; + void CloseDB(PGLOBAL g) override; protected: // Specific routines @@ -258,10 +258,10 @@ class DllExport CATCOL : public COLBLK { CATCOL(PCOLDEF cdp, PTDB tdbp, int n); // Implementation - virtual int GetAmType(void) {return TYPE_AM_ODBC;} + int GetAmType(void) override {return TYPE_AM_ODBC;} // Methods - virtual void ReadColumn(PGLOBAL g); + void ReadColumn(PGLOBAL g) override; protected: CATCOL(void) = default; // Default constructor not to be used diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 043183444da..68dd7b29d99 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -102,14 +102,14 @@ public: delete file_buff; free_root(&blobroot, MYF(0)); } - const char *index_type(uint inx) { return "NONE"; } - ulonglong table_flags() const + const char *index_type(uint inx) override { return "NONE"; } + ulonglong table_flags() const override { return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_EXPORT | HA_CAN_REPAIR | HA_SLOW_RND_POS); } - ulong index_flags(uint idx, uint part, bool all_parts) const + ulong index_flags(uint idx, uint part, bool all_parts) const override { /* We will never have indexes so this will never be called(AKA we return @@ -124,7 +124,7 @@ public: /* Called in test_quick_select to determine if indexes should be used. */ - virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; } + double scan_time() override { return (double) (stats.records+stats.deleted) / 20.0+10; } /* The next method will never be called */ virtual bool fast_key_read() { return 1;} /* @@ -132,38 +132,38 @@ public: (e.g. save number of records seen on full table scan and/or use file size as upper bound) */ - ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; } + ha_rows estimate_rows_upper_bound() override { return HA_POS_ERROR; } - int open(const char *name, int mode, uint open_options); - int close(void); - int write_row(const uchar * buf); - int update_row(const uchar * old_data, const uchar * new_data); - int delete_row(const uchar * buf); - int rnd_init(bool scan=1); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); - bool check_and_repair(THD *thd); - int check(THD* thd, HA_CHECK_OPT* check_opt); - bool is_crashed() const; - int rnd_end(); - int repair(THD* thd, HA_CHECK_OPT* check_opt); + int open(const char *name, int mode, uint open_options) override; + int close(void) override; + int write_row(const uchar * buf) override; + int update_row(const uchar * old_data, const uchar * new_data) override; + int delete_row(const uchar * buf) override; + int rnd_init(bool scan=1) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; + bool check_and_repair(THD *thd) override; + int check(THD* thd, HA_CHECK_OPT* check_opt) override; + bool is_crashed() const override; + int rnd_end() override; + int repair(THD* thd, HA_CHECK_OPT* check_opt) override; /* This is required for SQL layer to know that we support autorepair */ - bool auto_repair(int error) const + bool auto_repair(int error) const override { return error == HA_ERR_CRASHED_ON_USAGE; } bool auto_repair() const { return 1; } - void position(const uchar *record); - int info(uint); - int reset(); - int extra(enum ha_extra_function operation); - int delete_all_rows(void); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + void position(const uchar *record) override; + int info(uint) override; + int reset() override; + int extra(enum ha_extra_function operation) override; + int delete_all_rows(void) override; + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override; bool check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes); + uint table_changes) override; - int external_lock(THD *thd, int lock_type); + int external_lock(THD *thd, int lock_type) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); + enum thr_lock_type lock_type) override; /* These functions used to get/update status of the handler. diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index 5d067f7cda9..aa38b58d24b 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -74,13 +74,13 @@ public: The name of the index type that will be used for display. Don't implement this method unless you really have indexes. */ - const char *index_type(uint inx) { return "HASH"; } + const char *index_type(uint inx) override { return "HASH"; } /** @brief This is a list of flags that indicate what functionality the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const + ulonglong table_flags() const override { /* We are saying that this engine is just statement capable to have @@ -100,7 +100,7 @@ public: If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return 0; } @@ -112,7 +112,7 @@ public: send. Return *real* limits of your storage engine here; MySQL will do min(your_limits, MySQL_limits) automatically. */ - uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_record_length() const override { return HA_MAX_REC_LENGTH; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -123,7 +123,7 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_keys() const { return 0; } + uint max_supported_keys() const override { return 0; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -134,7 +134,7 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_key_parts() const { return 0; } + uint max_supported_key_parts() const override { return 0; } /** @brief unireg.cc will call this to make sure that the storage engine can handle @@ -145,17 +145,17 @@ public: There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_key_length() const { return 0; } + uint max_supported_key_length() const override { return 0; } /** @brief Called in test_quick_select to determine if indexes should be used. */ - virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; } + double scan_time() override { return (double) (stats.records+stats.deleted) / 20.0+10; } /** @brief This method will never be called if you do not implement indexes. */ - virtual double read_time(uint, uint, ha_rows rows) + double read_time(uint, uint, ha_rows rows) override { return (double) rows / 20.0+1; } /* @@ -167,61 +167,61 @@ public: /** @brief We implement this in ha_example.cc; it's a required method. */ - int open(const char *name, int mode, uint test_if_locked); // required + int open(const char *name, int mode, uint test_if_locked) override; // required /** @brief We implement this in ha_example.cc; it's a required method. */ - int close(void); // required + int close(void) override; // required /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int write_row(const uchar *buf); + int write_row(const uchar *buf) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int update_row(const uchar *old_data, const uchar *new_data); + int update_row(const uchar *old_data, const uchar *new_data) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int delete_row(const uchar *buf); + int delete_row(const uchar *buf) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ int index_read_map(uchar *buf, const uchar *key, - key_part_map keypart_map, enum ha_rkey_function find_flag); + key_part_map keypart_map, enum ha_rkey_function find_flag) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_next(uchar *buf); + int index_next(uchar *buf) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_prev(uchar *buf); + int index_prev(uchar *buf) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_first(uchar *buf); + int index_first(uchar *buf) override; /** @brief We implement this in ha_example.cc. It's not an obligatory method; skip it and and MySQL will treat it as not implemented. */ - int index_last(uchar *buf); + int index_last(uchar *buf) override; /** @brief Unlike index_init(), rnd_init() can be called two consecutive times @@ -231,24 +231,24 @@ public: cursor to the start of the table; no need to deallocate and allocate it again. This is a required method. */ - int rnd_init(bool scan); //required - int rnd_end(); - int rnd_next(uchar *buf); ///< required - int rnd_pos(uchar *buf, uchar *pos); ///< required - void position(const uchar *record); ///< required - int info(uint); ///< required - int extra(enum ha_extra_function operation); - int external_lock(THD *thd, int lock_type); ///< required - int delete_all_rows(void); + int rnd_init(bool scan) override; //required + int rnd_end() override; + int rnd_next(uchar *buf) override; ///< required + int rnd_pos(uchar *buf, uchar *pos) override; ///< required + void position(const uchar *record) override; ///< required + int info(uint) override; ///< required + int extra(enum ha_extra_function operation) override; + int external_lock(THD *thd, int lock_type) override; ///< required + int delete_all_rows(void) override; ha_rows records_in_range(uint inx, const key_range *min_key, - const key_range *max_key, page_range *pages); - int delete_table(const char *from); + const key_range *max_key, page_range *pages) override; + int delete_table(const char *from) override; int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); ///< required + HA_CREATE_INFO *create_info) override; ///< required enum_alter_inplace_result check_if_supported_inplace_alter(TABLE* altered_table, - Alter_inplace_info* ha_alter_info); + Alter_inplace_info* ha_alter_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); ///< required + enum thr_lock_type lock_type) override; ///< required }; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 25b12de3cd5..ff272234d73 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1656,7 +1656,7 @@ public: public: bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, - const char* msg, Sql_condition ** cond_hdl) + const char* msg, Sql_condition ** cond_hdl) override { return sql_errno >= ER_ABORTING_CONNECTION && sql_errno <= ER_NET_WRITE_INTERRUPTED; diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index fe729f08413..a08eebf30f5 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -131,13 +131,13 @@ public: don't implement this method unless you really have indexes */ // perhaps get index type - const char *index_type(uint inx) { return "REMOTE"; } + const char *index_type(uint inx) override { return "REMOTE"; } /* This is a list of flags that says what the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const + ulonglong table_flags() const override { /* fix server to be able to get remote server table flags */ return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED @@ -160,15 +160,15 @@ public: index up to and including 'part'. */ /* fix server to be able to get remote server index flags */ - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return (HA_READ_NEXT | HA_READ_RANGE | HA_READ_AFTER_KEY); } - uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_supported_keys() const { return MAX_KEY; } - uint max_supported_key_parts() const { return MAX_REF_PARTS; } - uint max_supported_key_length() const { return FEDERATED_MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return FEDERATED_MAX_KEY_LENGTH; } + uint max_supported_record_length() const override { return HA_MAX_REC_LENGTH; } + uint max_supported_keys() const override { return MAX_KEY; } + uint max_supported_key_parts() const override { return MAX_REF_PARTS; } + uint max_supported_key_length() const override { return FEDERATED_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const override { return FEDERATED_MAX_KEY_LENGTH; } /* Called in test_quick_select to determine if indexes should be used. Normally, we need to know number of blocks . For federated we need to @@ -180,7 +180,7 @@ public: The reason for "records * 1000" is that such a large number forces this to use indexes " */ - double scan_time() + double scan_time() override { DBUG_PRINT("info", ("records %lu", (ulong) stats.records)); return (double)(stats.records*1000); @@ -188,7 +188,7 @@ public: /* The next method will never be called if you do not implement indexes. */ - double read_time(uint index, uint ranges, ha_rows rows) + double read_time(uint index, uint ranges, ha_rows rows) override { /* Per Brian, this number is bugus, but this method must be implemented, @@ -197,33 +197,33 @@ public: return (double) rows / 20.0+1; } - const key_map *keys_to_use_for_scanning() { return &key_map_full; } + const key_map *keys_to_use_for_scanning() override { return &key_map_full; } /* Everything below are methods that we implment in ha_federated.cc. Most of these methods are not obligatory, skip them and MySQL will treat them as not implemented */ - int open(const char *name, int mode, uint test_if_locked); // required - int close(void); // required + int open(const char *name, int mode, uint test_if_locked) override; // required + int close(void) override; // required - void start_bulk_insert(ha_rows rows, uint flags); - int end_bulk_insert(); - int write_row(const uchar *buf); - int update_row(const uchar *old_data, const uchar *new_data); - int delete_row(const uchar *buf); - int index_init(uint keynr, bool sorted); - ha_rows estimate_rows_upper_bound(); + void start_bulk_insert(ha_rows rows, uint flags) override; + int end_bulk_insert() override; + int write_row(const uchar *buf) override; + int update_row(const uchar *old_data, const uchar *new_data) override; + int delete_row(const uchar *buf) override; + int index_init(uint keynr, bool sorted) override; + ha_rows estimate_rows_upper_bound() override; int index_read(uchar *buf, const uchar *key, - uint key_len, enum ha_rkey_function find_flag); + uint key_len, enum ha_rkey_function find_flag) override; int index_read_idx(uchar *buf, uint idx, const uchar *key, uint key_len, enum ha_rkey_function find_flag); - int index_next(uchar *buf); - int index_end(); + int index_next(uchar *buf) override; + int index_end() override; int read_range_first(const key_range *start_key, const key_range *end_key, - bool eq_range, bool sorted); - int read_range_next(); + bool eq_range, bool sorted) override; + int read_range_next() override; /* unlike index_init(), rnd_init() can be called two times without rnd_end() in between (it only makes sense if scan=1). @@ -232,17 +232,17 @@ public: position it to the start of the table, no need to deallocate and allocate it again */ - int rnd_init(bool scan); //required - int rnd_end(); - int rnd_next(uchar *buf); //required + int rnd_init(bool scan) override; //required + int rnd_end() override; + int rnd_next(uchar *buf) override; //required int rnd_next_int(uchar *buf); - int rnd_pos(uchar *buf, uchar *pos); //required - void position(const uchar *record); //required + int rnd_pos(uchar *buf, uchar *pos) override; //required + void position(const uchar *record) override; //required /* A ref is a pointer inside a local buffer. It is not comparable to other ref's. This is never called as HA_NON_COMPARABLE_ROWID is set. */ - int cmp_ref(const uchar *ref1, const uchar *ref2) + int cmp_ref(const uchar *ref1, const uchar *ref2) override { #ifdef NOT_YET DBUG_ASSERT(0); @@ -251,38 +251,38 @@ public: return handler::cmp_ref(ref1,ref2); /* Works if table scan is used */ #endif } - int info(uint); //required - int extra(ha_extra_function operation); + int info(uint) override; //required + int extra(ha_extra_function operation) override; void update_auto_increment(void); - int repair(THD* thd, HA_CHECK_OPT* check_opt); - int optimize(THD* thd, HA_CHECK_OPT* check_opt); - int delete_table(const char *name) + int repair(THD* thd, HA_CHECK_OPT* check_opt) override; + int optimize(THD* thd, HA_CHECK_OPT* check_opt) override; + int delete_table(const char *name) override { return 0; } - int delete_all_rows(void); - int truncate(); + int delete_all_rows(void) override; + int truncate() override; int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); //required + HA_CREATE_INFO *create_info) override; //required ha_rows records_in_range(uint inx, const key_range *start_key, const key_range *end_key, - page_range *pages); - uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; } + page_range *pages) override; + uint8 table_cache_type() override { return HA_CACHE_TBL_NOCACHE; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); //required - bool get_error_message(int error, String *buf); + enum thr_lock_type lock_type) override; //required + bool get_error_message(int error, String *buf) override; MYSQL_RES *store_result(MYSQL *mysql); void free_result(); - int external_lock(THD *thd, int lock_type); + int external_lock(THD *thd, int lock_type) override; int connection_commit(); int connection_rollback(); int connection_autocommit(bool state); int execute_simple_query(const char *query, int len); - int reset(void); + int reset(void) override; }; diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index 5649b903060..6cb520c9175 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -73,55 +73,55 @@ class federatedx_io_mysql :public federatedx_io bool test_all_restrict() const; public: federatedx_io_mysql(FEDERATEDX_SERVER *); - ~federatedx_io_mysql(); + ~federatedx_io_mysql() override; int simple_query(const char *fmt, ...); - int query(const char *buffer, size_t length); - virtual FEDERATEDX_IO_RESULT *store_result(); + int query(const char *buffer, size_t length) override; + FEDERATEDX_IO_RESULT *store_result() override; - virtual size_t max_query_size() const; + size_t max_query_size() const override; - virtual my_ulonglong affected_rows() const; - virtual my_ulonglong last_insert_id() const; + my_ulonglong affected_rows() const override; + my_ulonglong last_insert_id() const override; - virtual int error_code(); - virtual const char *error_str(); + int error_code() override; + const char *error_str() override; - void reset(); - int commit(); - int rollback(); + void reset() override; + int commit() override; + int rollback() override; - int savepoint_set(ulong sp); - ulong savepoint_release(ulong sp); - ulong savepoint_rollback(ulong sp); - void savepoint_restrict(ulong sp); + int savepoint_set(ulong sp) override; + ulong savepoint_release(ulong sp) override; + ulong savepoint_rollback(ulong sp) override; + void savepoint_restrict(ulong sp) override; - ulong last_savepoint() const; - ulong actual_savepoint() const; - bool is_autocommit() const; + ulong last_savepoint() const override; + ulong actual_savepoint() const override; + bool is_autocommit() const override; bool table_metadata(ha_statistics *stats, const char *table_name, - uint table_name_length, uint flag); + uint table_name_length, uint flag) override; /* resultset operations */ - virtual void free_result(FEDERATEDX_IO_RESULT *io_result); - virtual unsigned int get_num_fields(FEDERATEDX_IO_RESULT *io_result); - virtual my_ulonglong get_num_rows(FEDERATEDX_IO_RESULT *io_result); - virtual FEDERATEDX_IO_ROW *fetch_row(FEDERATEDX_IO_RESULT *io_result, - FEDERATEDX_IO_ROWS **current= NULL); - virtual ulong *fetch_lengths(FEDERATEDX_IO_RESULT *io_result); - virtual const char *get_column_data(FEDERATEDX_IO_ROW *row, - unsigned int column); - virtual bool is_column_null(const FEDERATEDX_IO_ROW *row, - unsigned int column) const; + void free_result(FEDERATEDX_IO_RESULT *io_result) override; + unsigned int get_num_fields(FEDERATEDX_IO_RESULT *io_result) override; + my_ulonglong get_num_rows(FEDERATEDX_IO_RESULT *io_result) override; + FEDERATEDX_IO_ROW *fetch_row(FEDERATEDX_IO_RESULT *io_result, + FEDERATEDX_IO_ROWS **current= NULL) override; + ulong *fetch_lengths(FEDERATEDX_IO_RESULT *io_result) override; + const char *get_column_data(FEDERATEDX_IO_ROW *row, + unsigned int column) override; + bool is_column_null(const FEDERATEDX_IO_ROW *row, + unsigned int column) const override; - virtual size_t get_ref_length() const; - virtual void mark_position(FEDERATEDX_IO_RESULT *io_result, - void *ref, FEDERATEDX_IO_ROWS *current); - virtual int seek_position(FEDERATEDX_IO_RESULT **io_result, - const void *ref); - virtual void set_thd(void *thd); + size_t get_ref_length() const override; + void mark_position(FEDERATEDX_IO_RESULT *io_result, + void *ref, FEDERATEDX_IO_ROWS *current) override; + int seek_position(FEDERATEDX_IO_RESULT **io_result, + const void *ref) override; + void set_thd(void *thd) override; }; diff --git a/storage/federatedx/federatedx_io_null.cc b/storage/federatedx/federatedx_io_null.cc index 8a2394f2150..24e499e4ba4 100644 --- a/storage/federatedx/federatedx_io_null.cc +++ b/storage/federatedx/federatedx_io_null.cc @@ -56,52 +56,52 @@ class federatedx_io_null :public federatedx_io { public: federatedx_io_null(FEDERATEDX_SERVER *); - ~federatedx_io_null(); + ~federatedx_io_null() override; - int query(const char *buffer, size_t length); - virtual FEDERATEDX_IO_RESULT *store_result(); + int query(const char *buffer, size_t length) override; + FEDERATEDX_IO_RESULT *store_result() override; - virtual size_t max_query_size() const; + size_t max_query_size() const override; - virtual my_ulonglong affected_rows() const; - virtual my_ulonglong last_insert_id() const; + my_ulonglong affected_rows() const override; + my_ulonglong last_insert_id() const override; - virtual int error_code(); - virtual const char *error_str(); + int error_code() override; + const char *error_str() override; - void reset(); - int commit(); - int rollback(); + void reset() override; + int commit() override; + int rollback() override; - int savepoint_set(ulong sp); - ulong savepoint_release(ulong sp); - ulong savepoint_rollback(ulong sp); - void savepoint_restrict(ulong sp); + int savepoint_set(ulong sp) override; + ulong savepoint_release(ulong sp) override; + ulong savepoint_rollback(ulong sp) override; + void savepoint_restrict(ulong sp) override; - ulong last_savepoint() const; - ulong actual_savepoint() const; - bool is_autocommit() const; + ulong last_savepoint() const override; + ulong actual_savepoint() const override; + bool is_autocommit() const override; bool table_metadata(ha_statistics *stats, const char *table_name, - uint table_name_length, uint flag); + uint table_name_length, uint flag) override; /* resultset operations */ - virtual void free_result(FEDERATEDX_IO_RESULT *io_result); - virtual unsigned int get_num_fields(FEDERATEDX_IO_RESULT *io_result); - virtual my_ulonglong get_num_rows(FEDERATEDX_IO_RESULT *io_result); - virtual FEDERATEDX_IO_ROW *fetch_row(FEDERATEDX_IO_RESULT *io_result, - FEDERATEDX_IO_ROWS **current= NULL); - virtual ulong *fetch_lengths(FEDERATEDX_IO_RESULT *io_result); - virtual const char *get_column_data(FEDERATEDX_IO_ROW *row, - unsigned int column); - virtual bool is_column_null(const FEDERATEDX_IO_ROW *row, - unsigned int column) const; - virtual size_t get_ref_length() const; - virtual void mark_position(FEDERATEDX_IO_RESULT *io_result, - void *ref, FEDERATEDX_IO_ROWS *current); - virtual int seek_position(FEDERATEDX_IO_RESULT **io_result, - const void *ref); + void free_result(FEDERATEDX_IO_RESULT *io_result) override; + unsigned int get_num_fields(FEDERATEDX_IO_RESULT *io_result) override; + my_ulonglong get_num_rows(FEDERATEDX_IO_RESULT *io_result) override; + FEDERATEDX_IO_ROW *fetch_row(FEDERATEDX_IO_RESULT *io_result, + FEDERATEDX_IO_ROWS **current= NULL) override; + ulong *fetch_lengths(FEDERATEDX_IO_RESULT *io_result) override; + const char *get_column_data(FEDERATEDX_IO_ROW *row, + unsigned int column) override; + bool is_column_null(const FEDERATEDX_IO_ROW *row, + unsigned int column) const override; + size_t get_ref_length() const override; + void mark_position(FEDERATEDX_IO_RESULT *io_result, + void *ref, FEDERATEDX_IO_ROWS *current) override; + int seek_position(FEDERATEDX_IO_RESULT **io_result, + const void *ref) override; }; diff --git a/storage/federatedx/federatedx_pushdown.h b/storage/federatedx/federatedx_pushdown.h index 673abcfc68d..a40594a988c 100644 --- a/storage/federatedx/federatedx_pushdown.h +++ b/storage/federatedx/federatedx_pushdown.h @@ -33,10 +33,10 @@ private: public: ha_federatedx_derived_handler(THD* thd_arg, TABLE_LIST *tbl); ~ha_federatedx_derived_handler(); - int init_scan(); - int next_row(); - int end_scan(); - void print_error(int, unsigned long); + int init_scan() override; + int next_row() override; + int end_scan() override; + void print_error(int, unsigned long) override; }; @@ -56,8 +56,8 @@ private: public: ha_federatedx_select_handler(THD* thd_arg, SELECT_LEX *sel); ~ha_federatedx_select_handler(); - int init_scan(); - int next_row(); - int end_scan(); - void print_error(int, unsigned long); + int init_scan() override; + int next_row() override; + int end_scan() override; + void print_error(int, unsigned long) override; }; diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index e2fdc54d8e7..ab5968b6055 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1829,7 +1829,7 @@ public: public: bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate, Sql_condition::enum_warning_level *level, - const char* msg, Sql_condition ** cond_hdl) + const char* msg, Sql_condition ** cond_hdl) override { return sql_errno >= ER_ABORTING_CONNECTION && sql_errno <= ER_NET_WRITE_INTERRUPTED; diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 8c59bc7c13a..f0f7d5422e6 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -323,13 +323,13 @@ public: don't implement this method unless you really have indexes */ // perhaps get index type - const char *index_type(uint inx) { return "REMOTE"; } + const char *index_type(uint inx) override { return "REMOTE"; } /* This is a list of flags that says what the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const + ulonglong table_flags() const override { /* fix server to be able to get remote server table flags */ return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED @@ -349,15 +349,15 @@ public: index up to and including 'part'. */ /* fix server to be able to get remote server index flags */ - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return (HA_READ_NEXT | HA_READ_RANGE); } - uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_supported_keys() const { return MAX_KEY; } - uint max_supported_key_parts() const { return MAX_REF_PARTS; } - uint max_supported_key_length() const { return FEDERATEDX_MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return FEDERATEDX_MAX_KEY_LENGTH; } + uint max_supported_record_length() const override { return HA_MAX_REC_LENGTH; } + uint max_supported_keys() const override { return MAX_KEY; } + uint max_supported_key_parts() const override { return MAX_REF_PARTS; } + uint max_supported_key_length() const override { return FEDERATEDX_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const override { return FEDERATEDX_MAX_KEY_LENGTH; } /* Called in test_quick_select to determine if indexes should be used. Normally, we need to know number of blocks . For federatedx we need to @@ -369,7 +369,7 @@ public: The reason for "records * 1000" is that such a large number forces this to use indexes " */ - double scan_time() + double scan_time() override { DBUG_PRINT("info", ("records %lu", (ulong) stats.records)); return (double)(stats.records*1000); @@ -377,7 +377,7 @@ public: /* The next method will never be called if you do not implement indexes. */ - double read_time(uint index, uint ranges, ha_rows rows) + double read_time(uint index, uint ranges, ha_rows rows) override { /* Per Brian, this number is bugus, but this method must be implemented, @@ -386,33 +386,33 @@ public: return (double) rows / 20.0+1; } - const key_map *keys_to_use_for_scanning() { return &key_map_full; } + const key_map *keys_to_use_for_scanning() override { return &key_map_full; } /* Everything below are methods that we implment in ha_federatedx.cc. Most of these methods are not obligatory, skip them and MySQL will treat them as not implemented */ - int open(const char *name, int mode, uint test_if_locked); // required - int close(void); // required + int open(const char *name, int mode, uint test_if_locked) override; // required + int close(void) override; // required - void start_bulk_insert(ha_rows rows, uint flags); - int end_bulk_insert(); - int write_row(const uchar *buf); - int update_row(const uchar *old_data, const uchar *new_data); - int delete_row(const uchar *buf); - int index_init(uint keynr, bool sorted); - ha_rows estimate_rows_upper_bound(); + void start_bulk_insert(ha_rows rows, uint flags) override; + int end_bulk_insert() override; + int write_row(const uchar *buf) override; + int update_row(const uchar *old_data, const uchar *new_data) override; + int delete_row(const uchar *buf) override; + int index_init(uint keynr, bool sorted) override; + ha_rows estimate_rows_upper_bound() override; int index_read(uchar *buf, const uchar *key, - uint key_len, enum ha_rkey_function find_flag); + uint key_len, enum ha_rkey_function find_flag) override; int index_read_idx(uchar *buf, uint idx, const uchar *key, uint key_len, enum ha_rkey_function find_flag); - int index_next(uchar *buf); - int index_end(); + int index_next(uchar *buf) override; + int index_end() override; int read_range_first(const key_range *start_key, const key_range *end_key, - bool eq_range, bool sorted); - int read_range_next(); + bool eq_range, bool sorted) override; + int read_range_next() override; /* unlike index_init(), rnd_init() can be called two times without rnd_end() in between (it only makes sense if scan=1). @@ -421,16 +421,16 @@ public: position it to the start of the table, no need to deallocate and allocate it again */ - int rnd_init(bool scan); //required - int rnd_end(); - int rnd_next(uchar *buf); //required - int rnd_pos(uchar *buf, uchar *pos); //required - void position(const uchar *record); //required + int rnd_init(bool scan) override; //required + int rnd_end() override; + int rnd_next(uchar *buf) override; //required + int rnd_pos(uchar *buf, uchar *pos) override; //required + void position(const uchar *record) override; //required /* A ref is a pointer inside a local buffer. It is not comparable to other ref's. This is never called as HA_NON_COMPARABLE_ROWID is set. */ - int cmp_ref(const uchar *ref1, const uchar *ref2) + int cmp_ref(const uchar *ref1, const uchar *ref2) override { #ifdef NOT_YET DBUG_ASSERT(0); @@ -439,29 +439,29 @@ public: return handler::cmp_ref(ref1,ref2); /* Works if table scan is used */ #endif } - int info(uint); //required - int extra(ha_extra_function operation); + int info(uint) override; //required + int extra(ha_extra_function operation) override; void update_auto_increment(void); - int repair(THD* thd, HA_CHECK_OPT* check_opt); - int optimize(THD* thd, HA_CHECK_OPT* check_opt); - int delete_table(const char *name) + int repair(THD* thd, HA_CHECK_OPT* check_opt) override; + int optimize(THD* thd, HA_CHECK_OPT* check_opt) override; + int delete_table(const char *name) override { return 0; } - int delete_all_rows(void); + int delete_all_rows(void) override; int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); //required + HA_CREATE_INFO *create_info) override; //required ha_rows records_in_range(uint inx, const key_range *start_key, - const key_range *end_key, page_range *pages); - uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; } + const key_range *end_key, page_range *pages) override; + uint8 table_cache_type() override { return HA_CACHE_TBL_NOCACHE; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); //required - bool get_error_message(int error, String *buf); - int start_stmt(THD *thd, thr_lock_type lock_type); - int external_lock(THD *thd, int lock_type); - int reset(void); + enum thr_lock_type lock_type) override; //required + bool get_error_message(int error, String *buf) override; + int start_stmt(THD *thd, thr_lock_type lock_type) override; + int external_lock(THD *thd, int lock_type) override; + int reset(void) override; int free_result(void); const FEDERATEDX_SHARE *get_federatedx_share() const { return share; } diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index d8636f7fc7e..c38ec325740 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -37,15 +37,15 @@ class ha_heap final : public handler public: ha_heap(handlerton *hton, TABLE_SHARE *table); ~ha_heap() = default; - handler *clone(const char *name, MEM_ROOT *mem_root); - const char *index_type(uint inx) + handler *clone(const char *name, MEM_ROOT *mem_root) override; + const char *index_type(uint inx) override { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? "BTREE" : "HASH"); } /* Rows also use a fixed-size format */ - enum row_type get_row_type() const { return ROW_TYPE_FIXED; } - ulonglong table_flags() const + enum row_type get_row_type() const override { return ROW_TYPE_FIXED; } + ulonglong table_flags() const override { return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | @@ -53,73 +53,73 @@ public: HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | HA_NO_TRANSACTIONS | HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_HASH_KEYS); } - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); } - const key_map *keys_to_use_for_scanning() { return &btree_keys; } - uint max_supported_keys() const { return MAX_KEY; } - uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; } - double scan_time() + const key_map *keys_to_use_for_scanning() override { return &btree_keys; } + uint max_supported_keys() const override { return MAX_KEY; } + uint max_supported_key_part_length() const override { return MAX_KEY_LENGTH; } + double scan_time() override { return (double) (stats.records+stats.deleted) / 20.0+10; } - double read_time(uint index, uint ranges, ha_rows rows) + double read_time(uint index, uint ranges, ha_rows rows) override { return (double) (rows +1)/ 20.0; } - double keyread_time(uint index, uint ranges, ha_rows rows) + double keyread_time(uint index, uint ranges, ha_rows rows) override { return (double) (rows + ranges) / 20.0 ; } - double avg_io_cost() + double avg_io_cost() override { return 0.05; } /* 1/20 */ - int open(const char *name, int mode, uint test_if_locked); - int close(void); + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; void set_keys_for_scanning(void); - int write_row(const uchar * buf); - int update_row(const uchar * old_data, const uchar * new_data); - int delete_row(const uchar * buf); - virtual void get_auto_increment(ulonglong offset, ulonglong increment, - ulonglong nb_desired_values, - ulonglong *first_value, - ulonglong *nb_reserved_values); + int write_row(const uchar * buf) override; + int update_row(const uchar * old_data, const uchar * new_data) override; + int delete_row(const uchar * buf) override; + void get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) override; int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map); + enum ha_rkey_function find_flag) override; + int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map) override; int index_read_idx_map(uchar * buf, uint index, const uchar * key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_next(uchar * buf); - int index_prev(uchar * buf); - int index_first(uchar * buf); - int index_last(uchar * buf); - int rnd_init(bool scan); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); - void position(const uchar *record); - int can_continue_handler_scan(); - int info(uint); - int extra(enum ha_extra_function operation); - int reset(); - int external_lock(THD *thd, int lock_type); - int delete_all_rows(void); - int reset_auto_increment(ulonglong value); - int disable_indexes(key_map map, bool persist); - int enable_indexes(key_map map, bool persist); - int indexes_are_disabled(void); + enum ha_rkey_function find_flag) override; + int index_next(uchar * buf) override; + int index_prev(uchar * buf) override; + int index_first(uchar * buf) override; + int index_last(uchar * buf) override; + int rnd_init(bool scan) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; + void position(const uchar *record) override; + int can_continue_handler_scan() override; + int info(uint) override; + int extra(enum ha_extra_function operation) override; + int reset() override; + int external_lock(THD *thd, int lock_type) override; + int delete_all_rows(void) override; + int reset_auto_increment(ulonglong value) override; + int disable_indexes(key_map map, bool persist) override; + int enable_indexes(key_map map, bool persist) override; + int indexes_are_disabled(void) override; ha_rows records_in_range(uint inx, const key_range *start_key, - const key_range *end_key, page_range *pages); - int delete_table(const char *from); - void drop_table(const char *name); - int rename_table(const char * from, const char * to); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); - void update_create_info(HA_CREATE_INFO *create_info); + const key_range *end_key, page_range *pages) override; + int delete_table(const char *from) override; + void drop_table(const char *name) override; + int rename_table(const char * from, const char * to) override; + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override; + void update_create_info(HA_CREATE_INFO *create_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); - int cmp_ref(const uchar *ref1, const uchar *ref2) + enum thr_lock_type lock_type) override; + int cmp_ref(const uchar *ref1, const uchar *ref2) override { return memcmp(ref1, ref2, sizeof(HEAP_PTR)); } - bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); - int find_unique_row(uchar *record, uint unique_idx); + bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override; + int find_unique_row(uchar *record, uint unique_idx) override; private: void update_key_stats(); }; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d29681bbcbd..b0f69c06d0c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -14867,11 +14867,13 @@ ha_innobase::info_low( stats.index_file_length = ulonglong(stat_sum_of_other_index_sizes) * size; - space->s_lock(); - stats.delete_length = 1024 - * fsp_get_available_space_in_free_extents( + if (flag & HA_STATUS_VARIABLE_EXTRA) { + space->s_lock(); + stats.delete_length = 1024 + * fsp_get_available_space_in_free_extents( *space); - space->s_unlock(); + space->s_unlock(); + } } stats.check_time = 0; stats.mrr_length_per_rec= (uint)ref_length + 8; // 8 = max(sizeof(void *)); diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 471d6915159..15d616ad640 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1168,7 +1168,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx trx_start_for_ddl(trx); } - ~ha_innobase_inplace_ctx() + ~ha_innobase_inplace_ctx() override { UT_DELETE(m_stage); if (instant_table) { @@ -1277,7 +1277,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx /** Share context between partitions. @param[in] ctx context from another partition of the table */ - void set_shared_data(const inplace_alter_handler_ctx& ctx) + void set_shared_data(const inplace_alter_handler_ctx& ctx) override { if (add_autoinc != ULINT_UNDEFINED) { const ha_innobase_inplace_ctx& ha_ctx = diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index f26067ae1f0..2d5b9048540 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -372,14 +372,14 @@ public: file_os_io &operator=(file_os_io &&rhs); ~file_os_io() noexcept; - dberr_t open(const char *path, bool read_only) noexcept final; + dberr_t open(const char *path, bool read_only) noexcept override final; bool is_opened() const noexcept { return m_fd != OS_FILE_CLOSED; } - dberr_t rename(const char *old_path, const char *new_path) noexcept final; - dberr_t close() noexcept final; - dberr_t read(os_offset_t offset, span buf) noexcept final; + dberr_t rename(const char *old_path, const char *new_path) noexcept override final; + dberr_t close() noexcept override final; + dberr_t read(os_offset_t offset, span buf) noexcept override final; dberr_t write(const char *path, os_offset_t offset, - span buf) noexcept final; - dberr_t flush() noexcept final; + span buf) noexcept override final; + dberr_t flush() noexcept override final; private: pfs_os_file_t m_fd{OS_FILE_CLOSED}; diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index ed693023025..e6772492ab9 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4739,7 +4739,9 @@ completed: if (!srv_read_only_mode && srv_operation <= SRV_OPERATION_EXPORT_RESTORED && (~log_t::FORMAT_ENCRYPTED & log_sys.log.format) - == log_t::FORMAT_10_5) { + == log_t::FORMAT_10_5 + && recv_sys.recovered_lsn - log_sys.last_checkpoint_lsn + < log_sys.log_capacity) { /* Write a FILE_CHECKPOINT marker as the first thing, before generating any other redo log. This ensures that subsequent crash recovery will be possible even @@ -4749,6 +4751,9 @@ completed: log_sys.next_checkpoint_no = ++checkpoint_no; + DBUG_EXECUTE_IF("before_final_redo_apply", + mysql_mutex_unlock(&log_sys.mutex); + return DB_ERROR;); mysql_mutex_lock(&recv_sys.mutex); recv_sys.apply_log_recs = true; recv_no_ibuf_operations = false; diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 41f644364bd..353ffd88d49 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -77,7 +77,7 @@ public: { return max_supported_key_length(); } enum row_type get_row_type() const override final; void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override final; - virtual double scan_time() override final; + double scan_time() override final; int open(const char *name, int mode, uint test_if_locked) override; int close(void) override final; diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp index 6bf971aa347..2bc5c2b30f3 100644 --- a/storage/mroonga/ha_mroonga.hpp +++ b/storage/mroonga/ha_mroonga.hpp @@ -35,11 +35,8 @@ extern "C" { #include #include -#if __cplusplus >= 201402 -# define mrn_override override -#else -# define mrn_override -#endif +#define mrn_override override + #if (MYSQL_VERSION_ID >= 50514 && MYSQL_VERSION_ID < 50600) # define MRN_HANDLER_HAVE_FINAL_ADD_INDEX 1 @@ -455,10 +452,10 @@ public: int update_row(const uchar *old_data, const uchar *new_data) mrn_override; int delete_row(const uchar *buf) mrn_override; - uint max_supported_record_length() const mrn_override; - uint max_supported_keys() const mrn_override; - uint max_supported_key_parts() const mrn_override; - uint max_supported_key_length() const mrn_override; + uint max_supported_record_length() const mrn_override; + uint max_supported_keys() const mrn_override; + uint max_supported_key_parts() const mrn_override; + uint max_supported_key_length() const mrn_override; uint max_supported_key_part_length() const mrn_override; ha_rows records_in_range(uint inx, const key_range *min_key, diff --git a/storage/mroonga/vendor/groonga/lib/dat/dat.hpp b/storage/mroonga/vendor/groonga/lib/dat/dat.hpp index b6e2893ad07..b1ae507542d 100644 --- a/storage/mroonga/vendor/groonga/lib/dat/dat.hpp +++ b/storage/mroonga/vendor/groonga/lib/dat/dat.hpp @@ -185,7 +185,7 @@ class Exception : public std::exception { virtual int line() const throw() { return line_; } - virtual const char *what() const throw() { + const char *what() const throw() override { return what_; } @@ -206,7 +206,7 @@ class Error : public Exception { : Exception(ex) {} virtual ~Error() throw() = default; - virtual ErrorCode code() const throw() { + ErrorCode code() const throw() override { return T; } }; diff --git a/storage/mroonga/vendor/groonga/lib/dat/id-cursor.hpp b/storage/mroonga/vendor/groonga/lib/dat/id-cursor.hpp index 60953faeb2f..63741e6bf20 100644 --- a/storage/mroonga/vendor/groonga/lib/dat/id-cursor.hpp +++ b/storage/mroonga/vendor/groonga/lib/dat/id-cursor.hpp @@ -44,17 +44,17 @@ class GRN_DAT_API IdCursor : public Cursor { UInt32 limit = MAX_UINT32, UInt32 flags = 0); - void close(); + void close() override; - const Key &next(); + const Key &next() override; - UInt32 offset() const { + UInt32 offset() const override { return offset_; } - UInt32 limit() const { + UInt32 limit() const override { return limit_; } - UInt32 flags() const { + UInt32 flags() const override { return flags_; } diff --git a/storage/mroonga/vendor/groonga/lib/dat/key-cursor.hpp b/storage/mroonga/vendor/groonga/lib/dat/key-cursor.hpp index 56392b63c23..978724fce80 100644 --- a/storage/mroonga/vendor/groonga/lib/dat/key-cursor.hpp +++ b/storage/mroonga/vendor/groonga/lib/dat/key-cursor.hpp @@ -38,17 +38,17 @@ class GRN_DAT_API KeyCursor : public Cursor { UInt32 limit = MAX_UINT32, UInt32 flags = 0); - void close(); + void close() override; - const Key &next(); + const Key &next() override; - UInt32 offset() const { + UInt32 offset() const override { return offset_; } - UInt32 limit() const { + UInt32 limit() const override { return limit_; } - UInt32 flags() const { + UInt32 flags() const override { return flags_; } diff --git a/storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.hpp b/storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.hpp index 88a950b8bba..93c151242f0 100644 --- a/storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.hpp +++ b/storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.hpp @@ -37,17 +37,17 @@ class GRN_DAT_API PredictiveCursor : public Cursor { UInt32 limit = MAX_UINT32, UInt32 flags = 0); - void close(); + void close() override; - const Key &next(); + const Key &next() override; - UInt32 offset() const { + UInt32 offset() const override { return offset_; } - UInt32 limit() const { + UInt32 limit() const override { return limit_; } - UInt32 flags() const { + UInt32 flags() const override { return flags_; } diff --git a/storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.hpp b/storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.hpp index 07a59186b37..8f6e04bd94b 100644 --- a/storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.hpp +++ b/storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.hpp @@ -38,17 +38,17 @@ class GRN_DAT_API PrefixCursor : public Cursor { UInt32 limit = MAX_UINT32, UInt32 flags = 0); - void close(); + void close() override; - const Key &next(); + const Key &next() override; - UInt32 offset() const { + UInt32 offset() const override { return offset_; } - UInt32 limit() const { + UInt32 limit() const override { return limit_; } - UInt32 flags() const { + UInt32 flags() const override { return flags_; } diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index e0121dbeb51..46202468475 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -54,101 +54,101 @@ class ha_myisam final : public handler public: ha_myisam(handlerton *hton, TABLE_SHARE *table_arg); ~ha_myisam() = default; - handler *clone(const char *name, MEM_ROOT *mem_root); - const char *index_type(uint key_number); - ulonglong table_flags() const { return int_table_flags; } - int index_init(uint idx, bool sorted); - int index_end(); - int rnd_end(); + handler *clone(const char *name, MEM_ROOT *mem_root) override; + const char *index_type(uint key_number) override; + ulonglong table_flags() const override { return int_table_flags; } + int index_init(uint idx, bool sorted) override; + int index_end() override; + int rnd_end() override; - ulong index_flags(uint inx, uint part, bool all_parts) const; - uint max_supported_keys() const { return MI_MAX_KEY; } - uint max_supported_key_parts() const { return HA_MAX_KEY_SEG; } - uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } - void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); - int open(const char *name, int mode, uint test_if_locked); - int close(void); - int write_row(const uchar * buf); - int update_row(const uchar * old_data, const uchar * new_data); - int delete_row(const uchar * buf); + ulong index_flags(uint inx, uint part, bool all_parts) const override; + uint max_supported_keys() const override { return MI_MAX_KEY; } + uint max_supported_key_parts() const override { return HA_MAX_KEY_SEG; } + uint max_supported_key_length() const override { return HA_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const override { return HA_MAX_KEY_LENGTH; } + void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override; + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; + int write_row(const uchar * buf) override; + int update_row(const uchar * old_data, const uchar * new_data) override; + int delete_row(const uchar * buf) override; int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, - enum ha_rkey_function find_flag); + enum ha_rkey_function find_flag) override; int index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_next(uchar * buf); - int index_prev(uchar * buf); - int index_first(uchar * buf); - int index_last(uchar * buf); - int index_next_same(uchar *buf, const uchar *key, uint keylen); - int ft_init() + enum ha_rkey_function find_flag) override; + int index_next(uchar * buf) override; + int index_prev(uchar * buf) override; + int index_first(uchar * buf) override; + int index_last(uchar * buf) override; + int index_next_same(uchar *buf, const uchar *key, uint keylen) override; + int ft_init() override { if (!ft_handler) return 1; ft_handler->please->reinit_search(ft_handler); return 0; } - FT_INFO *ft_init_ext(uint flags, uint inx,String *key) + FT_INFO *ft_init_ext(uint flags, uint inx,String *key) override { return ft_init_search(flags,file,inx, (uchar *)key->ptr(), key->length(), key->charset(), table->record[0]); } - int ft_read(uchar *buf); - int rnd_init(bool scan); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); - int remember_rnd_pos(); - int restart_rnd_next(uchar *buf); - void position(const uchar *record); - int info(uint); - int extra(enum ha_extra_function operation); - int extra_opt(enum ha_extra_function operation, ulong cache_size); - int reset(void); - int external_lock(THD *thd, int lock_type); - int delete_all_rows(void); - int reset_auto_increment(ulonglong value); - int disable_indexes(key_map map, bool persist); - int enable_indexes(key_map map, bool persist); - int indexes_are_disabled(void); - void start_bulk_insert(ha_rows rows, uint flags); - int end_bulk_insert(); + int ft_read(uchar *buf) override; + int rnd_init(bool scan) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; + int remember_rnd_pos() override; + int restart_rnd_next(uchar *buf) override; + void position(const uchar *record) override; + int info(uint) override; + int extra(enum ha_extra_function operation) override; + int extra_opt(enum ha_extra_function operation, ulong cache_size) override; + int reset(void) override; + int external_lock(THD *thd, int lock_type) override; + int delete_all_rows(void) override; + int reset_auto_increment(ulonglong value) override; + int disable_indexes(key_map map, bool persist) override; + int enable_indexes(key_map map, bool persist) override; + int indexes_are_disabled(void) override; + void start_bulk_insert(ha_rows rows, uint flags) override; + int end_bulk_insert() override; ha_rows records_in_range(uint inx, const key_range *min_key, - const key_range *max_key, page_range *pages); - void update_create_info(HA_CREATE_INFO *create_info); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + const key_range *max_key, page_range *pages) override; + void update_create_info(HA_CREATE_INFO *create_info) override; + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); - virtual void get_auto_increment(ulonglong offset, ulonglong increment, - ulonglong nb_desired_values, - ulonglong *first_value, - ulonglong *nb_reserved_values); - int rename_table(const char * from, const char * to); - int delete_table(const char *name); - int check_for_upgrade(HA_CHECK_OPT *check_opt); - int check(THD* thd, HA_CHECK_OPT* check_opt); - int analyze(THD* thd,HA_CHECK_OPT* check_opt); - int repair(THD* thd, HA_CHECK_OPT* check_opt); - bool check_and_repair(THD *thd); - bool is_crashed() const; - bool auto_repair(int error) const + enum thr_lock_type lock_type) override; + void get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) override; + int rename_table(const char * from, const char * to) override; + int delete_table(const char *name) override; + int check_for_upgrade(HA_CHECK_OPT *check_opt) override; + int check(THD* thd, HA_CHECK_OPT* check_opt) override; + int analyze(THD* thd,HA_CHECK_OPT* check_opt) override; + int repair(THD* thd, HA_CHECK_OPT* check_opt) override; + bool check_and_repair(THD *thd) override; + bool is_crashed() const override; + bool auto_repair(int error) const override { return (myisam_recover_options != HA_RECOVER_OFF && error == HA_ERR_CRASHED_ON_USAGE); } - int optimize(THD* thd, HA_CHECK_OPT* check_opt); - int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); - int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); + int optimize(THD* thd, HA_CHECK_OPT* check_opt) override; + int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) override; + int preload_keys(THD* thd, HA_CHECK_OPT* check_opt) override; enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *new_table, - Alter_inplace_info *alter_info); - bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); + Alter_inplace_info *alter_info) override; + bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override; #ifdef HAVE_QUERY_CACHE my_bool register_query_cache_table(THD *thd, const char *table_key, uint key_length, qc_engine_callback *engine_callback, - ulonglong *engine_data); + ulonglong *engine_data) override; #endif MI_INFO *file_ptr(void) { @@ -159,20 +159,20 @@ public: * Multi Range Read interface */ int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, - uint n_ranges, uint mode, HANDLER_BUFFER *buf); - int multi_range_read_next(range_id_t *range_info); + uint n_ranges, uint mode, HANDLER_BUFFER *buf) override; + int multi_range_read_next(range_id_t *range_info) override; ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, - uint *flags, Cost_estimate *cost); + uint *flags, Cost_estimate *cost) override; ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, uint key_parts, uint *bufsz, - uint *flags, Cost_estimate *cost); - int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size); + uint *flags, Cost_estimate *cost) override; + int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) override; /* Index condition pushdown implementation */ - Item *idx_cond_push(uint keyno, Item* idx_cond); - bool rowid_filter_push(Rowid_filter* rowid_filter); + Item *idx_cond_push(uint keyno, Item* idx_cond) override; + bool rowid_filter_push(Rowid_filter* rowid_filter) override; private: DsMrr_impl ds_mrr; diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 9964add9201..260a237cecd 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -82,8 +82,8 @@ public: ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg); ~ha_myisammrg(); - const char *index_type(uint key_number); - ulonglong table_flags() const + const char *index_type(uint key_number) override; + ulonglong table_flags() const override { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | @@ -93,70 +93,70 @@ public: HA_NO_COPY_ON_ALTER | HA_DUPLICATE_POS | HA_CAN_MULTISTEP_MERGE); } - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_READ_ORDER | HA_KEYREAD_ONLY); } - uint max_supported_keys() const { return MI_MAX_KEY; } - uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } - double scan_time() + uint max_supported_keys() const override { return MI_MAX_KEY; } + uint max_supported_key_length() const override{ return HA_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const override { return HA_MAX_KEY_LENGTH; } + double scan_time() override { return ulonglong2double(stats.data_file_length) / IO_SIZE + file->tables; } - int open(const char *name, int mode, uint test_if_locked); + int open(const char *name, int mode, uint test_if_locked) override; int add_children_list(void); int attach_children(void); int detach_children(void); - virtual handler *clone(const char *name, MEM_ROOT *mem_root); - int close(void); - int write_row(const uchar * buf); - int update_row(const uchar * old_data, const uchar * new_data); - int delete_row(const uchar * buf); + handler *clone(const char *name, MEM_ROOT *mem_root) override; + int close(void) override; + int write_row(const uchar * buf) override; + int update_row(const uchar * old_data, const uchar * new_data) override; + int delete_row(const uchar * buf) override; int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, - enum ha_rkey_function find_flag); + enum ha_rkey_function find_flag) override; int index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map); - int index_next(uchar * buf); - int index_prev(uchar * buf); - int index_first(uchar * buf); - int index_last(uchar * buf); - int index_next_same(uchar *buf, const uchar *key, uint keylen); - int rnd_init(bool scan); - int rnd_next(uchar *buf); - int rnd_pos(uchar * buf, uchar *pos); - void position(const uchar *record); + enum ha_rkey_function find_flag) override; + int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map) override; + int index_next(uchar * buf) override; + int index_prev(uchar * buf) override; + int index_first(uchar * buf) override; + int index_last(uchar * buf) override; + int index_next_same(uchar *buf, const uchar *key, uint keylen) override; + int rnd_init(bool scan) override; + int rnd_next(uchar *buf) override; + int rnd_pos(uchar * buf, uchar *pos) override; + void position(const uchar *record) override; ha_rows records_in_range(uint inx, const key_range *start_key, - const key_range *end_key, page_range *pages); - int delete_all_rows(); - int info(uint); - int reset(void); - int extra(enum ha_extra_function operation); - int extra_opt(enum ha_extra_function operation, ulong cache_size); - int external_lock(THD *thd, int lock_type); - uint lock_count(void) const; + const key_range *end_key, page_range *pages) override; + int delete_all_rows() override; + int info(uint) override; + int reset(void) override; + int extra(enum ha_extra_function operation) override; + int extra_opt(enum ha_extra_function operation, ulong cache_size) override; + int external_lock(THD *thd, int lock_type) override; + uint lock_count(void) const override; int create_mrg(const char *name, HA_CREATE_INFO *create_info); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); - void update_create_info(HA_CREATE_INFO *create_info); - void append_create_info(String *packet); + enum thr_lock_type lock_type) override; + void update_create_info(HA_CREATE_INFO *create_info) override; + void append_create_info(String *packet) override; MYRG_INFO *myrg_info() { return file; } TABLE *table_ptr() { return table; } enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *, - Alter_inplace_info *); + Alter_inplace_info *) override; bool inplace_alter_table(TABLE *altered_table, - Alter_inplace_info *ha_alter_info); - int check(THD* thd, HA_CHECK_OPT* check_opt); - ha_rows records(); - virtual uint count_query_cache_dependant_tables(uint8 *tables_type); - virtual my_bool + Alter_inplace_info *ha_alter_info) override; + int check(THD* thd, HA_CHECK_OPT* check_opt) override; + ha_rows records() override; + uint count_query_cache_dependant_tables(uint8 *tables_type) override; + my_bool register_query_cache_dependant_tables(THD *thd, Query_cache *cache, Query_cache_block_table **block, - uint *n); - virtual void set_lock_type(enum thr_lock_type lock); + uint *n) override; + void set_lock_type(enum thr_lock_type lock) override; }; diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h index 44175ceb3a2..61e9f9afd31 100644 --- a/storage/perfschema/cursor_by_account.h +++ b/storage/perfschema/cursor_by_account.h @@ -43,9 +43,9 @@ class cursor_by_account : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: cursor_by_account(const PFS_engine_table_share *share); diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h index c8a83a47ec6..a9e2005148f 100644 --- a/storage/perfschema/cursor_by_host.h +++ b/storage/perfschema/cursor_by_host.h @@ -43,9 +43,9 @@ class cursor_by_host : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: cursor_by_host(const PFS_engine_table_share *share); diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h index 50e162294cf..c1e647fba8c 100644 --- a/storage/perfschema/cursor_by_thread.h +++ b/storage/perfschema/cursor_by_thread.h @@ -43,9 +43,9 @@ class cursor_by_thread : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: cursor_by_thread(const PFS_engine_table_share *share); diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h index 4f48b40c870..fffa89c7e81 100644 --- a/storage/perfschema/cursor_by_thread_connect_attr.h +++ b/storage/perfschema/cursor_by_thread_connect_attr.h @@ -62,9 +62,9 @@ class cursor_by_thread_connect_attr : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: cursor_by_thread_connect_attr(const PFS_engine_table_share *share); diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h index 6438515cf1e..d45507a2b50 100644 --- a/storage/perfschema/cursor_by_user.h +++ b/storage/perfschema/cursor_by_user.h @@ -43,9 +43,9 @@ class cursor_by_user : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: cursor_by_user(const PFS_engine_table_share *share); diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index d8ef9e0085d..a78802c546e 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -53,10 +53,10 @@ public: ~ha_perfschema(); - const char *index_type(uint) { return ""; } + const char *index_type(uint) override { return ""; } /** Capabilities of the performance schema tables. */ - ulonglong table_flags(void) const + ulonglong table_flags(void) const override { /* About HA_FAST_KEY_READ: @@ -86,25 +86,25 @@ public: Operations supported by indexes. None, there are no indexes. */ - ulong index_flags(uint , uint , bool ) const + ulong index_flags(uint , uint , bool ) const override { return 0; } - uint max_supported_record_length(void) const + uint max_supported_record_length(void) const override { return HA_MAX_REC_LENGTH; } - uint max_supported_keys(void) const + uint max_supported_keys(void) const override { return 0; } - uint max_supported_key_parts(void) const + uint max_supported_key_parts(void) const override { return 0; } - uint max_supported_key_length(void) const + uint max_supported_key_length(void) const override { return 0; } - ha_rows estimate_rows_upper_bound(void) + ha_rows estimate_rows_upper_bound(void) override { return HA_POS_ERROR; } - double scan_time(void) + double scan_time(void) override { return 1.0; } /** @@ -114,22 +114,22 @@ public: @param test_if_locked unused @return 0 on success */ - int open(const char *name, int mode, uint test_if_locked); + int open(const char *name, int mode, uint test_if_locked) override; /** Close a table handle. @sa open. */ - int close(void); + int close(void) override; /** Write a row. @param buf the row to write @return 0 on success */ - int write_row(const uchar *buf); + int write_row(const uchar *buf) override; - void use_hidden_primary_key(); + void use_hidden_primary_key() override; /** Update a row. @@ -137,29 +137,29 @@ public: @param new_data the row new values @return 0 on success */ - int update_row(const uchar *old_data, const uchar *new_data); + int update_row(const uchar *old_data, const uchar *new_data) override; /** Delete a row. @param buf the row to delete @return 0 on success */ - int delete_row(const uchar *buf); + int delete_row(const uchar *buf) override; - int rnd_init(bool scan); + int rnd_init(bool scan) override; /** Scan end. @sa rnd_init. */ - int rnd_end(void); + int rnd_end(void) override; /** Iterator, fetch the next row. @param[out] buf the row fetched. @return 0 on success */ - int rnd_next(uchar *buf); + int rnd_next(uchar *buf) override; /** Iterator, fetch the row at a given position. @@ -167,42 +167,42 @@ public: @param pos the row position @return 0 on success */ - int rnd_pos(uchar *buf, uchar *pos); + int rnd_pos(uchar *buf, uchar *pos) override; /** Read the row current position. @param record the current row */ - void position(const uchar *record); + void position(const uchar *record) override; - int info(uint); + int info(uint) override; - int delete_all_rows(void); + int delete_all_rows(void) override; - int truncate(); + int truncate() override; - int delete_table(const char *from); + int delete_table(const char *from) override; - int rename_table(const char * from, const char * to); + int rename_table(const char * from, const char * to) override; int create(const char *name, TABLE *form, - HA_CREATE_INFO *create_info); + HA_CREATE_INFO *create_info) override; THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); + enum thr_lock_type lock_type) override; - virtual uint8 table_cache_type(void) + uint8 table_cache_type(void) override { return HA_CACHE_TBL_NOCACHE; } - virtual my_bool register_query_cache_table + my_bool register_query_cache_table (THD *, const char *, uint , qc_engine_callback *engine_callback, - ulonglong *) + ulonglong *) override { *engine_callback= 0; return FALSE; } - virtual void print_error(int error, myf errflags); + void print_error(int error, myf errflags) override; private: /** diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc index ecf26cd77ea..84257d9dc38 100644 --- a/storage/perfschema/pfs_account.cc +++ b/storage/perfschema/pfs_account.cc @@ -666,7 +666,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_account *pfs) + void operator()(PFS_account *pfs) override { PFS_user *user= sanitize_user(pfs->m_user); PFS_host *host= sanitize_host(pfs->m_host); @@ -699,7 +699,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_account *pfs) + void operator()(PFS_account *pfs) override { if (pfs->m_username_length > 0 && pfs->m_hostname_length > 0) { diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 76095b5311b..b46eed0b531 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -343,13 +343,13 @@ static PFS_engine_table_share *all_shares[]= class PFS_silent_check_intact : public Table_check_intact { protected: - virtual void report_error(uint code, const char *fmt, ...) {} + void report_error(uint code, const char *fmt, ...) override {} public: PFS_silent_check_intact() {} - ~PFS_silent_check_intact() + ~PFS_silent_check_intact() override {} }; @@ -672,12 +672,12 @@ class PFS_internal_schema_access : public ACL_internal_schema_access public: PFS_internal_schema_access() = default; - ~PFS_internal_schema_access() = default; + ~PFS_internal_schema_access() override = default; ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + privilege_t *save_priv) const override; - const ACL_internal_table_access *lookup(const char *name) const; + const ACL_internal_table_access *lookup(const char *name) const override; }; ACL_internal_access_result diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h index 02ef9b07010..0bf8e58c081 100644 --- a/storage/perfschema/pfs_engine_table.h +++ b/storage/perfschema/pfs_engine_table.h @@ -340,8 +340,8 @@ public: ~PFS_readonly_acl() = default; - virtual ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + ACL_internal_access_result check(privilege_t want_access, + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_readonly_acl. */ @@ -358,8 +358,8 @@ public: ~PFS_truncatable_acl() = default; - virtual ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + ACL_internal_access_result check(privilege_t want_access, + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_truncatable_acl. */ @@ -377,7 +377,7 @@ public: ~PFS_updatable_acl() = default; ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_updatable_acl. */ @@ -395,7 +395,7 @@ public: ~PFS_editable_acl() = default; ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_editable_acl. */ @@ -412,7 +412,7 @@ public: ~PFS_unknown_acl() = default; ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_unknown_acl. */ @@ -430,7 +430,7 @@ public: ~PFS_readonly_world_acl() {} - virtual ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv) const; + ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv) const override; }; @@ -449,7 +449,7 @@ public: ~PFS_truncatable_world_acl() {} - virtual ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv) const; + ACL_internal_access_result check(privilege_t want_access, privilege_t *save_priv) const override; }; @@ -468,8 +468,8 @@ class PFS_readonly_processlist_acl : public PFS_readonly_acl { ~PFS_readonly_processlist_acl() {} - virtual ACL_internal_access_result check(privilege_t want_access, - privilege_t *save_priv) const; + ACL_internal_access_result check(privilege_t want_access, + privilege_t *save_priv) const override; }; /** Singleton instance of PFS_readonly_processlist_acl */ diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc index d54725fe9a8..42c0620a39f 100644 --- a/storage/perfschema/pfs_host.cc +++ b/storage/perfschema/pfs_host.cc @@ -350,7 +350,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_host *pfs) + void operator()(PFS_host *pfs) override { pfs->aggregate(true); if (pfs->get_refcount() == 0) diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index fa85d8610bf..56573d3dffd 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -2022,7 +2022,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_table_share *pfs) + void operator()(PFS_table_share *pfs) override { pfs->refresh_setup_object_flags(m_thread); } @@ -2045,7 +2045,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_program *pfs) + void operator()(PFS_program *pfs) override { pfs->refresh_setup_object_flags(m_thread); } diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc index efe19b3c8b3..c2b53bf2d1e 100644 --- a/storage/perfschema/pfs_setup_actor.cc +++ b/storage/perfschema/pfs_setup_actor.cc @@ -231,7 +231,7 @@ public: : m_pins(pins) {} - virtual void operator()(PFS_setup_actor *pfs) + void operator()(PFS_setup_actor *pfs) override { lf_hash_delete(&setup_actor_hash, m_pins, pfs->m_key.m_hash_key, pfs->m_key.m_key_length); diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index 78617d1b2c6..b18bc2fd5ba 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -231,7 +231,7 @@ public: : m_pins(pins) {} - virtual void operator()(PFS_setup_object *pfs) + void operator()(PFS_setup_object *pfs) override { lf_hash_delete(&setup_object_hash, m_pins, pfs->m_key.m_hash_key, pfs->m_key.m_key_length); diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc index 1f299d9b9b6..fa39b330f75 100644 --- a/storage/perfschema/pfs_user.cc +++ b/storage/perfschema/pfs_user.cc @@ -314,7 +314,7 @@ public: : m_thread(thread) {} - virtual void operator()(PFS_user *pfs) + void operator()(PFS_user *pfs) override { pfs->aggregate(true); if (pfs->get_refcount() == 0) diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h index 7dc248269b3..03004f82da3 100644 --- a/storage/perfschema/pfs_variable.h +++ b/storage/perfschema/pfs_variable.h @@ -205,7 +205,7 @@ public: Find_THD_variable() : m_unsafe_thd(NULL) {} Find_THD_variable(THD *unsafe_thd) : m_unsafe_thd(unsafe_thd) {} - virtual bool operator()(THD *thd) + bool operator()(THD *thd) override { //TODO: filter bg threads? if (thd != m_unsafe_thd) @@ -612,18 +612,18 @@ public: private: /* Build SHOW_var array. */ bool init_show_var_array(enum_var_type scope, bool strict); - bool do_initialize_session(void); + bool do_initialize_session(void) override; /* Global */ - int do_materialize_global(void); + int do_materialize_global(void) override; /* Global and Session - THD */ - int do_materialize_all(THD* thd); + int do_materialize_all(THD* thd) override; /* Session - THD */ - int do_materialize_session(THD* thd); + int do_materialize_session(THD* thd) override; /* Session - PFS_thread */ - int do_materialize_session(PFS_thread *thread); + int do_materialize_session(PFS_thread *thread) override; /* Single variable - PFS_thread */ - int do_materialize_session(PFS_thread *pfs_thread, uint index); + int do_materialize_session(PFS_thread *pfs_thread, uint index) override; /* Temporary mem_root to use for materialization. */ MEM_ROOT m_mem_sysvar; @@ -664,14 +664,14 @@ protected: bool m_show_command; private: - bool do_initialize_session(void); + bool do_initialize_session(void) override; - int do_materialize_global(void); + int do_materialize_global(void) override; /* Global and Session - THD */ - int do_materialize_all(THD* thd); - int do_materialize_session(THD *thd); - int do_materialize_session(PFS_thread *thread); - int do_materialize_session(PFS_thread *thread, uint index) { return 0; } + int do_materialize_all(THD* thd) override; + int do_materialize_session(THD *thd) override; + int do_materialize_session(PFS_thread *thread) override; + int do_materialize_session(PFS_thread *thread, uint index) override { return 0; } int do_materialize_client(PFS_client *pfs_client); /* Callback to sum user, host or account status variables. */ diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc index 7e3027ac9a6..be22795df24 100644 --- a/storage/perfschema/pfs_visitor.cc +++ b/storage/perfschema/pfs_visitor.cc @@ -49,7 +49,7 @@ public: : m_visitor(visitor) {} - virtual void operator()(THD *thd) + void operator()(THD *thd) override { m_visitor->visit_THD(thd); } @@ -132,7 +132,7 @@ public: : m_visitor(visitor), m_host(host) {} - virtual void operator()(THD *thd) + void operator()(THD *thd) override { PSI_thread *psi= thd->get_psi(); PFS_thread *pfs= reinterpret_cast(psi); @@ -221,7 +221,7 @@ public: : m_visitor(visitor), m_user(user) {} - virtual void operator()(THD *thd) + void operator()(THD *thd) override { PSI_thread *psi= thd->get_psi(); PFS_thread *pfs= reinterpret_cast(psi); @@ -310,7 +310,7 @@ public: : m_visitor(visitor), m_account(account) {} - virtual void operator()(THD *thd) + void operator()(THD *thd) override { PSI_thread *psi= thd->get_psi(); PFS_thread *pfs= reinterpret_cast(psi); @@ -752,7 +752,7 @@ public: : m_visitor(visitor) {} - virtual void operator()(PFS_table_share *pfs) + void operator()(PFS_table_share *pfs) override { if (pfs->m_enabled) { @@ -772,7 +772,7 @@ public: : m_visitor(visitor) {} - virtual void operator()(PFS_table *pfs) + void operator()(PFS_table *pfs) override { PFS_table_share *safe_share= sanitize_table_share(pfs->m_share); if (safe_share != NULL) @@ -811,7 +811,7 @@ public: : m_visitor(visitor), m_share(share) {} - virtual void operator()(PFS_table *pfs) + void operator()(PFS_table *pfs) override { if (pfs->m_share == m_share) { @@ -852,7 +852,7 @@ public: : m_visitor(visitor), m_share(share), m_index(index) {} - virtual void operator()(PFS_table *pfs) + void operator()(PFS_table *pfs) override { if (pfs->m_share == m_share) { diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h index 03684ba9ca6..9de6c4217c6 100644 --- a/storage/perfschema/pfs_visitor.h +++ b/storage/perfschema/pfs_visitor.h @@ -314,11 +314,11 @@ public: /** Constructor. */ PFS_connection_wait_visitor(PFS_instr_class *klass); virtual ~PFS_connection_wait_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** EVENT_NAME instrument index. */ uint m_index; @@ -336,11 +336,11 @@ public: /** Constructor. */ PFS_connection_all_wait_visitor(); virtual ~PFS_connection_all_wait_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** Wait statistic collected. */ PFS_single_stat m_stat; @@ -359,11 +359,11 @@ public: /** Constructor. */ PFS_connection_stage_visitor(PFS_stage_class *klass); virtual ~PFS_connection_stage_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** EVENT_NAME instrument index. */ uint m_index; @@ -381,11 +381,11 @@ public: /** Constructor. */ PFS_connection_statement_visitor(PFS_statement_class *klass); virtual ~PFS_connection_statement_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** EVENT_NAME instrument index. */ uint m_index; @@ -403,11 +403,11 @@ public: /** Constructor. */ PFS_connection_all_statement_visitor(); virtual ~PFS_connection_all_statement_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** Statement statistic collected. */ PFS_statement_stat m_stat; @@ -426,11 +426,11 @@ public: /** Constructor. */ PFS_connection_transaction_visitor(PFS_transaction_class *klass); virtual ~PFS_connection_transaction_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** EVENT_NAME instrument index. */ uint m_index; @@ -450,11 +450,11 @@ public: /** Constructor. */ PFS_connection_all_transaction_visitor(); virtual ~PFS_connection_all_transaction_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** Statement statistic collected. */ PFS_transaction_stat m_stat; @@ -474,11 +474,11 @@ public: /** Constructor. */ PFS_connection_stat_visitor(); virtual ~PFS_connection_stat_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** Connection statistic collected. */ PFS_connection_stat m_stat; @@ -494,11 +494,11 @@ public: /** Constructor. */ PFS_connection_memory_visitor(PFS_memory_class *klass); virtual ~PFS_connection_memory_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; /** EVENT_NAME instrument index. */ uint m_index; @@ -516,12 +516,12 @@ public: /** Constructor. */ PFS_connection_status_visitor(STATUS_VAR *status_vars); virtual ~PFS_connection_status_visitor(); - virtual void visit_global(); - virtual void visit_host(PFS_host *pfs); - virtual void visit_account(PFS_account *pfs); - virtual void visit_user(PFS_user *pfs); - virtual void visit_thread(PFS_thread *pfs); - virtual void visit_THD(THD *thd); + void visit_global() override; + void visit_host(PFS_host *pfs) override; + void visit_account(PFS_account *pfs) override; + void visit_user(PFS_user *pfs) override; + void visit_thread(PFS_thread *pfs) override; + void visit_THD(THD *thd) override; private: STATUS_VAR *m_status_vars; @@ -536,16 +536,16 @@ class PFS_instance_wait_visitor : public PFS_instance_visitor public: PFS_instance_wait_visitor(); virtual ~PFS_instance_wait_visitor(); - virtual void visit_mutex_class(PFS_mutex_class *pfs); - virtual void visit_rwlock_class(PFS_rwlock_class *pfs); - virtual void visit_cond_class(PFS_cond_class *pfs); - virtual void visit_file_class(PFS_file_class *pfs); - virtual void visit_socket_class(PFS_socket_class *pfs); - virtual void visit_mutex(PFS_mutex *pfs); - virtual void visit_rwlock(PFS_rwlock *pfs); - virtual void visit_cond(PFS_cond *pfs); - virtual void visit_file(PFS_file *pfs); - virtual void visit_socket(PFS_socket *pfs); + void visit_mutex_class(PFS_mutex_class *pfs) override; + void visit_rwlock_class(PFS_rwlock_class *pfs) override; + void visit_cond_class(PFS_cond_class *pfs) override; + void visit_file_class(PFS_file_class *pfs) override; + void visit_socket_class(PFS_socket_class *pfs) override; + void visit_mutex(PFS_mutex *pfs) override; + void visit_rwlock(PFS_rwlock *pfs) override; + void visit_cond(PFS_cond *pfs) override; + void visit_file(PFS_file *pfs) override; + void visit_socket(PFS_socket *pfs) override; /** Wait statistic collected. */ PFS_single_stat m_stat; @@ -560,9 +560,9 @@ class PFS_object_wait_visitor : public PFS_object_visitor public: PFS_object_wait_visitor(); virtual ~PFS_object_wait_visitor(); - virtual void visit_global(); - virtual void visit_table_share(PFS_table_share *pfs); - virtual void visit_table(PFS_table *pfs); + void visit_global() override; + void visit_table_share(PFS_table_share *pfs) override; + void visit_table(PFS_table *pfs) override; /** Object wait statistic collected. */ PFS_single_stat m_stat; @@ -577,9 +577,9 @@ class PFS_table_io_wait_visitor : public PFS_object_visitor public: PFS_table_io_wait_visitor(); virtual ~PFS_table_io_wait_visitor(); - virtual void visit_global(); - virtual void visit_table_share(PFS_table_share *pfs); - virtual void visit_table(PFS_table *pfs); + void visit_global() override; + void visit_table_share(PFS_table_share *pfs) override; + void visit_table(PFS_table *pfs) override; /** Table io wait statistic collected. */ PFS_single_stat m_stat; @@ -594,8 +594,8 @@ class PFS_table_io_stat_visitor : public PFS_object_visitor public: PFS_table_io_stat_visitor(); virtual ~PFS_table_io_stat_visitor(); - virtual void visit_table_share(PFS_table_share *pfs); - virtual void visit_table(PFS_table *pfs); + void visit_table_share(PFS_table_share *pfs) override; + void visit_table(PFS_table *pfs) override; /** Table io statistic collected. */ PFS_table_io_stat m_stat; @@ -610,8 +610,8 @@ class PFS_index_io_stat_visitor : public PFS_object_visitor public: PFS_index_io_stat_visitor(); virtual ~PFS_index_io_stat_visitor(); - virtual void visit_table_share_index(PFS_table_share *pfs, uint index); - virtual void visit_table_index(PFS_table *pfs, uint index); + void visit_table_share_index(PFS_table_share *pfs, uint index) override; + void visit_table_index(PFS_table *pfs, uint index) override; /** Index io statistic collected. */ PFS_table_io_stat m_stat; @@ -626,9 +626,9 @@ class PFS_table_lock_wait_visitor : public PFS_object_visitor public: PFS_table_lock_wait_visitor(); virtual ~PFS_table_lock_wait_visitor(); - virtual void visit_global(); - virtual void visit_table_share(PFS_table_share *pfs); - virtual void visit_table(PFS_table *pfs); + void visit_global() override; + void visit_table_share(PFS_table_share *pfs) override; + void visit_table(PFS_table *pfs) override; /** Table lock wait statistic collected. */ PFS_single_stat m_stat; @@ -643,8 +643,8 @@ class PFS_table_lock_stat_visitor : public PFS_object_visitor public: PFS_table_lock_stat_visitor(); virtual ~PFS_table_lock_stat_visitor(); - virtual void visit_table_share(PFS_table_share *pfs); - virtual void visit_table(PFS_table *pfs); + void visit_table_share(PFS_table_share *pfs) override; + void visit_table(PFS_table *pfs) override; /** Table lock statistic collected. */ PFS_table_lock_stat m_stat; @@ -659,8 +659,8 @@ class PFS_instance_socket_io_stat_visitor : public PFS_instance_visitor public: PFS_instance_socket_io_stat_visitor(); virtual ~PFS_instance_socket_io_stat_visitor(); - virtual void visit_socket_class(PFS_socket_class *pfs); - virtual void visit_socket(PFS_socket *pfs); + void visit_socket_class(PFS_socket_class *pfs) override; + void visit_socket(PFS_socket *pfs) override; /** Wait and byte count statistics collected. */ PFS_socket_io_stat m_socket_io_stat; @@ -675,8 +675,8 @@ class PFS_instance_file_io_stat_visitor : public PFS_instance_visitor public: PFS_instance_file_io_stat_visitor(); virtual ~PFS_instance_file_io_stat_visitor(); - virtual void visit_file_class(PFS_file_class *pfs); - virtual void visit_file(PFS_file *pfs); + void visit_file_class(PFS_file_class *pfs) override; + void visit_file(PFS_file *pfs) override; /** Wait and byte count statistics collected. */ PFS_file_io_stat m_file_io_stat; diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h index 28348190e69..77d2940a411 100644 --- a/storage/perfschema/table_accounts.h +++ b/storage/perfschema/table_accounts.h @@ -57,10 +57,10 @@ public: static int delete_all_rows(); protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; protected: @@ -70,7 +70,7 @@ public: ~table_accounts() = default; private: - virtual void make_row(PFS_account *pfs); + void make_row(PFS_account *pfs) override; /** Table share lock. */ static THR_LOCK m_table_lock; diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h index d7f3fe6aa1a..803cb9b5005 100644 --- a/storage/perfschema/table_all_instr.h +++ b/storage/perfschema/table_all_instr.h @@ -76,9 +76,9 @@ class table_all_instr : public PFS_engine_table public: static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_all_instr(const PFS_engine_table_share *share); diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h index fa0c7d8ec2d..3c0e2f29413 100644 --- a/storage/perfschema/table_esgs_by_account_by_event_name.h +++ b/storage/perfschema/table_esgs_by_account_by_event_name.h @@ -91,16 +91,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esgs_by_account_by_event_name(); diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h index f71a479c8fa..0f5892fe288 100644 --- a/storage/perfschema/table_esgs_by_host_by_event_name.h +++ b/storage/perfschema/table_esgs_by_host_by_event_name.h @@ -91,16 +91,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esgs_by_host_by_event_name(); diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h index f9a52ebe189..848ace7609f 100644 --- a/storage/perfschema/table_esgs_by_thread_by_event_name.h +++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h @@ -95,16 +95,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esgs_by_thread_by_event_name(); diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h index e8b421089c8..df96dd48e8a 100644 --- a/storage/perfschema/table_esgs_by_user_by_event_name.h +++ b/storage/perfschema/table_esgs_by_user_by_event_name.h @@ -96,16 +96,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esgs_by_user_by_event_name(); diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h index bfcd70174ec..d5fe9b676e0 100644 --- a/storage/perfschema/table_esgs_global_by_event_name.h +++ b/storage/perfschema/table_esgs_global_by_event_name.h @@ -62,16 +62,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esgs_global_by_event_name(); diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h index 638cc28ed7b..e87e27d7688 100644 --- a/storage/perfschema/table_esms_by_account_by_event_name.h +++ b/storage/perfschema/table_esms_by_account_by_event_name.h @@ -91,16 +91,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_account_by_event_name(); diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h index 4711ffc56bf..ab4c7341bcb 100644 --- a/storage/perfschema/table_esms_by_digest.h +++ b/storage/perfschema/table_esms_by_digest.h @@ -65,15 +65,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_digest(); diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h index 65a7256b9cb..cb29690805d 100644 --- a/storage/perfschema/table_esms_by_host_by_event_name.h +++ b/storage/perfschema/table_esms_by_host_by_event_name.h @@ -91,16 +91,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_host_by_event_name(); diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h index f9e686efc6f..a27f2ab5432 100644 --- a/storage/perfschema/table_esms_by_program.h +++ b/storage/perfschema/table_esms_by_program.h @@ -75,15 +75,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_program(); diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h index 87a4e3c3ed4..f629e229403 100644 --- a/storage/perfschema/table_esms_by_thread_by_event_name.h +++ b/storage/perfschema/table_esms_by_thread_by_event_name.h @@ -95,16 +95,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_thread_by_event_name(); diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h index cbd388ef606..4d2d4a3fdff 100644 --- a/storage/perfschema/table_esms_by_user_by_event_name.h +++ b/storage/perfschema/table_esms_by_user_by_event_name.h @@ -91,16 +91,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_by_user_by_event_name(); diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h index 21a6b1a18b9..e63f341e759 100644 --- a/storage/perfschema/table_esms_global_by_event_name.h +++ b/storage/perfschema/table_esms_global_by_event_name.h @@ -62,16 +62,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_esms_global_by_event_name(); diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h index a5202b299e0..46734d04753 100644 --- a/storage/perfschema/table_ets_by_account_by_event_name.h +++ b/storage/perfschema/table_ets_by_account_by_event_name.h @@ -95,16 +95,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ets_by_account_by_event_name(); diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h index 00b4dbd02f8..e5e89a0f2a7 100644 --- a/storage/perfschema/table_ets_by_host_by_event_name.h +++ b/storage/perfschema/table_ets_by_host_by_event_name.h @@ -95,16 +95,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ets_by_host_by_event_name(); diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h index 1fa62f84e51..e7837d7000c 100644 --- a/storage/perfschema/table_ets_by_thread_by_event_name.h +++ b/storage/perfschema/table_ets_by_thread_by_event_name.h @@ -99,16 +99,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ets_by_thread_by_event_name(); diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h index 9bd5b859ef9..98e8d97c69c 100644 --- a/storage/perfschema/table_ets_by_user_by_event_name.h +++ b/storage/perfschema/table_ets_by_user_by_event_name.h @@ -95,16 +95,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ets_by_user_by_event_name(); diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h index d5a67f43505..14994984a30 100644 --- a/storage/perfschema/table_ets_global_by_event_name.h +++ b/storage/perfschema/table_ets_global_by_event_name.h @@ -66,16 +66,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ets_global_by_event_name(); diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h index d8b973acc8b..193fa4b40bc 100644 --- a/storage/perfschema/table_events_stages.h +++ b/storage/perfschema/table_events_stages.h @@ -100,10 +100,10 @@ struct pos_events_stages_history : public PFS_double_index class table_events_stages_common : public PFS_engine_table { protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_events_stages_common(const PFS_engine_table_share *share, void *pos); @@ -128,10 +128,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_stages_current(); @@ -163,10 +163,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_stages_history(); @@ -195,10 +195,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_stages_history_long(); diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h index 6acad7bb90d..61b5b28805d 100644 --- a/storage/perfschema/table_events_statements.h +++ b/storage/perfschema/table_events_statements.h @@ -183,10 +183,10 @@ struct pos_events_statements_history : public PFS_double_index class table_events_statements_common : public PFS_engine_table { protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_events_statements_common(const PFS_engine_table_share *share, void *pos); @@ -215,10 +215,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_statements_current(); @@ -252,10 +252,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_statements_history(); @@ -286,10 +286,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_statements_history_long(); diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h index f6024c63766..0911fd63cb7 100644 --- a/storage/perfschema/table_events_transactions.h +++ b/storage/perfschema/table_events_transactions.h @@ -127,10 +127,10 @@ struct pos_events_transactions_history : public PFS_double_index class table_events_transactions_common : public PFS_engine_table { protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_events_transactions_common(const PFS_engine_table_share *share, void *pos); @@ -156,10 +156,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_transactions_current(); @@ -198,10 +198,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_transactions_history(); @@ -231,10 +231,10 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_transactions_history_long(); diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h index 62df9ae2521..85a9b146745 100644 --- a/storage/perfschema/table_events_waits.h +++ b/storage/perfschema/table_events_waits.h @@ -139,10 +139,10 @@ struct pos_events_waits_history : public PFS_double_index class table_events_waits_common : public PFS_engine_table { protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_events_waits_common(const PFS_engine_table_share *share, void *pos); @@ -173,9 +173,9 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_waits_current(); @@ -209,9 +209,9 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: table_events_waits_history(); @@ -242,9 +242,9 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override;; protected: table_events_waits_history_long(); diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h index d84a79effc1..74f3a9ac959 100644 --- a/storage/perfschema/table_events_waits_summary.h +++ b/storage/perfschema/table_events_waits_summary.h @@ -67,16 +67,16 @@ protected: void make_instr_row(PFS_instr *pfs, PFS_instr_class *klass, const void *object_instance_begin, PFS_single_stat *pfs_stat); - virtual void make_mutex_row(PFS_mutex *pfs); - virtual void make_rwlock_row(PFS_rwlock *pfs); - virtual void make_cond_row(PFS_cond *pfs); - virtual void make_file_row(PFS_file *pfs); - virtual void make_socket_row(PFS_socket *pfs); + void make_mutex_row(PFS_mutex *pfs) override; + void make_rwlock_row(PFS_rwlock *pfs) override; + void make_cond_row(PFS_cond *pfs) override; + void make_file_row(PFS_file *pfs) override; + void make_socket_row(PFS_socket *pfs) override; - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_events_waits_summary_by_instance(); diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h index df72f25809b..b4e2df513b2 100644 --- a/storage/perfschema/table_ews_by_account_by_event_name.h +++ b/storage/perfschema/table_ews_by_account_by_event_name.h @@ -103,15 +103,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ews_by_account_by_event_name(); diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h index c88b3d77a3f..588244109be 100644 --- a/storage/perfschema/table_ews_by_host_by_event_name.h +++ b/storage/perfschema/table_ews_by_host_by_event_name.h @@ -103,15 +103,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ews_by_host_by_event_name(); diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h index 7ac6638a1cd..8dc51ddc579 100644 --- a/storage/perfschema/table_ews_by_thread_by_event_name.h +++ b/storage/perfschema/table_ews_by_thread_by_event_name.h @@ -102,15 +102,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ews_by_thread_by_event_name(); diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h index 82c7319c19a..5422d493df4 100644 --- a/storage/perfschema/table_ews_by_user_by_event_name.h +++ b/storage/perfschema/table_ews_by_user_by_event_name.h @@ -103,15 +103,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ews_by_user_by_event_name(); diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h index 84d8a742b3c..4e40923f2af 100644 --- a/storage/perfschema/table_ews_global_by_event_name.h +++ b/storage/perfschema/table_ews_global_by_event_name.h @@ -91,15 +91,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_ews_global_by_event_name(); diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h index 5b1b9016f41..1adc4896b9b 100644 --- a/storage/perfschema/table_file_instances.h +++ b/storage/perfschema/table_file_instances.h @@ -61,15 +61,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_file_instances(); diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h index 80b08773b55..0d660ffe216 100644 --- a/storage/perfschema/table_file_summary_by_event_name.h +++ b/storage/perfschema/table_file_summary_by_event_name.h @@ -62,15 +62,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_file_summary_by_event_name(); diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h index 750ba904484..09f4383394d 100644 --- a/storage/perfschema/table_file_summary_by_instance.h +++ b/storage/perfschema/table_file_summary_by_instance.h @@ -70,15 +70,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_file_summary_by_instance(); diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h index 5b5f6e60c37..16fc7c82877 100644 --- a/storage/perfschema/table_global_status.h +++ b/storage/perfschema/table_global_status.h @@ -75,16 +75,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_global_status(); public: diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h index 49083e63292..5172f215f72 100644 --- a/storage/perfschema/table_global_variables.h +++ b/storage/perfschema/table_global_variables.h @@ -74,16 +74,16 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_global_variables(); public: diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h index 59e3a973421..dc2d9916817 100644 --- a/storage/perfschema/table_host_cache.h +++ b/storage/perfschema/table_host_cache.h @@ -114,15 +114,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_host_cache(); diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h index 1f82cc5c60b..3d4dddbfa07 100644 --- a/storage/perfschema/table_hosts.h +++ b/storage/perfschema/table_hosts.h @@ -57,11 +57,11 @@ public: static int delete_all_rows(); protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); - + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; + protected: table_hosts(); @@ -70,7 +70,7 @@ public: ~table_hosts() = default; private: - virtual void make_row(PFS_host *pfs); + void make_row(PFS_host *pfs) override; /** Table share lock. */ static THR_LOCK m_table_lock; diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h index 5c9ad9b5638..62f681435f6 100644 --- a/storage/perfschema/table_md_locks.h +++ b/storage/perfschema/table_md_locks.h @@ -69,15 +69,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_metadata_locks(); diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h index e242bc40ac6..e393ba9d2f9 100644 --- a/storage/perfschema/table_mems_by_account_by_event_name.h +++ b/storage/perfschema/table_mems_by_account_by_event_name.h @@ -92,15 +92,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mems_by_account_by_event_name(); diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h index 7920b362b5e..cc1c4a0f2d9 100644 --- a/storage/perfschema/table_mems_by_host_by_event_name.h +++ b/storage/perfschema/table_mems_by_host_by_event_name.h @@ -92,15 +92,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mems_by_host_by_event_name(); diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h index 0f698990b47..ba23d790c17 100644 --- a/storage/perfschema/table_mems_by_thread_by_event_name.h +++ b/storage/perfschema/table_mems_by_thread_by_event_name.h @@ -92,15 +92,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mems_by_thread_by_event_name(); diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h index c17f5d3302b..4be0f659453 100644 --- a/storage/perfschema/table_mems_by_user_by_event_name.h +++ b/storage/perfschema/table_mems_by_user_by_event_name.h @@ -92,15 +92,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mems_by_user_by_event_name(); diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h index ae3cd0435d6..0cc426523b0 100644 --- a/storage/perfschema/table_mems_global_by_event_name.h +++ b/storage/perfschema/table_mems_global_by_event_name.h @@ -94,15 +94,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mems_global_by_event_name(); diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h index 7d0ed58ce5b..f8d407ae321 100644 --- a/storage/perfschema/table_os_global_by_type.h +++ b/storage/perfschema/table_os_global_by_type.h @@ -93,15 +93,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_os_global_by_type(); diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h index a28b4d3f2c9..b16af7c22ec 100644 --- a/storage/perfschema/table_performance_timers.h +++ b/storage/perfschema/table_performance_timers.h @@ -59,15 +59,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; protected: table_performance_timers(); diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h index 8bd9acafce5..838deec55a0 100644 --- a/storage/perfschema/table_prepared_stmt_instances.h +++ b/storage/perfschema/table_prepared_stmt_instances.h @@ -94,15 +94,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_prepared_stmt_instances(); diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h index 580b78cfb3b..cec084b1891 100644 --- a/storage/perfschema/table_replication_applier_configuration.h +++ b/storage/perfschema/table_replication_applier_configuration.h @@ -81,10 +81,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_applier_configuration(); @@ -96,9 +96,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h index 5e97dba5c45..a563f1bbf99 100644 --- a/storage/perfschema/table_replication_applier_status.h +++ b/storage/perfschema/table_replication_applier_status.h @@ -92,10 +92,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_applier_status(); @@ -107,9 +107,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h index 991e46afe50..d4ab387efca 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.h +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h @@ -101,10 +101,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_applier_status_by_coordinator(); @@ -116,9 +116,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h index 2e400783c61..77c649ad252 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.h +++ b/storage/perfschema/table_replication_applier_status_by_worker.h @@ -130,10 +130,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_applier_status_by_worker(); @@ -145,9 +145,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h index 5390c51e596..c9ff121be2b 100644 --- a/storage/perfschema/table_replication_connection_configuration.h +++ b/storage/perfschema/table_replication_connection_configuration.h @@ -153,10 +153,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_connection_configuration(); @@ -168,9 +168,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h index 57cc9a944df..d8c1a430037 100644 --- a/storage/perfschema/table_replication_connection_status.h +++ b/storage/perfschema/table_replication_connection_status.h @@ -126,10 +126,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_connection_status(); @@ -141,9 +141,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h index d3d00a7a5f2..af78971fbb8 100644 --- a/storage/perfschema/table_replication_group_member_stats.h +++ b/storage/perfschema/table_replication_group_member_stats.h @@ -91,10 +91,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_group_member_stats(); @@ -106,9 +106,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h index 3ea5787877a..f8c205ef2e2 100644 --- a/storage/perfschema/table_replication_group_members.h +++ b/storage/perfschema/table_replication_group_members.h @@ -84,10 +84,10 @@ protected: @param read_all true if all columns are read. */ - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_replication_group_members(); @@ -99,9 +99,9 @@ public: static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; }; diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h index 6a405db6cef..9c2acd714a9 100644 --- a/storage/perfschema/table_session_account_connect_attrs.h +++ b/storage/perfschema/table_session_account_connect_attrs.h @@ -46,7 +46,7 @@ public: ~table_session_account_connect_attrs() = default; protected: - virtual bool thread_fits(PFS_thread *thread); + bool thread_fits(PFS_thread *thread) override; private: /** Table share lock. */ diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h index bcc42beb574..9f077160780 100644 --- a/storage/perfschema/table_session_connect.h +++ b/storage/perfschema/table_session_connect.h @@ -69,10 +69,10 @@ public: ~table_session_connect(); protected: - virtual void make_row(PFS_thread *pfs, uint ordinal); + void make_row(PFS_thread *pfs, uint ordinal) override; virtual bool thread_fits(PFS_thread *thread); - virtual int read_row_values(TABLE *table, unsigned char *buf, - Field **fields, bool read_all); + int read_row_values(TABLE *table, unsigned char *buf, + Field **fields, bool read_all) override; protected: /** Current row. */ row_session_connect_attrs m_row; diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h index 0b3e16c6011..f8b93dcc945 100644 --- a/storage/perfschema/table_session_status.h +++ b/storage/perfschema/table_session_status.h @@ -76,16 +76,16 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_session_status(); public: diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h index f46d9967e5c..1f27b1796ce 100644 --- a/storage/perfschema/table_session_variables.h +++ b/storage/perfschema/table_session_variables.h @@ -74,16 +74,16 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_session_variables(); public: diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h index 1909d41e24b..dcd7eabd808 100644 --- a/storage/perfschema/table_setup_actors.h +++ b/storage/perfschema/table_setup_actors.h @@ -71,24 +71,24 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; - virtual int delete_row_values(TABLE *table, - const unsigned char *buf, - Field **fields); + int delete_row_values(TABLE *table, + const unsigned char *buf, + Field **fields) override; table_setup_actors(); diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h index c7386d7a050..2e5cc618609 100644 --- a/storage/perfschema/table_setup_consumers.h +++ b/storage/perfschema/table_setup_consumers.h @@ -59,20 +59,20 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; table_setup_consumers(); diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h index 9ea142857ce..40266900283 100644 --- a/storage/perfschema/table_setup_instruments.h +++ b/storage/perfschema/table_setup_instruments.h @@ -97,21 +97,21 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); - - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); - + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; + + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; + table_setup_instruments(); public: diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h index 32853b36497..5409e3d8813 100644 --- a/storage/perfschema/table_setup_objects.h +++ b/storage/perfschema/table_setup_objects.h @@ -70,24 +70,24 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); - - virtual int delete_row_values(TABLE *table, - const unsigned char *buf, - Field **fields); + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; + + int delete_row_values(TABLE *table, + const unsigned char *buf, + Field **fields) override; table_setup_objects(); diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h index e606fcbfa8b..d66fa548584 100644 --- a/storage/perfschema/table_setup_timers.h +++ b/storage/perfschema/table_setup_timers.h @@ -55,20 +55,20 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; table_setup_timers(); diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h index c8a4a5b6a5d..61cb121afd4 100644 --- a/storage/perfschema/table_socket_instances.h +++ b/storage/perfschema/table_socket_instances.h @@ -73,15 +73,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_socket_instances(); diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h index 726d16abb0a..ab0f8bb8fae 100644 --- a/storage/perfschema/table_socket_summary_by_event_name.h +++ b/storage/perfschema/table_socket_summary_by_event_name.h @@ -63,15 +63,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_socket_summary_by_event_name(); diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h index 21e811baabf..2f51d8b5e39 100644 --- a/storage/perfschema/table_socket_summary_by_instance.h +++ b/storage/perfschema/table_socket_summary_by_instance.h @@ -66,15 +66,15 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_socket_summary_by_instance(); diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h index c8d270c5926..e06885bbfad 100644 --- a/storage/perfschema/table_status_by_account.h +++ b/storage/perfschema/table_status_by_account.h @@ -111,16 +111,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_status_by_account(); public: diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h index 4e28966c016..41810ee3969 100644 --- a/storage/perfschema/table_status_by_host.h +++ b/storage/perfschema/table_status_by_host.h @@ -109,16 +109,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_status_by_host(); public: diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h index 770490438f1..c8fb8c4f095 100644 --- a/storage/perfschema/table_status_by_thread.h +++ b/storage/perfschema/table_status_by_thread.h @@ -107,16 +107,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_status_by_thread(); public: diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h index 1954b15d820..69cc3a6c14e 100644 --- a/storage/perfschema/table_status_by_user.h +++ b/storage/perfschema/table_status_by_user.h @@ -109,16 +109,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_status_by_user(); public: diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h index 75424d56540..1a6cf81a173 100644 --- a/storage/perfschema/table_sync_instances.h +++ b/storage/perfschema/table_sync_instances.h @@ -65,15 +65,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_mutex_instances(); @@ -123,15 +123,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_rwlock_instances(); @@ -175,15 +175,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; private: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_cond_instances(); diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h index 7e184deb9a0..d2330104e5d 100644 --- a/storage/perfschema/table_table_handles.h +++ b/storage/perfschema/table_table_handles.h @@ -69,16 +69,16 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_table_handles(); diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h index 1f981ded4d7..b71fb47e7b8 100644 --- a/storage/perfschema/table_threads.h +++ b/storage/perfschema/table_threads.h @@ -95,16 +95,16 @@ public: static PFS_engine_table* create(); protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; + - - virtual int update_row_values(TABLE *table, - const unsigned char *old_buf, - const unsigned char *new_buf, - Field **fields); + int update_row_values(TABLE *table, + const unsigned char *old_buf, + const unsigned char *new_buf, + Field **fields) override; protected: table_threads(); @@ -113,7 +113,7 @@ public: ~table_threads() = default; private: - virtual void make_row(PFS_thread *pfs); + void make_row(PFS_thread *pfs) override; /** Table share lock. */ static THR_LOCK m_table_lock; diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h index 6bc009fcf20..70095921d3b 100644 --- a/storage/perfschema/table_tiws_by_index_usage.h +++ b/storage/perfschema/table_tiws_by_index_usage.h @@ -87,16 +87,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_tiws_by_index_usage(); diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h index 2970ee64b06..e28704ec270 100644 --- a/storage/perfschema/table_tiws_by_table.h +++ b/storage/perfschema/table_tiws_by_table.h @@ -62,16 +62,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_tiws_by_table(); diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h index 5755e33f7a7..6d2a77f0f3b 100644 --- a/storage/perfschema/table_tlws_by_table.h +++ b/storage/perfschema/table_tlws_by_table.h @@ -62,16 +62,16 @@ public: static int delete_all_rows(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_tlws_by_table(); diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h index 9255ec9546a..7a16284c088 100644 --- a/storage/perfschema/table_users.h +++ b/storage/perfschema/table_users.h @@ -57,10 +57,10 @@ public: static int delete_all_rows(); protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; protected: @@ -70,7 +70,7 @@ public: ~table_users() = default; private: - virtual void make_row(PFS_user *pfs); + void make_row(PFS_user *pfs) override; /** Table share lock. */ static THR_LOCK m_table_lock; diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc index 74b6165d039..ed4ed039481 100644 --- a/storage/perfschema/table_uvar_by_thread.cc +++ b/storage/perfschema/table_uvar_by_thread.cc @@ -46,7 +46,7 @@ public: : m_unsafe_thd(unsafe_thd) {} - virtual bool operator()(THD *thd) + bool operator()(THD *thd) override { if (thd != m_unsafe_thd) return false; diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h index 61c521069c7..37427a0d201 100644 --- a/storage/perfschema/table_uvar_by_thread.h +++ b/storage/perfschema/table_uvar_by_thread.h @@ -154,15 +154,15 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_uvar_by_thread(); diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h index 99adcda4e98..87f284429eb 100644 --- a/storage/perfschema/table_variables_by_thread.h +++ b/storage/perfschema/table_variables_by_thread.h @@ -107,16 +107,16 @@ public: static PFS_engine_table* create(); static ha_rows get_row_count(); - virtual int rnd_init(bool scan); - virtual int rnd_next(); - virtual int rnd_pos(const void *pos); - virtual void reset_position(void); + int rnd_init(bool scan) override; + int rnd_next() override; + int rnd_pos(const void *pos) override; + void reset_position(void) override; protected: - virtual int read_row_values(TABLE *table, - unsigned char *buf, - Field **fields, - bool read_all); + int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) override; table_variables_by_thread(); public: diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index f8fb05f16e5..e4b8807d87b 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -3176,7 +3176,7 @@ class Rdb_transaction_impl : public Rdb_transaction { } } - virtual bool is_writebatch_trx() const override { return false; } + bool is_writebatch_trx() const override { return false; } bool is_prepared() override { return m_rocksdb_tx && rocksdb::Transaction::PREPARED == m_rocksdb_tx->GetState(); @@ -3521,7 +3521,7 @@ private: m_notifier = std::make_shared(this); } - virtual ~Rdb_transaction_impl() override { + ~Rdb_transaction_impl() override { rollback(); // Theoretically the notifier could outlive the Rdb_transaction_impl @@ -3727,7 +3727,7 @@ class Rdb_writebatch_impl : public Rdb_transaction { true); } - virtual ~Rdb_writebatch_impl() override { + ~Rdb_writebatch_impl() override { rollback(); delete m_batch; } diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index ee330dfa82a..b547e2d5f2e 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -441,7 +441,7 @@ class ha_rocksdb : public my_core::handler { ha_rocksdb(my_core::handlerton *const hton, my_core::TABLE_SHARE *const table_arg); - virtual ~ha_rocksdb() override { + ~ha_rocksdb() override { int err MY_ATTRIBUTE((__unused__)); err = finalize_bulk_load(false); if (err != 0) { @@ -458,7 +458,7 @@ class ha_rocksdb : public my_core::handler { const char *table_type() const - is non-virtual in class handler, so there's no point to override it. + is non-in class handler, so there's no point to override it. */ /* The following is only used by SHOW KEYS: */ @@ -623,15 +623,15 @@ public: bool sorted) override MY_ATTRIBUTE((__warn_unused_result__)); - virtual double scan_time() override { + double scan_time() override { DBUG_ENTER_FUNC(); DBUG_RETURN( static_cast((stats.records + stats.deleted) / 20.0 + 10)); } - virtual double read_time(uint, uint, ha_rows rows) override; - virtual void print_error(int error, myf errflag) override; + double read_time(uint, uint, ha_rows rows) override; + void print_error(int error, myf errflag) override; int open(const char *const name, int mode, uint test_if_locked) override MY_ATTRIBUTE((__warn_unused_result__)); @@ -980,11 +980,11 @@ public: #ifdef MARIAROCKS_NOT_YET // MDEV-10976 public: - virtual void rpl_before_delete_rows() override; - virtual void rpl_after_delete_rows() override; - virtual void rpl_before_update_rows() override; - virtual void rpl_after_update_rows() override; - virtual bool use_read_free_rpl() const override; + void rpl_before_delete_rows() override; + void rpl_after_delete_rows() override; + void rpl_before_update_rows() override; + void rpl_after_update_rows() override; + bool use_read_free_rpl() const override; #endif // MARIAROCKS_NOT_YET private: diff --git a/storage/rocksdb/properties_collector.h b/storage/rocksdb/properties_collector.h index ce2773cd618..a924227d5b1 100644 --- a/storage/rocksdb/properties_collector.h +++ b/storage/rocksdb/properties_collector.h @@ -128,7 +128,7 @@ class Rdb_tbl_prop_coll : public rocksdb::TablePropertiesCollector { virtual rocksdb::Status Finish( rocksdb::UserCollectedProperties *properties) override; - virtual const char *Name() const override { return "Rdb_tbl_prop_coll"; } + const char *Name() const override { return "Rdb_tbl_prop_coll"; } rocksdb::UserCollectedProperties GetReadableProperties() const override; @@ -193,7 +193,7 @@ class Rdb_tbl_prop_coll_factory m_table_stats_sampling_pct); } - virtual const char *Name() const override { + const char *Name() const override { return "Rdb_tbl_prop_coll_factory"; } diff --git a/storage/rocksdb/rdb_compact_filter.h b/storage/rocksdb/rdb_compact_filter.h index 93767b23787..cadd55e8c2f 100644 --- a/storage/rocksdb/rdb_compact_filter.h +++ b/storage/rocksdb/rdb_compact_filter.h @@ -105,9 +105,9 @@ class Rdb_compact_filter : public rocksdb::CompactionFilter { return false; } - virtual bool IgnoreSnapshots() const override { return true; } + bool IgnoreSnapshots() const override { return true; } - virtual const char *Name() const override { return "Rdb_compact_filter"; } + const char *Name() const override { return "Rdb_compact_filter"; } void get_ttl_duration_and_offset(const GL_INDEX_ID &gl_index_id, uint64 *ttl_duration, diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index acff43ab565..63df304896d 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -1584,7 +1584,7 @@ class Rdb_system_merge_op : public rocksdb::AssociativeMergeOperator { return true; } - virtual const char *Name() const override { return "Rdb_system_merge_op"; } + const char *Name() const override { return "Rdb_system_merge_op"; } private: /* diff --git a/storage/rocksdb/rdb_mutex_wrapper.h b/storage/rocksdb/rdb_mutex_wrapper.h index fd0790aa8e6..bcc92533e73 100644 --- a/storage/rocksdb/rdb_mutex_wrapper.h +++ b/storage/rocksdb/rdb_mutex_wrapper.h @@ -39,7 +39,7 @@ class Rdb_mutex : public rocksdb::TransactionDBMutex { public: Rdb_mutex(); - virtual ~Rdb_mutex() override; + ~Rdb_mutex() override; /* Override parent class's virtual methods of interrest. @@ -47,7 +47,7 @@ class Rdb_mutex : public rocksdb::TransactionDBMutex { // Attempt to acquire lock. Return OK on success, or other Status on failure. // If returned status is OK, TransactionDB will eventually call UnLock(). - virtual rocksdb::Status Lock() override; + rocksdb::Status Lock() override; // Attempt to acquire lock. If timeout is non-negative, operation should be // failed after this many microseconds. @@ -59,7 +59,7 @@ class Rdb_mutex : public rocksdb::TransactionDBMutex { int64_t timeout_time MY_ATTRIBUTE((__unused__))) override; // Unlock Mutex that was successfully locked by Lock() or TryLockUntil() - virtual void UnLock() override; + void UnLock() override; private: mysql_mutex_t m_mutex; @@ -77,7 +77,7 @@ class Rdb_cond_var : public rocksdb::TransactionDBCondVar { public: Rdb_cond_var(); - virtual ~Rdb_cond_var() override; + ~Rdb_cond_var() override; /* Override parent class's virtual methods of interrest. @@ -109,10 +109,10 @@ class Rdb_cond_var : public rocksdb::TransactionDBCondVar { // If any threads are waiting on *this, unblock at least one of the // waiting threads. - virtual void Notify() override; + void Notify() override; // Unblocks all threads waiting on *this. - virtual void NotifyAll() override; + void NotifyAll() override; private: mysql_cond_t m_cond; @@ -137,7 +137,7 @@ class Rdb_mutex_factory : public rocksdb::TransactionDBMutexFactory { return std::make_shared(); } - virtual ~Rdb_mutex_factory() override = default; + ~Rdb_mutex_factory() override = default; }; } // namespace myrocks diff --git a/storage/rocksdb/rdb_threads.h b/storage/rocksdb/rdb_threads.h index d23419df3b9..36ce4620343 100644 --- a/storage/rocksdb/rdb_threads.h +++ b/storage/rocksdb/rdb_threads.h @@ -148,7 +148,7 @@ class Rdb_background_thread : public Rdb_thread { } public: - virtual void run() override; + void run() override; void request_save_stats() { RDB_MUTEX_LOCK_CHECK(m_signal_mutex); @@ -175,7 +175,7 @@ class Rdb_manual_compaction_thread : public Rdb_thread { std::map m_requests; public: - virtual void run() override; + void run() override; int request_manual_compaction(rocksdb::ColumnFamilyHandle *cf, rocksdb::Slice *start, rocksdb::Slice *limit, int concurrency = 0); @@ -189,7 +189,7 @@ class Rdb_manual_compaction_thread : public Rdb_thread { */ struct Rdb_drop_index_thread : public Rdb_thread { - virtual void run() override; + void run() override; }; } // namespace myrocks diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc index b2bce9325ac..4db6a5144ef 100644 --- a/storage/sequence/sequence.cc +++ b/storage/sequence/sequence.cc @@ -47,7 +47,7 @@ public: { thr_lock_init(&lock); } - ~Sequence_share() + ~Sequence_share() override { thr_lock_delete(&lock); } @@ -64,45 +64,45 @@ public: Sequence_share *seqs; ha_seq(handlerton *hton, TABLE_SHARE *table_arg) : handler(hton, table_arg), seqs(0) { } - ulonglong table_flags() const + ulonglong table_flags() const override { return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; } /* open/close/locking */ int create(const char *name, TABLE *table_arg, - HA_CREATE_INFO *create_info) + HA_CREATE_INFO *create_info) override { return HA_ERR_WRONG_COMMAND; } - int open(const char *name, int mode, uint test_if_locked); - int close(void); - int delete_table(const char *name) + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; + int delete_table(const char *name) override { return 0; } - THR_LOCK_DATA **store_lock(THD *, THR_LOCK_DATA **, enum thr_lock_type); + THR_LOCK_DATA **store_lock(THD *, THR_LOCK_DATA **, enum thr_lock_type) override; /* table scan */ - int rnd_init(bool scan); - int rnd_next(unsigned char *buf); - void position(const uchar *record); - int rnd_pos(uchar *buf, uchar *pos); - int info(uint flag); + int rnd_init(bool scan) override; + int rnd_next(unsigned char *buf) override; + void position(const uchar *record) override; + int rnd_pos(uchar *buf, uchar *pos) override; + int info(uint flag) override; /* indexes */ - ulong index_flags(uint inx, uint part, bool all_parts) const + ulong index_flags(uint inx, uint part, bool all_parts) const override { return HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE | HA_KEYREAD_ONLY; } - uint max_supported_keys() const { return 1; } + uint max_supported_keys() const override { return 1; } int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - int index_next(uchar *buf); - int index_prev(uchar *buf); - int index_first(uchar *buf); - int index_last(uchar *buf); + enum ha_rkey_function find_flag) override; + int index_next(uchar *buf) override; + int index_prev(uchar *buf) override; + int index_first(uchar *buf) override; + int index_last(uchar *buf) override; ha_rows records_in_range(uint inx, const key_range *start_key, - const key_range *end_key, page_range *pages); - double scan_time() { return (double)nvalues(); } - double read_time(uint index, uint ranges, ha_rows rows) { return (double)rows; } - double keyread_time(uint index, uint ranges, ha_rows rows) { return (double)rows; } + const key_range *end_key, page_range *pages) override; + double scan_time() override { return (double)nvalues(); } + double read_time(uint index, uint ranges, ha_rows rows) override { return (double)rows; } + double keyread_time(uint index, uint ranges, ha_rows rows) override { return (double)rows; } private: void set(uchar *buf); @@ -382,10 +382,10 @@ public: // Reset limit because we are handling it now orig_lim->set_unlimited(); } - ~ha_seq_group_by_handler() = default; - int init_scan() { first_row= 1 ; return 0; } - int next_row(); - int end_scan() { return 0; } + ~ha_seq_group_by_handler() override = default; + int init_scan() override { first_row= 1 ; return 0; } + int next_row() override; + int end_scan() override { return 0; } }; static group_by_handler * diff --git a/storage/sphinx/ha_sphinx.h b/storage/sphinx/ha_sphinx.h index 5a1541f1d2e..0e71013a7bc 100644 --- a/storage/sphinx/ha_sphinx.h +++ b/storage/sphinx/ha_sphinx.h @@ -55,85 +55,85 @@ public: #endif ~ha_sphinx (); - const char * table_type () const { return "SPHINX"; } ///< SE name for display purposes - const char * index_type ( uint ) { return "HASH"; } ///< index type name for display purposes + const char * table_type () const override { return "SPHINX"; } ///< SE name for display purposes + const char * index_type ( uint ) override { return "HASH"; } ///< index type name for display purposes #if MYSQL_VERSION_ID>50100 - ulonglong table_flags () const { return HA_CAN_INDEX_BLOBS | + ulonglong table_flags () const override { return HA_CAN_INDEX_BLOBS | HA_CAN_TABLE_CONDITION_PUSHDOWN; } ///< bitmap of implemented flags (see handler.h for more info) #else ulong table_flags () const { return HA_CAN_INDEX_BLOBS; } ///< bitmap of implemented flags (see handler.h for more info) #endif - ulong index_flags ( uint, uint, bool ) const { return 0; } ///< bitmap of flags that says how SE implements indexes - uint max_supported_record_length () const { return HA_MAX_REC_LENGTH; } - uint max_supported_keys () const { return 1; } - uint max_supported_key_parts () const { return 1; } - uint max_supported_key_length () const { return MAX_KEY_LENGTH; } - uint max_supported_key_part_length () const { return MAX_KEY_LENGTH; } + ulong index_flags ( uint, uint, bool ) const override { return 0; } ///< bitmap of flags that says how SE implements indexes + uint max_supported_record_length () const override { return HA_MAX_REC_LENGTH; } + uint max_supported_keys () const override { return 1; } + uint max_supported_key_parts () const override { return 1; } + uint max_supported_key_length () const override { return MAX_KEY_LENGTH; } + uint max_supported_key_part_length () const override { return MAX_KEY_LENGTH; } #if MYSQL_VERSION_ID>50100 - virtual double scan_time () { return (double)( stats.records+stats.deleted )/20.0 + 10; } ///< called in test_quick_select to determine if indexes should be used + double scan_time () override { return (double)( stats.records+stats.deleted )/20.0 + 10; } ///< called in test_quick_select to determine if indexes should be used #else virtual double scan_time () { return (double)( records+deleted )/20.0 + 10; } ///< called in test_quick_select to determine if indexes should be used #endif - virtual double read_time(uint index, uint ranges, ha_rows rows) + double read_time(uint index, uint ranges, ha_rows rows) override { return ranges + (double)rows/20.0 + 1; } ///< index read time estimate public: - int open ( const char * name, int mode, uint test_if_locked ); - int close (); + int open ( const char * name, int mode, uint test_if_locked ) override; + int close () override; - int write_row ( const byte * buf ); - int update_row ( const byte * old_data, const byte * new_data ); - int delete_row ( const byte * buf ); - int extra ( enum ha_extra_function op ); + int write_row ( const byte * buf ) override; + int update_row ( const byte * old_data, const byte * new_data ) override; + int delete_row ( const byte * buf ) override; + int extra ( enum ha_extra_function op ) override; - int index_init ( uint keynr, bool sorted ); // 5.1.x + int index_init ( uint keynr, bool sorted ) override; // 5.1.x int index_init ( uint keynr ) { return index_init ( keynr, false ); } // 5.0.x - int index_end (); - int index_read ( byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag ); + int index_end () override; + int index_read ( byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag ) override; int index_read_idx ( byte * buf, uint idx, const byte * key, uint key_len, enum ha_rkey_function find_flag ); - int index_next ( byte * buf ); - int index_next_same ( byte * buf, const byte * key, uint keylen ); - int index_prev ( byte * buf ); - int index_first ( byte * buf ); - int index_last ( byte * buf ); + int index_next ( byte * buf ) override; + int index_next_same ( byte * buf, const byte * key, uint keylen ) override; + int index_prev ( byte * buf ) override; + int index_first ( byte * buf ) override; + int index_last ( byte * buf ) override; int get_rec ( byte * buf, const byte * key, uint keylen ); - int rnd_init ( bool scan ); - int rnd_end (); - int rnd_next ( byte * buf ); - int rnd_pos ( byte * buf, byte * pos ); - void position ( const byte * record ); + int rnd_init ( bool scan ) override; + int rnd_end () override; + int rnd_next ( byte * buf ) override; + int rnd_pos ( byte * buf, byte * pos ) override; + void position ( const byte * record ) override; #if MYSQL_VERSION_ID>=50030 - int info ( uint ); + int info ( uint ) override; #else void info ( uint ); #endif - int reset(); - int external_lock ( THD * thd, int lock_type ); - int delete_all_rows (); - ha_rows records_in_range ( uint inx, const key_range * min_key, const key_range * max_key, page_range *pages); + int reset() override; + int external_lock ( THD * thd, int lock_type ) override; + int delete_all_rows () override; + ha_rows records_in_range ( uint inx, const key_range * min_key, const key_range * max_key, page_range *pages) override; - int delete_table ( const char * from ); - int rename_table ( const char * from, const char * to ); - int create ( const char * name, TABLE * form, HA_CREATE_INFO * create_info ); + int delete_table ( const char * from ) override; + int rename_table ( const char * from, const char * to ) override; + int create ( const char * name, TABLE * form, HA_CREATE_INFO * create_info ) override; - THR_LOCK_DATA ** store_lock ( THD * thd, THR_LOCK_DATA ** to, enum thr_lock_type lock_type ); + THR_LOCK_DATA ** store_lock ( THD * thd, THR_LOCK_DATA ** to, enum thr_lock_type lock_type ) override; public: #if MYSQL_VERSION_ID<50610 virtual const COND * cond_push ( const COND *cond ); #else - virtual const Item * cond_push ( const Item *cond ); + const Item * cond_push ( const Item *cond ) override; #endif - virtual void cond_pop (); + void cond_pop () override; private: uint32 m_iFields; diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index 5ccf3d5c4f5..77693e97efd 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -208,14 +208,14 @@ public: handler *clone( const char *name, MEM_ROOT *mem_root - ); + ) override; const char **bas_ext() const; int open( const char* name, int mode, uint test_if_locked - ); - int close(); + ) override; + int close() override; int check_access_kind_for_connection( THD *thd, bool write_request @@ -233,30 +233,30 @@ public: THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type - ); + ) override; int external_lock( THD *thd, int lock_type - ); + ) override; int start_stmt( THD *thd, thr_lock_type lock_type - ); - int reset(); + ) override; + int reset() override; int extra( enum ha_extra_function operation - ); + ) override; int index_init( uint idx, bool sorted - ); + ) override; #ifdef HA_CAN_BULK_ACCESS int pre_index_init( uint idx, bool sorted ); #endif - int index_end(); + int index_end() override; #ifdef HA_CAN_BULK_ACCESS int pre_index_end(); #endif @@ -265,36 +265,36 @@ public: const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag - ); + ) override; int index_read_last_map( uchar *buf, const uchar *key, key_part_map keypart_map - ); + ) override; int index_next( uchar *buf - ); + ) override; int index_prev( uchar *buf - ); + ) override; int index_first( uchar *buf - ); + ) override; int index_last( uchar *buf - ); + ) override; int index_next_same( uchar *buf, const uchar *key, uint keylen - ); + ) override; int read_range_first( const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted - ); - int read_range_next(); + ) override; + int read_range_next() override; void reset_no_where_cond(); bool check_no_where_cond(); #ifdef HA_MRR_USE_DEFAULT_IMPL @@ -306,7 +306,7 @@ public: uint *bufsz, uint *flags, Cost_estimate *cost - ); + ) override; ha_rows multi_range_read_info( uint keyno, uint n_ranges, @@ -315,17 +315,17 @@ public: uint *bufsz, uint *flags, Cost_estimate *cost - ); + ) override; int multi_range_read_init( RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf - ); + ) override; int multi_range_read_next( range_id_t *range_info - ); + ) override; int multi_range_read_next_first( range_id_t *range_info ); @@ -346,57 +346,57 @@ public: #endif int rnd_init( bool scan - ); + ) override; #ifdef HA_CAN_BULK_ACCESS int pre_rnd_init( bool scan ); #endif - int rnd_end(); + int rnd_end() override; #ifdef HA_CAN_BULK_ACCESS int pre_rnd_end(); #endif int rnd_next( uchar *buf - ); + ) override; void position( const uchar *record - ); + ) override; int rnd_pos( uchar *buf, uchar *pos - ); + ) override; int cmp_ref( const uchar *ref1, const uchar *ref2 - ); - int ft_init(); - void ft_end(); + ) override; + int ft_init() override; + void ft_end() override; FT_INFO *ft_init_ext( uint flags, uint inx, String *key - ); + ) override; int ft_read( uchar *buf - ); + ) override; int pre_index_read_map( const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag, bool use_parallel - ); - int pre_index_first(bool use_parallel); - int pre_index_last(bool use_parallel); + ) override; + int pre_index_first(bool use_parallel) override; + int pre_index_last(bool use_parallel) override; int pre_index_read_last_map( const uchar *key, key_part_map keypart_map, bool use_parallel - ); + ) override; #ifdef HA_MRR_USE_DEFAULT_IMPL int pre_multi_range_read_next( bool use_parallel - ); + ) override; #else int pre_read_multi_range_first( KEY_MULTI_RANGE **found_range_p, @@ -413,47 +413,47 @@ public: bool eq_range, bool sorted, bool use_parallel - ); - int pre_ft_read(bool use_parallel); - int pre_rnd_next(bool use_parallel); + ) override; + int pre_ft_read(bool use_parallel) override; + int pre_rnd_next(bool use_parallel) override; int info( uint flag - ); + ) override; ha_rows records_in_range( uint inx, const key_range *start_key, const key_range *end_key, page_range *pages - ); + ) override; int check_crd(); - int pre_records(); - ha_rows records(); + int pre_records() override; + ha_rows records() override; #ifdef HA_HAS_CHECKSUM_EXTENDED - int pre_calculate_checksum(); - int calculate_checksum(); + int pre_calculate_checksum() override; + int calculate_checksum() override; #endif - const char *table_type() const; - ulonglong table_flags() const; + const char *table_type() const override; + ulonglong table_flags() const override; ulong table_flags_for_partition(); const char *index_type( uint key_number - ); + ) override; ulong index_flags( uint idx, uint part, bool all_parts - ) const; - uint max_supported_record_length() const; - uint max_supported_keys() const; - uint max_supported_key_parts() const; - uint max_supported_key_length() const; - uint max_supported_key_part_length() const; - uint8 table_cache_type(); + ) const override; + uint max_supported_record_length() const override; + uint max_supported_keys() const override; + uint max_supported_key_parts() const override; + uint max_supported_key_length() const override; + uint max_supported_key_part_length() const override; + uint8 table_cache_type() override; #ifdef HANDLER_HAS_NEED_INFO_FOR_AUTO_INC - bool need_info_for_auto_inc(); + bool need_info_for_auto_inc() override; #endif #ifdef HANDLER_HAS_CAN_USE_FOR_AUTO_INC_INIT - bool can_use_for_auto_inc_init(); + bool can_use_for_auto_inc_init() override; #endif int update_auto_increment(); void get_auto_increment( @@ -462,25 +462,25 @@ public: ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values - ); + ) override; int reset_auto_increment( ulonglong value - ); - void release_auto_increment(); + ) override; + void release_auto_increment() override; #ifdef SPIDER_HANDLER_START_BULK_INSERT_HAS_FLAGS void start_bulk_insert( ha_rows rows, uint flags - ); + ) override; #else void start_bulk_insert( ha_rows rows ); #endif - int end_bulk_insert(); + int end_bulk_insert() override; int write_row( const uchar *buf - ); + ) override; #ifdef HA_CAN_BULK_ACCESS int pre_write_row( uchar *buf @@ -492,21 +492,21 @@ public: bool hs_request ); #endif - bool start_bulk_update(); + bool start_bulk_update() override; int exec_bulk_update( ha_rows *dup_key_found - ); - int end_bulk_update(); + ) override; + int end_bulk_update() override; #ifdef SPIDER_UPDATE_ROW_HAS_CONST_NEW_DATA int bulk_update_row( const uchar *old_data, const uchar *new_data, ha_rows *dup_key_found - ); + ) override; int update_row( const uchar *old_data, const uchar *new_data - ); + ) override; #else int bulk_update_row( const uchar *old_data, @@ -556,7 +556,7 @@ public: #ifdef SPIDER_MDEV_16246 int direct_update_rows_init( List *update_fields - ); + ) override; #else int direct_update_rows_init(); #endif @@ -617,7 +617,7 @@ public: int direct_update_rows( ha_rows *update_rows, ha_rows *found_row - ); + ) override; #endif #ifdef HA_CAN_BULK_ACCESS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS @@ -642,11 +642,11 @@ public: #endif #endif #endif - bool start_bulk_delete(); - int end_bulk_delete(); + bool start_bulk_delete() override; + int end_bulk_delete() override; int delete_row( const uchar *buf - ); + ) override; #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS bool check_direct_delete_sql_part( st_select_lex *select_lex, @@ -665,7 +665,7 @@ public: bool sorted ); #else - int direct_delete_rows_init(); + int direct_delete_rows_init() override; #endif #ifdef HA_CAN_BULK_ACCESS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS @@ -697,7 +697,7 @@ public: #else int direct_delete_rows( ha_rows *delete_rows - ); + ) override; #endif #ifdef HA_CAN_BULK_ACCESS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS @@ -718,90 +718,90 @@ public: #endif #endif #endif - int delete_all_rows(); - int truncate(); - double scan_time(); + int delete_all_rows() override; + int truncate() override; + double scan_time() override; double read_time( uint index, uint ranges, ha_rows rows - ); + ) override; #ifdef HA_CAN_BULK_ACCESS void bulk_req_exec(); #endif - const key_map *keys_to_use_for_scanning(); - ha_rows estimate_rows_upper_bound(); + const key_map *keys_to_use_for_scanning() override; + ha_rows estimate_rows_upper_bound() override; void print_error( int error, myf errflag - ); + ) override; bool get_error_message( int error, String *buf - ); + ) override; int create( const char *name, TABLE *form, HA_CREATE_INFO *info - ); + ) override; void update_create_info( HA_CREATE_INFO* create_info - ); + ) override; int rename_table( const char *from, const char *to - ); + ) override; int delete_table( const char *name - ); - bool is_crashed() const; + ) override; + bool is_crashed() const override; #ifdef SPIDER_HANDLER_AUTO_REPAIR_HAS_ERROR - bool auto_repair(int error) const; + bool auto_repair(int error) const override; #else bool auto_repair() const; #endif int disable_indexes( key_map map, bool persist - ); + ) override; int enable_indexes( key_map map, bool persist - ); + ) override; int check( THD* thd, HA_CHECK_OPT* check_opt - ); + ) override; int repair( THD* thd, HA_CHECK_OPT* check_opt - ); + ) override; bool check_and_repair( THD *thd - ); + ) override; int analyze( THD* thd, HA_CHECK_OPT* check_opt - ); + ) override; int optimize( THD* thd, HA_CHECK_OPT* check_opt - ); + ) override; bool is_fatal_error( int error_num, uint flags - ); + ) override; Field *field_exchange( Field *field ); const COND *cond_push( const COND* cond - ); - void cond_pop(); + ) override; + void cond_pop() override; int info_push( uint info_type, void *info - ); + ) override; #ifdef HANDLER_HAS_DIRECT_AGGREGATE - void return_record_by_parent(); + void return_record_by_parent() override; #endif TABLE *get_table(); void set_ft_discard_bitmap(); diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index 3b07681a2a6..614feecc619 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -251,29 +251,29 @@ public: int store_to_field( Field *field, CHARSET_INFO *access_charset - ); + ) override; int append_to_str( spider_string *str - ); + ) override; int append_escaped_to_str( spider_string *str, uint dbton_id - ); - void first(); - void next(); - bool is_null(); - int val_int(); - double val_real(); + ) override; + void first() override; + void next() override; + bool is_null() override; + int val_int() override; + double val_real() override; my_decimal *val_decimal( my_decimal *decimal_value, CHARSET_INFO *access_charset - ); - SPIDER_DB_ROW *clone(); + ) override; + SPIDER_DB_ROW *clone() override; int store_to_tmp_table( TABLE *tmp_table, spider_string *str - ); - uint get_byte_size(); + ) override; + uint get_byte_size() override; }; class spider_db_mysql_row: public spider_db_mbase_row @@ -301,20 +301,20 @@ public: SPIDER_DB_CONN *in_db_conn ); virtual ~spider_db_mbase_result(); - bool has_result(); - void free_result(); - SPIDER_DB_ROW *current_row(); - SPIDER_DB_ROW *fetch_row(); + bool has_result() override; + void free_result() override; + SPIDER_DB_ROW *current_row() override; + SPIDER_DB_ROW *fetch_row() override; SPIDER_DB_ROW *fetch_row_from_result_buffer( spider_db_result_buffer *spider_res_buf - ); + ) override; SPIDER_DB_ROW *fetch_row_from_tmp_table( TABLE *tmp_table - ); + ) override; int fetch_table_status( int mode, ha_statistics &stat - ); + ) override; int fetch_simple_action( uint simple_action, uint position, @@ -323,11 +323,11 @@ public: int fetch_table_records( int mode, ha_rows &records - ); + ) override; #ifdef HA_HAS_CHECKSUM_EXTENDED int fetch_table_checksum( ha_spider *spider - ); + ) override; #endif int fetch_table_cardinality( int mode, @@ -335,10 +335,10 @@ public: longlong *cardinality, uchar *cardinality_upd, int bitmap_size - ); + ) override; int fetch_table_mon_status( int &status - ); + ) override; int fetch_show_master_status( const char **binlog_file_name, const char **binlog_pos @@ -346,26 +346,26 @@ public: int fetch_select_binlog_gtid_pos( const char **gtid_pos ); - longlong num_rows(); - uint num_fields(); + longlong num_rows() override; + uint num_fields() override; void move_to_pos( longlong pos - ); - int get_errno(); + ) override; + int get_errno() override; #ifdef SPIDER_HAS_DISCOVER_TABLE_STRUCTURE int fetch_columns_for_discover_table_structure( spider_string *str, CHARSET_INFO *access_charset - ); + ) override; int fetch_index_for_discover_table_structure( spider_string *str, CHARSET_INFO *access_charset - ); + ) override; int fetch_table_for_discover_table_structure( spider_string *str, SPIDER_SHARE *spider_share, CHARSET_INFO *access_charset - ); + ) override; #endif }; @@ -411,9 +411,9 @@ public: spider_db_mbase_util *spider_db_mbase_utility ); virtual ~spider_db_mbase(); - int init(); - bool is_connected(); - void bg_connect(); + int init() override; + bool is_connected() override; + void bg_connect() override; int connect( char *tgt_host, char *tgt_username, @@ -423,116 +423,116 @@ public: char *server_name, int connect_retry_count, longlong connect_retry_interval - ); - int ping(); - void bg_disconnect(); - void disconnect(); - int set_net_timeout(); + ) override; + int ping() override; + void bg_disconnect() override; + void disconnect() override; + int set_net_timeout() override; int exec_query( const char *query, uint length, int quick_mode - ); - int get_errno(); - const char *get_error(); + ) override; + int get_errno() override; + const char *get_error() override; bool is_server_gone_error( int error_num - ); + ) override; bool is_dup_entry_error( int error_num - ); + ) override; bool is_xa_nota_error( int error_num - ); + ) override; int fetch_and_print_warnings(struct tm *l_time); spider_db_result *store_result( spider_db_result_buffer **spider_res_buf, st_spider_db_request_key *request_key, int *error_num - ); + ) override; spider_db_result *use_result( ha_spider *spider, st_spider_db_request_key *request_key, int *error_num - ); - int next_result(); - uint affected_rows(); - uint matched_rows(); + ) override; + int next_result() override; + uint affected_rows() override; + uint matched_rows() override; bool inserted_info( spider_db_handler *handler, ha_copy_info *copy_info - ); - ulonglong last_insert_id(); + ) override; + ulonglong last_insert_id() override; int set_character_set( const char *csname - ); + ) override; int select_db( const char *dbname - ); + ) override; int consistent_snapshot( int *need_mon - ); - bool trx_start_in_bulk_sql(); + ) override; + bool trx_start_in_bulk_sql() override; int start_transaction( int *need_mon - ); + ) override; int commit( int *need_mon - ); + ) override; int rollback( int *need_mon - ); - bool xa_start_in_bulk_sql(); + ) override; + bool xa_start_in_bulk_sql() override; int xa_start( XID *xid, int *need_mon - ); + ) override; int xa_end( XID *xid, int *need_mon - ); + ) override; int xa_prepare( XID *xid, int *need_mon - ); + ) override; int xa_commit( XID *xid, int *need_mon - ); + ) override; int xa_rollback( XID *xid, int *need_mon - ); - bool set_trx_isolation_in_bulk_sql(); + ) override; + bool set_trx_isolation_in_bulk_sql() override; int set_trx_isolation( int trx_isolation, int *need_mon - ); - bool set_autocommit_in_bulk_sql(); + ) override; + bool set_autocommit_in_bulk_sql() override; int set_autocommit( bool autocommit, int *need_mon - ); - bool set_sql_log_off_in_bulk_sql(); + ) override; + bool set_sql_log_off_in_bulk_sql() override; int set_sql_log_off( bool sql_log_off, int *need_mon - ); - bool set_wait_timeout_in_bulk_sql(); + ) override; + bool set_wait_timeout_in_bulk_sql() override; int set_wait_timeout( int wait_timeout, int *need_mon - ); - bool set_sql_mode_in_bulk_sql(); + ) override; + bool set_sql_mode_in_bulk_sql() override; int set_sql_mode( sql_mode_t sql_mode, int *need_mon - ); - bool set_time_zone_in_bulk_sql(); + ) override; + bool set_time_zone_in_bulk_sql() override; int set_time_zone( Time_zone *time_zone, int *need_mon - ); + ) override; int exec_simple_sql_with_result( SPIDER_TRX *trx, SPIDER_SHARE *share, @@ -552,7 +552,7 @@ public: int mode, SPIDER_DB_RESULT **res1, SPIDER_DB_RESULT **res2 - ); + ) override; int select_binlog_gtid_pos( SPIDER_TRX *trx, SPIDER_SHARE *share, @@ -570,25 +570,25 @@ public: char *to, const char *from, size_t from_length - ); - bool have_lock_table_list(); + ) override; + bool have_lock_table_list() override; int append_lock_tables( spider_string *str - ); + ) override; int append_unlock_tables( spider_string *str - ); - uint get_lock_table_hash_count(); - void reset_lock_table_hash(); - uint get_opened_handler_count(); - void reset_opened_handler(); + ) override; + uint get_lock_table_hash_count() override; + void reset_lock_table_hash() override; + uint get_opened_handler_count() override; + void reset_opened_handler() override; void set_dup_key_idx( ha_spider *spider, int link_idx - ); + ) override; bool cmp_request_key_to_snd( st_spider_db_request_key *request_key - ); + ) override; }; class spider_db_mysql: public spider_db_mbase @@ -643,20 +643,20 @@ public: spider_db_mbase_util *spider_db_mbase_utility ); virtual ~spider_mbase_share(); - int init(); + int init() override; uint get_column_name_length( uint field_index - ); + ) override; int append_column_name( spider_string *str, uint field_index - ); + ) override; int append_column_name_with_alias( spider_string *str, uint field_index, const char *alias, uint alias_length - ); + ) override; int append_table_name( spider_string *str, int all_link_idx @@ -669,16 +669,16 @@ public: spider_string *str, int *table_name_pos ); - bool need_change_db_table_name(); + bool need_change_db_table_name() override; #ifdef SPIDER_HAS_DISCOVER_TABLE_STRUCTURE int discover_table_structure( SPIDER_TRX *trx, SPIDER_SHARE *spider_share, spider_string *str - ); + ) override; #endif #ifdef HA_HAS_CHECKSUM_EXTENDED - bool checksum_support(); + bool checksum_support() override; #endif protected: int create_table_names_str(); @@ -769,17 +769,17 @@ public: spider_db_mbase_util *spider_db_mbase_utility ); virtual ~spider_mbase_handler(); - int init(); + int init() override; int append_index_hint( spider_string *str, int link_idx, ulong sql_type - ); + ) override; int append_table_name_with_adjusting( spider_string *str, int link_idx, ulong sql_type - ); + ) override; int append_key_column_types( const key_range *start_key, spider_string *str @@ -792,8 +792,8 @@ public: ); int append_tmp_table_and_sql_for_bka( const key_range *start_key - ); - int reuse_tmp_table_and_sql_for_bka(); + ) override; + int reuse_tmp_table_and_sql_for_bka() override; void create_tmp_bka_table_name( char *tmp_table_name, int *tmp_table_name_length, @@ -824,62 +824,62 @@ public: ); int append_union_table_and_sql_for_bka( const key_range *start_key - ); - int reuse_union_table_and_sql_for_bka(); + ) override; + int reuse_union_table_and_sql_for_bka() override; int append_insert_for_recovery( ulong sql_type, int link_idx - ); + ) override; int append_update( const TABLE *table, my_ptrdiff_t ptr_diff - ); + ) override; int append_update( const TABLE *table, my_ptrdiff_t ptr_diff, int link_idx - ); + ) override; int append_delete( const TABLE *table, my_ptrdiff_t ptr_diff - ); + ) override; int append_delete( const TABLE *table, my_ptrdiff_t ptr_diff, int link_idx - ); - int append_insert_part(); + ) override; + int append_insert_part() override; int append_insert( spider_string *str, int link_idx ); - int append_update_part(); + int append_update_part() override; int append_update( spider_string *str, int link_idx ); - int append_delete_part(); + int append_delete_part() override; int append_delete( spider_string *str ); - int append_update_set_part(); + int append_update_set_part() override; int append_update_set( spider_string *str ); #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS - int append_direct_update_set_part(); + int append_direct_update_set_part() override; int append_direct_update_set( spider_string *str ); int append_dup_update_pushdown_part( const char *alias, uint alias_length - ); + ) override; int append_update_columns_part( const char *alias, uint alias_length - ); - int check_update_columns_part(); + ) override; + int check_update_columns_part() override; int append_update_columns( spider_string *str, const char *alias, @@ -888,28 +888,28 @@ public: #endif int append_select_part( ulong sql_type - ); + ) override; int append_select( spider_string *str, ulong sql_type - ); + ) override; int append_table_select_part( ulong sql_type - ); + ) override; int append_table_select( spider_string *str ); int append_key_select_part( ulong sql_type, uint idx - ); + ) override; int append_key_select( spider_string *str, uint idx ); int append_minimum_select_part( ulong sql_type - ); + ) override; int append_minimum_select( spider_string *str, ulong sql_type @@ -937,47 +937,47 @@ public: ); int append_hint_after_table_part( ulong sql_type - ); + ) override; int append_hint_after_table( spider_string *str ); void set_where_pos( ulong sql_type - ); + ) override; void set_where_to_pos( ulong sql_type - ); + ) override; int check_item_type( Item *item - ); + ) override; int append_values_connector_part( ulong sql_type - ); + ) override; int append_values_connector( spider_string *str ); int append_values_terminator_part( ulong sql_type - ); + ) override; int append_values_terminator( spider_string *str ); int append_union_table_connector_part( ulong sql_type - ); + ) override; int append_union_table_connector( spider_string *str ); int append_union_table_terminator_part( ulong sql_type - ); + ) override; int append_union_table_terminator( spider_string *str ); int append_key_column_values_part( const key_range *start_key, ulong sql_type - ); + ) override; int append_key_column_values( spider_string *str, const key_range *start_key @@ -985,7 +985,7 @@ public: int append_key_column_values_with_name_part( const key_range *start_key, ulong sql_type - ); + ) override; int append_key_column_values_with_name( spider_string *str, const key_range *start_key @@ -994,7 +994,7 @@ public: const key_range *start_key, const key_range *end_key, ulong sql_type - ); + ) override; int append_key_where( spider_string *str, spider_string *str_part, @@ -1011,7 +1011,7 @@ public: const uchar **ptr, bool key_eq, bool tgt_final - ); + ) override; int append_is_null( ulong sql_type, spider_string *str, @@ -1027,7 +1027,7 @@ public: ulong sql_type, bool set_order, int key_count - ); + ) override; int append_where_terminator( ulong sql_type, spider_string *str, @@ -1038,7 +1038,7 @@ public: ); int append_match_where_part( ulong sql_type - ); + ) override; int append_match_where( spider_string *str ); @@ -1052,7 +1052,7 @@ public: uint alias_length, ulong sql_type, bool test_flg - ); + ) override; int append_condition( spider_string *str, const char *alias, @@ -1076,7 +1076,7 @@ public: ulong sql_type, const char *alias, uint alias_length - ); + ) override; int append_match_select( spider_string *str, const char *alias, @@ -1087,7 +1087,7 @@ public: ulong sql_type, const char *alias, uint alias_length - ); + ) override; int append_sum_select( spider_string *str, const char *alias, @@ -1096,16 +1096,16 @@ public: #endif void set_order_pos( ulong sql_type - ); + ) override; void set_order_to_pos( ulong sql_type - ); + ) override; #ifdef HANDLER_HAS_DIRECT_AGGREGATE int append_group_by_part( const char *alias, uint alias_length, ulong sql_type - ); + ) override; int append_group_by( spider_string *str, const char *alias, @@ -1116,7 +1116,7 @@ public: const char *alias, uint alias_length, ulong sql_type - ); + ) override; int append_key_order_for_merge_with_alias( spider_string *str, const char *alias, @@ -1126,7 +1126,7 @@ public: const char *alias, uint alias_length, ulong sql_type - ); + ) override; int append_key_order_for_direct_order_limit_with_alias( spider_string *str, const char *alias, @@ -1136,7 +1136,7 @@ public: const char *alias, uint alias_length, ulong sql_type - ); + ) override; int append_key_order_for_handler( spider_string *str, const char *alias, @@ -1151,12 +1151,12 @@ public: longlong offset, longlong limit, ulong sql_type - ); + ) override; int reappend_limit_part( longlong offset, longlong limit, ulong sql_type - ); + ) override; int append_limit( spider_string *str, longlong offset, @@ -1164,25 +1164,25 @@ public: ); int append_select_lock_part( ulong sql_type - ); + ) override; int append_select_lock( spider_string *str ); int append_union_all_start_part( ulong sql_type - ); + ) override; int append_union_all_start( spider_string *str ); int append_union_all_part( ulong sql_type - ); + ) override; int append_union_all( spider_string *str ); int append_union_all_end_part( ulong sql_type - ); + ) override; int append_union_all_end( spider_string *str ); @@ -1190,7 +1190,7 @@ public: ulong sql_type, uint multi_range_cnt, bool with_comma - ); + ) override; int append_multi_range_cnt( spider_string *str, uint multi_range_cnt, @@ -1199,7 +1199,7 @@ public: int append_multi_range_cnt_with_name_part( ulong sql_type, uint multi_range_cnt - ); + ) override; int append_multi_range_cnt_with_name( spider_string *str, uint multi_range_cnt @@ -1209,7 +1209,7 @@ public: uint handler_id, SPIDER_CONN *conn, int link_idx - ); + ) override; int append_open_handler( spider_string *str, uint handler_id, @@ -1219,36 +1219,36 @@ public: int append_close_handler_part( ulong sql_type, int link_idx - ); + ) override; int append_close_handler( spider_string *str, int link_idx ); int append_insert_terminator_part( ulong sql_type - ); + ) override; int append_insert_terminator( spider_string *str ); int append_insert_values_part( ulong sql_type - ); + ) override; int append_insert_values( spider_string *str ); int append_into_part( ulong sql_type - ); + ) override; int append_into( spider_string *str ); void set_insert_to_pos( ulong sql_type - ); + ) override; int append_from_part( ulong sql_type, int link_idx - ); + ) override; int append_from( spider_string *str, ulong sql_type, @@ -1294,7 +1294,7 @@ public: ); int append_delete_all_rows_part( ulong sql_type - ); + ) override; int append_delete_all_rows( spider_string *str, ulong sql_type @@ -1309,7 +1309,7 @@ public: const key_range *end_key, ulong sql_type, int link_idx - ); + ) override; int append_explain_select( spider_string *str, const key_range *start_key, @@ -1319,32 +1319,32 @@ public: ); bool is_sole_projection_field( uint16 field_index - ); + ) override; bool is_bulk_insert_exec_period( bool bulk_end - ); + ) override; bool sql_is_filled_up( ulong sql_type - ); + ) override; bool sql_is_empty( ulong sql_type - ); - bool support_multi_split_read(); - bool support_bulk_update(); - int bulk_tmp_table_insert(); + ) override; + bool support_multi_split_read() override; + bool support_bulk_update() override; + int bulk_tmp_table_insert() override; int bulk_tmp_table_insert( int link_idx - ); - int bulk_tmp_table_end_bulk_insert(); - int bulk_tmp_table_rnd_init(); - int bulk_tmp_table_rnd_next(); - int bulk_tmp_table_rnd_end(); + ) override; + int bulk_tmp_table_end_bulk_insert() override; + int bulk_tmp_table_rnd_init() override; + int bulk_tmp_table_rnd_next() override; + int bulk_tmp_table_rnd_end() override; bool need_copy_for_update( int link_idx - ); - bool bulk_tmp_table_created(); - int mk_bulk_tmp_table_and_bulk_start(); - void rm_bulk_tmp_table(); + ) override; + bool bulk_tmp_table_created() override; + int mk_bulk_tmp_table_and_bulk_start() override; + void rm_bulk_tmp_table() override; int store_sql_to_bulk_tmp_table( spider_string *str, TABLE *tmp_table @@ -1356,156 +1356,156 @@ public: int insert_lock_tables_list( SPIDER_CONN *conn, int link_idx - ); + ) override; int append_lock_tables_list( SPIDER_CONN *conn, int link_idx, int *appended - ); + ) override; int realloc_sql( ulong *realloced - ); + ) override; int reset_sql( ulong sql_type - ); + ) override; #ifdef SPIDER_HAS_GROUP_BY_HANDLER int set_sql_for_exec( ulong sql_type, int link_idx, SPIDER_LINK_IDX_CHAIN *link_idx_chain - ); + ) override; #endif int set_sql_for_exec( ulong sql_type, int link_idx - ); + ) override; int set_sql_for_exec( spider_db_copy_table *tgt_ct, ulong sql_type - ); + ) override; int execute_sql( ulong sql_type, SPIDER_CONN *conn, int quick_mode, int *need_mon - ); - int reset(); + ) override; + int reset() override; int sts_mode_exchange( int sts_mode - ); + ) override; int show_table_status( int link_idx, int sts_mode, uint flag - ); + ) override; int crd_mode_exchange( int crd_mode - ); + ) override; int show_index( int link_idx, int crd_mode - ); + ) override; int simple_action( uint simple_action, int link_idx ); int show_records( int link_idx - ); + ) override; #ifdef HA_HAS_CHECKSUM_EXTENDED int checksum_table( int link_idx - ); + ) override; #endif int show_last_insert_id( int link_idx, ulonglong &last_insert_id - ); + ) override; ha_rows explain_select( const key_range *start_key, const key_range *end_key, int link_idx - ); + ) override; int lock_tables( int link_idx - ); + ) override; int unlock_tables( int link_idx - ); + ) override; int disable_keys( SPIDER_CONN *conn, int link_idx - ); + ) override; int enable_keys( SPIDER_CONN *conn, int link_idx - ); + ) override; int check_table( SPIDER_CONN *conn, int link_idx, HA_CHECK_OPT* check_opt - ); + ) override; int repair_table( SPIDER_CONN *conn, int link_idx, HA_CHECK_OPT* check_opt - ); + ) override; int analyze_table( SPIDER_CONN *conn, int link_idx - ); + ) override; int optimize_table( SPIDER_CONN *conn, int link_idx - ); + ) override; int flush_tables( SPIDER_CONN *conn, int link_idx, bool lock - ); + ) override; int flush_logs( SPIDER_CONN *conn, int link_idx - ); + ) override; int insert_opened_handler( SPIDER_CONN *conn, int link_idx - ); + ) override; int delete_opened_handler( SPIDER_CONN *conn, int link_idx - ); + ) override; int sync_from_clone_source( spider_db_handler *dbton_hdl - ); + ) override; bool support_use_handler( int use_handler - ); + ) override; void minimum_select_bitmap_create(); bool minimum_select_bit_is_set( uint field_index - ); + ) override; void copy_minimum_select_bitmap( uchar *bitmap - ); - int init_union_table_name_pos(); - int set_union_table_name_pos(); + ) override; + int init_union_table_name_pos() override; + int set_union_table_name_pos() override; int reset_union_table_name( spider_string *str, int link_idx, ulong sql_type - ); + ) override; #ifdef SPIDER_HAS_GROUP_BY_HANDLER int append_from_and_tables_part( spider_fields *fields, ulong sql_type - ); + ) override; int append_where_part( ulong sql_type - ); + ) override; int append_having_part( ulong sql_type - ); + ) override; int append_item_type_part( Item *item, const char *alias, @@ -1513,7 +1513,7 @@ public: bool use_fields, spider_fields *fields, ulong sql_type - ); + ) override; int append_list_item_select_part( List *select, const char *alias, @@ -1521,7 +1521,7 @@ public: bool use_fields, spider_fields *fields, ulong sql_type - ); + ) override; int append_list_item_select( List *select, spider_string *str, @@ -1537,7 +1537,7 @@ public: bool use_fields, spider_fields *fields, ulong sql_type - ); + ) override; int append_group_by( ORDER *order, spider_string *str, @@ -1553,7 +1553,7 @@ public: bool use_fields, spider_fields *fields, ulong sql_type - ); + ) override; int append_order_by( ORDER *order, spider_string *str, @@ -1568,12 +1568,12 @@ public: st_select_lex *select_lex, longlong select_limit, longlong offset_limit - ); + ) override; bool check_direct_delete( st_select_lex *select_lex, longlong select_limit, longlong offset_limit - ); + ) override; #endif }; @@ -1607,49 +1607,49 @@ public: spider_mbase_share *db_share ); virtual ~spider_mbase_copy_table(); - int init(); + int init() override; void set_sql_charset( CHARSET_INFO *cs - ); - int append_select_str(); + ) override; + int append_select_str() override; int append_insert_str( int insert_flg - ); + ) override; int append_table_columns( TABLE_SHARE *table_share - ); - int append_from_str(); + ) override; + int append_from_str() override; int append_table_name( int link_idx - ); - void set_sql_pos(); - void set_sql_to_pos(); + ) override; + void set_sql_pos() override; + void set_sql_to_pos() override; int append_copy_where( spider_db_copy_table *source_ct, KEY *key_info, ulong *last_row_pos, ulong *last_lengths - ); + ) override; int append_key_order_str( KEY *key_info, int start_pos, bool desc_flg - ); + ) override; int append_limit( longlong offset, longlong limit - ); - int append_into_str(); - int append_open_paren_str(); - int append_values_str(); + ) override; + int append_into_str() override; + int append_open_paren_str() override; + int append_values_str() override; int append_select_lock_str( int lock_mode - ); + ) override; int exec_query( SPIDER_CONN *conn, int quick_mode, int *need_mon - ); + ) override; int copy_key_row( spider_db_copy_table *source_ct, Field *field, @@ -1667,15 +1667,15 @@ public: SPIDER_DB_ROW *row, ulong **last_row_pos, ulong **last_lengths - ); + ) override; int copy_rows( TABLE *table, SPIDER_DB_ROW *row - ); - int append_insert_terminator(); + ) override; + int append_insert_terminator() override; int copy_insert_values( spider_db_copy_table *source_ct - ); + ) override; }; class spider_mysql_copy_table: public spider_mbase_copy_table diff --git a/storage/spider/spd_group_by_handler.h b/storage/spider/spd_group_by_handler.h index 09f82168708..b3984951ec5 100644 --- a/storage/spider/spd_group_by_handler.h +++ b/storage/spider/spd_group_by_handler.h @@ -32,9 +32,9 @@ public: spider_fields *fields_arg ); ~spider_group_by_handler(); - int init_scan(); - int next_row(); - int end_scan(); + int init_scan() override; + int next_row() override; + int end_scan() override; }; group_by_handler *spider_create_group_by_handler( diff --git a/storage/test_sql_discovery/test_sql_discovery.cc b/storage/test_sql_discovery/test_sql_discovery.cc index 0758d5f503f..0e009fca59b 100644 --- a/storage/test_sql_discovery/test_sql_discovery.cc +++ b/storage/test_sql_discovery/test_sql_discovery.cc @@ -48,7 +48,7 @@ public: { thr_lock_init(&lock); } - ~TSD_share() + ~TSD_share() override { thr_lock_delete(&lock); } @@ -64,17 +64,17 @@ private: public: ha_tsd(handlerton *hton, TABLE_SHARE *table_arg) : handler(hton, table_arg) { } - ulonglong table_flags() const + ulonglong table_flags() const override { // NO_TRANSACTIONS and everything that affects CREATE TABLE return HA_NO_TRANSACTIONS | HA_CAN_GEOMETRY | HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_CAN_RTREEKEYS | HA_CAN_FULLTEXT; } - ulong index_flags(uint inx, uint part, bool all_parts) const { return 0; } + ulong index_flags(uint inx, uint part, bool all_parts) const override { return 0; } THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type) + enum thr_lock_type lock_type) override { if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) lock.type = lock_type; @@ -82,17 +82,17 @@ public: return to; } - int rnd_init(bool scan) { return 0; } - int rnd_next(unsigned char *buf) { return HA_ERR_END_OF_FILE; } - void position(const uchar *record) { } - int rnd_pos(uchar *buf, uchar *pos) { return HA_ERR_END_OF_FILE; } - int info(uint flag) { return 0; } - uint max_supported_keys() const { return 16; } + int rnd_init(bool scan) override { return 0; } + int rnd_next(unsigned char *buf) override { return HA_ERR_END_OF_FILE; } + void position(const uchar *record) override { } + int rnd_pos(uchar *buf, uchar *pos) override { return HA_ERR_END_OF_FILE; } + int info(uint flag) override { return 0; } + uint max_supported_keys() const override { return 16; } int create(const char *name, TABLE *table_arg, - HA_CREATE_INFO *create_info) { return HA_ERR_WRONG_COMMAND; } + HA_CREATE_INFO *create_info) override { return HA_ERR_WRONG_COMMAND; } - int open(const char *name, int mode, uint test_if_locked); - int close(void); + int open(const char *name, int mode, uint test_if_locked) override; + int close(void) override; }; TSD_share *ha_tsd::get_share() diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index 79c8b9a8cca..e47a67f6880 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -80,7 +80,7 @@ PermissionsStartOnly=true # Do not panic if galera_recovery script is not available. (MDEV-10538) ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ - VAR=`cd @bindir@/..; @bindir@/galera_recovery`; [ $? -eq 0 ] \ + VAR=`@bindir@/galera_recovery`; [ $? -eq 0 ] \ && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1" # Needed to create system tables etc. diff --git a/tpool/aio_simulated.cc b/tpool/aio_simulated.cc index 4bc58c2930c..4167b8cdd1a 100644 --- a/tpool/aio_simulated.cc +++ b/tpool/aio_simulated.cc @@ -142,7 +142,7 @@ public: pool->submit_task(&cb->m_internal_task); } - virtual int submit_io(aiocb *aiocb) override + int submit_io(aiocb *aiocb) override { aiocb->m_internal_task.m_func = simulated_aio_callback; aiocb->m_internal_task.m_arg = aiocb; @@ -152,8 +152,8 @@ public: return 0; } - virtual int bind(native_file_handle &fd) override { return 0; } - virtual int unbind(const native_file_handle &fd) override { return 0; } + int bind(native_file_handle &fd) override { return 0; } + int unbind(const native_file_handle &fd) override { return 0; } }; aio *create_simulated_aio(thread_pool *tp) diff --git a/tpool/aio_win.cc b/tpool/aio_win.cc index b44f705bd1e..eec37383152 100644 --- a/tpool/aio_win.cc +++ b/tpool/aio_win.cc @@ -102,7 +102,7 @@ public: m_thread.join(); } - virtual int submit_io(aiocb* cb) override + int submit_io(aiocb* cb) override { memset((OVERLAPPED *)cb, 0, sizeof(OVERLAPPED)); cb->m_internal = this; @@ -123,12 +123,12 @@ public: } // Inherited via aio - virtual int bind(native_file_handle& fd) override + int bind(native_file_handle& fd) override { return CreateIoCompletionPort(fd, m_completion_port, 0, 0) ? 0 : GetLastError(); } - virtual int unbind(const native_file_handle& fd) override { return 0; } + int unbind(const native_file_handle& fd) override { return 0; } }; aio* create_win_aio(thread_pool* pool, int max_io) diff --git a/tpool/tpool_generic.cc b/tpool/tpool_generic.cc index 774576d5cde..9ed832dd1ed 100644 --- a/tpool/tpool_generic.cc +++ b/tpool/tpool_generic.cc @@ -304,11 +304,11 @@ class thread_pool_generic : public thread_pool } public: thread_pool_generic(int min_threads, int max_threads); - ~thread_pool_generic(); + ~thread_pool_generic() override; void wait_begin() override; void wait_end() override; void submit_task(task *task) override; - virtual aio *create_native_aio(int max_io) override + aio *create_native_aio(int max_io) override { #ifdef _WIN32 return create_win_aio(this, max_io); @@ -436,13 +436,13 @@ public: m_task.wait(); } - virtual ~timer_generic() + ~timer_generic() override { disarm(); } }; timer_generic m_maintenance_timer; - virtual timer* create_timer(callback_func func, void *data) override + timer* create_timer(callback_func func, void *data) override { return new timer_generic(func, data, this); } diff --git a/tpool/tpool_win.cc b/tpool/tpool_win.cc index 88168b26eff..4e119332dd1 100644 --- a/tpool/tpool_win.cc +++ b/tpool/tpool_win.cc @@ -143,7 +143,7 @@ class thread_pool_win : public thread_pool /** Submit async IO. */ - virtual int submit_io(aiocb* cb) override + int submit_io(aiocb* cb) override { memset((OVERLAPPED *)cb, 0, sizeof(OVERLAPPED)); @@ -191,7 +191,7 @@ class thread_pool_win : public thread_pool /** Binds the file handle via CreateThreadpoolIo(). */ - virtual int bind(native_file_handle& fd) override + int bind(native_file_handle& fd) override { fd.m_ptp_io = CreateThreadpoolIo(fd.m_handle, io_completion_callback, 0, &(m_pool.m_env)); @@ -203,7 +203,7 @@ class thread_pool_win : public thread_pool /** Unbind the file handle via CloseThreadpoolIo. */ - virtual int unbind(const native_file_handle& fd) override + int unbind(const native_file_handle& fd) override { if (fd.m_ptp_io) CloseThreadpoolIo(fd.m_ptp_io); @@ -261,7 +261,7 @@ public: task->execute(); } - virtual void submit_task(task *task) override + void submit_task(task *task) override { auto entry= m_task_cache.get(); task->add_ref(); diff --git a/unittest/sql/my_apc-t.cc b/unittest/sql/my_apc-t.cc index 9edb209b1f6..e3f8293ffcb 100644 --- a/unittest/sql/my_apc-t.cc +++ b/unittest/sql/my_apc-t.cc @@ -123,7 +123,7 @@ public: int *where_to; // Where to write it Apc_order(int a, int *b) : value(a), where_to(b) {} - void call_in_target_thread() + void call_in_target_thread() override { my_sleep(int_rand(1000)); *where_to = value;