From 6c174bd2a59dfb411b0830455121618acfc10406 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 21 Feb 2017 13:39:24 +0100 Subject: [PATCH] Bug #25597667: REMOVE MY_BOOL Replace my_bool with bool everywhere. Change-Id: Ibfe9f9b4a05d8ee82d09ffdc4f1f038ec4555b89 --- client/base/abstract_program.cc | 4 +- client/base/abstract_program.h | 2 +- client/check/mysqlcheck.cc | 18 +- client/check/mysqlcheck.h | 18 +- client/check/mysqlcheck_core.cc | 34 ++-- client/get_password.c | 2 +- client/mysql.cc | 70 ++++---- client/mysql_config_editor.cc | 32 ++-- client/mysql_secure_installation.cc | 18 +- client/mysql_ssl_rsa_setup.cc | 6 +- client/mysqladmin.cc | 42 ++--- client/mysqlbinlog.cc | 26 +-- client/mysqlbinlog.h | 4 +- client/mysqldump.cc | 110 ++++++------ client/mysqlimport.cc | 8 +- client/mysqlshow.cc | 14 +- client/mysqlslap.cc | 18 +- client/mysqltest.cc | 139 +++++++-------- dbug/dbug.c | 18 +- extra/regex/reginit.c | 2 +- include/decimal.h | 6 +- include/ft_global.h | 2 +- include/hash.h | 12 +- include/heap.h | 20 +-- include/keycache.h | 20 +-- include/m_ctype.h | 88 ++++----- include/m_string.h | 6 +- include/my_aes.h | 4 +- include/my_alloc.h | 6 +- include/my_bitmap.h | 28 +-- include/my_compare.h | 4 +- include/my_default.h | 16 +- include/my_getopt.h | 14 +- include/my_inttypes.h | 8 +- include/my_sys.h | 108 +++++------ include/my_thread.h | 7 +- include/my_time.h | 28 +-- include/my_timer.h | 4 +- include/my_tree.h | 6 +- include/myisam.h | 32 ++-- include/myisammrg.h | 10 +- include/mysql.h | 98 +++++----- include/mysql.h.pp | 132 +++++++------- include/mysql/plugin.h | 2 +- include/mysql/plugin_keyring.h | 16 +- include/mysql/plugin_keyring.h.pp | 14 +- include/mysql/psi/mysql_transaction.h | 4 +- include/mysql/psi/psi_abi_cond_v0.h.pp | 1 - include/mysql/psi/psi_abi_cond_v1.h.pp | 1 - include/mysql/psi/psi_abi_cond_v2.h.pp | 1 - include/mysql/psi/psi_abi_file_v0.h.pp | 1 - include/mysql/psi/psi_abi_file_v1.h.pp | 1 - include/mysql/psi/psi_abi_file_v2.h.pp | 1 - include/mysql/psi/psi_abi_idle_v0.h.pp | 1 - include/mysql/psi/psi_abi_idle_v1.h.pp | 1 - include/mysql/psi/psi_abi_idle_v2.h.pp | 1 - include/mysql/psi/psi_abi_mdl_v0.h.pp | 1 - include/mysql/psi/psi_abi_mdl_v1.h.pp | 1 - include/mysql/psi/psi_abi_mdl_v2.h.pp | 1 - include/mysql/psi/psi_abi_memory_v2.h.pp | 2 +- include/mysql/psi/psi_abi_mutex_v0.h.pp | 1 - include/mysql/psi/psi_abi_mutex_v1.h.pp | 1 - include/mysql/psi/psi_abi_mutex_v2.h.pp | 1 - include/mysql/psi/psi_abi_rwlock_v0.h.pp | 1 - include/mysql/psi/psi_abi_rwlock_v1.h.pp | 1 - include/mysql/psi/psi_abi_rwlock_v2.h.pp | 1 - include/mysql/psi/psi_abi_socket_v0.h.pp | 1 - include/mysql/psi/psi_abi_socket_v1.h.pp | 1 - include/mysql/psi/psi_abi_socket_v2.h.pp | 1 - include/mysql/psi/psi_abi_stage_v0.h.pp | 1 - include/mysql/psi/psi_abi_stage_v1.h.pp | 1 - include/mysql/psi/psi_abi_stage_v2.h.pp | 1 - include/mysql/psi/psi_abi_statement_v0.h.pp | 1 - include/mysql/psi/psi_abi_statement_v1.h.pp | 5 +- include/mysql/psi/psi_abi_statement_v2.h.pp | 1 - include/mysql/psi/psi_abi_table_v0.h.pp | 1 - include/mysql/psi/psi_abi_table_v1.h.pp | 5 +- include/mysql/psi/psi_abi_table_v2.h.pp | 1 - include/mysql/psi/psi_abi_thread_v0.h.pp | 1 - include/mysql/psi/psi_abi_thread_v1.h.pp | 1 - include/mysql/psi/psi_abi_thread_v2.h.pp | 1 - include/mysql/psi/psi_abi_transaction_v0.h.pp | 1 - include/mysql/psi/psi_abi_transaction_v1.h.pp | 11 +- include/mysql/psi/psi_abi_transaction_v2.h.pp | 1 - include/mysql/psi/psi_statement.h | 4 +- include/mysql/psi/psi_table.h | 4 +- include/mysql/psi/psi_transaction.h | 10 +- include/mysql/service_rpl_transaction_ctx.h | 8 +- include/mysql/services.h.pp | 9 +- include/mysql_com.h | 34 ++-- include/mysql_com_server.h | 4 +- include/mysql_time.h | 4 +- include/pfs_table_provider.h | 4 +- include/pfs_transaction_provider.h | 8 +- include/sql_chars.h | 4 +- include/sql_common.h | 46 ++--- include/sslopt-vars.h | 2 +- include/str_uca_type.h | 4 +- include/thr_lock.h | 4 +- include/thr_mutex.h | 4 +- include/thr_rwlock.h | 4 +- include/violite.h | 46 ++--- libmysql/client_settings.h | 4 +- libmysql/get_password.cc | 2 +- libmysql/libmysql.cc | 115 ++++++------ libmysql/mysql_trace.c | 2 +- mysys/array.cc | 16 +- mysys/base64.cc | 8 +- mysys/charset-def.cc | 2 +- mysys/charset.cc | 26 +-- mysys/hash.cc | 12 +- mysys/mf_arr_appstr.cc | 6 +- mysys/mf_cache.cc | 8 +- mysys/mf_iocache.cc | 14 +- mysys/mf_iocache2.cc | 2 +- mysys/mf_keycache.cc | 24 +-- mysys/mf_keycaches.cc | 18 +- mysys/mf_qsort.cc | 4 +- mysys/mf_radix.cc | 4 +- mysys/mf_tempdir.cc | 2 +- mysys/my_access.cc | 8 +- mysys/my_alloc.cc | 6 +- mysys/my_bitmap.cc | 28 +-- mysys/my_chmod.cc | 4 +- mysys/my_compare.cc | 30 ++-- mysys/my_compress.cc | 4 +- mysys/my_conio.cc | 2 +- mysys/my_copy.cc | 4 +- mysys/my_error.cc | 2 +- mysys/my_gethwaddr.cc | 10 +- mysys/my_getwd.cc | 4 +- mysys/my_init.cc | 10 +- mysys/my_largepage.cc | 6 +- mysys/my_static.cc | 8 +- mysys/my_string.cc | 20 +-- mysys/my_thr_init.cc | 12 +- mysys/my_time.cc | 33 ++-- mysys/my_windac.cc | 4 +- mysys/psi_noop.cc | 12 +- mysys/sql_chars.cc | 4 +- mysys/stacktrace.cc | 8 +- mysys/thr_lock.cc | 18 +- mysys/thr_mutex.cc | 4 +- mysys/tree.cc | 4 +- mysys/typelib.cc | 4 +- mysys_ssl/my_aes_openssl.cc | 2 +- mysys_ssl/my_aes_yassl.cc | 2 +- mysys_ssl/my_default.cc | 44 ++--- mysys_ssl/my_getopt.cc | 64 +++---- plugin/audit_null/audit_null.c | 4 +- .../daemon/memcached_mysql.cc | 4 +- plugin/keyring/buffer.cc | 4 +- plugin/keyring/buffer.h | 4 +- plugin/keyring/buffered_file_io.cc | 32 ++-- plugin/keyring/buffered_file_io.h | 30 ++-- plugin/keyring/checker/checker.cc | 8 +- plugin/keyring/checker/checker.h | 14 +- plugin/keyring/checker/checker_ver_1_0.cc | 8 +- plugin/keyring/checker/checker_ver_1_0.h | 6 +- plugin/keyring/checker/checker_ver_2_0.cc | 6 +- plugin/keyring/checker/checker_ver_2_0.h | 6 +- plugin/keyring/common/i_keyring_io.h | 10 +- plugin/keyring/common/i_keyring_key.h | 10 +- plugin/keyring/common/i_keys_container.h | 8 +- plugin/keyring/common/i_serialized_object.h | 4 +- plugin/keyring/common/keyring.h | 24 +-- plugin/keyring/common/keyring_impl.cc | 14 +- plugin/keyring/common/keyring_key.cc | 20 +-- plugin/keyring/common/keyring_key.h | 20 +-- plugin/keyring/common/keys_container.cc | 20 +-- plugin/keyring/common/keys_container.h | 16 +- plugin/keyring/digest.cc | 2 +- plugin/keyring/digest.h | 4 +- plugin/keyring/file_io.cc | 6 +- plugin/keyring/file_io.h | 4 +- plugin/keyring/hash_to_buffer_serializer.cc | 8 +- plugin/keyring/hash_to_buffer_serializer.h | 4 +- plugin/keyring/keyring-test/keyring-test.cc | 14 +- plugin/keyring/keyring.cc | 16 +- plugin/keyring_udf/keyring_udf.cc | 32 ++-- .../password_validation/validate_password.cc | 2 +- plugin/rewriter/rewriter_plugin.cc | 2 +- plugin/rewriter/rewriter_udf.cc | 2 +- plugin/semisync/semisync_master.cc | 6 +- plugin/semisync/semisync_master.h | 4 +- plugin/semisync/semisync_slave.cc | 2 +- plugin/semisync/semisync_slave.h | 2 +- .../test_session_detach.cc | 2 +- .../test_service_sql_api/test_session_info.cc | 2 +- .../test_sql_2_sessions.cc | 2 +- .../test_sql_9_sessions.cc | 10 +- .../test_service_sql_api/test_sql_cmds_1.cc | 2 +- .../test_service_sql_api/test_sql_errors.cc | 2 +- plugin/test_service_sql_api/test_sql_lock.cc | 2 +- .../test_sql_processlist.cc | 2 +- .../test_service_sql_api/test_sql_shutdown.cc | 2 +- plugin/udf_services/test_udf_services.cc | 2 +- plugin/version_token/version_token.cc | 30 ++-- rapid/plugin/group_replication/src/plugin.cc | 34 ++-- rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h | 21 +-- .../x/mysqlxtest_src/mysqlx/mysqlx_priv.h | 8 +- .../x/ngs/include/ngs/protocol/row_builder.h | 2 +- .../plugin/x/ngs/src/protocol/row_builder.cc | 2 +- .../x/src/streaming_command_delegate.cc | 2 +- sql-common/client.cc | 90 +++++----- sql-common/client_plugin.c | 2 +- sql-common/net_serv.cc | 34 ++-- sql/auth/auth_common.h | 16 +- sql/auth/auth_internal.h | 2 +- sql/auth/password.c | 4 +- sql/auth/service_security_context.cc | 2 +- sql/auth/sql_auth_cache.cc | 36 ++-- sql/auth/sql_authentication.cc | 6 +- sql/binlog.cc | 8 +- sql/conn_handler/init_net_server_extension.cc | 2 +- sql/dd/dd_upgrade.cc | 8 +- sql/dd/impl/bootstrapper.cc | 6 +- sql/dd/impl/raw/raw_record.cc | 4 +- sql/event_data_objects.cc | 4 +- sql/event_data_objects.h | 6 +- sql/event_parse_data.cc | 6 +- sql/event_parse_data.h | 6 +- sql/events.cc | 4 +- sql/events.h | 2 +- sql/field.cc | 4 +- sql/field.h | 8 +- sql/ha_ndbcluster.cc | 36 ++-- sql/ha_ndbcluster.h | 21 +-- sql/ha_ndbcluster_binlog.cc | 30 ++-- sql/ha_ndbcluster_binlog.h | 2 +- sql/ha_ndbinfo.cc | 6 +- sql/handler.cc | 82 ++++----- sql/handler.h | 14 +- sql/hash_filo.h | 2 +- sql/item.h | 2 +- sql/item_cmpfunc.cc | 2 +- sql/item_cmpfunc.h | 4 +- sql/item_func.cc | 2 +- sql/item_timefunc.cc | 6 +- sql/keyring_service.cc | 10 +- sql/locking_service_udf.cc | 14 +- sql/log_event.cc | 18 +- sql/log_event.h | 8 +- sql/my_decimal.h | 4 +- sql/mysqld.cc | 106 +++++------ sql/mysqld.h | 78 ++++---- sql/ndb_share.h | 6 +- sql/opt_hints.h | 2 +- sql/opt_range.cc | 12 +- sql/parse_file.cc | 4 +- sql/parse_file.h | 10 +- sql/partitioning/partition_handler.h | 2 +- sql/rpl_master.cc | 2 +- sql/rpl_master.h | 4 +- sql/rpl_mi.cc | 4 +- sql/rpl_mi.h | 4 +- sql/rpl_rli_pdb.cc | 2 +- sql/rpl_slave.cc | 2 +- sql/rpl_slave.h | 6 +- sql/rpl_utility.h | 2 +- sql/sql_audit.cc | 8 +- sql/sql_base.cc | 8 +- sql/sql_bitmap.h | 32 ++-- sql/sql_cache.h | 6 +- sql/sql_class.h | 8 +- sql/sql_connect.cc | 4 +- sql/sql_db.cc | 4 +- sql/sql_initialize.cc | 2 +- sql/sql_initialize.h | 2 +- sql/sql_optimizer.cc | 4 +- sql/sql_parse.cc | 24 +-- sql/sql_plugin.cc | 44 ++--- sql/sql_plugin.h | 6 +- sql/sql_query_rewrite.cc | 2 +- sql/sql_query_rewrite.h | 2 +- sql/sql_select.cc | 6 +- sql/sql_show.cc | 38 ++-- sql/sql_table.cc | 8 +- sql/sql_table.h | 10 +- sql/sql_time.cc | 8 +- sql/sql_time.h | 2 +- sql/sql_tmp_table.cc | 6 +- sql/sql_tmp_table.h | 4 +- sql/sql_udf.h | 4 +- sql/sql_update.cc | 2 +- sql/sys_vars.cc | 168 +++++++++--------- sql/sys_vars.h | 58 +++--- sql/system_variables.h | 34 ++-- sql/table.cc | 4 +- sql/table.h | 38 ++-- sql/tztime.cc | 36 ++-- sql/tztime.h | 4 +- sql/udf_example.cc | 58 +++--- sql/xa.cc | 14 +- sql/xa.h | 4 +- storage/csv/ha_tina.cc | 4 +- storage/csv/ha_tina.h | 2 +- storage/heap/_check.c | 10 +- storage/heap/ha_heap.cc | 6 +- storage/heap/ha_heap.h | 2 +- storage/heap/heapdef.h | 4 +- storage/heap/hp_create.c | 4 +- storage/heap/hp_hash.c | 2 +- storage/heap/hp_open.c | 2 +- storage/heap/hp_test1.c | 2 +- storage/heap/hp_test2.c | 4 +- storage/heap/hp_update.c | 2 +- storage/innobase/api/api0api.cc | 6 +- storage/innobase/btr/btr0sea.cc | 2 +- storage/innobase/buf/buf0buf.cc | 2 +- storage/innobase/buf/buf0flu.cc | 4 +- storage/innobase/buf/buf0lru.cc | 2 +- storage/innobase/dict/dict0crea.cc | 6 +- storage/innobase/dict/dict0load.cc | 2 +- storage/innobase/dict/dict0stats_bg.cc | 4 +- storage/innobase/fts/fts0opt.cc | 2 +- storage/innobase/handler/ha_innodb.cc | 72 ++++---- storage/innobase/handler/ha_innodb.h | 6 +- storage/innobase/handler/ha_innopart.cc | 2 +- storage/innobase/handler/ha_innopart.h | 4 +- storage/innobase/ibuf/ibuf0ibuf.cc | 2 +- storage/innobase/include/api0misc.h | 6 +- storage/innobase/include/btr0types.h | 2 +- storage/innobase/include/buf0flu.h | 4 +- storage/innobase/include/dict0stats_bg.h | 4 +- storage/innobase/include/fts0fts.h | 2 +- storage/innobase/include/ha_prototypes.h | 4 +- storage/innobase/include/lock0lock.h | 4 +- storage/innobase/include/log0log.h | 2 +- storage/innobase/include/os0proc.h | 4 +- storage/innobase/include/page0zip.h | 2 +- storage/innobase/include/srv0srv.h | 54 +++--- storage/innobase/lock/lock0lock.cc | 2 +- storage/innobase/log/log0log.cc | 4 +- storage/innobase/os/os0proc.cc | 2 +- storage/innobase/page/page0zip.cc | 4 +- storage/innobase/row/row0merge.cc | 2 +- storage/innobase/srv/srv0srv.cc | 46 ++--- storage/innobase/sync/sync0arr.cc | 2 +- storage/innobase/sync/sync0debug.cc | 2 +- storage/innobase/trx/trx0purge.cc | 2 +- storage/myisam/ft_boolean_search.c | 12 +- storage/myisam/ft_parser.c | 4 +- storage/myisam/ftdefs.h | 2 +- storage/myisam/ha_myisam.cc | 8 +- storage/myisam/ha_myisam.h | 10 +- storage/myisam/mi_check.c | 34 ++-- storage/myisam/mi_close.c | 2 +- storage/myisam/mi_dbug.c | 2 +- storage/myisam/mi_delete.c | 4 +- storage/myisam/mi_dynrec.c | 12 +- storage/myisam/mi_extra.c | 12 +- storage/myisam/mi_key.c | 8 +- storage/myisam/mi_locking.c | 4 +- storage/myisam/mi_open.c | 4 +- storage/myisam/mi_packrec.c | 12 +- storage/myisam/mi_panic.c | 2 +- storage/myisam/mi_preload.c | 2 +- storage/myisam/mi_range.c | 2 +- storage/myisam/mi_rrnd.c | 2 +- storage/myisam/mi_search.c | 22 +-- storage/myisam/mi_static.c | 2 +- storage/myisam/mi_statrec.c | 2 +- storage/myisam/mi_test1.c | 6 +- storage/myisam/mi_unique.c | 6 +- storage/myisam/mi_update.c | 2 +- storage/myisam/mi_write.c | 22 +-- storage/myisam/myisam_ftdump.c | 6 +- storage/myisam/myisamchk.c | 24 +-- storage/myisam/myisamdef.h | 70 ++++---- storage/myisam/myisamlog.c | 6 +- storage/myisam/myisampack.c | 16 +- storage/myisam/queues.cc | 10 +- storage/myisam/queues.h | 12 +- storage/myisam/sort.c | 2 +- storage/myisammrg/ha_myisammrg.cc | 4 +- storage/myisammrg/ha_myisammrg.h | 2 +- storage/myisammrg/myrg_create.c | 2 +- storage/myisammrg/myrg_open.c | 8 +- storage/ndb/include/portlib/NdbThread.h | 8 +- storage/ndb/include/util/ndb_opts.h | 12 +- storage/ndb/src/common/portlib/NdbThread.c | 30 ++-- storage/ndb/src/common/util/ndb_opts.cpp | 6 +- storage/ndb/src/cw/cpcd/main.cpp | 4 +- storage/ndb/src/kernel/ndbd.cpp | 4 +- storage/ndb/src/kernel/vm/mt_thr_config.cpp | 4 +- .../ndb/src/mgmsrv/InitConfigFileParser.cpp | 4 +- storage/ndb/src/mgmsrv/MgmtSrvr.cpp | 4 +- storage/ndb/test/ndbapi/testFK.cpp | 4 +- storage/ndb/test/ndbapi/testIndexStat.cpp | 6 +- storage/ndb/test/ndbapi/test_event_merge.cpp | 20 +-- storage/ndb/test/run-test/main.cpp | 4 +- storage/ndb/test/src/DbUtil.cpp | 6 +- storage/ndb/test/src/SqlClient.cpp | 4 +- storage/ndb/tools/delete_all.cpp | 8 +- storage/ndb/tools/ndb_blob_tool.cpp | 8 +- storage/ndb/tools/ndb_index_stat.cpp | 24 +-- storage/ndb/tools/ndb_move_data.cpp | 16 +- storage/ndb/tools/restore/restore_main.cpp | 4 +- storage/perfschema/ha_perfschema.h | 2 +- storage/perfschema/pfs.cc | 10 +- storage/perfschema/pfs_events_transactions.h | 6 +- storage/perfschema/pfs_instr_class.cc | 2 +- storage/perfschema/pfs_instr_class.h | 2 +- strings/conf_to_src.cc | 2 +- strings/ctype-big5.cc | 2 +- strings/ctype-bin.cc | 6 +- strings/ctype-cp932.cc | 2 +- strings/ctype-czech.cc | 14 +- strings/ctype-gb18030.cc | 6 +- strings/ctype-gbk.cc | 2 +- strings/ctype-latin1.cc | 2 +- strings/ctype-mb.cc | 16 +- strings/ctype-simple.cc | 32 ++-- strings/ctype-sjis.cc | 2 +- strings/ctype-tis620.cc | 2 +- strings/ctype-uca.cc | 38 ++-- strings/ctype-ucs2.cc | 12 +- strings/ctype-utf8.cc | 6 +- strings/ctype-win1250ch.cc | 4 +- strings/ctype.cc | 10 +- strings/decimal.cc | 2 +- strings/dtoa.cc | 8 +- strings/uctypedump.cc | 2 +- strings/xml.cc | 2 +- testclients/mysql_client_fw.c | 26 +-- testclients/mysql_client_test.c | 140 +++++++-------- unittest/gunit/dynarray-t.cc | 10 +- unittest/gunit/gunit_test_main.cc | 6 +- unittest/gunit/gunit_test_main_server.cc | 6 +- unittest/gunit/keyring/buffered_file_io_10.cc | 8 +- unittest/gunit/keyring/buffered_file_io_10.h | 4 +- unittest/gunit/keyring/keys_container-t.cc | 18 +- unittest/gunit/rpl_group_set-t.cc | 6 +- unittest/gunit/thread_utils.cc | 2 +- utilities/comp_client_err.cc | 2 +- utilities/comp_err.cc | 12 +- utilities/ibd2sdi.cc | 2 +- utilities/innochecksum.cc | 8 +- utilities/my_print_defaults.c | 6 +- utilities/perror.cc | 10 +- utilities/resolve_stack_dump.cc | 2 +- utilities/resolveip.cc | 4 +- vio/test-ssl.c | 2 +- vio/vio.cc | 8 +- vio/vio_priv.h | 10 +- vio/viopipe.cc | 4 +- vio/vioshm.cc | 2 +- vio/viosocket.cc | 34 ++-- vio/viossl.cc | 10 +- vio/viosslfactories.cc | 6 +- 451 files changed, 2730 insertions(+), 2777 deletions(-) diff --git a/client/base/abstract_program.cc b/client/base/abstract_program.cc index 042570786ce0..f0ceb1702b40 100644 --- a/client/base/abstract_program.cc +++ b/client/base/abstract_program.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ using std::vector; extern const char *load_default_groups[]; -my_bool Abstract_program::callback_option_parsed( +bool Abstract_program::callback_option_parsed( int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) diff --git a/client/base/abstract_program.h b/client/base/abstract_program.h index 3b9f901bf4cd..d34faa128863 100644 --- a/client/base/abstract_program.h +++ b/client/base/abstract_program.h @@ -113,7 +113,7 @@ class Abstract_program : public Options::Composite_options_provider Redirects call to option_parsed of main Abstract_program instance. If we have anonymous functions or binding this should be removed. */ - static my_bool callback_option_parsed(int optid, + static bool callback_option_parsed(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument); diff --git a/client/check/mysqlcheck.cc b/client/check/mysqlcheck.cc index d8052d4e7475..5e80c8ba1e20 100644 --- a/client/check/mysqlcheck.cc +++ b/client/check/mysqlcheck.cc @@ -42,16 +42,16 @@ using std::vector; #define EX_MYSQLERR 2 static MYSQL mysql_connection, *sock = 0; -static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, - opt_compress = 0, opt_databases = 0, opt_fast = 0, - opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, - opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, - tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, - opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, - opt_write_binlog= 1, opt_secure_auth=TRUE; +static bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, + opt_compress = 0, opt_databases = 0, opt_fast = 0, + opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, + opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, + tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, + opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, + opt_write_binlog= 1, opt_secure_auth=TRUE; static uint verbose = 0, opt_mysql_port=0; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; +static bool using_opt_enable_cleartext_plugin= 0; static int my_end_arg; static char * opt_mysql_unix_port = 0; static char *opt_password = 0, *current_user = 0, @@ -266,7 +266,7 @@ static void usage(void) extern "C" { -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { diff --git a/client/check/mysqlcheck.h b/client/check/mysqlcheck.h index dc12ba316aeb..e3a5b91a59fa 100644 --- a/client/check/mysqlcheck.h +++ b/client/check/mysqlcheck.h @@ -28,15 +28,15 @@ namespace Check{ enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE }; -extern void mysql_check(MYSQL* connection, int what_to_do, my_bool opt_alldbs, - my_bool opt_check_only_changed, my_bool opt_extended, - my_bool opt_databases, my_bool opt_fast, - my_bool opt_medium_check, my_bool opt_quick, - my_bool opt_all_in_1, my_bool opt_silent, - my_bool opt_auto_repair, my_bool ignore_errors, - my_bool opt_frm, my_bool opt_fix_table_names, - my_bool opt_fix_db_names, my_bool opt_upgrade, - my_bool opt_write_binlog, uint verbose, +extern void mysql_check(MYSQL* connection, int what_to_do, bool opt_alldbs, + bool opt_check_only_changed, bool opt_extended, + bool opt_databases, bool opt_fast, + bool opt_medium_check, bool opt_quick, + bool opt_all_in_1, bool opt_silent, + bool opt_auto_repair, bool ignore_errors, + bool opt_frm, bool opt_fix_table_names, + bool opt_fix_db_names, bool opt_upgrade, + bool opt_write_binlog, uint verbose, std::string opt_skip_database, std::vector arguments, void (*dberror)(MYSQL *mysql, std::string when)); diff --git a/client/check/mysqlcheck_core.cc b/client/check/mysqlcheck_core.cc index 656477decef3..400bfda12eb4 100644 --- a/client/check/mysqlcheck_core.cc +++ b/client/check/mysqlcheck_core.cc @@ -38,12 +38,12 @@ using std::vector; #define KEY_PARTITIONING_CHANGED_STR "KEY () partitioning changed" static MYSQL *sock= 0; -static my_bool opt_alldbs= 0, opt_check_only_changed= 0, opt_extended= 0, - opt_databases= 0, opt_fast= 0, - opt_medium_check = 0, opt_quick= 0, opt_all_in_1= 0, - opt_silent= 0, opt_auto_repair= 0, ignore_errors= 0, - opt_frm= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, - opt_write_binlog= 1; +static bool opt_alldbs= 0, opt_check_only_changed= 0, opt_extended= 0, + opt_databases= 0, opt_fast= 0, + opt_medium_check = 0, opt_quick= 0, opt_all_in_1= 0, + opt_silent= 0, opt_auto_repair= 0, ignore_errors= 0, + opt_frm= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, + opt_write_binlog= 1; static uint verbose = 0; static string opt_skip_database; int what_to_do = 0; @@ -308,7 +308,7 @@ static void print_result() char prev_alter[MAX_ALTER_STR_SIZE]; uint i; size_t dot_pos; - my_bool found_error=0, table_rebuild=0; + bool found_error=0, table_rebuild=0; res = mysql_use_result(sock); dot_pos= strlen(sock->db) + 1; @@ -319,7 +319,7 @@ static void print_result() for (i = 0; (row = mysql_fetch_row(res)); i++) { int changed = strcmp(prev, row[0]); - my_bool status = !strcmp(row[2], "status"); + bool status = !strcmp(row[2], "status"); if (status) { @@ -415,15 +415,15 @@ static void print_result() } void Mysql::Tools::Check::mysql_check(MYSQL* connection, int what_to_do, - my_bool opt_alldbs, - my_bool opt_check_only_changed, my_bool opt_extended, - my_bool opt_databases, my_bool opt_fast, - my_bool opt_medium_check, my_bool opt_quick, - my_bool opt_all_in_1, my_bool opt_silent, - my_bool opt_auto_repair, my_bool ignore_errors, - my_bool opt_frm, my_bool opt_fix_table_names, - my_bool opt_fix_db_names, my_bool opt_upgrade, - my_bool opt_write_binlog, uint verbose, + bool opt_alldbs, + bool opt_check_only_changed, bool opt_extended, + bool opt_databases, bool opt_fast, + bool opt_medium_check, bool opt_quick, + bool opt_all_in_1, bool opt_silent, + bool opt_auto_repair, bool ignore_errors, + bool opt_frm, bool opt_fix_table_names, + bool opt_fix_db_names, bool opt_upgrade, + bool opt_write_binlog, uint verbose, std::string opt_skip_database, std::vector arguments, void (*dberror)(MYSQL *mysql, std::string when)) diff --git a/client/get_password.c b/client/get_password.c index 83d12eacfbc4..a5d74d39cdbb 100644 --- a/client/get_password.c +++ b/client/get_password.c @@ -113,7 +113,7 @@ char *get_tty_password_ext(const char *opt_message, * to will not include the eol characters. */ -static void get_password(char *to,uint length,int fd, my_bool echo) +static void get_password(char *to,uint length,int fd, bool echo) { char *pos=to,*end=to+length; diff --git a/client/mysql.cc b/client/mysql.cc index d0894c99cc7e..6bf4b60a29e6 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -147,31 +147,31 @@ enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT}; typedef enum enum_info_type INFO_TYPE; static MYSQL mysql; /* The connection */ -static my_bool ignore_errors=0,wait_flag=0,quick=0, - connected=0,opt_raw_data=0,unbuffered=0,output_tables=0, - opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0, - opt_compress=0, using_opt_local_infile=0, - vertical=0, line_numbers=1, column_names=1,opt_html=0, - opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0, - tty_password= 0, opt_nobeep=0, opt_reconnect=1, - opt_secure_auth= TRUE, - default_pager_set= 0, opt_sigint_ignore= 0, - auto_vertical_output= 0, - show_warnings= 0, executing_query= 0, interrupted_query= 0, - ignore_spaces= 0, sigint_received= 0, opt_syslog= 0; -static my_bool debug_info_flag, debug_check_flag; -static my_bool column_types_flag; -static my_bool preserve_comments= 0; +static bool ignore_errors=0,wait_flag=0,quick=0, + connected=0,opt_raw_data=0,unbuffered=0,output_tables=0, + opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0, + opt_compress=0, using_opt_local_infile=0, + vertical=0, line_numbers=1, column_names=1,opt_html=0, + opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0, + tty_password= 0, opt_nobeep=0, opt_reconnect=1, + opt_secure_auth= TRUE, + default_pager_set= 0, opt_sigint_ignore= 0, + auto_vertical_output= 0, + show_warnings= 0, executing_query= 0, interrupted_query= 0, + ignore_spaces= 0, sigint_received= 0, opt_syslog= 0; +static bool debug_info_flag, debug_check_flag; +static bool column_types_flag; +static bool preserve_comments= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; +static bool using_opt_enable_cleartext_plugin= 0; static uint my_end_arg; static char * opt_mysql_unix_port=0; static char *opt_bind_addr = NULL; static int connect_flag=CLIENT_INTERACTIVE; -static my_bool opt_binary_mode= FALSE; -static my_bool opt_connect_expired_password= FALSE; +static bool opt_binary_mode= FALSE; +static bool opt_connect_expired_password= FALSE; static char *current_host,*current_db,*current_user=0,*opt_password=0, *current_prompt=0, *delimiter_str= 0, *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME, @@ -239,7 +239,7 @@ const char *default_dbug_option="d:t:o,/tmp/mysql.trace"; For using this feature in test case, we add the option in debug code. */ #ifndef DBUG_OFF -static my_bool opt_build_completion_hash = FALSE; +static bool opt_build_completion_hash = FALSE; #endif #ifdef _WIN32 @@ -247,7 +247,7 @@ static my_bool opt_build_completion_hash = FALSE; A flag that indicates if --execute buffer has already been converted, to avoid double conversion on reconnect. */ -static my_bool execute_buffer_conversion_done= 0; +static bool execute_buffer_conversion_done= 0; /* my_win_is_console(...) is quite slow. @@ -264,7 +264,7 @@ static uint win_is_console_cache= (MY_TEST(my_win_is_console(stdout)) * (1 << _fileno(stdout))) | (MY_TEST(my_win_is_console(stderr)) * (1 << _fileno(stderr))); -static inline my_bool +static inline bool my_win_is_console_cached(FILE *file) { return win_is_console_cache & (1 << _fileno(file)); @@ -287,8 +287,8 @@ void tee_putc(int c, FILE *file); static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool); /* The names of functions that actually do the manipulation. */ static int get_options(int argc,char **argv); -extern "C" my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); +extern "C" bool get_one_option(int optid, const struct my_option *opt, + char *argument); static int com_quit(String *str,char*), com_go(String *str,char*), com_ego(String *str,char*), com_print(String *str,char*), @@ -322,7 +322,7 @@ static void init_tee(const char *); static void end_tee(); static const char* construct_prompt(); static inline void reset_prompt(char *in_string, bool *ml_comment); -static char *get_arg(char *line, my_bool get_next_arg); +static char *get_arg(char *line, bool get_next_arg); static void init_username(); static void add_int_to_prompt(int toadd); static int get_result_width(MYSQL_RES *res); @@ -333,9 +333,9 @@ static int get_quote_count(const char *line); typedef Prealloced_array Histignore_patterns; Histignore_patterns *histignore_patterns; -static my_bool check_histignore(const char *string); -static my_bool parse_histignore(); -static my_bool init_hist_patterns(); +static bool check_histignore(const char *string); +static bool parse_histignore(); +static bool init_hist_patterns(); static void free_hist_patterns(); static void add_filtered_history(const char *string); @@ -1939,7 +1939,7 @@ static void usage(int version) } -my_bool +bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { @@ -3189,7 +3189,7 @@ static void add_filtered_history(const char *string) */ static -my_bool check_histignore(const char *string) +bool check_histignore(const char *string) { int rc; @@ -3220,7 +3220,7 @@ my_bool check_histignore(const char *string) */ static -my_bool parse_histignore() +bool parse_histignore() { LEX_STRING pattern; @@ -3245,7 +3245,7 @@ my_bool parse_histignore() } static -my_bool init_hist_patterns() +bool init_hist_patterns() { histignore_patterns= new (std::nothrow) Histignore_patterns(PSI_NOT_INSTRUMENTED); @@ -4849,10 +4849,10 @@ com_nowarnings(String *buffer MY_ATTRIBUTE((unused)), items in the array to zero first. */ -char *get_arg(char *line, my_bool get_next_arg) +char *get_arg(char *line, bool get_next_arg) { char *ptr, *start; - my_bool quoted= 0, valid_arg= 0; + bool quoted= 0, valid_arg= 0; char qtype= 0; ptr= line; @@ -5019,7 +5019,7 @@ sql_real_connect(char *host,char *database,char *user,char *password, static void init_connection_options(MYSQL *mysql) { - my_bool handle_expired= (opt_connect_expired_password || !status.batch) ? + bool handle_expired= (opt_connect_expired_password || !status.batch) ? TRUE : FALSE; if (opt_init_command) @@ -5374,7 +5374,7 @@ static void remove_cntrl(String &buffer) void tee_write(FILE *file, const char *s, size_t slen, int flags) { #ifdef _WIN32 - my_bool is_console= my_win_is_console_cached(file); + bool is_console= my_win_is_console_cached(file); #endif const char *se; for (se= s + slen; s < se; s++) diff --git a/client/mysql_config_editor.cc b/client/mysql_config_editor.cc index e7e659f60899..826b642cfd5a 100644 --- a/client/mysql_config_editor.cc +++ b/client/mysql_config_editor.cc @@ -66,9 +66,9 @@ static const char *opt_user= NULL, *opt_password= NULL, *opt_host=NULL, static char my_login_file[FN_REFLEN]; static char my_key[LOGIN_KEY_LEN]; -static my_bool opt_verbose, opt_all, tty_password= 0, opt_warn, - opt_remove_host, opt_remove_pass, opt_remove_user, - opt_remove_socket, opt_remove_port, login_path_specified= FALSE; +static bool opt_verbose, opt_all, tty_password= 0, opt_warn, + opt_remove_host, opt_remove_pass, opt_remove_user, + opt_remove_socket, opt_remove_port, login_path_specified= FALSE; static int execute_commands(int command); static int set_command(void); @@ -77,7 +77,7 @@ static int print_command(void); static void print_login_path(DYNAMIC_STRING *file_buf, const char *path_name); static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name); static char* locate_login_path(DYNAMIC_STRING *file_buf, const char *path_name); -static my_bool check_and_create_login_file(void); +static bool check_and_create_login_file(void); static void mask_password_and_print(char *buf); static int reset_login_file(bool gen_key); @@ -98,8 +98,8 @@ static void verbose_msg(const char *fmt, ...) MY_ATTRIBUTE((format(printf, 1, 2))); static void usage_program(void); static void usage_command(int command); -extern "C" my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); +extern "C" bool get_one_option(int optid, const struct my_option *opt, + char *argument); enum commands { MY_CONFIG_SET, @@ -115,9 +115,9 @@ struct my_command_data { const char *name; const char *description; my_option *options; - my_bool (*get_one_option_func)(int optid, - const struct my_option *opt, - char *argument); + bool (*get_one_option_func)(int optid, + const struct my_option *opt, + char *argument); }; } @@ -224,7 +224,7 @@ static struct my_option my_help_command_options[]= }; extern "C" { -static my_bool +static bool my_program_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -245,7 +245,7 @@ my_program_get_one_option(int optid, return 0; } -static my_bool +static bool my_set_command_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -272,7 +272,7 @@ my_set_command_get_one_option(int optid, return 0; } -static my_bool +static bool my_remove_command_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -296,7 +296,7 @@ my_remove_command_get_one_option(int optid, return 0; } -static my_bool +static bool my_print_command_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -320,7 +320,7 @@ my_print_command_get_one_option(int optid, return 0; } -static my_bool +static bool my_reset_command_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -719,7 +719,7 @@ static int print_command(void) FALSE Success */ -static my_bool check_and_create_login_file(void) +static bool check_and_create_login_file(void) { DBUG_ENTER("check_and_create_login_file"); @@ -1178,7 +1178,7 @@ static int encrypt_and_write_file(DYNAMIC_STRING *file_buf) { DBUG_ENTER("encrypt_and_write_file"); - my_bool done= FALSE; + bool done= FALSE; char cipher[MY_LINE_MAX], *tmp= NULL; uint bytes_read=0, len= 0; int enc_len= 0; // Can be negative. diff --git a/client/mysql_secure_installation.cc b/client/mysql_secure_installation.cc index 46432af8a45d..9c3305e726f1 100644 --- a/client/mysql_secure_installation.cc +++ b/client/mysql_secure_installation.cc @@ -42,9 +42,9 @@ static uint opt_protocol= 0; static char *opt_socket= 0; static MYSQL mysql; static char *password= 0; -static my_bool password_provided= FALSE; -static my_bool g_expire_password_on_exit= FALSE; -static my_bool opt_use_default= FALSE; +static bool password_provided= FALSE; +static bool g_expire_password_on_exit= FALSE; +static bool opt_use_default= FALSE; #if defined (_WIN32) static char *shared_memory_base_name= default_shared_memory_base_name; @@ -97,7 +97,7 @@ static struct my_option my_connection_options[]= {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -my_bool find_temporary_password(char **p); +bool find_temporary_password(char **p); static void usage() { @@ -126,7 +126,7 @@ static void free_resources() } extern "C" { -static my_bool +static bool my_arguments_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -448,7 +448,7 @@ static void estimate_password_strength(char *password_string) @retval FALSE failure */ -static my_bool mysql_set_password(MYSQL *mysql, char *password) +static bool mysql_set_password(MYSQL *mysql, char *password) { size_t password_len= strlen(password); char *query, *end; @@ -484,7 +484,7 @@ static my_bool mysql_set_password(MYSQL *mysql, char *password) @retval FALSE failure */ -static my_bool mysql_expire_password(MYSQL *mysql) +static bool mysql_expire_password(MYSQL *mysql) { char sql[]= "UPDATE mysql.user SET password_expired= 'Y'"; size_t sql_len= strlen(sql); @@ -589,7 +589,7 @@ static void set_opt_user_password(int plugin_set) */ static int get_opt_user_password() { - my_bool using_temporary_password= FALSE; + bool using_temporary_password= FALSE; int res; if (!password_provided) @@ -852,7 +852,7 @@ static void reload_privilege_tables() @returns true if the password was successfully retrieved. */ -my_bool find_temporary_password(char **p) +bool find_temporary_password(char **p) { const char *root_path= "/root"; const char *password_file_name= "/.mysql_secret"; diff --git a/client/mysql_ssl_rsa_setup.cc b/client/mysql_ssl_rsa_setup.cc index 226c2f60485a..6f9071391ff5 100644 --- a/client/mysql_ssl_rsa_setup.cc +++ b/client/mysql_ssl_rsa_setup.cc @@ -111,7 +111,7 @@ struct passwd *user_info= 0; #endif /* HAVE_CHOWN */ Path dir_string; Sql_string_t suffix_string; -my_bool opt_verbose; +bool opt_verbose; static const char *load_default_groups[]= { @@ -359,7 +359,7 @@ void usage(void) extern "C" { -static my_bool +static bool my_arguments_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) { int ret_val= 0; Sql_string_t openssl_check("openssl version"); - my_bool save_skip_unknown= my_getopt_skip_unknown; + bool save_skip_unknown= my_getopt_skip_unknown; MY_INIT(argv[0]); DBUG_ENTER("main"); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index a5d474b242cd..be3dd41f71a9 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -51,10 +51,10 @@ char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; static int interval=0; -static my_bool option_force=0,interrupted=0,new_line=0, - opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0, - tty_password= 0, opt_nobeep, opt_secure_auth= TRUE; -static my_bool debug_info_flag= 0, debug_check_flag= 0; +static bool option_force=0,interrupted=0,new_line=0, + opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0, + tty_password= 0, opt_nobeep, opt_secure_auth= TRUE; +static bool debug_info_flag= 0, debug_check_flag= 0; static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations; static uint opt_count_iterations= 0, my_end_arg; static char *opt_bind_addr = NULL; @@ -62,8 +62,8 @@ static ulong opt_connect_timeout, opt_shutdown_timeout; static char * unix_port=0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; -static my_bool opt_show_warnings= 0; +static bool using_opt_enable_cleartext_plugin= 0; +static bool opt_show_warnings= 0; #if defined (_WIN32) static char *shared_memory_base_name=0; @@ -78,15 +78,15 @@ static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */ */ static uint ex_val_max_len[MAX_MYSQL_VAR]; -static my_bool ex_status_printed = 0; /* First output is not relative. */ +static bool ex_status_printed = 0; /* First output is not relative. */ static uint ex_var_count, max_var_length, max_val_length; #include static void usage(void); -extern "C" my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); -static my_bool sql_connect(MYSQL *mysql, uint wait); +extern "C" bool get_one_option(int optid, const struct my_option *opt, + char *argument); +static bool sql_connect(MYSQL *mysql, uint wait); static int execute_commands(MYSQL *mysql,int argc, char **argv); static char **mask_password(int argc, char ***argv); static int drop_db(MYSQL *mysql,const char *db); @@ -100,9 +100,9 @@ static void print_relative_row_vert(MYSQL_RES *result, MYSQL_ROW cur, uint row); static void print_relative_header(); static void print_relative_line(); static void truncate_names(); -static my_bool get_pidfile(MYSQL *mysql, char *pidfile); -static my_bool wait_pidfile(char *pidfile, time_t last_modified, - struct stat *pidfile_status); +static bool get_pidfile(MYSQL *mysql, char *pidfile); +static bool wait_pidfile(char *pidfile, time_t last_modified, + struct stat *pidfile_status); static void store_values(MYSQL_RES *result); static void print_warnings(MYSQL *mysql); @@ -261,7 +261,7 @@ static struct my_option my_long_options[] = static const char *load_default_groups[]= { "mysqladmin","client",0 }; -my_bool +bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { @@ -352,7 +352,7 @@ int main(int argc,char *argv[]) { int error= 0, ho_error, temp_argc; int first_command; - my_bool can_handle_passwords; + bool can_handle_passwords; MYSQL mysql; char **commands, **save_argv, **temp_argv; @@ -567,9 +567,9 @@ void endprog(int signal_number MY_ATTRIBUTE((unused))) @retval 1 failure */ -static my_bool sql_connect(MYSQL *mysql, uint wait) +static bool sql_connect(MYSQL *mysql, uint wait) { - my_bool info=0; + bool info=0; for (;;) { @@ -711,7 +711,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_SHUTDOWN: { char pidfile[FN_REFLEN]; - my_bool got_pidfile= 0; + bool got_pidfile= 0; time_t last_modified= 0; struct stat pidfile_status; @@ -1549,7 +1549,7 @@ static void truncate_names() } -static my_bool get_pidfile(MYSQL *mysql, char *pidfile) +static bool get_pidfile(MYSQL *mysql, char *pidfile) { MYSQL_RES* result; @@ -1576,8 +1576,8 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile) Return 1 if pid file didn't disappear or change */ -static my_bool wait_pidfile(char *pidfile, time_t last_modified, - struct stat *pidfile_status) +static bool wait_pidfile(char *pidfile, time_t last_modified, + struct stat *pidfile_status) { char buff[FN_REFLEN]; int error= 1; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ad589178e429..4514ca9c99ee 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -305,8 +305,8 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace"; #endif static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; -static my_bool one_database=0, disable_log_bin= 0; -static my_bool opt_hexdump= 0; +static bool one_database=0, disable_log_bin= 0; +static bool opt_hexdump= 0; const char *base64_output_mode_names[]= {"NEVER", "AUTO", "UNSPEC", "DECODE-ROWS", NullS}; TYPELIB base64_output_mode_typelib= @@ -314,7 +314,7 @@ TYPELIB base64_output_mode_typelib= base64_output_mode_names, NULL }; static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC; static char *opt_base64_output_mode_str= 0; -static my_bool opt_remote_alias= 0; +static bool opt_remote_alias= 0; const char *remote_proto_names[]= {"BINLOG-DUMP-NON-GTIDS", "BINLOG-DUMP-GTIDS", NullS}; TYPELIB remote_proto_typelib= @@ -329,11 +329,11 @@ static char *opt_remote_proto_str= 0; static char *database= 0; static char *output_file= 0; static char *rewrite= 0; -my_bool force_opt= 0, short_form= 0, idempotent_mode= 0; -static my_bool debug_info_flag, debug_check_flag; -static my_bool force_if_open_opt= 1, raw_mode= 0; -static my_bool to_last_remote_log= 0, stop_never= 0; -static my_bool opt_verify_binlog_checksum= 1; +bool force_opt= 0, short_form= 0, idempotent_mode= 0; +static bool debug_info_flag, debug_check_flag; +static bool force_if_open_opt= 1, raw_mode= 0; +static bool to_last_remote_log= 0, stop_never= 0; +static bool opt_verify_binlog_checksum= 1; static ulonglong offset = 0; static int64 stop_never_slave_server_id= -1; static int64 connection_server_id= -1; @@ -342,7 +342,7 @@ static int port= 0; static uint my_end_arg; static const char* sock= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; -static my_bool opt_secure_auth= TRUE; +static bool opt_secure_auth= TRUE; #if defined (_WIN32) static char *shared_memory_base_name= 0; @@ -395,7 +395,7 @@ enum Exit_status { */ static char *opt_include_gtids_str= NULL, *opt_exclude_gtids_str= NULL; -static my_bool opt_skip_gtids= 0; +static bool opt_skip_gtids= 0; static bool filter_based_on_gtids= false; /* It is set to true when BEGIN is found, and false when the transaction ends. */ @@ -1004,7 +1004,7 @@ static Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event * { char ll_buff[21]; Log_event_type ev_type= ev->get_type_code(); - my_bool destroy_evt= TRUE; + bool destroy_evt= TRUE; DBUG_ENTER("process_event"); Exit_status retval= OK_CONTINUE; IO_CACHE *const head= &print_event_info->head_cache; @@ -1827,7 +1827,7 @@ static my_time_t convert_str_to_timestamp(const char* str) MYSQL_TIME_STATUS status; MYSQL_TIME l_time; long dummy_my_timezone; - my_bool dummy_in_dst_time_gap; + bool dummy_in_dst_time_gap; /* We require a total specification (date AND time) */ if (str_to_datetime(str, strlen(str), &l_time, 0, &status) || l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings) @@ -1845,7 +1845,7 @@ static my_time_t convert_str_to_timestamp(const char* str) } -extern "C" my_bool +extern "C" bool get_one_option(int optid, const struct my_option *opt, char *argument) { diff --git a/client/mysqlbinlog.h b/client/mysqlbinlog.h index b6f9e4ad1faf..2abfdf18cfaf 100644 --- a/client/mysqlbinlog.h +++ b/client/mysqlbinlog.h @@ -24,8 +24,8 @@ class Format_description_log_event; -extern my_bool force_opt; -extern my_bool short_form; +extern bool force_opt; +extern bool short_form; extern ulong opt_server_id_mask; extern ulong opt_binlog_rows_event_max_size; diff --git a/client/mysqldump.cc b/client/mysqldump.cc index 6b7595c08b3e..abd020150416 100644 --- a/client/mysqldump.cc +++ b/client/mysqldump.cc @@ -111,28 +111,28 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length, static char *alloc_query_str(size_t size); static void field_escape(DYNAMIC_STRING* in, const char *from); -static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, - quick= 1, extended_insert= 1, - lock_tables= 1, opt_force= 0, flush_logs= 0, - flush_privileges= 0, - opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, - create_options=1,opt_quoted=0,opt_databases=0, - opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0, - opt_set_charset=0, opt_dump_date=1, - opt_autocommit=0,opt_disable_keys=1,opt_xml=0, - opt_delete_master_logs=0, tty_password=0, - opt_single_transaction=0, opt_comments= 0, opt_compact= 0, - opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0, - opt_complete_insert= 0, opt_drop_database= 0, - opt_replace_into= 0, - opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1, - opt_slave_apply= 0, - opt_include_master_host_port= 0, - opt_events= 0, opt_comments_used= 0, - opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0, - opt_secure_auth= TRUE, opt_network_timeout= 0, - stats_tables_included= 0; -static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; +static bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, + quick= 1, extended_insert= 1, + lock_tables= 1, opt_force= 0, flush_logs= 0, + flush_privileges= 0, + opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, + create_options=1,opt_quoted=0,opt_databases=0, + opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0, + opt_set_charset=0, opt_dump_date=1, + opt_autocommit=0,opt_disable_keys=1,opt_xml=0, + opt_delete_master_logs=0, tty_password=0, + opt_single_transaction=0, opt_comments= 0, opt_compact= 0, + opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0, + opt_complete_insert= 0, opt_drop_database= 0, + opt_replace_into= 0, + opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1, + opt_slave_apply= 0, + opt_include_master_host_port= 0, + opt_events= 0, opt_comments_used= 0, + opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0, + opt_secure_auth= TRUE, opt_network_timeout= 0, + stats_tables_included= 0; +static bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; static DYNAMIC_STRING insert_pat; @@ -146,14 +146,14 @@ static char *opt_password=0,*current_user=0, static char **defaults_argv= 0; static char compatible_mode_normal_str[255]; /* Server supports character_set_results session variable? */ -static my_bool server_supports_switching_charsets= TRUE; +static bool server_supports_switching_charsets= TRUE; static ulong opt_compatible_mode= 0; #define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1 #define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2 #define MYSQL_OPT_SLAVE_DATA_EFFECTIVE_SQL 1 #define MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL 2 static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; +static bool using_opt_enable_cleartext_plugin= 0; static uint opt_mysql_port= 0, opt_master_data; static uint opt_slave_data; static uint my_end_arg; @@ -208,7 +208,7 @@ static char *default_charset; static CHARSET_INFO *charset_info= &my_charset_latin1; const char *default_dbug_option="d:t:o,/tmp/mysqldump.trace"; /* have we seen any VIEWs during table scanning? */ -my_bool seen_views= 0; +bool seen_views= 0; const char *compatible_mode_names[]= { "MYSQL323", "MYSQL40", "POSTGRESQL", "ORACLE", "MSSQL", "DB2", @@ -605,17 +605,17 @@ static int init_dumping_tables(char *); static int init_dumping(char *, int init_func(char*)); static int dump_databases(char **); static int dump_all_databases(); -static char *quote_name(const char *name, char *buff, my_bool force); +static char *quote_name(const char *name, char *buff, bool force); char check_if_ignore_table(const char *table_name, char *table_type); bool is_infoschema_db(const char *db); static char *primary_key_fields(const char *table_name); -static my_bool get_view_structure(char *table, char* db); -static my_bool dump_all_views_in_db(char *database); +static bool get_view_structure(char *table, char* db); +static bool dump_all_views_in_db(char *database); static int dump_all_tablespaces(); static int dump_tablespaces_for_tables(char *db, char **table_names, int tables); static int dump_tablespaces_for_databases(char** databases); static int dump_tablespaces(char* ts_where); -static void print_comment(FILE *sql_file, my_bool is_error, const char *format, +static void print_comment(FILE *sql_file, bool is_error, const char *format, ...); static void verbose_msg(const char *fmt, ...) MY_ATTRIBUTE((format(printf,1,2))); @@ -821,7 +821,7 @@ static const uchar* get_table_key(const uchar *entry, size_t *length) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { @@ -1237,7 +1237,7 @@ static int fetch_db_collation(const char *db_name, char *db_cl_name, int db_cl_size) { - my_bool err_status= FALSE; + bool err_status= FALSE; char query[QUERY_LENGTH]; MYSQL_RES *db_cl_res; MYSQL_ROW db_cl_row; @@ -1616,10 +1616,10 @@ int parse_ignore_error() @retval 1 yes 0 no */ -static my_bool do_ignore_error() +static bool do_ignore_error() { uint last_errno; - my_bool found= 0; + bool found= 0; DBUG_ENTER("do_ignore_error"); @@ -1821,7 +1821,7 @@ static void unescape(FILE *file,char *pos, size_t length) } /* unescape */ -static my_bool test_if_special_chars(const char *str) +static bool test_if_special_chars(const char *str) { for ( ; *str ; str++) if (!my_isvar(charset_info,*str) && *str != '$') @@ -1847,7 +1847,7 @@ static my_bool test_if_special_chars(const char *str) buff quoted string */ -static char *quote_name(const char *name, char *buff, my_bool force) +static char *quote_name(const char *name, char *buff, bool force) { char *to= buff; char qtype= (opt_compatible_mode & MASK_ANSI_QUOTES) ? '\"' : '`'; @@ -1923,7 +1923,7 @@ static char *quote_for_like(const char *name, char *buff) */ static void print_quoted_xml(FILE *xml_file, const char *str, size_t len, - my_bool is_attribute_name) + bool is_attribute_name) { const char *end; @@ -2206,7 +2206,7 @@ static void print_xml_comment(FILE *xml_file, size_t len, /* A common printing function for xml and non-xml modes. */ -static void print_comment(FILE *sql_file, my_bool is_error, const char *format, +static void print_comment(FILE *sql_file, bool is_error, const char *format, ...) { static char comment_buff[COMMENT_LENGTH]; @@ -2658,8 +2658,8 @@ static uint dump_routines_for_db(char *db) } /* general_log or slow_log tables under mysql database */ -static inline my_bool general_log_or_slow_log_tables(const char *db, - const char *table) +static inline bool general_log_or_slow_log_tables(const char *db, + const char *table) { return (!my_strcasecmp(charset_info, db, "mysql")) && (!my_strcasecmp(charset_info, table, "general_log") || @@ -2675,8 +2675,8 @@ static inline my_bool general_log_or_slow_log_tables(const char *db, @return @retval TRUE if it is innodb stats table else FALSE */ -static inline my_bool innodb_stats_tables(const char *db, - const char *table) +static inline bool innodb_stats_tables(const char *db, + const char *table) { return (!my_strcasecmp(charset_info, db, "mysql")) && (!my_strcasecmp(charset_info, table, "innodb_table_stats") || @@ -2693,7 +2693,7 @@ static inline my_bool innodb_stats_tables(const char *db, @return @retval TRUE if dump contains innodb stats table or else FALSE */ -static inline my_bool is_innodb_stats_tables_included(int argc, char**argv) +static inline bool is_innodb_stats_tables_included(int argc, char**argv) { if (opt_alldbs) return true; @@ -2738,9 +2738,9 @@ static inline my_bool is_innodb_stats_tables_included(int argc, char**argv) */ static uint get_table_structure(char *table, char *db, char *table_type, - char *ignore_flag, my_bool real_columns[]) + char *ignore_flag, bool real_columns[]) { - my_bool init=0, write_data, complete_insert, skip_ddl; + bool init=0, write_data, complete_insert, skip_ddl; my_ulonglong num_fields; char *result_table, *opt_quoted_table; const char *insert_option; @@ -2758,7 +2758,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, "ORDER BY ORDINAL_POSITION"; FILE *sql_file= md_result_file; size_t len; - my_bool is_log_table; + bool is_log_table; unsigned int colno; MYSQL_RES *result; MYSQL_ROW row; @@ -3728,7 +3728,7 @@ static void dump_table(char *table, char *db) MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; - my_bool real_columns[MAX_FIELDS]; + bool real_columns[MAX_FIELDS]; DBUG_ENTER("dump_table"); /* @@ -4723,7 +4723,7 @@ static int init_dumping(char *database, int init_func(char*)) /* Return 1 if we should copy the table */ -static my_bool include_table(const uchar *hash_key, size_t len) +static bool include_table(const uchar *hash_key, size_t len) { return ! my_hash_search(&ignore_table, hash_key, len); } @@ -4736,9 +4736,9 @@ static int dump_all_tables_in_db(char *database) char table_buff[NAME_LEN*2+3]; char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ char *afterdot; - my_bool general_log_table_exists= 0, slow_log_table_exists=0; + bool general_log_table_exists= 0, slow_log_table_exists=0; int using_mysql_db= !my_strcasecmp(charset_info, database, "mysql"); - my_bool real_columns[MAX_FIELDS]; + bool real_columns[MAX_FIELDS]; DBUG_ENTER("dump_all_tables_in_db"); @@ -4906,7 +4906,7 @@ static int dump_all_tables_in_db(char *database) 1 ERROR */ -static my_bool dump_all_views_in_db(char *database) +static bool dump_all_views_in_db(char *database) { char *table; uint numrows; @@ -5759,9 +5759,9 @@ static int replace(DYNAMIC_STRING *ds_str, restore the session binlog. */ -static void set_session_binlog(my_bool flag) +static void set_session_binlog(bool flag) { - static my_bool is_binlog_disabled= FALSE; + static bool is_binlog_disabled= FALSE; if (!flag && !is_binlog_disabled) { @@ -5792,7 +5792,7 @@ static void set_session_binlog(my_bool flag) */ -static my_bool add_set_gtid_purged(MYSQL *mysql_con) +static bool add_set_gtid_purged(MYSQL *mysql_con) { MYSQL_RES *gtid_purged_res; MYSQL_ROW gtid_set; @@ -5841,7 +5841,7 @@ static my_bool add_set_gtid_purged(MYSQL *mysql_con) @retval TRUE fail. */ -static my_bool process_set_gtid_purged(MYSQL* mysql_con) +static bool process_set_gtid_purged(MYSQL* mysql_con) { MYSQL_RES *gtid_mode_res; MYSQL_ROW gtid_mode_row; @@ -5921,7 +5921,7 @@ static my_bool process_set_gtid_purged(MYSQL* mysql_con) 1 ERROR */ -static my_bool get_view_structure(char *table, char* db) +static bool get_view_structure(char *table, char* db) { MYSQL_RES *table_res; MYSQL_ROW row; diff --git a/client/mysqlimport.cc b/client/mysqlimport.cc index ba5cb66be07e..9f6fccc1e061 100644 --- a/client/mysqlimport.cc +++ b/client/mysqlimport.cc @@ -51,10 +51,10 @@ static char *field_escape(char *to,const char *from,uint length); static char *add_load_option(char *ptr,const char *object, const char *statement); -static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, +static bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, replace=0,silent=0,ignore=0,opt_compress=0, opt_low_priority= 0, tty_password= 0, opt_secure_auth= TRUE; -static my_bool debug_info_flag= 0, debug_check_flag= 0; +static bool debug_info_flag= 0, debug_check_flag= 0; static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0; static char *opt_password=0, *current_user=0, *current_host=0, *current_db=0, *fields_terminated=0, @@ -62,7 +62,7 @@ static char *opt_password=0, *current_user=0, *escaped=0, *opt_columns=0, *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; +static bool using_opt_enable_cleartext_plugin= 0; static uint opt_mysql_port= 0, opt_protocol= 0; static char *opt_bind_addr = NULL; static char * opt_mysql_unix_port=0; @@ -248,7 +248,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n"); extern "C" { -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { diff --git a/client/mysqlshow.cc b/client/mysqlshow.cc index c6e62acaf3db..57fa6073e18f 100644 --- a/client/mysqlshow.cc +++ b/client/mysqlshow.cc @@ -39,16 +39,16 @@ #include "typelib.h" static char * host=0, *opt_password=0, *user=0; -static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0; -static my_bool tty_password= 0, opt_table_type= 0; -static my_bool debug_info_flag= 0, debug_check_flag= 0; +static bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0; +static bool tty_password= 0, opt_table_type= 0; +static bool debug_info_flag= 0, debug_check_flag= 0; static uint my_end_arg= 0; static uint opt_verbose=0; static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; -static my_bool opt_secure_auth= TRUE; +static bool using_opt_enable_cleartext_plugin= 0; +static bool opt_secure_auth= TRUE; #if defined (_WIN32) static char *shared_memory_base_name=0; @@ -76,7 +76,7 @@ static char * opt_mysql_unix_port=0; int main(int argc, char **argv) { int error; - my_bool first_argument_uses_wildcards=0; + bool first_argument_uses_wildcards=0; char *wild; MYSQL mysql; MY_INIT(argv[0]); @@ -317,7 +317,7 @@ are shown."); extern "C" { -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { diff --git a/client/mysqlslap.cc b/client/mysqlslap.cc index 51c66633a009..e4a3bd859c28 100644 --- a/client/mysqlslap.cc +++ b/client/mysqlslap.cc @@ -141,18 +141,18 @@ static char *host= NULL, *opt_password= NULL, *user= NULL, *post_system= NULL, *opt_mysql_unix_port= NULL; static char *opt_plugin_dir= 0, *opt_default_auth= 0; -static my_bool opt_secure_auth= TRUE; +static bool opt_secure_auth= TRUE; static uint opt_enable_cleartext_plugin= 0; -static my_bool using_opt_enable_cleartext_plugin= 0; +static bool using_opt_enable_cleartext_plugin= 0; const char *delimiter= "\n"; const char *create_schema_string= "mysqlslap"; -static my_bool opt_preserve= TRUE, opt_no_drop= FALSE; -static my_bool debug_info_flag= 0, debug_check_flag= 0; -static my_bool opt_only_print= FALSE; -static my_bool opt_compress= FALSE, tty_password= FALSE, +static bool opt_preserve= TRUE, opt_no_drop= FALSE; +static bool debug_info_flag= 0, debug_check_flag= 0; +static bool opt_only_print= FALSE; +static bool opt_compress= FALSE, tty_password= FALSE, opt_silent= FALSE, auto_generate_sql_autoincrement= FALSE, auto_generate_sql_guid_primary= FALSE, @@ -269,7 +269,7 @@ size_t get_random_string(char *buf); static statement *build_table_string(void); static statement *build_insert_string(void); static statement *build_update_string(void); -static statement * build_select_string(my_bool key); +static statement * build_select_string(bool key); static int generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt); static int drop_primary_key_list(void); static int create_schema(MYSQL *mysql, const char *db, statement *stmt, @@ -755,7 +755,7 @@ static void usage(void) extern "C" { -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { @@ -1144,7 +1144,7 @@ build_insert_string(void) statement or file containing a query statement */ static statement * -build_select_string(my_bool key) +build_select_string(bool key) { char buf[HUGE_STRING_LENGTH]; unsigned int col_count; diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 1e2b418d0ce0..235298b554b8 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -135,8 +135,8 @@ extern CHARSET_INFO my_charset_utf16le_bin; C_MODE_START static void signal_handler(int sig); -static my_bool get_one_option(int optid, const struct my_option *, - char *argument); +static bool get_one_option(int optid, const struct my_option *, + char *argument); C_MODE_END enum { @@ -158,44 +158,44 @@ static int opt_port= 0; static int opt_max_connect_retries; static int opt_result_format_version; static int opt_max_connections= DEFAULT_MAX_CONN; -static my_bool opt_compress= 0, silent= 0, verbose= 0, trace_exec= 0; -static my_bool debug_info_flag= 0, debug_check_flag= 0; -static my_bool tty_password= 0; -static my_bool opt_mark_progress= 0; -static my_bool ps_protocol= 0, ps_protocol_enabled= 0; -static my_bool sp_protocol= 0, sp_protocol_enabled= 0; -static my_bool no_skip=0; -static my_bool view_protocol= 0, view_protocol_enabled= 0; -static my_bool opt_trace_protocol= 0, opt_trace_protocol_enabled= 0; -static my_bool explain_protocol= 0, explain_protocol_enabled= 0; -static my_bool json_explain_protocol= 0, json_explain_protocol_enabled= 0; -static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0; -static my_bool parsing_disabled= 0; -static my_bool display_result_vertically= FALSE, display_result_lower= FALSE, +static bool opt_compress= 0, silent= 0, verbose= 0, trace_exec= 0; +static bool debug_info_flag= 0, debug_check_flag= 0; +static bool tty_password= 0; +static bool opt_mark_progress= 0; +static bool ps_protocol= 0, ps_protocol_enabled= 0; +static bool sp_protocol= 0, sp_protocol_enabled= 0; +static bool no_skip=0; +static bool view_protocol= 0, view_protocol_enabled= 0; +static bool opt_trace_protocol= 0, opt_trace_protocol_enabled= 0; +static bool explain_protocol= 0, explain_protocol_enabled= 0; +static bool json_explain_protocol= 0, json_explain_protocol_enabled= 0; +static bool cursor_protocol= 0, cursor_protocol_enabled= 0; +static bool parsing_disabled= 0; +static bool display_result_vertically= FALSE, display_result_lower= FALSE, display_metadata= FALSE, display_result_sorted= FALSE, display_session_track_info= FALSE; -static my_bool disable_query_log= 0, disable_result_log= 0; -static my_bool disable_connect_log= 1; -static my_bool disable_warnings= 0; -static my_bool disable_info= 1; -static my_bool abort_on_error= 1; -static my_bool server_initialized= 0; -static my_bool is_windows= 0; +static bool disable_query_log= 0, disable_result_log= 0; +static bool disable_connect_log= 1; +static bool disable_warnings= 0; +static bool disable_info= 1; +static bool abort_on_error= 1; +static bool server_initialized= 0; +static bool is_windows= 0; static char **default_argv; static const char *load_default_groups[]= { "mysqltest", "client", 0 }; static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer; #if !defined(HAVE_YASSL) static const char *opt_server_public_key= 0; #endif -static my_bool can_handle_expired_passwords= TRUE; +static bool can_handle_expired_passwords= TRUE; /* Info on properties that can be set with --enable_X and --disable_X */ struct property { - my_bool *var; /* Actual variable */ - my_bool set; /* Has been set for ONE command */ - my_bool old; /* If set, thus is the old value */ - my_bool reverse; /* Varible is true if disabled */ + bool *var; /* Actual variable */ + bool set; /* Has been set for ONE command */ + bool old; /* If set, thus is the old value */ + bool reverse; /* Variable is true if disabled */ const char *env_name; /* Env. variable name */ }; @@ -211,7 +211,7 @@ static struct property prop_list[] = { { &disable_warnings, 0, 0, 1, "$ENABLED_WARNINGS" } }; -static my_bool once_property= FALSE; +static bool once_property= FALSE; enum enum_prop { P_ABORT= 0, @@ -249,7 +249,7 @@ enum block_cmd { struct st_block { int line; /* Start line of block */ - my_bool ok; /* Should block be executed */ + bool ok; /* Should block be executed */ enum block_cmd cmd; /* Command owning the block */ char delim[MAX_DELIMITER_LENGTH]; /* Delimiter before block */ }; @@ -365,7 +365,7 @@ struct st_connection size_t name_len; MYSQL_STMT* stmt; /* Set after send to disallow other queries before reap */ - my_bool pending; + bool pending; }; struct st_connection *connections= NULL; @@ -571,7 +571,7 @@ struct st_command char *query, *query_buf,*first_argument,*last_argument,*end; DYNAMIC_STRING content; size_t first_word_len, query_len; - my_bool abort_on_error, used_replace; + bool abort_on_error, used_replace; struct st_expected_errors expected_errors; char output_file[FN_REFLEN]; enum enum_commands type; @@ -646,15 +646,15 @@ VAR* var_from_env(const char *, const char *); VAR* var_init(VAR* v, const char *name, size_t name_len, const char *val, size_t val_len); VAR* var_get(const char *var_name, const char** var_name_end, - my_bool raw, my_bool ignore_not_existing); + bool raw, bool ignore_not_existing); void eval_expr(VAR* v, const char *p, const char** p_end, bool open_end=false, bool do_eval=true); -my_bool match_delimiter(int c, const char *delim, size_t length); +bool match_delimiter(int c, const char *delim, size_t length); void do_eval(DYNAMIC_STRING *query_eval, const char *query, - const char *query_end, my_bool pass_through_escape_chars); + const char *query_end, bool pass_through_escape_chars); void str_to_file(const char *fname, char *str, size_t size); -void str_to_file2(const char *fname, char *str, size_t size, my_bool append); +void str_to_file2(const char *fname, char *str, size_t size, bool append); void fix_win_paths(const char *val, size_t len); const char *get_errname_from_code (uint error_code); @@ -878,7 +878,7 @@ void handle_no_error(struct st_command*); void revert_properties(); void do_eval(DYNAMIC_STRING *query_eval, const char *query, - const char *query_end, my_bool pass_through_escape_chars) + const char *query_end, bool pass_through_escape_chars) { const char *p; char c, next_c; @@ -1085,7 +1085,7 @@ enum arg_type struct command_arg { const char *argname; /* Name of argument */ enum arg_type type; /* Type of argument */ - my_bool required; /* Argument required */ + bool required; /* Argument required */ DYNAMIC_STRING *ds; /* Storage for argument */ const char *description; /* Description of the argument */ }; @@ -2093,8 +2093,8 @@ VAR* var_from_env(const char *name, const char *def_val) } -VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw, - my_bool ignore_not_existing) +VAR* var_get(const char *var_name, const char **var_name_end, bool raw, + bool ignore_not_existing) { int digit; VAR *v; @@ -2236,7 +2236,7 @@ static void var_set_errno(int sql_errno) /* Functions to handle --disable and --enable properties */ -static void set_once_property(enum_prop prop, my_bool val) +static void set_once_property(enum_prop prop, bool val) { property &pr= prop_list[prop]; pr.set= 1; @@ -2246,7 +2246,7 @@ static void set_once_property(enum_prop prop, my_bool val) once_property= TRUE; } -static void set_property(st_command *command, enum_prop prop, my_bool val) +static void set_property(st_command *command, enum_prop prop, bool val) { char* p= command->first_argument; if (p && !strcmp (p, "ONCE")) @@ -2788,7 +2788,7 @@ static int open_file(const char *name) DBUG_ENTER("open_file"); DBUG_PRINT("enter", ("name: %s", name)); - my_bool file_exists= false; + bool file_exists= false; /* Extract path from current file and try it as base first */ if (dirname_part(buff, cur_file->file_name, &length)) { @@ -4008,7 +4008,7 @@ void do_force_rmdir(struct st_command *command, DYNAMIC_STRING *ds_dirname) Remove the empty directory */ -static void do_rmdir(struct st_command *command, my_bool force) +static void do_rmdir(struct st_command *command, bool force) { int error; static DYNAMIC_STRING ds_dirname; @@ -4126,7 +4126,7 @@ static void do_list_files(struct st_command *command) */ static void do_list_files_write_file_command(struct st_command *command, - my_bool append) + bool append) { int error; static DYNAMIC_STRING ds_content; @@ -4230,7 +4230,7 @@ static void read_until_delimiter(DYNAMIC_STRING *ds, } -static void do_write_file_command(struct st_command *command, my_bool append) +static void do_write_file_command(struct st_command *command, bool append) { static DYNAMIC_STRING ds_content; static DYNAMIC_STRING ds_filename; @@ -5331,7 +5331,7 @@ static void do_let(struct st_command *command) used for cpu-independent delays. */ -static int do_sleep(struct st_command *command, my_bool real_sleep) +static int do_sleep(struct st_command *command, bool real_sleep) { int error= 0; char *sleep_start, *sleep_end; @@ -5941,7 +5941,7 @@ static char *get_string(char **to_ptr, char **from_ptr, static void set_reconnect(MYSQL* mysql, int val) { - my_bool reconnect= val; + bool reconnect= val; DBUG_ENTER("set_reconnect"); DBUG_PRINT("info", ("val: %d", val)); mysql_options(mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect); @@ -6308,8 +6308,8 @@ static void do_connect(struct st_command *command) { int con_port= opt_port; char *con_options; - my_bool con_ssl= 0, con_compress= 0; - my_bool con_pipe= 0, con_shm= 0, con_cleartext_enable= 0; + bool con_ssl= 0, con_compress= 0; + bool con_pipe= 0, con_shm= 0, con_cleartext_enable= 0; struct st_connection* con_slot; #if defined(HAVE_OPENSSL) uint save_opt_ssl_mode= opt_ssl_mode; @@ -6380,7 +6380,7 @@ static void do_connect(struct st_command *command) /* Options */ con_options= ds_options.str; - my_bool con_socket=0, con_tcp= 0; + bool con_socket=0, con_tcp= 0; while (*con_options) { /* Step past any spaces in beginning of option */ @@ -6673,7 +6673,7 @@ static void do_block(enum block_cmd cmd, struct st_command* command) const char *expr_start, *expr_end; VAR v; const char *cmd_name= (cmd == cmd_while ? "while" : "if"); - my_bool not_expr= FALSE; + bool not_expr= FALSE; DBUG_ENTER("do_block"); DBUG_PRINT("enter", ("%s", cmd_name)); @@ -6898,7 +6898,7 @@ static void do_reset_connection() DBUG_VOID_RETURN; } -my_bool match_delimiter(int c, const char *delim, size_t length) +bool match_delimiter(int c, const char *delim, size_t length) { uint i; char tmp[MAX_DELIMITER_LENGTH]; @@ -6922,7 +6922,7 @@ my_bool match_delimiter(int c, const char *delim, size_t length) } -static my_bool end_of_query(int c) +static bool end_of_query(int c) { return match_delimiter(c, delimiter, delimiter_length); } @@ -6958,7 +6958,7 @@ static int read_line(char *buf, int size) char *p= buf, *buf_end= buf + size - 1; int skip_char= 0; int query_comment= 0, query_comment_start= 0, query_comment_end= 0; - my_bool have_slash= FALSE; + bool have_slash= FALSE; enum {R_NORMAL, R_Q, R_SLASH_IN_Q, R_COMMENT, R_LINE_START} state= R_LINE_START; @@ -7590,7 +7590,7 @@ static void usage() } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt, char *argument) { switch(optid) { @@ -7722,7 +7722,7 @@ static int parse_args(int argc, char **argv) append - append to file instead of overwriting old file */ -void str_to_file2(const char *fname, char *str, size_t size, my_bool append) +void str_to_file2(const char *fname, char *str, size_t size, bool append) { int fd; char buff[FN_REFLEN]; @@ -7913,7 +7913,7 @@ void fix_win_paths(const char *val, size_t len) */ static void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field, - char* val, size_t len, my_bool is_null) + char* val, size_t len, bool is_null) { char null[]= "NULL"; @@ -8008,7 +8008,7 @@ static void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, MYSQL_FIELD *fields, uint num_fields) { MYSQL_BIND *my_bind; - my_bool *is_null; + bool *is_null; ulong *length; uint i; @@ -8019,9 +8019,9 @@ static void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong), MYF(MY_WME | MY_FAE)); - is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, - num_fields * sizeof(my_bool), - MYF(MY_WME | MY_FAE)); + is_null= (bool*) my_malloc(PSI_NOT_INSTRUMENTED, + num_fields * sizeof(bool), + MYF(MY_WME | MY_FAE)); /* Allocate data for the result of each field */ for (i= 0; i < num_fields; i++) @@ -8646,7 +8646,7 @@ static void run_query_stmt(MYSQL *mysql, struct st_command *command, buffer to allocate for result data */ { - my_bool one= 1; + bool one= 1; if (mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &one)) die("mysql_stmt_attr_set(STMT_ATTR_UPDATE_MAX_LENGTH) failed': %d %s", mysql_stmt_errno(stmt), mysql_stmt_error(stmt)); @@ -8845,9 +8845,8 @@ static void run_query(struct st_connection *cn, struct st_command *command, int DYNAMIC_STRING eval_query; char *query; size_t query_len; - my_bool view_created= 0, sp_created= 0; - my_bool complete_query= ((flags & QUERY_SEND_FLAG) && - (flags & QUERY_REAP_FLAG)); + bool view_created= 0, sp_created= 0; + bool complete_query= ((flags & QUERY_SEND_FLAG) && (flags & QUERY_REAP_FLAG)); DBUG_ENTER("run_query"); dynstr_set(&ds_result, ""); @@ -9498,7 +9497,7 @@ static void init_signal_handling(void) int main(int argc, char **argv) { struct st_command *command; - my_bool q_send_flag= 0, abort_flag= 0; + bool q_send_flag= 0, abort_flag= 0; uint command_executed= 0, last_command_executed= 0; char output_file[FN_REFLEN]; MY_INIT(argv[0]); @@ -9729,7 +9728,7 @@ int main(int argc, char **argv) abort_on_error); /* delimiter needs to be executed so we can continue to parse */ - my_bool ok_to_do= cur_block->ok || command->type == Q_DELIMITER; + bool ok_to_do= cur_block->ok || command->type == Q_DELIMITER; /* Some commands need to be "done" the first time if they may get re-iterated over in a true context. This can only happen if there's @@ -9897,7 +9896,7 @@ int main(int argc, char **argv) case Q_QUERY: case Q_REAP: { - my_bool old_display_result_vertically= display_result_vertically; + bool old_display_result_vertically= display_result_vertically; /* Default is full query, both reap and send */ int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG; @@ -10198,7 +10197,7 @@ int main(int argc, char **argv) if (parsing_disabled) die("Test ended with parsing disabled"); - my_bool empty_result= FALSE; + bool empty_result= FALSE; /* The whole test has been executed _sucessfully_. diff --git a/dbug/dbug.c b/dbug/dbug.c index 41f42827d909..0f706e4d3c5e 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -153,12 +153,6 @@ #define DEBUGGING (cs->stack->flags & DEBUG_ON) #define PROFILING (cs->stack->flags & PROFILE_ON) -/* - * Typedefs to make things more obvious. - */ - -#define BOOLEAN my_bool - /* * The user may specify a list of functions to trace or * debug. These lists are kept in a linear linked list, @@ -211,7 +205,7 @@ struct settings { */ -static BOOLEAN init_done= FALSE; /* Set to TRUE when initialization done */ +static bool init_done= FALSE; /* Set to TRUE when initialization done */ /** Global debugging settings. This structure shared between all threads, @@ -284,7 +278,7 @@ static int DoTrace(CODE_STATE *cs); #define DISABLE_TRACE 4 static void DoPrefix(CODE_STATE *cs, uint line); -static BOOLEAN Writable(const char *pathname); +static bool Writable(const char *pathname); static char *DbugMalloc(size_t size); static const char *BaseName(const char *pathname); @@ -1873,7 +1867,7 @@ FILE *_db_fp_(void) int _db_keyword_(CODE_STATE *cs, const char *keyword, int strict) { - BOOLEAN result; + bool result; get_code_state_if_not_set_or_return FALSE; /* Dirty read, for DBUG_EXECUTE(), DBUG_EXECUTE_IF() ... performance. */ @@ -2226,7 +2220,7 @@ static const char *BaseName(const char *pathname) * * SYNOPSIS * - * static BOOLEAN Writable(pathname) + * static bool Writable(pathname) * char *pathname; * * DESCRIPTION @@ -2243,9 +2237,9 @@ static const char *BaseName(const char *pathname) */ -static BOOLEAN Writable(const char *pathname) +static bool Writable(const char *pathname) { - BOOLEAN granted; + bool granted; char *lastslash; granted= FALSE; diff --git a/extra/regex/reginit.c b/extra/regex/reginit.c index 321d02988117..4c39b89df721 100644 --- a/extra/regex/reginit.c +++ b/extra/regex/reginit.c @@ -8,7 +8,7 @@ #include "cclass.h" #include "my_regex.h" -static my_bool regex_inited=0; +static bool regex_inited=0; extern my_regex_stack_check_t my_regex_enough_mem_in_stack; void my_regex_init(const CHARSET_INFO *cs, my_regex_stack_check_t func) diff --git a/include/decimal.h b/include/decimal.h index 2caed1d157ef..1557e744591b 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,13 +41,13 @@ typedef int32 decimal_digit_t; */ typedef struct st_decimal_t { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t *buf; } decimal_t; #ifndef MYSQL_ABI_CHECK int internal_str2dec(const char *from, decimal_t *to, char **end, - my_bool fixed); + bool fixed); int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler); diff --git a/include/ft_global.h b/include/ft_global.h index a96f9cb83e1c..fa5902659f1f 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -129,7 +129,7 @@ struct ft_hints FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint, const CHARSET_INFO *, uchar *); -my_bool ft_boolean_check_syntax_string(const uchar *); +bool ft_boolean_check_syntax_string(const uchar *); #ifdef __cplusplus } diff --git a/include/hash.h b/include/hash.h index 681721f4497a..60880a13cf7b 100644 --- a/include/hash.h +++ b/include/hash.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -114,12 +114,12 @@ uchar *my_hash_first_from_hash_value(const HASH *info, HASH_SEARCH_STATE *state); uchar *my_hash_next(const HASH *info, const uchar *key, size_t length, HASH_SEARCH_STATE *state); -my_bool my_hash_insert(HASH *info, const uchar *data); -my_bool my_hash_delete(HASH *hash, uchar *record); -my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, - size_t old_key_length); +bool my_hash_insert(HASH *info, const uchar *data); +bool my_hash_delete(HASH *hash, uchar *record); +bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, + size_t old_key_length); void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); -my_bool my_hash_check(HASH *hash); /* Only in debug library */ +bool my_hash_check(HASH *hash); /* Only in debug library */ inline void my_hash_clear(HASH *h) { new(h) st_hash(); } inline bool my_hash_inited(const HASH *h) { return h->blength != 0; } diff --git a/include/heap.h b/include/heap.h index ba2cc4a01f67..86efbaf0f482 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -158,7 +158,7 @@ typedef struct st_heap_share char * name; /* Name of "memory-file" */ time_t create_time; THR_LOCK lock; - my_bool delete_on_close; + bool delete_on_close; LIST open_list; uint auto_key; uint auto_key_type; /* real type of the auto key segment */ @@ -182,7 +182,7 @@ typedef struct st_heap_info TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1]; TREE_ELEMENT **last_pos; uint lastkey_len; - my_bool implicit_emptied; + bool implicit_emptied; THR_LOCK_DATA lock; LIST open_list; } HP_INFO; @@ -199,14 +199,14 @@ typedef struct st_heap_create_info uint reclength; ulonglong max_table_size; ulonglong auto_increment; - my_bool with_auto_increment; - my_bool single_instance; - my_bool delete_on_close; + bool with_auto_increment; + bool single_instance; + bool delete_on_close; /* TRUE if heap_create should 'pin' the created share by setting open_count to 1. Is only looked at if not internal_table. */ - my_bool pin_share; + bool pin_share; } HP_CREATE_INFO; /* Prototypes for heap-functions */ @@ -214,7 +214,7 @@ typedef struct st_heap_create_info extern HP_INFO *heap_open(const char *name, int mode); extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode); extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode); -extern void heap_release_share(HP_SHARE *share, my_bool single_instance); +extern void heap_release_share(HP_SHARE *share, bool single_instance); extern int heap_close(HP_INFO *info); extern int heap_write(HP_INFO *info,const uchar *buff); extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata); @@ -225,7 +225,7 @@ extern int heap_delete(HP_INFO *info,const uchar *buff); extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag); extern int heap_create(const char *name, HP_CREATE_INFO *create_info, HP_SHARE **share, - my_bool *created_new_share); + bool *created_new_share); extern int heap_delete_table(const char *name); extern void heap_drop_table(HP_INFO *info); extern int heap_extra(HP_INFO *info,enum ha_extra_function function); @@ -249,7 +249,7 @@ int hp_panic(enum ha_panic_function flag); int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag); extern uchar * heap_find(HP_INFO *info,int inx,const uchar *key); -extern int heap_check_heap(HP_INFO *info, my_bool print_status); +extern int heap_check_heap(HP_INFO *info, bool print_status); extern uchar *heap_position(HP_INFO *info); typedef uchar *HEAP_PTR; diff --git a/include/keycache.h b/include/keycache.h index ae6f1d814568..8d37e6774d81 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,11 +70,11 @@ typedef struct st_keycache_wqueue typedef struct st_key_cache { - my_bool key_cache_inited; - my_bool in_resize; /* true during resize operation */ - my_bool resize_in_flush; /* true during flush of resize operation */ - my_bool can_be_used; /* usage of cache for read/write is allowed */ - size_t key_cache_mem_size; /* specified size of the cache memory */ + bool key_cache_inited; + bool in_resize; /* true during resize operation */ + bool resize_in_flush; /* true during flush of resize operation */ + bool can_be_used; /* usage of cache for read/write is allowed */ + size_t key_cache_mem_size; /* specified size of the cache memory */ uint key_cache_block_size; /* size of the page buffer of a cache block */ ulonglong min_warm_blocks; /* min number of warm blocks; */ ulonglong age_threshold; /* age threshold for hot blocks */ @@ -127,7 +127,7 @@ typedef struct st_key_cache ulonglong global_cache_read; /* number of reads from files to cache */ int blocks; /* max number of blocks in the cache */ - my_bool in_init; /* Set to 1 in MySQL during init/resize */ + bool in_init; /* Set to 1 in MySQL during init/resize */ } KEY_CACHE; /* The default key cache */ @@ -158,13 +158,13 @@ extern int key_cache_write(KEY_CACHE *keycache, extern int flush_key_blocks(KEY_CACHE *keycache, st_keycache_thread_var *thread_var, int file, enum flush_type type); -extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); +extern void end_key_cache(KEY_CACHE *keycache, bool cleanup); /* Functions to handle multiple key caches */ -extern my_bool multi_keycache_init(void); +extern bool multi_keycache_init(void); extern void multi_keycache_free(void); extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length); -extern my_bool multi_key_cache_set(const uchar *key, uint length, +extern bool multi_key_cache_set(const uchar *key, uint length, KEY_CACHE *key_cache); extern void multi_key_cache_change(KEY_CACHE *old_data, KEY_CACHE *new_data); diff --git a/include/m_ctype.h b/include/m_ctype.h index 438e75f8562d..c0549ce44aef 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -111,7 +111,7 @@ typedef struct my_contraction_t { my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */ uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */ - my_bool with_context; + bool with_context; } MY_CONTRACTION; @@ -141,8 +141,8 @@ typedef struct my_contraction_list_t } MY_CONTRACTIONS; -my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc); -my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc); +bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc); +bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc); uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c, my_wc_t wc1, my_wc_t wc2); @@ -265,10 +265,10 @@ extern int (*my_string_stack_guard)(int); /* See strings/CHARSET_INFO.txt for information about this structure */ typedef struct my_collation_handler_st { - my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *); + bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *); /* Collation routines */ int (*strnncoll)(const struct charset_info_st *, - const uchar *, size_t, const uchar *, size_t, my_bool); + const uchar *, size_t, const uchar *, size_t, bool); int (*strnncollsp)(const struct charset_info_st *, const uchar *, size_t, const uchar *, size_t); /** @@ -297,12 +297,12 @@ typedef struct my_collation_handler_st uchar *dst, size_t dstlen, uint num_codepoints, const uchar *src, size_t srclen, uint flags); size_t (*strnxfrmlen)(const struct charset_info_st *, size_t); - my_bool (*like_range)(const struct charset_info_st *, - const char *s, size_t s_length, - char w_prefix, char w_one, char w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_len, size_t *max_len); + bool (*like_range)(const struct charset_info_st *, + const char *s, size_t s_length, + char w_prefix, char w_one, char w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_len, size_t *max_len); int (*wildcmp)(const struct charset_info_st *, const char *str,const char *str_end, const char *wildstr,const char *wildend, @@ -329,8 +329,8 @@ typedef struct my_collation_handler_st */ void (*hash_sort)(const struct charset_info_st *cs, const uchar *key, size_t len, ulong *nr1, ulong *nr2); - my_bool (*propagate)(const struct charset_info_st *cs, const uchar *str, - size_t len); + bool (*propagate)(const struct charset_info_st *cs, const uchar *str, + size_t len); } MY_COLLATION_HANDLER; extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; @@ -350,7 +350,7 @@ typedef size_t (*my_charset_conv_case)(const struct charset_info_st *, /* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct my_charset_handler_st { - my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader); + bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader); /* Multibyte routines */ uint (*ismbchar)(const struct charset_info_st *, const char *, const char *); @@ -457,7 +457,7 @@ typedef struct charset_info_st my_wc_t min_sort_char; my_wc_t max_sort_char; /* For LIKE optimization */ uchar pad_char; - my_bool escape_with_backslash_is_dangerous; + bool escape_with_backslash_is_dangerous; uchar levels_for_compare; MY_CHARSET_HANDLER *cset; @@ -497,7 +497,7 @@ extern size_t my_strnxfrm_simple(const CHARSET_INFO *, const uchar *src, size_t srclen, uint flags); size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t); extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t, - const uchar *, size_t, my_bool); + const uchar *, size_t, bool); extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t); @@ -570,28 +570,28 @@ ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs, void my_fill_8bit(const CHARSET_INFO *cs, char* to, size_t l, int fill); /* For 8-bit character set */ -my_bool my_like_range_simple(const CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - my_bool escape, my_bool w_one, my_bool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); +bool my_like_range_simple(const CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); /* For ASCII-based multi-byte character sets with mbminlen=1 */ -my_bool my_like_range_mb(const CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - my_bool escape, my_bool w_one, my_bool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); +bool my_like_range_mb(const CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); /* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */ -my_bool my_like_range_generic(const CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - my_bool escape, my_bool w_one, my_bool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); +bool my_like_range_generic(const CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); int my_wildcmp_8bit(const CHARSET_INFO *, const char *str,const char *str_end, @@ -648,7 +648,7 @@ uint my_instr_mb(const struct charset_info_st *, int my_strnncoll_mb_bin(const CHARSET_INFO * cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix); + bool t_is_prefix); int my_strnncollsp_mb_bin(const CHARSET_INFO *cs, const uchar *a, size_t a_length, @@ -684,23 +684,23 @@ int my_wildcmp_unicode(const CHARSET_INFO *cs, int escape, int w_one, int w_many, const MY_UNICASE_INFO *weights); -extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, - const char *buf, size_t buflen); +extern bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, + const char *buf, size_t buflen); extern char *my_strchr(const CHARSET_INFO *cs, const char *str, const char *end, char c); extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str, const char *end, const char *reject, size_t reject_length); -my_bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str, - size_t len); -my_bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str, - size_t len); +bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str, + size_t len); +bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str, + size_t len); uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len); -my_bool my_charset_is_ascii_based(const CHARSET_INFO *cs); -my_bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs); +bool my_charset_is_ascii_based(const CHARSET_INFO *cs); +bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs); uint my_charset_repertoire(const CHARSET_INFO *cs); @@ -709,7 +709,7 @@ size_t my_strxfrm_pad(const CHARSET_INFO *cs, uchar *str, uchar *frmend, uchar *strend, uint nweights, uint flags); -my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs); +bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs); const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs); diff --git a/include/m_string.h b/include/m_string.h index 524384b18519..562ddbee9a45 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -269,9 +269,9 @@ typedef enum { double my_strtod(const char *str, char **end, int *error); double my_atof(const char *nptr); -size_t my_fcvt(double x, int precision, char *to, my_bool *error); +size_t my_fcvt(double x, int precision, char *to, bool *error); size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, - my_bool *error); + bool *error); #define NOT_FIXED_DEC 31 diff --git a/include/my_aes.h b/include/my_aes.h index 39650aaa5485..3b1a50e30511 100644 --- a/include/my_aes.h +++ b/include/my_aes.h @@ -1,7 +1,7 @@ #ifndef MY_AES_INCLUDED #define MY_AES_INCLUDED -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -132,7 +132,7 @@ int my_aes_get_size(uint32 source_length, enum my_aes_opmode opmode); @retval FALSE IV not needed */ -my_bool my_aes_needs_iv(my_aes_opmode opmode); +bool my_aes_needs_iv(my_aes_opmode opmode); C_MODE_END diff --git a/include/my_alloc.h b/include/my_alloc.h index c004b2c61605..40fe20b81669 100644 --- a/include/my_alloc.h +++ b/include/my_alloc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ #ifndef _my_alloc_h #define _my_alloc_h +#include + /* How much overhead does malloc have. The code often allocates something like 1024-MALLOC_OVERHEAD bytes @@ -100,7 +102,7 @@ struct st_mem_root size_t allocated_size; /* Enable this for error reporting if capacity is exceeded */ - my_bool error_for_capacity_exceeded; + bool error_for_capacity_exceeded; void (*error_handler)(void); diff --git a/include/my_bitmap.h b/include/my_bitmap.h index d0a8c160489e..f1a6aebc0cc6 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,17 +50,17 @@ typedef struct st_bitmap extern "C" { #endif extern void create_last_word_mask(MY_BITMAP *map); -extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe); -extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); -extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); -extern my_bool bitmap_is_set_all(const MY_BITMAP *map); -extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2); -extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, - const MY_BITMAP *map2); -extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); -extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); -extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, + bool thread_safe); +extern bool bitmap_is_clear_all(const MY_BITMAP *map); +extern bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); +extern bool bitmap_is_set_all(const MY_BITMAP *map); +extern bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2); +extern bool bitmap_is_overlapping(const MY_BITMAP *map1, + const MY_BITMAP *map2); +extern bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); +extern bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); extern uint bitmap_set_next(MY_BITMAP *map); extern uint bitmap_get_first(const MY_BITMAP *map); extern uint bitmap_get_first_set(const MY_BITMAP *map); @@ -104,7 +104,7 @@ static inline void bitmap_clear_bit(MY_BITMAP *map, uint bit) } -static inline my_bool bitmap_is_set(const MY_BITMAP *map, uint bit) +static inline bool bitmap_is_set(const MY_BITMAP *map, uint bit) { DBUG_ASSERT(bit < map->n_bits); return ((uchar*)map->bitmap)[bit / 8] & (1 << (bit & 7)); @@ -118,7 +118,7 @@ static inline my_bool bitmap_is_set(const MY_BITMAP *map, uint bit) @retval true The bitmaps are equal. @retval false The bitmaps differ. */ -static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) +static inline bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) { DBUG_ASSERT(map1->n_bits > 0); DBUG_ASSERT(map2->n_bits > 0); diff --git a/include/my_compare.h b/include/my_compare.h index e41a2e18a2b3..85153f086bd3 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -114,7 +114,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */ set_rec_bits(0, bit_ptr, bit_ofs, bit_len) extern int ha_compare_text(const CHARSET_INFO *, uchar *, uint, uchar *, uint , - my_bool); + bool); extern int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length, uint nextflag, uint *diff_pos); diff --git a/include/my_default.h b/include/my_default.h index 9dbedd9dcbda..ad54a15fdae7 100644 --- a/include/my_default.h +++ b/include/my_default.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,29 +30,29 @@ C_MODE_START extern const char *my_defaults_extra_file; extern const char *my_defaults_group_suffix; extern const char *my_defaults_file; -extern my_bool my_getopt_use_args_separator; -extern my_bool my_defaults_read_login_file; -extern my_bool no_defaults; +extern bool my_getopt_use_args_separator; +extern bool my_defaults_read_login_file; +extern bool no_defaults; /* Define the type of function to be passed to process_default_option_files */ typedef int (*Process_option_func)(void *ctx, const char *group_name, const char *option, const char *cnf_file); -my_bool my_getopt_is_args_separator(const char* arg); +bool my_getopt_is_args_separator(const char* arg); int get_defaults_options(int argc, char **argv, char **defaults, char **extra_defaults, char **group_suffix, char **login_path, - my_bool found_no_defaults); + bool found_no_defaults); int my_load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv, const char ***); -int check_file_permissions(const char *file_name, my_bool is_login_file); +int check_file_permissions(const char *file_name, bool is_login_file); int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv); int my_search_option_files(const char *conf_file, int *argc, char ***argv, uint *args_used, Process_option_func func, void *func_ctx, const char **default_directories, - my_bool is_login_file, my_bool found_no_defaults); + bool is_login_file, bool found_no_defaults); void free_defaults(char **argv); void my_print_default_files(const char *conf_file); void print_defaults(const char *conf_file, const char **groups); diff --git a/include/my_getopt.h b/include/my_getopt.h index dea00f962823..29773f147424 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -142,7 +142,7 @@ struct my_option }; -typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); +typedef bool (*my_get_one_option)(int, const struct my_option *, char *); /** Used to retrieve a reference to the object (variable) that holds the value for the given option. For example, if var_type is GET_UINT, the function @@ -154,8 +154,8 @@ typedef void *(*my_getopt_value)(const char *, size_t, const struct my_option *, extern char *disabled_my_option; -extern my_bool my_getopt_print_errors; -extern my_bool my_getopt_skip_unknown; +extern bool my_getopt_print_errors; +extern bool my_getopt_skip_unknown; extern my_error_reporter my_getopt_error_reporter; extern int handle_options (int *argc, char ***argv, @@ -163,7 +163,7 @@ extern int handle_options (int *argc, char ***argv, extern int my_handle_options (int *argc, char ***argv, const struct my_option *longopts, my_get_one_option, - const char **command_list, my_bool ignore_unknown_option); + const char **command_list, bool ignore_unknown_option); extern void print_cmdline_password_warning(); extern void my_cleanup_options(const struct my_option *options); extern void my_print_help(const struct my_option *options); @@ -172,11 +172,11 @@ extern void my_print_variables_ex(const struct my_option *options, FILE* file); extern void my_getopt_register_get_addr(my_getopt_value); ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - my_bool *fix); + bool *fix); longlong getopt_ll_limit_value(longlong, const struct my_option *, - my_bool *fix); + bool *fix); double getopt_double_limit_value(double num, const struct my_option *optp, - my_bool *fix); + bool *fix); ulonglong max_of_int_range(int var_type); ulonglong getopt_double2ulonglong(double); diff --git a/include/my_inttypes.h b/include/my_inttypes.h index c6c2b32457dc..521d3e1f94a7 100644 --- a/include/my_inttypes.h +++ b/include/my_inttypes.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -118,12 +118,6 @@ typedef unsigned long my_off_t; */ typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; /* Small bool */ - -#if !defined(__cplusplus) && !defined(bool) -#define bool In_C_you_should_use_my_bool_instead() -#endif - /* Define some general constants */ #ifndef TRUE #define TRUE (1) /* Logical true */ diff --git a/include/my_sys.h b/include/my_sys.h index ede25653fadb..61d66ff44afe 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -224,7 +224,7 @@ extern void (*debug_sync_C_callback_ptr)(const char *, size_t); extern uint my_get_large_page_size(void); extern uchar * my_large_malloc(PSI_memory_key key, size_t size, myf my_flags); extern void my_large_free(uchar *ptr); -extern my_bool my_use_large_pages; +extern bool my_use_large_pages; extern uint my_large_page_size; #else #define my_get_large_page_size() (0) @@ -278,13 +278,13 @@ extern CHARSET_INFO compiled_charsets[]; /* statistics */ extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern ulong my_file_total_opened; -extern my_bool my_init_done; +extern bool my_init_done; extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */ extern int my_umask_dir; extern ulong my_default_record_cache_size; -extern my_bool my_disable_locking, +extern bool my_disable_locking, my_enable_symlinks; extern const char *charsets_dir; @@ -481,7 +481,7 @@ typedef struct st_io_cache /* Used when cacheing files */ Currently READ_NET is the only one that will use a buffer allocated somewhere else */ - my_bool alloced_buffer; + bool alloced_buffer; } IO_CACHE; typedef int (*qsort_cmp)(const void *,const void *); @@ -608,8 +608,8 @@ extern int check_if_legal_filename(const char *path); extern int check_if_legal_tablename(const char *path); #ifdef _WIN32 -extern my_bool is_filename_allowed(const char *name, size_t length, - my_bool allow_current_dir); +extern bool is_filename_allowed(const char *name, size_t length, + bool allow_current_dir); #else /* _WIN32 */ # define is_filename_allowed(name, length, allow_cwd) (TRUE) #endif /* _WIN32 */ @@ -650,17 +650,17 @@ extern void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap); extern int my_error_register(const char* (*get_errmsg) (int), int first, int last); -extern my_bool my_error_unregister(int first, int last); +extern bool my_error_unregister(int first, int last); extern void my_message(uint my_err, const char *str,myf MyFlags); extern void my_message_stderr(uint my_err, const char *str, myf MyFlags); void my_message_local_stderr(enum loglevel ll, const char *format, va_list args); extern void my_message_local(enum loglevel ll, const char *format, ...); -extern my_bool my_init(void); +extern bool my_init(void); extern void my_end(int infoflag); extern char * my_filename(File fd); extern MY_MODE get_file_perm(ulong perm_flags); -extern my_bool my_chmod(const char *filename, ulong perm_flags, myf my_flags); +extern bool my_chmod(const char *filename, ulong perm_flags, myf my_flags); #ifdef EXTRA_DEBUG void my_print_open_files(void); @@ -668,7 +668,7 @@ void my_print_open_files(void); #define my_print_open_files() #endif -extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); +extern bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); extern char *my_tmpdir(MY_TMPDIR *tmpdir); extern void free_tmpdir(MY_TMPDIR *tmpdir); @@ -676,7 +676,7 @@ extern size_t dirname_part(char * to,const char *name, size_t *to_res_length); extern size_t dirname_length(const char *name); #define base_name(A) (A+dirname_length(A)) extern int test_if_hard_path(const char *dir_name); -extern my_bool has_path(const char *name); +extern bool has_path(const char *name); extern char *convert_dirname(char *to, const char *from, const char *from_end); extern void to_unix_path(char * name); extern char * fn_ext(const char *name); @@ -696,11 +696,11 @@ extern char * my_path(char * to,const char *progname, const char *own_pathname_part); extern char * my_load_path(char * to, const char *path, const char *own_path_prefix); -extern my_bool array_append_string_unique(const char *str, +extern bool array_append_string_unique(const char *str, const char **array, size_t size); extern void get_date(char * to,int timeflag,time_t use_time); -extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element); +extern bool radixsort_is_appliccable(uint n_items, size_t size_of_element); extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, size_t size_of_element,uchar *buffer[]); extern void my_qsort(void *base_ptr, size_t total_elems, size_t size, @@ -711,14 +711,14 @@ void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); my_off_t my_get_ptr(uchar *ptr, size_t pack_length); extern int init_io_cache_ext(IO_CACHE *info,File file,size_t cachesize, enum cache_type type,my_off_t seek_offset, - my_bool use_async_io, myf cache_myflags, + bool use_async_io, myf cache_myflags, PSI_file_key file_key); extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, enum cache_type type,my_off_t seek_offset, - my_bool use_async_io, myf cache_myflags); -extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, - my_off_t seek_offset,my_bool use_async_io, - my_bool clear_cache); + bool use_async_io, myf cache_myflags); +extern bool reinit_io_cache(IO_CACHE *info,enum cache_type type, + my_off_t seek_offset,bool use_async_io, + bool clear_cache); extern void setup_io_cache(IO_CACHE* info); extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); @@ -746,28 +746,28 @@ extern my_off_t my_b_filelength(IO_CACHE *info); extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...) MY_ATTRIBUTE((format(printf, 2, 3))); extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); -extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, - const char *prefix, size_t cache_size, - myf cache_myflags); -extern my_bool real_open_cached_file(IO_CACHE *cache); +extern bool open_cached_file(IO_CACHE *cache,const char *dir, + const char *prefix, size_t cache_size, + myf cache_myflags); +extern bool real_open_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache); File create_temp_file(char *to, const char *dir, const char *pfx, int mode, myf MyFlags); // Use Prealloced_array or std::vector or something similar in C++ -extern my_bool my_init_dynamic_array(DYNAMIC_ARRAY *array, - PSI_memory_key key, - uint element_size, - void *init_buffer, - uint init_alloc, - uint alloc_increment); +extern bool my_init_dynamic_array(DYNAMIC_ARRAY *array, + PSI_memory_key key, + uint element_size, + void *init_buffer, + uint init_alloc, + uint alloc_increment); /* init_dynamic_array() function is deprecated */ #define dynamic_element(array,array_index,type) \ ((type)((array)->buffer) +(array_index)) /* Some functions are still in use in C++, because HASH uses DYNAMIC_ARRAY */ -extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element); +extern bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element); extern void *alloc_dynamic(DYNAMIC_ARRAY *array); extern void *pop_dynamic(DYNAMIC_ARRAY*); extern void claim_dynamic(DYNAMIC_ARRAY *array); @@ -778,16 +778,16 @@ static inline void reset_dynamic(DYNAMIC_ARRAY *array) array->elements= 0; } -extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, - size_t init_alloc,size_t alloc_increment); -extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); -my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, - size_t length); -extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, - ...); -extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); -extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); -extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); +extern bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, + size_t init_alloc,size_t alloc_increment); +extern bool dynstr_append(DYNAMIC_STRING *str, const char *append); +bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, + size_t length); +extern bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, + ...); +extern bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); +extern bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); +extern bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern void dynstr_free(DYNAMIC_STRING *str); #define alloc_root_inited(A) ((A)->min_malloc != 0) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) @@ -807,9 +807,9 @@ extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); extern void set_memroot_max_capacity(MEM_ROOT *mem_root, size_t size); extern void set_memroot_error_reporting(MEM_ROOT *mem_root, - my_bool report_error); -extern my_bool my_compress(uchar *, size_t *, size_t *); -extern my_bool my_uncompress(uchar *, size_t , size_t *); + bool report_error); +extern bool my_compress(uchar *, size_t *, size_t *); +extern bool my_uncompress(uchar *, size_t , size_t *); extern uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen); extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, @@ -834,7 +834,7 @@ void my_free_open_file_info(void); extern time_t my_time(myf flags); extern ulonglong my_micro_time(); extern ulonglong my_micro_time_ntp(); -extern my_bool my_gethwaddr(uchar *to); +extern bool my_gethwaddr(uchar *to); #ifdef HAVE_SYS_MMAN_H #include @@ -902,17 +902,17 @@ extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, extern CHARSET_INFO *my_charset_get_by_name(MY_CHARSET_LOADER *loader, const char *name, uint cs_flags, myf my_flags); -extern my_bool resolve_charset(const char *cs_name, - const CHARSET_INFO *default_cs, - const CHARSET_INFO **cs); -extern my_bool resolve_collation(const char *cl_name, - const CHARSET_INFO *default_cl, - const CHARSET_INFO **cl); +extern bool resolve_charset(const char *cs_name, + const CHARSET_INFO *default_cs, + const CHARSET_INFO **cs); +extern bool resolve_collation(const char *cl_name, + const CHARSET_INFO *default_cl, + const CHARSET_INFO **cl); extern void free_charsets(void); extern char *get_charsets_dir(char *buf); -extern my_bool my_charset_same(const CHARSET_INFO *cs1, - const CHARSET_INFO *cs2); -extern my_bool init_compiled_charsets(myf flags); +extern bool my_charset_same(const CHARSET_INFO *cs1, + const CHARSET_INFO *cs2); +extern bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); extern size_t escape_string_for_mysql(const CHARSET_INFO *charset_info, char *to, size_t to_length, @@ -925,7 +925,7 @@ extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length, char quote); #ifdef _WIN32 -extern my_bool have_tcpip; /* Is set if tcpip is used */ +extern bool have_tcpip; /* Is set if tcpip is used */ /* implemented in my_windac.c */ @@ -935,7 +935,7 @@ int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, void my_security_attr_free(SECURITY_ATTRIBUTES *sa); /* implemented in my_conio.c */ -my_bool my_win_is_console(FILE *file); +bool my_win_is_console(FILE *file); char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize, size_t *nread); void my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t datalen); diff --git a/include/my_thread.h b/include/my_thread.h index 5453966531f3..4a7fac31ab9d 100644 --- a/include/my_thread.h +++ b/include/my_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ #define MY_THREAD_INCLUDED #include +#include #include #include "my_compiler.h" @@ -201,10 +202,10 @@ int my_thread_cancel(my_thread_handle *thread); void my_thread_exit(void *value_ptr) MY_ATTRIBUTE((noreturn)); -extern my_bool my_thread_global_init(); +extern bool my_thread_global_init(); extern void my_thread_global_reinit(); extern void my_thread_global_end(); -extern my_bool my_thread_init(); +extern bool my_thread_init(); extern void my_thread_end(); C_MODE_END diff --git a/include/my_time.h b/include/my_time.h index 5588c7c1b3bb..e8a9ec78fce3 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -116,13 +116,13 @@ static inline void my_time_status_init(MYSQL_TIME_STATUS *status) } -my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - my_time_flags_t flags, int *was_cut); -my_bool str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, - my_time_flags_t flags, MYSQL_TIME_STATUS *status); +bool check_date(const MYSQL_TIME *ltime, bool not_zero_date, + my_time_flags_t flags, int *was_cut); +bool str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, + my_time_flags_t flags, MYSQL_TIME_STATUS *status); longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, my_time_flags_t flags, int *was_cut); -my_bool number_to_time(longlong nr, MYSQL_TIME *ltime, int *warnings); +bool number_to_time(longlong nr, MYSQL_TIME *ltime, int *warnings); ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); @@ -154,12 +154,12 @@ longlong my_time_packed_from_binary(const uchar *ptr, uint dec); void my_timestamp_to_binary(const struct timeval *tm, uchar *ptr, uint dec); void my_timestamp_from_binary(struct timeval *tm, const uchar *ptr, uint dec); -my_bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time, - MYSQL_TIME_STATUS *status); +bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time, + MYSQL_TIME_STATUS *status); -my_bool check_time_mmssff_range(const MYSQL_TIME *ltime); -my_bool check_time_range_quick(const MYSQL_TIME *ltime); -my_bool check_datetime_range(const MYSQL_TIME *ltime); +bool check_time_mmssff_range(const MYSQL_TIME *ltime); +bool check_time_range_quick(const MYSQL_TIME *ltime); +bool check_datetime_range(const MYSQL_TIME *ltime); void adjust_time_range(struct st_mysql_time *, int *warning); long calc_daynr(uint year,uint month,uint day); @@ -182,7 +182,7 @@ void my_init_time(void); FALSE The MYSQL_TIME value is definitely out of range */ -static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) +static inline bool validate_timestamp_range(const MYSQL_TIME *t) { if ((t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) || (t->year == TIMESTAMP_MAX_YEAR && (t->month > 1 || t->day > 19)) || @@ -194,10 +194,10 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) my_time_t my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, - my_bool *in_dst_time_gap); + bool *in_dst_time_gap); void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); -void set_max_time(MYSQL_TIME *tm, my_bool neg); +void set_max_time(MYSQL_TIME *tm, bool neg); void set_max_hhmmss(MYSQL_TIME *tm); /* diff --git a/include/my_timer.h b/include/my_timer.h index f0ebc1c15d17..af28e4e34eca 100644 --- a/include/my_timer.h +++ b/include/my_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ struct st_my_timer; typedef struct st_os_timer { HANDLE timer_handle; - my_bool timer_state; + bool timer_state; } os_timer_t; #endif diff --git a/include/my_tree.h b/include/my_tree.h index 35151e7e82d6..1b9a14823290 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,14 +67,14 @@ typedef struct st_tree { qsort2_cmp compare; const void *custom_arg; MEM_ROOT mem_root; - my_bool with_delete; + bool with_delete; tree_element_free free; uint flag; } TREE; /* Functions on whole tree */ void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit, - int size, qsort2_cmp compare, my_bool with_delete, + int size, qsort2_cmp compare, bool with_delete, tree_element_free free_element, const void *custom_arg); void delete_tree(TREE*); void reset_tree(TREE*); diff --git a/include/myisam.h b/include/myisam.h index f9c9a1d8ba0d..60f3a74a7717 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -169,7 +169,7 @@ typedef struct st_mi_create_info ulonglong key_file_length; uint old_options; uint16 language; - my_bool with_auto_increment; + bool with_auto_increment; } MI_CREATE_INFO; struct st_myisam_info; /* For referense */ @@ -198,7 +198,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */ int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo, uchar *page,uchar *key, uint key_len,uint comp_flag,uchar * *ret_pos, - uchar *buff, my_bool *was_last_key); + uchar *buff, bool *was_last_key); uint (*get_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar * *page, uchar *key); int (*pack_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar *next_key, @@ -256,7 +256,7 @@ typedef struct st_columndef /* column information */ extern char * myisam_log_filename; /* Name of logfile */ extern ulong myisam_block_size; extern ulong myisam_concurrent_insert; -extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; +extern bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_off_t myisam_max_temp_length; extern ulong myisam_data_pointer_size; @@ -268,7 +268,7 @@ extern mysql_mutex_t THR_LOCK_myisam_mmap; /* Prototypes for myisam-functions */ -extern int mi_close_share(struct st_myisam_info *file, my_bool *closed_share); +extern int mi_close_share(struct st_myisam_info *file, bool *closed_share); #define mi_close(file) mi_close_share(file, NULL) extern int mi_delete(struct st_myisam_info *file,const uchar *buff); extern struct st_myisam_info *mi_open_share(const char *name, @@ -378,8 +378,8 @@ typedef struct st_mi_check_param uint opt_sort_key,total_files,max_level; uint testflag, key_cache_block_size; uint16 language; - my_bool using_global_keycache, opt_follow_links; - my_bool retry_repair, force_sort; + bool using_global_keycache, opt_follow_links; + bool retry_repair, force_sort; char temp_filename[FN_REFLEN],*isam_file_name; MY_TMPDIR *tmpdir; int tmpfile_createflag; @@ -400,7 +400,7 @@ typedef struct st_mi_check_param const char *op_name; enum_mi_stats_method stats_method; mysql_mutex_t print_msg_mutex; - my_bool need_print_msg_lock; + bool need_print_msg_lock; } MI_CHECK; typedef struct st_sort_ft_buf @@ -436,20 +436,20 @@ int chk_size(MI_CHECK *param, MI_INFO *info); int chk_key(MI_CHECK *param, MI_INFO *info); int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend); int mi_repair(MI_CHECK *param, MI_INFO *info, - char * name, int rep_quick, my_bool no_copy_stat); + char * name, int rep_quick, bool no_copy_stat); int mi_sort_index(MI_CHECK *param, MI_INFO *info, char * name, - my_bool no_copy_stat); + bool no_copy_stat); int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, - const char * name, int rep_quick, my_bool no_copy_stat); + const char * name, int rep_quick, bool no_copy_stat); int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, - const char * name, int rep_quick, my_bool no_copy_stat); + const char * name, int rep_quick, bool no_copy_stat); int change_to_newfile(const char * filename, const char * old_ext, const char * new_ext, myf myflags); int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type, const char *filetype, const char *filename); void lock_memory(MI_CHECK *param); void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, - my_bool repair); + bool repair); int update_state_info(MI_CHECK *param, MI_INFO *info,uint update); void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, ulonglong *unique, ulonglong *notnull, @@ -458,12 +458,12 @@ int filecopy(MI_CHECK *param, File to,File from,my_off_t start, my_off_t length, const char *type); int movepoint(MI_INFO *info,uchar *record,my_off_t oldpos, my_off_t newpos, uint prot_key); -int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile); +int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile); int test_if_almost_full(MI_INFO *info); int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename); void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); -my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, - my_bool force); +bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, + bool force); int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows); void mi_flush_bulk_insert(MI_INFO *info, uint inx); @@ -472,7 +472,7 @@ int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map, KEY_CACHE *key_cache); void mi_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache); -int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves); +int mi_preload(MI_INFO *info, ulonglong key_map, bool ignore_leaves); extern st_keycache_thread_var main_thread_keycache_var; st_keycache_thread_var *keycache_thread_var(); diff --git a/include/myisammrg.h b/include/myisammrg.h index ce392b39c85d..8ec3633ef371 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,9 +73,9 @@ typedef struct st_myrg_info ulong cache_size; uint merge_insert_method; uint tables,options,reclength,keys; - my_bool cache_in_use; + bool cache_in_use; /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */ - my_bool children_attached; + bool children_attached; LIST open_list; QUEUE by_key; ulong *rec_per_key_part; /* for sql optimizing */ @@ -94,7 +94,7 @@ extern MYRG_INFO *myrg_parent_open(const char *parent_name, extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, MI_INFO *(*callback)(void*), void *callback_param, - my_bool *need_compat_check); + bool *need_compat_check); extern int myrg_detach_children(MYRG_INFO *m_info); extern int myrg_panic(enum ha_panic_function function); extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx); @@ -111,7 +111,7 @@ extern int myrg_write(MYRG_INFO *info,uchar *rec); extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag); extern int myrg_lock_database(MYRG_INFO *file,int lock_type); extern int myrg_create(const char *name, const char **table_names, - uint insert_method, my_bool fix_names); + uint insert_method, bool fix_names); extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, void *extra_arg); extern int myrg_reset(MYRG_INFO *info); diff --git a/include/mysql.h b/include/mysql.h index a2a5593ee478..67dc52f3739d 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -28,13 +28,13 @@ #define _mysql_h #ifndef MYSQL_ABI_CHECK +#include #include #include #endif // Small extra definitions to avoid pulling in my_inttypes.h in client code. // IWYU pragma: no_include "my_inttypes.h" -typedef char my_bool; #if defined (_WIN32) typedef unsigned __int64 my_ulonglong; #else @@ -201,12 +201,12 @@ struct st_mysql_options { char *ssl_cipher; /* cipher to use */ char *shared_memory_base_name; unsigned long max_allowed_packet; - my_bool unused6; /* Deprecated ! Former use_ssl */ - my_bool compress,named_pipe; - my_bool unused1; - my_bool unused2; - my_bool unused3; - my_bool unused4; + bool unused6; /* Deprecated ! Former use_ssl */ + bool compress,named_pipe; + bool unused1; + bool unused2; + bool unused3; + bool unused4; enum mysql_option methods_to_use; union { /* @@ -222,9 +222,9 @@ struct st_mysql_options { */ char *bind_address; } ci; - my_bool unused5; + bool unused5; /* 0 - never report, 1 - always report (default) */ - my_bool report_data_truncation; + bool report_data_truncation; /* function pointers for local infile support */ int (*local_infile_init)(void **, const char *, void *); @@ -291,12 +291,12 @@ typedef struct st_mysql unsigned int warning_count; struct st_mysql_options options; enum mysql_status status; - my_bool free_me; /* If free in mysql_close */ - my_bool reconnect; /* set to 1 if automatic reconnect */ + bool free_me; /* If free in mysql_close */ + bool reconnect; /* set to 1 if automatic reconnect */ /* session-wide random string */ char scramble[SCRAMBLE_LENGTH+1]; - my_bool unused1; + bool unused1; void *unused2, *unused3, *unused4, *unused5; LIST *stmts; /* list of all statements */ @@ -306,7 +306,7 @@ typedef struct st_mysql Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag from mysql_stmt_close if close had to cancel result set of this object. */ - my_bool *unbuffered_fetch_owner; + bool *unbuffered_fetch_owner; /* needed for embedded server - no net buffer to store the 'info' */ char *info_buffer; void *extension; @@ -325,9 +325,9 @@ typedef struct st_mysql_res { MYSQL_ROW current_row; /* buffer to current row */ MEM_ROOT *field_alloc; unsigned int field_count, current_field; - my_bool eof; /* Used by mysql_fetch_row */ + bool eof; /* Used by mysql_fetch_row */ /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; + bool unbuffered_fetch_cancelled; void *extension; } MYSQL_RES; @@ -399,7 +399,7 @@ void STDCALL mysql_server_end(void); connection. All uses of the connection(s) should be between these function calls. */ -my_bool STDCALL mysql_thread_init(void); +bool STDCALL mysql_thread_init(void); void STDCALL mysql_thread_end(void); /* @@ -409,7 +409,7 @@ void STDCALL mysql_thread_end(void); my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); -my_bool STDCALL mysql_eof(MYSQL_RES *res); +bool STDCALL mysql_eof(MYSQL_RES *res); MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr); MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); @@ -429,11 +429,11 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL * STDCALL mysql_init(MYSQL *mysql); -my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, +bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher); const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, +bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db); MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, const char *user, @@ -531,7 +531,7 @@ unsigned long STDCALL mysql_real_escape_string_quote(MYSQL *mysql, void STDCALL mysql_debug(const char *debug); void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int STDCALL mysql_thread_safe(void); -my_bool STDCALL mysql_read_query_result(MYSQL *mysql); +bool STDCALL mysql_read_query_result(MYSQL *mysql); int STDCALL mysql_reset_connection(MYSQL *mysql); int STDCALL mysql_binlog_open(MYSQL *mysql, MYSQL_RPL *rpl); @@ -617,10 +617,10 @@ enum enum_mysql_stmt_state typedef struct st_mysql_bind { unsigned long *length; /* output length pointer */ - my_bool *is_null; /* Pointer to null indicator */ + bool *is_null; /* Pointer to null indicator */ void *buffer; /* buffer to get/put data */ /* set this if you want to track data truncations happened during fetch */ - my_bool *error; + bool *error; unsigned char *row_ptr; /* for the current data position */ void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, @@ -634,10 +634,10 @@ typedef struct st_mysql_bind unsigned int param_number; /* For null count and error messages */ unsigned int pack_length; /* Internal length for packed data */ enum enum_field_types buffer_type; /* buffer type */ - my_bool error_value; /* used if error is 0 */ - my_bool is_unsigned; /* set if integer type is unsigned */ - my_bool long_data_used; /* If used with mysql_send_long_data */ - my_bool is_null_value; /* Used if is_null is 0 */ + bool error_value; /* used if error is 0 */ + bool is_unsigned; /* set if integer type is unsigned */ + bool long_data_used; /* If used with mysql_send_long_data */ + bool is_null_value; /* Used if is_null is 0 */ void *extension; } MYSQL_BIND; @@ -679,16 +679,16 @@ typedef struct st_mysql_stmt char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ char sqlstate[SQLSTATE_LENGTH+1]; /* Types of input parameters should be sent to server */ - my_bool send_types_to_server; - my_bool bind_param_done; /* input buffers were supplied */ + bool send_types_to_server; + bool bind_param_done; /* input buffers were supplied */ unsigned char bind_result_done; /* output buffers were supplied */ /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; + bool unbuffered_fetch_cancelled; /* Is set to true if we need to calculate field->max_length for metadata fields when doing mysql_stmt_store_result. */ - my_bool update_max_length; + bool update_max_length; struct st_mysql_stmt_extension *extension; } MYSQL_STMT; @@ -725,21 +725,21 @@ int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned long offset); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *attr); -my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *attr); -my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, - unsigned int param_number, - const char *data, - unsigned long length); +bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *attr); +bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *attr); +bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); +bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); +bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); +bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, + unsigned int param_number, + const char *data, + unsigned long length); MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); @@ -754,10 +754,10 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); -my_bool STDCALL mysql_commit(MYSQL * mysql); -my_bool STDCALL mysql_rollback(MYSQL * mysql); -my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); -my_bool STDCALL mysql_more_results(MYSQL *mysql); +bool STDCALL mysql_commit(MYSQL * mysql); +bool STDCALL mysql_rollback(MYSQL * mysql); +bool STDCALL mysql_autocommit(MYSQL * mysql, bool auto_mode); +bool STDCALL mysql_more_results(MYSQL *mysql); int STDCALL mysql_next_result(MYSQL *mysql); int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); void STDCALL mysql_close(MYSQL *sock); diff --git a/include/mysql.h.pp b/include/mysql.h.pp index d0d0c3da9ea9..ae84cd8a79ba 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -1,4 +1,3 @@ -typedef char my_bool; typedef unsigned long long my_ulonglong; typedef int my_socket; #include "binary_log_types.h" @@ -98,7 +97,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" @@ -139,7 +137,7 @@ unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool compress; + bool compress; unsigned char *unused; unsigned int last_errno; unsigned char error; @@ -178,18 +176,18 @@ SESSION_TRACK_TRANSACTION_CHARACTERISTICS, SESSION_TRACK_TRANSACTION_STATE }; -my_bool my_net_init(NET *net, void* vio); +bool my_net_init(NET *net, void* vio); void my_net_local_init(NET *net); void net_end(NET *net); -void net_clear(NET *net, my_bool check_buffer); +void net_clear(NET *net, bool check_buffer); void net_claim_memory_ownership(NET *net); -my_bool net_realloc(NET *net, size_t length); -my_bool net_flush(NET *net); -my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); -my_bool net_write_command(NET *net,unsigned char command, +bool net_realloc(NET *net, size_t length); +bool net_flush(NET *net); +bool my_net_write(NET *net,const unsigned char *packet, size_t len); +bool net_write_command(NET *net,unsigned char command, const unsigned char *header, size_t head_len, const unsigned char *packet, size_t len); -my_bool net_write_packet(NET *net, const unsigned char *packet, size_t length); +bool net_write_packet(NET *net, const unsigned char *packet, size_t length); unsigned long my_net_read(NET *net); void my_net_set_write_timeout(NET *net, uint timeout); void my_net_set_read_timeout(NET *net, uint timeout); @@ -214,11 +212,11 @@ } UDF_ARGS; typedef struct st_udf_init { - my_bool maybe_null; + bool maybe_null; unsigned int decimals; unsigned long max_length; char *ptr; - my_bool const_item; + bool const_item; void *extension; } UDF_INIT; void randominit(struct rand_struct *, unsigned long seed1, @@ -228,20 +226,20 @@ void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const unsigned char *reply, const char *message, - unsigned long *salt); +bool check_scramble_323(const unsigned char *reply, const char *message, + unsigned long *salt); void get_salt_from_password_323(unsigned long *res, const char *password); void make_password_from_salt_323(char *to, const unsigned long *salt); void make_scrambled_password(char *to, const char *password); void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const unsigned char *reply, const char *message, - const unsigned char *hash_stage2); +bool check_scramble(const unsigned char *reply, const char *message, + const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); char *octet2hex(char *to, const char *str, unsigned int len); char *get_tty_password(const char *opt_message); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); -my_bool my_thread_init(void); +bool my_thread_init(void); void my_thread_end(void); ulong net_field_length(uchar **packet); my_ulonglong net_field_length_ll(uchar **packet); @@ -299,7 +297,7 @@ { unsigned int year, month, day, hour, minute, second; unsigned long second_part; - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; extern unsigned int mysql_port; @@ -384,19 +382,19 @@ char *ssl_cipher; char *shared_memory_base_name; unsigned long max_allowed_packet; - my_bool unused6; - my_bool compress,named_pipe; - my_bool unused1; - my_bool unused2; - my_bool unused3; - my_bool unused4; + bool unused6; + bool compress,named_pipe; + bool unused1; + bool unused2; + bool unused3; + bool unused4; enum mysql_option methods_to_use; union { char *client_ip; char *bind_address; } ci; - my_bool unused5; - my_bool report_data_truncation; + bool unused5; + bool report_data_truncation; int (*local_infile_init)(void **, const char *, void *); int (*local_infile_read)(void *, char *, unsigned int); void (*local_infile_end)(void *); @@ -455,15 +453,15 @@ unsigned int warning_count; struct st_mysql_options options; enum mysql_status status; - my_bool free_me; - my_bool reconnect; + bool free_me; + bool reconnect; char scramble[20 +1]; - my_bool unused1; + bool unused1; void *unused2, *unused3, *unused4, *unused5; LIST *stmts; const struct st_mysql_methods *methods; void *thd; - my_bool *unbuffered_fetch_owner; + bool *unbuffered_fetch_owner; char *info_buffer; void *extension; } MYSQL; @@ -479,8 +477,8 @@ MYSQL_ROW current_row; MEM_ROOT *field_alloc; unsigned int field_count, current_field; - my_bool eof; - my_bool unbuffered_fetch_cancelled; + bool eof; + bool unbuffered_fetch_cancelled; void *extension; } MYSQL_RES; typedef struct st_mysql_rpl { @@ -491,18 +489,18 @@ unsigned int flags; size_t gtid_set_encoded_size; void (*fix_gtid_set)(struct st_mysql_rpl *rpl, - unsigned char *packet_gtid_set); + unsigned char *packet_gtid_set); void *gtid_set_arg; unsigned long size; const unsigned char *buffer; } MYSQL_RPL; int mysql_server_init(int argc, char **argv, char **groups); void mysql_server_end(void); -my_bool mysql_thread_init(void); +bool mysql_thread_init(void); void mysql_thread_end(void); my_ulonglong mysql_num_rows(MYSQL_RES *res); unsigned int mysql_num_fields(MYSQL_RES *res); -my_bool mysql_eof(MYSQL_RES *res); +bool mysql_eof(MYSQL_RES *res); MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr); MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res); @@ -520,11 +518,11 @@ const char * mysql_character_set_name(MYSQL *mysql); int mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL * mysql_init(MYSQL *mysql); -my_bool mysql_ssl_set(MYSQL *mysql, const char *key, +bool mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher); const char * mysql_get_ssl_cipher(MYSQL *mysql); -my_bool mysql_change_user(MYSQL *mysql, const char *user, +bool mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db); MYSQL * mysql_real_connect(MYSQL *mysql, const char *host, const char *user, @@ -615,7 +613,7 @@ void mysql_debug(const char *debug); void myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int mysql_thread_safe(void); -my_bool mysql_read_query_result(MYSQL *mysql); +bool mysql_read_query_result(MYSQL *mysql); int mysql_reset_connection(MYSQL *mysql); int mysql_binlog_open(MYSQL *mysql, MYSQL_RPL *rpl); int mysql_binlog_fetch(MYSQL *mysql, MYSQL_RPL *rpl); @@ -628,9 +626,9 @@ typedef struct st_mysql_bind { unsigned long *length; - my_bool *is_null; + bool *is_null; void *buffer; - my_bool *error; + bool *error; unsigned char *row_ptr; void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, @@ -643,10 +641,10 @@ unsigned int param_number; unsigned int pack_length; enum enum_field_types buffer_type; - my_bool error_value; - my_bool is_unsigned; - my_bool long_data_used; - my_bool is_null_value; + bool error_value; + bool is_unsigned; + bool long_data_used; + bool is_null_value; void *extension; } MYSQL_BIND; struct st_mysql_stmt_extension; @@ -674,11 +672,11 @@ enum enum_mysql_stmt_state state; char last_error[512]; char sqlstate[5 +1]; - my_bool send_types_to_server; - my_bool bind_param_done; + bool send_types_to_server; + bool bind_param_done; unsigned char bind_result_done; - my_bool unbuffered_fetch_cancelled; - my_bool update_max_length; + bool unbuffered_fetch_cancelled; + bool update_max_length; struct st_mysql_stmt_extension *extension; } MYSQL_STMT; enum enum_stmt_attr_type @@ -697,21 +695,21 @@ unsigned long offset); int mysql_stmt_store_result(MYSQL_STMT *stmt); unsigned long mysql_stmt_param_count(MYSQL_STMT * stmt); -my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *attr); -my_bool mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *attr); -my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool mysql_stmt_close(MYSQL_STMT * stmt); -my_bool mysql_stmt_reset(MYSQL_STMT * stmt); -my_bool mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, - unsigned int param_number, - const char *data, - unsigned long length); +bool mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *attr); +bool mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *attr); +bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +bool mysql_stmt_close(MYSQL_STMT * stmt); +bool mysql_stmt_reset(MYSQL_STMT * stmt); +bool mysql_stmt_free_result(MYSQL_STMT *stmt); +bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + unsigned int param_number, + const char *data, + unsigned long length); MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt); MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT *stmt); unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); @@ -725,10 +723,10 @@ my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt); my_ulonglong mysql_stmt_insert_id(MYSQL_STMT *stmt); unsigned int mysql_stmt_field_count(MYSQL_STMT *stmt); -my_bool mysql_commit(MYSQL * mysql); -my_bool mysql_rollback(MYSQL * mysql); -my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode); -my_bool mysql_more_results(MYSQL *mysql); +bool mysql_commit(MYSQL * mysql); +bool mysql_rollback(MYSQL * mysql); +bool mysql_autocommit(MYSQL * mysql, bool auto_mode); +bool mysql_more_results(MYSQL *mysql); int mysql_next_result(MYSQL *mysql); int mysql_stmt_next_result(MYSQL_STMT *stmt); void mysql_close(MYSQL *sock); diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index ac556590370d..ad5c4f4f74d5 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -349,7 +349,7 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd, */ #define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \ -DECLARE_MYSQL_SYSVAR_BASIC(name, my_bool) = { \ +DECLARE_MYSQL_SYSVAR_BASIC(name, bool) = { \ PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \ #name, comment, check, update, &varname, def} diff --git a/include/mysql/plugin_keyring.h b/include/mysql/plugin_keyring.h index 2c40507ea19b..b69f8acdf227 100644 --- a/include/mysql/plugin_keyring.h +++ b/include/mysql/plugin_keyring.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,8 +49,8 @@ struct st_mysql_keyring @retval 0 OK @retval 1 ERROR */ - my_bool (*mysql_key_store)(const char *key_id, const char *key_type, - const char* user_id, const void *key, size_t key_len); + bool (*mysql_key_store)(const char *key_id, const char *key_type, + const char* user_id, const void *key, size_t key_len); /*! Fetches key from the keyring. @@ -70,8 +70,8 @@ struct st_mysql_keyring @retval 0 OK @retval 1 ERROR */ - my_bool (*mysql_key_fetch)(const char *key_id, char **key_type, - const char *user_id, void **key, size_t *key_len); + bool (*mysql_key_fetch)(const char *key_id, char **key_type, + const char *user_id, void **key, size_t *key_len); /*! Removes key from the keyring. @@ -86,7 +86,7 @@ struct st_mysql_keyring @retval 0 OK @retval 1 ERROR */ - my_bool (*mysql_key_remove)(const char *key_id, const char *user_id); + bool (*mysql_key_remove)(const char *key_id, const char *user_id); /*! Generates and stores the key. @@ -103,7 +103,7 @@ struct st_mysql_keyring @retval 0 OK @retval 1 ERROR */ - my_bool (*mysql_key_generate)(const char *key_id, const char *key_type, - const char *user_id, size_t key_len); + bool (*mysql_key_generate)(const char *key_id, const char *key_type, + const char *user_id, size_t key_len); }; #endif diff --git a/include/mysql/plugin_keyring.h.pp b/include/mysql/plugin_keyring.h.pp index 96207fa75204..52b0e398b4a6 100644 --- a/include/mysql/plugin_keyring.h.pp +++ b/include/mysql/plugin_keyring.h.pp @@ -114,11 +114,11 @@ struct st_mysql_keyring { int interface_version; - my_bool (*mysql_key_store)(const char *key_id, const char *key_type, - const char* user_id, const void *key, size_t key_len); - my_bool (*mysql_key_fetch)(const char *key_id, char **key_type, - const char *user_id, void **key, size_t *key_len); - my_bool (*mysql_key_remove)(const char *key_id, const char *user_id); - my_bool (*mysql_key_generate)(const char *key_id, const char *key_type, - const char *user_id, size_t key_len); + bool (*mysql_key_store)(const char *key_id, const char *key_type, + const char* user_id, const void *key, size_t key_len); + bool (*mysql_key_fetch)(const char *key_id, char **key_type, + const char *user_id, void **key, size_t *key_len); + bool (*mysql_key_remove)(const char *key_id, const char *user_id); + bool (*mysql_key_generate)(const char *key_id, const char *key_type, + const char *user_id, size_t key_len); }; diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h index 725ae7794a04..c2c8cdccd812 100644 --- a/include/mysql/psi/mysql_transaction.h +++ b/include/mysql/psi/mysql_transaction.h @@ -136,8 +136,8 @@ inline_mysql_start_transaction(PSI_transaction_locker_state *state, const void *xid, const ulonglong *trxid, int isolation_level, - my_bool read_only, - my_bool autocommit, + bool read_only, + bool autocommit, const char *src_file, int src_line) { diff --git a/include/mysql/psi/psi_abi_cond_v0.h.pp b/include/mysql/psi/psi_abi_cond_v0.h.pp index c71e76b8192a..c1be60ac272c 100644 --- a/include/mysql/psi/psi_abi_cond_v0.h.pp +++ b/include/mysql/psi/psi_abi_cond_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_cond_v1.h.pp b/include/mysql/psi/psi_abi_cond_v1.h.pp index bf86a1b10a05..c126ec3e35e3 100644 --- a/include/mysql/psi/psi_abi_cond_v1.h.pp +++ b/include/mysql/psi/psi_abi_cond_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_cond_v2.h.pp b/include/mysql/psi/psi_abi_cond_v2.h.pp index abedebcce1c7..55e11b35a0ca 100644 --- a/include/mysql/psi/psi_abi_cond_v2.h.pp +++ b/include/mysql/psi/psi_abi_cond_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_file_v0.h.pp b/include/mysql/psi/psi_abi_file_v0.h.pp index 76626ec4a712..e47d5ab383fa 100644 --- a/include/mysql/psi/psi_abi_file_v0.h.pp +++ b/include/mysql/psi/psi_abi_file_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_file_v1.h.pp b/include/mysql/psi/psi_abi_file_v1.h.pp index 8f3c84216c4e..5e897ef20b2d 100644 --- a/include/mysql/psi/psi_abi_file_v1.h.pp +++ b/include/mysql/psi/psi_abi_file_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_file_v2.h.pp b/include/mysql/psi/psi_abi_file_v2.h.pp index 7b015227dd47..7b606f07ed58 100644 --- a/include/mysql/psi/psi_abi_file_v2.h.pp +++ b/include/mysql/psi/psi_abi_file_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_idle_v0.h.pp b/include/mysql/psi/psi_abi_idle_v0.h.pp index 4d7a28ef14f4..815784f78064 100644 --- a/include/mysql/psi/psi_abi_idle_v0.h.pp +++ b/include/mysql/psi/psi_abi_idle_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_idle_v1.h.pp b/include/mysql/psi/psi_abi_idle_v1.h.pp index c37bb8fb3e70..d47e17f057b3 100644 --- a/include/mysql/psi/psi_abi_idle_v1.h.pp +++ b/include/mysql/psi/psi_abi_idle_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_idle_v2.h.pp b/include/mysql/psi/psi_abi_idle_v2.h.pp index 08441e3fdced..e26ca4326c7e 100644 --- a/include/mysql/psi/psi_abi_idle_v2.h.pp +++ b/include/mysql/psi/psi_abi_idle_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_mdl_v0.h.pp b/include/mysql/psi/psi_abi_mdl_v0.h.pp index 4340c41c0ac6..45a85be6d3d7 100644 --- a/include/mysql/psi/psi_abi_mdl_v0.h.pp +++ b/include/mysql/psi/psi_abi_mdl_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_mdl_v1.h.pp b/include/mysql/psi/psi_abi_mdl_v1.h.pp index f875413e4e36..2423e1d306c3 100644 --- a/include/mysql/psi/psi_abi_mdl_v1.h.pp +++ b/include/mysql/psi/psi_abi_mdl_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_mdl_v2.h.pp b/include/mysql/psi/psi_abi_mdl_v2.h.pp index a2abc73e8407..3d2312573f9c 100644 --- a/include/mysql/psi/psi_abi_mdl_v2.h.pp +++ b/include/mysql/psi/psi_abi_mdl_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_memory_v2.h.pp b/include/mysql/psi/psi_abi_memory_v2.h.pp index eddf7a1ece97..9cc062917157 100644 --- a/include/mysql/psi/psi_abi_memory_v2.h.pp +++ b/include/mysql/psi/psi_abi_memory_v2.h.pp @@ -5,7 +5,7 @@ struct PSI_thread; struct PSI_memory_bootstrap { - void* (*get_interface)(int version); + void *(*get_interface)(int version); }; typedef struct PSI_memory_bootstrap PSI_memory_bootstrap; typedef struct PSI_placeholder PSI_memory_service_t; diff --git a/include/mysql/psi/psi_abi_mutex_v0.h.pp b/include/mysql/psi/psi_abi_mutex_v0.h.pp index 8d4b9dacfa7a..eb7845fed8b4 100644 --- a/include/mysql/psi/psi_abi_mutex_v0.h.pp +++ b/include/mysql/psi/psi_abi_mutex_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_mutex_v1.h.pp b/include/mysql/psi/psi_abi_mutex_v1.h.pp index 6dad91d79fad..657e96eefa1f 100644 --- a/include/mysql/psi/psi_abi_mutex_v1.h.pp +++ b/include/mysql/psi/psi_abi_mutex_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_mutex_v2.h.pp b/include/mysql/psi/psi_abi_mutex_v2.h.pp index 203b11d29a55..cff6af0f5e25 100644 --- a/include/mysql/psi/psi_abi_mutex_v2.h.pp +++ b/include/mysql/psi/psi_abi_mutex_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_rwlock_v0.h.pp b/include/mysql/psi/psi_abi_rwlock_v0.h.pp index 6994c5337dcd..48a82eb98a38 100644 --- a/include/mysql/psi/psi_abi_rwlock_v0.h.pp +++ b/include/mysql/psi/psi_abi_rwlock_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_rwlock_v1.h.pp b/include/mysql/psi/psi_abi_rwlock_v1.h.pp index 276e86bc5b09..5670bf14f92e 100644 --- a/include/mysql/psi/psi_abi_rwlock_v1.h.pp +++ b/include/mysql/psi/psi_abi_rwlock_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_rwlock_v2.h.pp b/include/mysql/psi/psi_abi_rwlock_v2.h.pp index 513882f9a2b4..e6090e888972 100644 --- a/include/mysql/psi/psi_abi_rwlock_v2.h.pp +++ b/include/mysql/psi/psi_abi_rwlock_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_socket_v0.h.pp b/include/mysql/psi/psi_abi_socket_v0.h.pp index a4e7448af2ee..fefbf354e47c 100644 --- a/include/mysql/psi/psi_abi_socket_v0.h.pp +++ b/include/mysql/psi/psi_abi_socket_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_socket_v1.h.pp b/include/mysql/psi/psi_abi_socket_v1.h.pp index a3873705b923..12e4a2368d0a 100644 --- a/include/mysql/psi/psi_abi_socket_v1.h.pp +++ b/include/mysql/psi/psi_abi_socket_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_socket_v2.h.pp b/include/mysql/psi/psi_abi_socket_v2.h.pp index d97c2218dfe3..9e3801bfafdd 100644 --- a/include/mysql/psi/psi_abi_socket_v2.h.pp +++ b/include/mysql/psi/psi_abi_socket_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_io.h" #include "my_config.h" diff --git a/include/mysql/psi/psi_abi_stage_v0.h.pp b/include/mysql/psi/psi_abi_stage_v0.h.pp index f1d37eba37a3..20c62e8e09ca 100644 --- a/include/mysql/psi/psi_abi_stage_v0.h.pp +++ b/include/mysql/psi/psi_abi_stage_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_stage_v1.h.pp b/include/mysql/psi/psi_abi_stage_v1.h.pp index f4c27c191048..cdb8e30941f8 100644 --- a/include/mysql/psi/psi_abi_stage_v1.h.pp +++ b/include/mysql/psi/psi_abi_stage_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_stage_v2.h.pp b/include/mysql/psi/psi_abi_stage_v2.h.pp index 3e5a1c86c2e5..96e660703c0e 100644 --- a/include/mysql/psi/psi_abi_stage_v2.h.pp +++ b/include/mysql/psi/psi_abi_stage_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_statement_v0.h.pp b/include/mysql/psi/psi_abi_statement_v0.h.pp index f1e45f7424a9..d53ce88ae0fc 100644 --- a/include/mysql/psi/psi_abi_statement_v0.h.pp +++ b/include/mysql/psi/psi_abi_statement_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_statement_v1.h.pp b/include/mysql/psi/psi_abi_statement_v1.h.pp index 33daff62de35..ab7c99a9e881 100644 --- a/include/mysql/psi/psi_abi_statement_v1.h.pp +++ b/include/mysql/psi/psi_abi_statement_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" @@ -59,8 +58,8 @@ typedef struct PSI_statement_info_v1 PSI_statement_info_v1; struct PSI_statement_locker_state_v1 { - my_bool m_discarded; - my_bool m_in_prepare; + bool m_discarded; + bool m_in_prepare; uchar m_no_index_used; uchar m_no_good_index_used; uint m_flags; diff --git a/include/mysql/psi/psi_abi_statement_v2.h.pp b/include/mysql/psi/psi_abi_statement_v2.h.pp index 20aab243ca82..0fe1498b7751 100644 --- a/include/mysql/psi/psi_abi_statement_v2.h.pp +++ b/include/mysql/psi/psi_abi_statement_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_table_v0.h.pp b/include/mysql/psi/psi_abi_table_v0.h.pp index ea1505e92a26..2028475d7c56 100644 --- a/include/mysql/psi/psi_abi_table_v0.h.pp +++ b/include/mysql/psi/psi_abi_table_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_table_v1.h.pp b/include/mysql/psi/psi_abi_table_v1.h.pp index b4364eb31eb1..1a1d84b578ea 100644 --- a/include/mysql/psi/psi_abi_table_v1.h.pp +++ b/include/mysql/psi/psi_abi_table_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" @@ -75,9 +74,9 @@ }; typedef enum PSI_table_lock_operation PSI_table_lock_operation; typedef struct PSI_table_share *(*get_table_share_v1_t)( - my_bool temporary, struct TABLE_SHARE *share); + bool temporary, struct TABLE_SHARE *share); typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); -typedef void (*drop_table_share_v1_t)(my_bool temporary, +typedef void (*drop_table_share_v1_t)(bool temporary, const char *schema_name, int schema_name_length, const char *table_name, diff --git a/include/mysql/psi/psi_abi_table_v2.h.pp b/include/mysql/psi/psi_abi_table_v2.h.pp index 7a5283c31966..10cbc0d5b709 100644 --- a/include/mysql/psi/psi_abi_table_v2.h.pp +++ b/include/mysql/psi/psi_abi_table_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_thread_v0.h.pp b/include/mysql/psi/psi_abi_thread_v0.h.pp index 73b1cdde58f9..2f658f9238e0 100644 --- a/include/mysql/psi/psi_abi_thread_v0.h.pp +++ b/include/mysql/psi/psi_abi_thread_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_thread_v1.h.pp b/include/mysql/psi/psi_abi_thread_v1.h.pp index 6d2b5f84765f..5f53bd249523 100644 --- a/include/mysql/psi/psi_abi_thread_v1.h.pp +++ b/include/mysql/psi/psi_abi_thread_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_thread_v2.h.pp b/include/mysql/psi/psi_abi_thread_v2.h.pp index 19a4e0e4c134..71876665f3da 100644 --- a/include/mysql/psi/psi_abi_thread_v2.h.pp +++ b/include/mysql/psi/psi_abi_thread_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_transaction_v0.h.pp b/include/mysql/psi/psi_abi_transaction_v0.h.pp index 5d937305cb69..a06471be04c8 100644 --- a/include/mysql/psi/psi_abi_transaction_v0.h.pp +++ b/include/mysql/psi/psi_abi_transaction_v0.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_abi_transaction_v1.h.pp b/include/mysql/psi/psi_abi_transaction_v1.h.pp index e9b0c1cfc5f8..f9b901bf952c 100644 --- a/include/mysql/psi/psi_abi_transaction_v1.h.pp +++ b/include/mysql/psi/psi_abi_transaction_v1.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" @@ -50,8 +49,8 @@ ulonglong m_timer_start; ulonglong (*m_timer)(void); void *m_transaction; - my_bool m_read_only; - my_bool m_autocommit; + bool m_read_only; + bool m_autocommit; ulong m_statement_count; ulong m_savepoint_count; ulong m_rollback_to_savepoint_count; @@ -63,8 +62,8 @@ const void *xid, const ulonglong *trxid, int isolation_level, - my_bool read_only, - my_bool autocommit); + bool read_only, + bool autocommit); typedef void (*start_transaction_v1_t)(struct PSI_transaction_locker *locker, const char *src_file, uint src_line); @@ -85,7 +84,7 @@ typedef void (*inc_transaction_release_savepoint_v1_t)( struct PSI_transaction_locker *locker, ulong count); typedef void (*end_transaction_v1_t)(struct PSI_transaction_locker *locker, - my_bool commit); + bool commit); struct PSI_transaction_service_v1 { get_thread_transaction_locker_v1_t get_thread_transaction_locker; diff --git a/include/mysql/psi/psi_abi_transaction_v2.h.pp b/include/mysql/psi/psi_abi_transaction_v2.h.pp index 5b139d9f37fb..100cbdea8fe1 100644 --- a/include/mysql/psi/psi_abi_transaction_v2.h.pp +++ b/include/mysql/psi/psi_abi_transaction_v2.h.pp @@ -16,7 +16,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; #include "my_macros.h" #include "my_psi_config.h" diff --git a/include/mysql/psi/psi_statement.h b/include/mysql/psi/psi_statement.h index c0f949942b9f..36749453b3be 100644 --- a/include/mysql/psi/psi_statement.h +++ b/include/mysql/psi/psi_statement.h @@ -154,9 +154,9 @@ typedef struct PSI_statement_info_v1 PSI_statement_info_v1; struct PSI_statement_locker_state_v1 { /** Discarded flag. */ - my_bool m_discarded; + bool m_discarded; /** In prepare flag. */ - my_bool m_in_prepare; + bool m_in_prepare; /** Metric, no index used flag. */ uchar m_no_index_used; /** Metric, no good index used flag. */ diff --git a/include/mysql/psi/psi_table.h b/include/mysql/psi/psi_table.h index 41070bd79a24..d54a76cb6500 100644 --- a/include/mysql/psi/psi_table.h +++ b/include/mysql/psi/psi_table.h @@ -187,7 +187,7 @@ typedef enum PSI_table_lock_operation PSI_table_lock_operation; @return a table share instrumentation, or NULL */ typedef struct PSI_table_share *(*get_table_share_v1_t)( - my_bool temporary, struct TABLE_SHARE *share); + bool temporary, struct TABLE_SHARE *share); /** Release a table share. @@ -203,7 +203,7 @@ typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); @param table_name the table name @param table_name_length the table name length */ -typedef void (*drop_table_share_v1_t)(my_bool temporary, +typedef void (*drop_table_share_v1_t)(bool temporary, const char *schema_name, int schema_name_length, const char *table_name, diff --git a/include/mysql/psi/psi_transaction.h b/include/mysql/psi/psi_transaction.h index 0a44ea2a57d5..0bc7749ae6f7 100644 --- a/include/mysql/psi/psi_transaction.h +++ b/include/mysql/psi/psi_transaction.h @@ -119,9 +119,9 @@ struct PSI_transaction_locker_state_v1 /** Internal data. */ void *m_transaction; /** True if read-only transaction, false if read-write. */ - my_bool m_read_only; + bool m_read_only; /** True if transaction is autocommit. */ - my_bool m_autocommit; + bool m_autocommit; /** Number of statements. */ ulong m_statement_count; /** Total number of savepoints. */ @@ -148,8 +148,8 @@ typedef struct PSI_transaction_locker *(*get_thread_transaction_locker_v1_t)( const void *xid, const ulonglong *trxid, int isolation_level, - my_bool read_only, - my_bool autocommit); + bool read_only, + bool autocommit); /** Start a new transaction event. @@ -227,7 +227,7 @@ typedef void (*inc_transaction_release_savepoint_v1_t)( @param commit true if transaction was committed, false if rolled back */ typedef void (*end_transaction_v1_t)(struct PSI_transaction_locker *locker, - my_bool commit); + bool commit); /** Performance Schema Transaction Interface, version 1. diff --git a/include/mysql/service_rpl_transaction_ctx.h b/include/mysql/service_rpl_transaction_ctx.h index e25b22f4c26a..7cc5f186c60a 100644 --- a/include/mysql/service_rpl_transaction_ctx.h +++ b/include/mysql/service_rpl_transaction_ctx.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,16 +43,14 @@ struct st_transaction_termination_ctx /* If the instruction is to rollback the transaction, then this flag is set to false. - Note: type is char like on my_bool. */ - char m_rollback_transaction; + bool m_rollback_transaction; /* If the plugin has generated a GTID, then the follwoing fields MUST be set. - Note: type is char like on my_bool. */ - char m_generated_gtid; + bool m_generated_gtid; int m_sidno; long long int m_gno; }; diff --git a/include/mysql/services.h.pp b/include/mysql/services.h.pp index 8405202e8412..d209412ae536 100644 --- a/include/mysql/services.h.pp +++ b/include/mysql/services.h.pp @@ -148,7 +148,6 @@ typedef intptr_t intptr; typedef ulonglong my_off_t; typedef ptrdiff_t my_ptrdiff_t; -typedef char my_bool; typedef int myf; enum enum_mysql_timestamp_type { @@ -159,7 +158,7 @@ { unsigned int year, month, day, hour, minute, second; unsigned long second_part; - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; #include "decimal.h" @@ -171,7 +170,7 @@ typedef int32 decimal_digit_t; typedef struct st_decimal_t { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t *buf; } decimal_t; struct st_send_field @@ -528,8 +527,8 @@ { unsigned long m_thread_id; unsigned int m_flags; - char m_rollback_transaction; - char m_generated_gtid; + bool m_rollback_transaction; + bool m_generated_gtid; int m_sidno; long long int m_gno; }; diff --git a/include/mysql_com.h b/include/mysql_com.h index a49b8ef22945..36f337af080f 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -21,6 +21,10 @@ #ifndef _mysql_com_h #define _mysql_com_h +#ifndef MYSQL_ABI_CHECK +#include +#endif + #include "my_command.h" #include "my_inttypes.h" #include "my_io.h" @@ -788,7 +792,7 @@ typedef struct st_net { unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool compress; + bool compress; /** Pointer to query object in query cache, do not equal NULL (0) for queries in cache that have not stored its results yet @@ -942,18 +946,18 @@ enum enum_session_state_type extern "C" { #endif -my_bool my_net_init(NET *net, MYSQL_VIO vio); +bool my_net_init(NET *net, MYSQL_VIO vio); void my_net_local_init(NET *net); void net_end(NET *net); -void net_clear(NET *net, my_bool check_buffer); +void net_clear(NET *net, bool check_buffer); void net_claim_memory_ownership(NET *net); -my_bool net_realloc(NET *net, size_t length); -my_bool net_flush(NET *net); -my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); -my_bool net_write_command(NET *net,unsigned char command, +bool net_realloc(NET *net, size_t length); +bool net_flush(NET *net); +bool my_net_write(NET *net,const unsigned char *packet, size_t len); +bool net_write_command(NET *net,unsigned char command, const unsigned char *header, size_t head_len, const unsigned char *packet, size_t len); -my_bool net_write_packet(NET *net, const unsigned char *packet, size_t length); +bool net_write_packet(NET *net, const unsigned char *packet, size_t length); unsigned long my_net_read(NET *net); void my_net_set_write_timeout(NET *net, uint timeout); @@ -995,11 +999,11 @@ typedef struct st_udf_args */ typedef struct st_udf_init { - my_bool maybe_null; /** 1 if function can return NULL */ + bool maybe_null; /** 1 if function can return NULL */ unsigned int decimals; /** for real functions */ unsigned long max_length; /** For string functions */ char *ptr; /** free pointer for function data */ - my_bool const_item; /** 1 if function always returns the same value */ + bool const_item; /** 1 if function always returns the same value */ void *extension; } UDF_INIT; @@ -1031,15 +1035,15 @@ void create_random_string(char *to, unsigned int length, struct rand_struct *ran void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const unsigned char *reply, const char *message, - unsigned long *salt); +bool check_scramble_323(const unsigned char *reply, const char *message, + unsigned long *salt); void get_salt_from_password_323(unsigned long *res, const char *password); void make_password_from_salt_323(char *to, const unsigned long *salt); void make_scrambled_password(char *to, const char *password); void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const unsigned char *reply, const char *message, - const unsigned char *hash_stage2); +bool check_scramble(const unsigned char *reply, const char *message, + const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); char *octet2hex(char *to, const char *str, unsigned int len); @@ -1051,7 +1055,7 @@ const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); /* Some other useful functions */ -my_bool my_thread_init(void); +bool my_thread_init(void); void my_thread_end(void); #ifdef STDCALL diff --git a/include/mysql_com_server.h b/include/mysql_com_server.h index 15ce35ba6e5d..8f96b449d111 100644 --- a/include/mysql_com_server.h +++ b/include/mysql_com_server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ typedef void (*before_header_callback_fn) (struct st_net *net, void *user_data, size_t count); typedef void (*after_header_callback_fn) - (struct st_net *net, void *user_data, size_t count, my_bool rc); + (struct st_net *net, void *user_data, size_t count, bool rc); struct st_net_server { diff --git a/include/mysql_time.h b/include/mysql_time.h index b053eda87815..b56ec560d397 100644 --- a/include/mysql_time.h +++ b/include/mysql_time.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ typedef struct st_mysql_time { unsigned int year, month, day, hour, minute, second; unsigned long second_part; /**< microseconds */ - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; diff --git a/include/pfs_table_provider.h b/include/pfs_table_provider.h index 290e2c0d8c1c..2db09d861f0c 100644 --- a/include/pfs_table_provider.h +++ b/include/pfs_table_provider.h @@ -38,12 +38,12 @@ C_MODE_START PSI_table_share* -pfs_get_table_share_v1(my_bool temporary, struct TABLE_SHARE *share); +pfs_get_table_share_v1(bool temporary, struct TABLE_SHARE *share); void pfs_release_table_share_v1(PSI_table_share* share); void -pfs_drop_table_share_v1(my_bool temporary, +pfs_drop_table_share_v1(bool temporary, const char *schema_name, int schema_name_length, const char *table_name, int table_name_length); diff --git a/include/pfs_transaction_provider.h b/include/pfs_transaction_provider.h index 2c44c11e562b..5d2f108b3189 100644 --- a/include/pfs_transaction_provider.h +++ b/include/pfs_transaction_provider.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,8 +44,8 @@ pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, const void *xid, const ulonglong *trxid, int isolation_level, - my_bool read_only, - my_bool autocommit); + bool read_only, + bool autocommit); void pfs_start_transaction_v1(PSI_transaction_locker *locker, const char *src_file, uint src_line); @@ -73,7 +73,7 @@ void pfs_inc_transaction_rollback_to_savepoint_v1(PSI_transaction_locker *locker void pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker, ulong count); -void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit); +void pfs_end_transaction_v1(PSI_transaction_locker *locker, bool commit); C_MODE_END diff --git a/include/sql_chars.h b/include/sql_chars.h index 1a7bac5ec621..5fae01832c19 100644 --- a/include/sql_chars.h +++ b/include/sql_chars.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,7 +70,7 @@ C_MODE_START typedef struct lex_state_maps_st lex_state_maps_st; typedef struct charset_info_st charset_info_st; -my_bool init_state_maps(struct charset_info_st *cs); +bool init_state_maps(struct charset_info_st *cs); C_MODE_END #endif /* SQL_LEX_CHARS_INCLUDED */ diff --git a/include/sql_common.h b/include/sql_common.h index bdcdf056e9e0..0fd4de891a39 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -1,7 +1,7 @@ #ifndef SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -114,8 +114,8 @@ struct st_mysql_options_extention { struct My_hash *connection_attributes; char *server_public_key_path; size_t connection_attributes_length; - my_bool enable_cleartext_plugin; - my_bool unused0; /* Former ssl_enforce */ + bool enable_cleartext_plugin; + bool unused0; /* Former ssl_enforce */ char *tls_version; /* TLS version option */ long ssl_ctx_flags; /* SSL ctx options flag */ unsigned int ssl_mode; @@ -124,31 +124,31 @@ struct st_mysql_options_extention { typedef struct st_mysql_methods { - my_bool (*read_query_result)(MYSQL *mysql); - my_bool (*advanced_command)(MYSQL *mysql, - enum enum_server_command command, - const unsigned char *header, - size_t header_length, - const unsigned char *arg, - size_t arg_length, - my_bool skip_check, - MYSQL_STMT *stmt); + bool (*read_query_result)(MYSQL *mysql); + bool (*advanced_command)(MYSQL *mysql, + enum enum_server_command command, + const unsigned char *header, + size_t header_length, + const unsigned char *arg, + size_t arg_length, + bool skip_check, + MYSQL_STMT *stmt); MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, unsigned int fields); MYSQL_RES * (*use_result)(MYSQL *mysql); void (*fetch_lengths)(unsigned long *to, MYSQL_ROW column, unsigned int field_count); - void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results); + void (*flush_use_result)(MYSQL *mysql, bool flush_all_results); int (*read_change_user_result)(MYSQL *mysql); #if !defined(MYSQL_SERVER) MYSQL_FIELD * (*list_fields)(MYSQL *mysql); - my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); + bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); int (*stmt_execute)(MYSQL_STMT *stmt); int (*read_binary_rows)(MYSQL_STMT *stmt); int (*unbuffered_fetch)(MYSQL *mysql, char **row); void (*free_embedded_thd)(MYSQL *mysql); const char *(*read_statistics)(MYSQL *mysql); - my_bool (*next_result)(MYSQL *mysql); + bool (*next_result)(MYSQL *mysql); int (*read_rows_from_cursor)(MYSQL_STMT *stmt); void (*free_rows)(MYSQL_DATA *cur); #endif @@ -167,7 +167,7 @@ typedef struct st_mysql_methods extern struct charset_info_st *default_client_charset_info; MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_ROWS *data,MEM_ROOT *alloc, - uint fields, my_bool default_value, + uint fields, bool default_value, uint server_capabilities); MYSQL_FIELD * cli_read_metadata_ex(MYSQL *mysql, MEM_ROOT *alloc, unsigned long field_count, @@ -177,17 +177,17 @@ MYSQL_FIELD * cli_read_metadata(MYSQL *mysql, unsigned long field_count, void free_rows(MYSQL_DATA *cur); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); -my_bool mysql_reconnect(MYSQL *mysql); +bool mysql_reconnect(MYSQL *mysql); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); -my_bool +bool cli_advanced_command(MYSQL *mysql, enum enum_server_command command, const unsigned char *header, size_t header_length, const unsigned char *arg, size_t arg_length, - my_bool skip_check, MYSQL_STMT *stmt); -unsigned long cli_safe_read(MYSQL *mysql, my_bool *is_data_packet); -unsigned long cli_safe_read_with_ok(MYSQL *mysql, my_bool parse_ok, - my_bool *is_data_packet); + bool skip_check, MYSQL_STMT *stmt); +unsigned long cli_safe_read(MYSQL *mysql, bool *is_data_packet); +unsigned long cli_safe_read_with_ok(MYSQL *mysql, bool parse_ok, + bool *is_data_packet); void net_clear_error(NET *net); void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net); void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate, @@ -209,7 +209,7 @@ struct st_mysql_client_plugin; extern struct st_mysql_client_plugin *mysql_client_builtins[]; uchar * send_client_connect_attrs(MYSQL *mysql, uchar *buf); -extern my_bool libmysql_cleartext_plugin_enabled; +extern bool libmysql_cleartext_plugin_enabled; void read_ok_ex(MYSQL *mysql, unsigned long len); #ifdef __cplusplus diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h index d79c751a7a81..f0b0af9ed417 100644 --- a/include/sslopt-vars.h +++ b/include/sslopt-vars.h @@ -58,7 +58,7 @@ static char *opt_ssl_key = 0; static char *opt_ssl_crl = 0; static char *opt_ssl_crlpath = 0; static char *opt_tls_version = 0; -static my_bool ssl_mode_set_explicitly= FALSE; +static bool ssl_mode_set_explicitly= FALSE; static void set_client_ssl_options(MYSQL *mysql) { diff --git a/include/str_uca_type.h b/include/str_uca_type.h index 9ae2ee831698..67ea7736ec28 100644 --- a/include/str_uca_type.h +++ b/include/str_uca_type.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -71,7 +71,7 @@ enum enum_case_first struct Coll_param { struct Reorder_param *reorder_param; - my_bool norm_enabled; // false = normalization off, default; + bool norm_enabled; // false = normalization off, default; // true = on enum enum_case_first case_first; }; diff --git a/include/thr_lock.h b/include/thr_lock.h index d84c5192ef0b..46e3aeae4f18 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -144,7 +144,7 @@ typedef struct st_thr_lock { void (*copy_status)(void*,void*); void (*update_status)(void*); /* Before release of write */ void (*restore_status)(void*); /* Before release of read */ - my_bool (*check_status)(void *); + bool (*check_status)(void *); } THR_LOCK; diff --git a/include/thr_mutex.h b/include/thr_mutex.h index 6c708fa67d88..31550e9743be 100644 --- a/include/thr_mutex.h +++ b/include/thr_mutex.h @@ -1,7 +1,7 @@ #ifndef THR_MUTEX_INCLUDED #define THR_MUTEX_INCLUDED -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -143,7 +143,7 @@ typedef struct st_safe_mutex_t void safe_mutex_global_init(); int safe_mutex_init(my_mutex_t *mp, const native_mutexattr_t *attr, const char *file, uint line); -int safe_mutex_lock(my_mutex_t *mp, my_bool try_lock, const char *file, uint line); +int safe_mutex_lock(my_mutex_t *mp, bool try_lock, const char *file, uint line); int safe_mutex_unlock(my_mutex_t *mp, const char *file, uint line); int safe_mutex_destroy(my_mutex_t *mp, const char *file, uint line); diff --git a/include/thr_rwlock.h b/include/thr_rwlock.h index b9a2d8612b6f..69a9a0544508 100644 --- a/include/thr_rwlock.h +++ b/include/thr_rwlock.h @@ -1,7 +1,7 @@ #ifndef THR_RWLOCK_INCLUDED #define THR_RWLOCK_INCLUDED -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -188,7 +188,7 @@ typedef struct st_rw_pr_lock_t { /** Number of writers waiting for readers to go away. */ uint writers_waiting_readers; /** Indicates whether there is an active writer. */ - my_bool active_writer; + bool active_writer; #ifdef SAFE_MUTEX /** Thread holding wr-lock (for debug purposes only). */ my_thread_t writer_thread; diff --git a/include/violite.h b/include/violite.h index a58dd98068cc..7d987f543cac 100644 --- a/include/violite.h +++ b/include/violite.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -150,19 +150,19 @@ MYSQL_VIO vio_new_win32shared_memory(HANDLE handle_file_map, void vio_delete(MYSQL_VIO vio); int vio_shutdown(MYSQL_VIO vio); -my_bool vio_reset(MYSQL_VIO vio, enum enum_vio_type type, - my_socket sd, void *ssl, uint flags); +bool vio_reset(MYSQL_VIO vio, enum enum_vio_type type, + my_socket sd, void *ssl, uint flags); size_t vio_read(MYSQL_VIO vio, uchar * buf, size_t size); size_t vio_read_buff(MYSQL_VIO vio, uchar * buf, size_t size); size_t vio_write(MYSQL_VIO vio, const uchar * buf, size_t size); /* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */ int vio_fastsend(MYSQL_VIO vio); /* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */ -int vio_keepalive(MYSQL_VIO vio, my_bool onoff); +int vio_keepalive(MYSQL_VIO vio, bool onoff); /* Whenever we should retry the last read/write operation. */ -my_bool vio_should_retry(MYSQL_VIO vio); +bool vio_should_retry(MYSQL_VIO vio); /* Check that operation was timed out */ -my_bool vio_was_timeout(MYSQL_VIO vio); +bool vio_was_timeout(MYSQL_VIO vio); /* Short text description of the socket for those, who are curious.. */ #define VIO_DESCRIPTION_SIZE 30 /* size of description */ void vio_description(MYSQL_VIO vio, char *buf); @@ -173,23 +173,23 @@ int vio_errno(MYSQL_VIO vio); /* Get socket number */ my_socket vio_fd(MYSQL_VIO vio); /* Remote peer's address and name in text form */ -my_bool vio_peer_addr(MYSQL_VIO vio, char *buf, uint16 *port, size_t buflen); +bool vio_peer_addr(MYSQL_VIO vio, char *buf, uint16 *port, size_t buflen); /* Wait for an I/O event notification. */ int vio_io_wait(MYSQL_VIO vio, enum enum_vio_io_event event, int timeout); -my_bool vio_is_connected(MYSQL_VIO vio); +bool vio_is_connected(MYSQL_VIO vio); #ifndef DBUG_OFF ssize_t vio_pending(MYSQL_VIO vio); #endif /* Set timeout for a network operation. */ int vio_timeout(MYSQL_VIO vio, uint which, int timeout_sec); /* Connect to a peer. */ -my_bool vio_socket_connect(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len, - int timeout); +bool vio_socket_connect(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len, + int timeout); -my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, size_t addr_length, - char *ip_string, size_t ip_string_size); +bool vio_get_normalized_ip_string(const struct sockaddr *addr, size_t addr_length, + char *ip_string, size_t ip_string_size); -my_bool vio_is_no_name_error(int err_code); +bool vio_is_no_name_error(int err_code); int vio_getnameinfo(const struct sockaddr *sa, char *hostname, size_t hostname_size, @@ -342,23 +342,23 @@ struct st_vio int (*vioerrno)(MYSQL_VIO)= { nullptr }; size_t (*read)(MYSQL_VIO, uchar *, size_t)= { nullptr }; size_t (*write)(MYSQL_VIO, const uchar *, size_t)= { nullptr }; - int (*timeout)(MYSQL_VIO, uint, my_bool)= { nullptr }; - int (*viokeepalive)(MYSQL_VIO, my_bool)= { nullptr }; + int (*timeout)(MYSQL_VIO, uint, bool)= { nullptr }; + int (*viokeepalive)(MYSQL_VIO, bool)= { nullptr }; int (*fastsend)(MYSQL_VIO)= { nullptr }; - my_bool (*peer_addr)(MYSQL_VIO, char *, uint16*, size_t)= { nullptr }; + bool (*peer_addr)(MYSQL_VIO, char *, uint16*, size_t)= { nullptr }; void (*in_addr)(MYSQL_VIO, struct sockaddr_storage*)= { nullptr }; - my_bool (*should_retry)(MYSQL_VIO)= { nullptr }; - my_bool (*was_timeout)(MYSQL_VIO)= { nullptr }; + bool (*should_retry)(MYSQL_VIO)= { nullptr }; + bool (*was_timeout)(MYSQL_VIO)= { nullptr }; /* vioshutdown is resposnible to shutdown/close the channel, so that no further communications can take place, however any related buffers, descriptors, handles can remain valid after a shutdown. */ int (*vioshutdown)(MYSQL_VIO)= { nullptr }; - my_bool (*is_connected)(MYSQL_VIO)= { nullptr }; - my_bool (*has_data) (MYSQL_VIO)= { nullptr }; + bool (*is_connected)(MYSQL_VIO)= { nullptr }; + bool (*has_data) (MYSQL_VIO)= { nullptr }; int (*io_wait)(MYSQL_VIO, enum enum_vio_io_event, int)= { nullptr }; - my_bool (*connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int)= { nullptr }; + bool (*connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int)= { nullptr }; #ifdef _WIN32 OVERLAPPED overlapped = { 0 }; HANDLE hPipe { nullptr }; @@ -381,8 +381,8 @@ struct st_vio private: friend st_vio *internal_vio_create(uint flags); friend void internal_vio_delete(st_vio *vio); - friend my_bool vio_reset(Vio* vio, enum_vio_type type, - my_socket sd, void *ssl, uint flags); + friend bool vio_reset(Vio* vio, enum_vio_type type, + my_socket sd, void *ssl, uint flags); explicit st_vio(uint flags); ~st_vio(); diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index ca39a911b62e..dca1912af974 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -45,7 +45,7 @@ extern char * mysql_unix_port; C_MODE_START void read_user_name(char *name); -my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); +bool handle_local_infile(MYSQL *mysql, const char *net_filename); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); @@ -58,7 +58,7 @@ cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, void cli_mysql_close(MYSQL *mysql); MYSQL_FIELD * cli_list_fields(MYSQL *mysql); -my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt); +bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt); MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, uint fields); int cli_stmt_execute(MYSQL_STMT *stmt); diff --git a/libmysql/get_password.cc b/libmysql/get_password.cc index 057e2bc4e78a..38a0f1f6614d 100644 --- a/libmysql/get_password.cc +++ b/libmysql/get_password.cc @@ -110,7 +110,7 @@ char *get_tty_password(const char *opt_message) to will not include the eol characters. */ -static void get_password(char *to,uint length,int fd, my_bool echo) +static void get_password(char *to,uint length,int fd, bool echo) { char *pos=to,*end=to+length; diff --git a/libmysql/libmysql.cc b/libmysql/libmysql.cc index 6143649e4b43..bf266a5845de 100644 --- a/libmysql/libmysql.cc +++ b/libmysql/libmysql.cc @@ -83,8 +83,8 @@ #define COM_SHUTDOWN_DEPRECATED 8 static void append_wild(char *to,char *end,const char *wild); -static my_bool mysql_client_init= 0; -static my_bool org_my_init_done= 0; +static bool mysql_client_init= 0; +static bool org_my_init_done= 0; typedef struct st_mysql_stmt_extension { @@ -211,7 +211,7 @@ void STDCALL mysql_server_end() mysql_client_init= org_my_init_done= 0; } -my_bool STDCALL mysql_thread_init() +bool STDCALL mysql_thread_init() { return my_thread_init(); } @@ -285,7 +285,7 @@ mysql_debug(const char *debug MY_ATTRIBUTE((unused))) Change user and database **************************************************************************/ -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, +bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db) { int rc; @@ -396,9 +396,9 @@ void read_user_name(char *name) #endif -my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) +bool handle_local_infile(MYSQL *mysql, const char *net_filename) { - my_bool result= 1; + bool result= 1; uint packet_length=MY_ALIGN(mysql->net.max_packet-16,IO_SIZE); NET *net= &mysql->net; int readcount; @@ -980,7 +980,7 @@ ulong STDCALL mysql_get_client_version(void) return MYSQL_VERSION_ID; } -my_bool STDCALL mysql_eof(MYSQL_RES *res) +bool STDCALL mysql_eof(MYSQL_RES *res) { return res->eof; } @@ -1239,7 +1239,7 @@ void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name) { char *to; - my_bool use_mb_flag=use_mb(mysql->charset); + bool use_mb_flag=use_mb(mysql->charset); char *end= NULL; if (use_mb_flag) for (end=name; *end ; end++) ; @@ -1298,7 +1298,7 @@ static int stmt_read_row_no_result_set(MYSQL_STMT *stmt, unsigned char **row); STMT_ATTR_UPDATE_MAX_LENGTH attribute is set. */ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); -static my_bool setup_one_fetch_function(MYSQL_BIND *, MYSQL_FIELD *field); +static bool setup_one_fetch_function(MYSQL_BIND *, MYSQL_FIELD *field); /* Auxilary function used to reset statement handle. */ @@ -1307,7 +1307,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *, MYSQL_FIELD *field); #define RESET_STORE_RESULT 4 #define RESET_CLEAR_ERROR 8 -static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags); +static bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags); /* Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME @@ -1362,10 +1362,10 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags); than max_allowed_packet. The error code is stored in net->last_errno. */ -static my_bool my_realloc_str(NET *net, ulong length) +static bool my_realloc_str(NET *net, ulong length) { ulong buf_length= (ulong) (net->write_pos - net->buff); - my_bool res=0; + bool res=0; DBUG_ENTER("my_realloc_str"); if (buf_length + length > net->max_packet) { @@ -1457,7 +1457,7 @@ void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net) 1 error */ -my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) +bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) { uchar *pos; uint field_count, param_count; @@ -1654,7 +1654,8 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) These members must be reset for API to function in case of error or misuse. */ - stmt->bind_param_done= stmt->bind_result_done= FALSE; + stmt->bind_param_done= FALSE; + stmt->bind_result_done= FALSE; stmt->param_count= stmt->field_count= 0; free_root(stmt->mem_root, MYF(MY_KEEP_PREALLOC)); free_root(&stmt->extension->fields_mem_root, MYF(0)); @@ -2087,7 +2088,7 @@ static void store_param_null(NET *net, MYSQL_BIND *param) of store_param_xxxx functions. */ -static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) +static bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) { NET *net= &stmt->mysql->net; DBUG_ENTER("store_param"); @@ -2139,14 +2140,14 @@ static inline int add_binary_row(NET *net, MYSQL_STMT *stmt, ulong pkt_len, MYSQ Used from cli_stmt_execute, which is in turn used by mysql_stmt_execute. */ -static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) +static bool execute(MYSQL_STMT *stmt, char *packet, ulong length) { MYSQL *mysql= stmt->mysql; NET *net= &mysql->net; uchar buff[4 /* size of stmt id */ + 5 /* execution flags */]; - my_bool res; - my_bool is_data_packet= FALSE; + bool res; + bool is_data_packet= FALSE; ulong pkt_len; MYSQL_ROWS **prev_ptr= NULL; DBUG_ENTER("execute"); @@ -2223,7 +2224,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) char *param_data; ulong length; uint null_count; - my_bool result; + bool result; if (!stmt->bind_param_done) { @@ -2479,13 +2480,13 @@ stmt_read_row_no_result_set(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)), !0 wrong attribute type */ -my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *value) +bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *value) { switch (attr_type) { case STMT_ATTR_UPDATE_MAX_LENGTH: - stmt->update_max_length= value ? *(const my_bool*) value : 0; + stmt->update_max_length= value ? *(const bool*) value : 0; break; case STMT_ATTR_CURSOR_TYPE: { @@ -2514,13 +2515,13 @@ my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, } -my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *value) +bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *value) { switch (attr_type) { case STMT_ATTR_UPDATE_MAX_LENGTH: - *(my_bool*) value= stmt->update_max_length; + *(bool*) value= stmt->update_max_length; break; case STMT_ATTR_CURSOR_TYPE: *(ulong*) value= stmt->flags; @@ -2734,8 +2735,8 @@ my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt) } -static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */ -static my_bool int_is_null_false= 0; +static bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */ +static bool int_is_null_false= 0; /* @@ -2838,7 +2839,7 @@ static my_bool int_is_null_false= 0; MYSQL_BIND::is_null to 0, or this has already been done if you zero-initialized the entire structure. If you set MYSQL_TYPE::is_null to point to an application buffer of type - 'my_bool', then this buffer will be checked on each execution: + 'bool', then this buffer will be checked on each execution: this way you can set the buffer to TRUE, or any non-0 value for NULLs, and to FALSE or 0 for not NULL data. @@ -2907,7 +2908,7 @@ static my_bool int_is_null_false= 0; 1 error, can be retrieved with mysql_stmt_error. */ -my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) +bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) { uint count=0; MYSQL_BIND *param, *end; @@ -3067,7 +3068,7 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) 1 error */ -my_bool STDCALL +bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length) { @@ -3380,7 +3381,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, */ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, - longlong value, my_bool is_unsigned) + longlong value, bool is_unsigned) { uchar *buffer= pointer_cast(param->buffer); @@ -3798,7 +3799,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) { - my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); + bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); uchar data= **row; *(uchar *)param->buffer= data; *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX8; @@ -3808,7 +3809,7 @@ static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field, static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) { - my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); + bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); ushort data= (ushort) sint2korr(*row); shortstore(pointer_cast(param->buffer), data); *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX16; @@ -3819,7 +3820,7 @@ static void fetch_result_int32(MYSQL_BIND *param, MYSQL_FIELD *field MY_ATTRIBUTE((unused)), uchar **row) { - my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); + bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); uint32 data= (uint32) sint4korr(*row); longstore(pointer_cast(param->buffer), data); *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX32; @@ -3830,7 +3831,7 @@ static void fetch_result_int64(MYSQL_BIND *param, MYSQL_FIELD *field MY_ATTRIBUTE((unused)), uchar **row) { - my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); + bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG); ulonglong data= (ulonglong) sint8korr(*row); *param->error= param->is_unsigned != field_is_unsigned && data > LLONG_MAX; longlongstore(pointer_cast(param->buffer), data); @@ -3959,8 +3960,8 @@ static void skip_result_string(MYSQL_BIND *param MY_ATTRIBUTE((unused)), TRUE or FALSE */ -static my_bool is_binary_compatible(enum enum_field_types type1, - enum enum_field_types type2) +static bool is_binary_compatible(enum enum_field_types type1, + enum enum_field_types type2) { static const enum enum_field_types range1[]= { MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR, MYSQL_TYPE_NULL }, @@ -3980,7 +3981,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1, for (range= range_list; range != range_list_end; ++range) { /* check that both type1 and type2 are in the same range */ - my_bool type1_found= FALSE, type2_found= FALSE; + bool type1_found= FALSE, type2_found= FALSE; for (type= *range; *type != MYSQL_TYPE_NULL; type++) { type1_found|= type1 == *type; @@ -4018,7 +4019,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1, FALSE success */ -static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) +static bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) { DBUG_ENTER("setup_one_fetch_function"); @@ -4172,7 +4173,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) Setup the bind buffers for resultset processing */ -my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) +bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) { MYSQL_BIND *param, *end; MYSQL_FIELD *field; @@ -4308,7 +4309,7 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) int cli_unbuffered_fetch(MYSQL *mysql, char **row) { ulong len= 0; - my_bool is_data_packet; + bool is_data_packet; if (packet_error == cli_safe_read(mysql, &is_data_packet)) { MYSQL_TRACE_STAGE(mysql, READY_FOR_COMMAND); @@ -4428,7 +4429,7 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) MYSQL_DATA *result= &stmt->result; MYSQL_ROWS **prev_ptr= &result->data; NET *net; - my_bool is_data_packet; + bool is_data_packet; DBUG_ENTER("cli_read_binary_rows"); @@ -4733,7 +4734,7 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt) this has been requested. */ -static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) +static bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) { /* If statement hasn't been prepared there is nothing to reset */ if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) @@ -4800,7 +4801,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) return 0; } -my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) +bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) { DBUG_ENTER("mysql_stmt_free_result"); @@ -4825,7 +4826,7 @@ my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) 1 error */ -my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) +bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) { MYSQL *mysql= stmt->mysql; int rc= 0; @@ -4880,7 +4881,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) Reset the statement buffers in server */ -my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) +bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) { DBUG_ENTER("mysql_stmt_reset"); DBUG_ASSERT(stmt != 0); @@ -4931,20 +4932,20 @@ const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt) Commit the current transaction */ -my_bool STDCALL mysql_commit(MYSQL * mysql) +bool STDCALL mysql_commit(MYSQL * mysql) { DBUG_ENTER("mysql_commit"); - DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6)); + DBUG_RETURN((bool) mysql_real_query(mysql, "commit", 6)); } /* Rollback the current transaction */ -my_bool STDCALL mysql_rollback(MYSQL * mysql) +bool STDCALL mysql_rollback(MYSQL * mysql) { DBUG_ENTER("mysql_rollback"); - DBUG_RETURN((my_bool) mysql_real_query(mysql, "rollback", 8)); + DBUG_RETURN((bool) mysql_real_query(mysql, "rollback", 8)); } @@ -4952,12 +4953,12 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql) Set autocommit to either true or false */ -my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode) +bool STDCALL mysql_autocommit(MYSQL * mysql, bool auto_mode) { DBUG_ENTER("mysql_autocommit"); DBUG_PRINT("enter", ("mode : %d", auto_mode)); - DBUG_RETURN((my_bool) mysql_real_query(mysql, auto_mode ? + DBUG_RETURN((bool) mysql_real_query(mysql, auto_mode ? "set autocommit=1":"set autocommit=0", 16)); } @@ -4972,9 +4973,9 @@ my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode) to be read using mysql_next_result() */ -my_bool STDCALL mysql_more_results(MYSQL *mysql) +bool STDCALL mysql_more_results(MYSQL *mysql) { - my_bool res; + bool res; DBUG_ENTER("mysql_more_results"); res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0); @@ -5060,7 +5061,7 @@ MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql) return (*mysql->methods->use_result)(mysql); } -my_bool STDCALL mysql_read_query_result(MYSQL *mysql) +bool STDCALL mysql_read_query_result(MYSQL *mysql) { return (*mysql->methods->read_query_result)(mysql); } diff --git a/libmysql/mysql_trace.c b/libmysql/mysql_trace.c index 110646b01906..b301aed42a28 100644 --- a/libmysql/mysql_trace.c +++ b/libmysql/mysql_trace.c @@ -156,7 +156,7 @@ void mysql_trace_trace(struct st_mysql *m, by setting trace data pointer to NULL. Also, set reconnect flag to 0 in case plugin executes any queries. */ - my_bool saved_reconnect_flag= m->reconnect; + bool saved_reconnect_flag= m->reconnect; TRACE_DATA(m)= NULL; m->reconnect= 0; diff --git a/mysys/array.cc b/mysys/array.cc index a5c9210caaf1..a657d4f6c0b3 100644 --- a/mysys/array.cc +++ b/mysys/array.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,12 +51,12 @@ FALSE Ok */ -my_bool my_init_dynamic_array(DYNAMIC_ARRAY *array, - PSI_memory_key psi_key, - uint element_size, - void *init_buffer, - uint init_alloc, - uint alloc_increment) +bool my_init_dynamic_array(DYNAMIC_ARRAY *array, + PSI_memory_key psi_key, + uint element_size, + void *init_buffer, + uint init_alloc, + uint alloc_increment) { DBUG_ENTER("my_init_dynamic_array"); if (!alloc_increment) @@ -102,7 +102,7 @@ my_bool my_init_dynamic_array(DYNAMIC_ARRAY *array, FALSE Ok */ -my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element) +bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element) { uchar* buffer; if (array->elements == array->max_element) diff --git a/mysys/base64.cc b/mysys/base64.cc index 27c12a00ea36..c40cb7e46749 100644 --- a/mysys/base64.cc +++ b/mysys/base64.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -206,7 +206,7 @@ from_base64_table[]= * FALSE on success (there are some more non-space input characters) * TRUE on error (end-of-input found) */ -static inline my_bool +static inline bool my_base64_decoder_skip_spaces(MY_BASE64_DECODER *decoder) { for ( ; decoder->src < decoder->end; decoder->src++) @@ -231,7 +231,7 @@ my_base64_decoder_skip_spaces(MY_BASE64_DECODER *decoder) * FALSE on success * TRUE on error (invalid base64 character found) */ -static inline my_bool +static inline bool my_base64_add(MY_BASE64_DECODER *decoder) { int res; @@ -253,7 +253,7 @@ my_base64_add(MY_BASE64_DECODER *decoder) * FALSE on success (a valid base64 encoding character found) * TRUE on error (unexpected character or unexpected end-of-input found) */ -static inline my_bool +static inline bool my_base64_decoder_getch(MY_BASE64_DECODER *decoder) { if (my_base64_decoder_skip_spaces(decoder)) diff --git a/mysys/charset-def.cc b/mysys/charset-def.cc index 902d2c4618a8..2ece15b22fb0 100644 --- a/mysys/charset-def.cc +++ b/mysys/charset-def.cc @@ -240,7 +240,7 @@ extern CHARSET_INFO my_charset_utf8mb4_ja_0900_as_cs; extern CHARSET_INFO my_charset_gb18030_unicode_520_ci; -my_bool init_compiled_charsets(myf flags MY_ATTRIBUTE((unused))) +bool init_compiled_charsets(myf flags MY_ATTRIBUTE((unused))) { CHARSET_INFO *cs; diff --git a/mysys/charset.cc b/mysys/charset.cc index a50fc137f3b2..e9602ab55790 100644 --- a/mysys/charset.cc +++ b/mysys/charset.cc @@ -59,7 +59,7 @@ extern CHARSET_INFO my_charset_utf16_unicode_ci; extern CHARSET_INFO my_charset_utf32_unicode_ci; extern CHARSET_INFO my_charset_cp932_japanese_ci; -my_bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2) +bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2) { return ((cs1 == cs2) || !strcmp(cs1->csname,cs2->csname)); } @@ -156,7 +156,7 @@ static int cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) -static my_bool simple_cs_is_full(CHARSET_INFO *cs) +static bool simple_cs_is_full(CHARSET_INFO *cs) { return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && cs->to_lower) && @@ -368,7 +368,7 @@ my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader) const char *charsets_dir= NULL; -static my_bool +static bool my_read_charset_file(MY_CHARSET_LOADER *loader, const char *filename, myf myflags) @@ -727,9 +727,9 @@ get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags) is no character set with given name. */ -my_bool resolve_charset(const char *cs_name, - const CHARSET_INFO *default_cs, - const CHARSET_INFO **cs) +bool resolve_charset(const char *cs_name, + const CHARSET_INFO *default_cs, + const CHARSET_INFO **cs) { *cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)); @@ -759,9 +759,9 @@ my_bool resolve_charset(const char *cs_name, collation with given name. */ -my_bool resolve_collation(const char *cl_name, - const CHARSET_INFO *default_cl, - const CHARSET_INFO **cl) +bool resolve_collation(const char *cl_name, + const CHARSET_INFO *default_cl, + const CHARSET_INFO **cl) { *cl= get_charset_by_name(cl_name, MYF(0)); @@ -806,8 +806,8 @@ size_t escape_string_for_mysql(const CHARSET_INFO *charset_info, { const char *to_start= to; const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); - my_bool overflow= FALSE; - my_bool use_mb_flag= use_mb(charset_info); + bool overflow= FALSE; + bool use_mb_flag= use_mb(charset_info); for (end= from + length; from < end; from++) { char escape= 0; @@ -945,8 +945,8 @@ size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, { const char *to_start= to; const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); - my_bool overflow= FALSE; - my_bool use_mb_flag= use_mb(charset_info); + bool overflow= FALSE; + bool use_mb_flag= use_mb(charset_info); for (end= from + length; from < end; from++) { int tmp_length; diff --git a/mysys/hash.cc b/mysys/hash.cc index 0d97e7111194..0c9c4771132e 100644 --- a/mysys/hash.cc +++ b/mysys/hash.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -385,7 +385,7 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key, /* Write a hash-key to the hash-index */ -my_bool my_hash_insert(HASH *info, const uchar *record) +bool my_hash_insert(HASH *info, const uchar *record) { int flag; size_t idx,halfbuff,first_index; @@ -523,7 +523,7 @@ my_bool my_hash_insert(HASH *info, const uchar *record) ** if there is a free-function it's called for record if found ******************************************************************************/ -my_bool my_hash_delete(HASH *hash, uchar *record) +bool my_hash_delete(HASH *hash, uchar *record) { size_t blength; uint pos2, idx, empty_index; @@ -612,8 +612,8 @@ my_bool my_hash_delete(HASH *hash, uchar *record) This is much more efficent than using a delete & insert. */ -my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, - size_t old_key_length) +bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, + size_t old_key_length) { uint new_index,new_pos_index,records; size_t blength, idx, empty; @@ -735,7 +735,7 @@ void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, #ifndef DBUG_OFF -my_bool my_hash_check(HASH *hash) +bool my_hash_check(HASH *hash) { int error; uint i,rec_link,found,max_links,seek,links,idx; diff --git a/mysys/mf_arr_appstr.cc b/mysys/mf_arr_appstr.cc index 89a6ac595437..65f89174eedd 100644 --- a/mysys/mf_arr_appstr.cc +++ b/mysys/mf_arr_appstr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,8 +36,8 @@ #include "my_dbug.h" #include "my_inttypes.h" -extern "C" my_bool array_append_string_unique(const char *str, - const char **array, size_t size) +extern "C" bool array_append_string_unique(const char *str, + const char **array, size_t size) { const char **p; /* end points at the terminating NULL element */ diff --git a/mysys/mf_cache.cc b/mysys/mf_cache.cc index 7b3b7e95fb92..1bf4acc2bd97 100644 --- a/mysys/mf_cache.cc +++ b/mysys/mf_cache.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,8 +38,8 @@ ** If dir is not given, use TMPDIR. */ -my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, - size_t cache_size, myf cache_myflags) +bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, + size_t cache_size, myf cache_myflags) { DBUG_ENTER("open_cached_file"); cache->dir= dir ? my_strdup(key_memory_IO_CACHE, @@ -61,7 +61,7 @@ my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, /* Create the temporary file */ -my_bool real_open_cached_file(IO_CACHE *cache) +bool real_open_cached_file(IO_CACHE *cache) { char name_buff[FN_REFLEN]; int error=1; diff --git a/mysys/mf_iocache.cc b/mysys/mf_iocache.cc index b592697f853e..b52f1134c82f 100644 --- a/mysys/mf_iocache.cc +++ b/mysys/mf_iocache.cc @@ -168,7 +168,7 @@ init_functions(IO_CACHE* info) int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, - my_bool use_async_io, myf cache_myflags, + bool use_async_io, myf cache_myflags, PSI_file_key file_key) { size_t min_cache; @@ -316,7 +316,7 @@ int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize, int init_io_cache(IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, - my_bool use_async_io, myf cache_myflags) + bool use_async_io, myf cache_myflags) { return init_io_cache_ext(info, file, cachesize, type, seek_offset, use_async_io, cache_myflags, key_file_io_cache); @@ -329,10 +329,10 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, in the cache, we are reusing this memory without flushing it to disk. */ -my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, - my_off_t seek_offset, - my_bool use_async_io MY_ATTRIBUTE((unused)), - my_bool clear_cache) +bool reinit_io_cache(IO_CACHE *info, enum cache_type type, + my_off_t seek_offset, + bool use_async_io MY_ATTRIBUTE((unused)), + bool clear_cache) { DBUG_ENTER("reinit_io_cache"); DBUG_PRINT("enter",("cache: %p type: %d seek_offset: %lu clear_cache: %d", @@ -1532,7 +1532,7 @@ int my_b_flush_io_cache(IO_CACHE *info, { size_t length; my_off_t pos_in_file; - my_bool append_cache= (info->type == SEQ_READ_APPEND); + bool append_cache= (info->type == SEQ_READ_APPEND); DBUG_ENTER("my_b_flush_io_cache"); DBUG_PRINT("enter", ("cache: %p", info)); diff --git a/mysys/mf_iocache2.cc b/mysys/mf_iocache2.cc index 661c38d3fe27..b4df7352a102 100644 --- a/mysys/mf_iocache2.cc +++ b/mysys/mf_iocache2.cc @@ -325,7 +325,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) uint minimum_width; /* as yet unimplemented */ uint minimum_width_sign; uint precision; /* as yet unimplemented for anything but %b */ - my_bool is_zero_padded; + bool is_zero_padded; /* Store the location of the beginning of a format directive, for the diff --git a/mysys/mf_keycache.cc b/mysys/mf_keycache.cc index e7dea9c70b40..6c89fd27f339 100644 --- a/mysys/mf_keycache.cc +++ b/mysys/mf_keycache.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -626,7 +626,7 @@ static void change_key_cache_param(KEY_CACHE *keycache, none */ -void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) +void end_key_cache(KEY_CACHE *keycache, bool cleanup) { DBUG_ENTER("end_key_cache"); DBUG_PRINT("enter", ("key_cache: %p", keycache)); @@ -905,7 +905,7 @@ static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) static void link_to_file_list(KEY_CACHE *keycache, BLOCK_LINK *block, int file, - my_bool unlink_block) + bool unlink_block) { DBUG_ASSERT(block->status & BLOCK_IN_USE); DBUG_ASSERT(block->hash_link && block->hash_link->block == block); @@ -999,8 +999,8 @@ static void link_to_changed_list(KEY_CACHE *keycache, not linked in the LRU ring. */ -static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, - my_bool at_end) +static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, bool hot, + bool at_end) { BLOCK_LINK *ins; BLOCK_LINK **pins; @@ -1207,7 +1207,7 @@ static void unreg_request(KEY_CACHE *keycache, */ if (!--block->requests && !(block->status & BLOCK_ERROR)) { - my_bool hot; + bool hot; if (block->hits_left) block->hits_left--; hot= !block->hits_left && at_end && @@ -1218,7 +1218,7 @@ static void unreg_request(KEY_CACHE *keycache, keycache->warm_blocks--; block->temperature= BLOCK_HOT; } - link_block(keycache, block, hot, (my_bool)at_end); + link_block(keycache, block, hot, at_end); block->last_hit_time= keycache->keycache_time; keycache->keycache_time++; /* @@ -2180,7 +2180,7 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache, static void read_block(KEY_CACHE *keycache, st_keycache_thread_var *thread_var, BLOCK_LINK *block, uint read_length, - uint min_length, my_bool primary) + uint min_length, bool primary) { size_t got_length; @@ -2292,7 +2292,7 @@ uchar *key_cache_read(KEY_CACHE *keycache, uint block_length, int return_buffer MY_ATTRIBUTE((unused))) { - my_bool locked_and_incremented= FALSE; + bool locked_and_incremented= FALSE; int error=0; uchar *start= buff; DBUG_ENTER("key_cache_read"); @@ -2380,7 +2380,7 @@ uchar *key_cache_read(KEY_CACHE *keycache, /* The requested page is to be read into the block buffer */ read_block(keycache, thread_var, block, keycache->key_cache_block_size, read_length+offset, - (my_bool)(page_st == PAGE_TO_BE_READ)); + page_st == PAGE_TO_BE_READ); /* A secondary request must now have the block assigned to the requested file block. It does not hurt to check it for @@ -2511,7 +2511,7 @@ int key_cache_insert(KEY_CACHE *keycache, uint read_length; uint offset; int page_st; - my_bool locked_and_incremented= FALSE; + bool locked_and_incremented= FALSE; /* When the keycache is once initialized, we use the cache_lock to @@ -2746,7 +2746,7 @@ int key_cache_write(KEY_CACHE *keycache, uint block_length MY_ATTRIBUTE((unused)), int dont_write) { - my_bool locked_and_incremented= FALSE; + bool locked_and_incremented= FALSE; int error=0; DBUG_ENTER("key_cache_write"); DBUG_PRINT("enter", diff --git a/mysys/mf_keycaches.cc b/mysys/mf_keycaches.cc index 6efe991b96b8..38f83be9535b 100644 --- a/mysys/mf_keycaches.cc +++ b/mysys/mf_keycaches.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,8 +112,8 @@ static const uchar *safe_hash_entry_get(const uchar *arg, size_t *length) 1 error */ -static my_bool safe_hash_init(SAFE_HASH *hash, uint elements, - uchar *default_value) +static bool safe_hash_init(SAFE_HASH *hash, uint elements, + uchar *default_value) { DBUG_ENTER("safe_hash"); if (my_hash_init(&hash->hash, &my_charset_bin, elements, 0, @@ -192,11 +192,11 @@ static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length) 1 error (Can only be EOM). In this case my_message() is called. */ -static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length, - uchar *data) +static bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length, + uchar *data) { SAFE_HASH_ENTRY *entry; - my_bool error= 0; + bool error= 0; DBUG_ENTER("safe_hash_set"); DBUG_PRINT("enter",("key: %.*s data: %p", length, key, data)); @@ -307,7 +307,7 @@ static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data) static SAFE_HASH key_cache_hash; -my_bool multi_keycache_init(void) +bool multi_keycache_init(void) { return safe_hash_init(&key_cache_hash, 16, (uchar*) dflt_key_cache); } @@ -359,8 +359,8 @@ KEY_CACHE *multi_key_cache_search(uchar *key, uint length) */ -my_bool multi_key_cache_set(const uchar *key, uint length, - KEY_CACHE *key_cache) +bool multi_key_cache_set(const uchar *key, uint length, + KEY_CACHE *key_cache) { return safe_hash_set(&key_cache_hash, key, length, (uchar*) key_cache); } diff --git a/mysys/mf_qsort.cc b/mysys/mf_qsort.cc index e678ad4413d1..d57920aa3b9d 100644 --- a/mysys/mf_qsort.cc +++ b/mysys/mf_qsort.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ void my_qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp) { char *low, *high, *pivot; stack_node stack[STACK_SIZE], *stack_ptr; - my_bool ptr_cmp; + bool ptr_cmp; /* Handle the simple case first */ /* This will also make the rest of the code simpler */ if (count <= 1) diff --git a/mysys/mf_radix.cc b/mysys/mf_radix.cc index 0d0619a01386..4df582478db1 100644 --- a/mysys/mf_radix.cc +++ b/mysys/mf_radix.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #include "my_inttypes.h" #include "my_sys.h" // IWYU pragma: keep -my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element) +bool radixsort_is_appliccable(uint n_items, size_t size_of_element) { return size_of_element <= 20 && n_items >= 1000 && n_items < 100000; } diff --git a/mysys/mf_tempdir.cc b/mysys/mf_tempdir.cc index bb4ff90ce911..61a6128a2f0f 100644 --- a/mysys/mf_tempdir.cc +++ b/mysys/mf_tempdir.cc @@ -32,7 +32,7 @@ #define DELIM ':' #endif -my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) +bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) { char *end, *copy; char buff[FN_REFLEN]; diff --git a/mysys/my_access.cc b/mysys/my_access.cc index 69a6ba22be1b..c015d4499974 100644 --- a/mysys/my_access.cc +++ b/mysys/my_access.cc @@ -173,7 +173,7 @@ int check_if_legal_tablename(const char *name) @return TRUE if the drive exists, FALSE otherwise. */ -static my_bool does_drive_exists(char drive_letter) +static bool does_drive_exists(char drive_letter) { DWORD drive_mask= GetLogicalDrives(); drive_letter= toupper(drive_letter); @@ -195,9 +195,9 @@ static my_bool does_drive_exists(char drive_letter) @return TRUE if the file name is allowed, FALSE otherwise. */ -my_bool is_filename_allowed(const char *name MY_ATTRIBUTE((unused)), - size_t length MY_ATTRIBUTE((unused)), - my_bool allow_current_dir MY_ATTRIBUTE((unused))) +bool is_filename_allowed(const char *name MY_ATTRIBUTE((unused)), + size_t length MY_ATTRIBUTE((unused)), + bool allow_current_dir MY_ATTRIBUTE((unused))) { /* For Windows, check if the file name contains : character. diff --git a/mysys/my_alloc.cc b/mysys/my_alloc.cc index a6eabcb79d0b..41f7a6373850 100644 --- a/mysys/my_alloc.cc +++ b/mysys/my_alloc.cc @@ -34,7 +34,7 @@ #include "mysql/service_mysql_alloc.h" #include "mysys_err.h" -static inline my_bool is_mem_available(MEM_ROOT *mem_root, size_t size); +static inline bool is_mem_available(MEM_ROOT *mem_root, size_t size); /* For instrumented code: don't preallocate memory in alloc_root(). @@ -536,7 +536,7 @@ void *memdup_root(MEM_ROOT *root, const void *str, size_t len) @retval 0 Memory is not available */ -static inline my_bool is_mem_available(MEM_ROOT *mem_root, size_t size) +static inline bool is_mem_available(MEM_ROOT *mem_root, size_t size) { if (mem_root->max_capacity) { @@ -569,7 +569,7 @@ void set_memroot_max_capacity(MEM_ROOT *mem_root, size_t max_value) @param report_error set to true if error should be reported else set to false */ -void set_memroot_error_reporting(MEM_ROOT *mem_root, my_bool report_error) +void set_memroot_error_reporting(MEM_ROOT *mem_root, bool report_error) { DBUG_ASSERT(alloc_root_inited(mem_root)); mem_root->error_for_capacity_exceeded= report_error; diff --git a/mysys/my_bitmap.cc b/mysys/my_bitmap.cc index 38fd4cd35c9f..521955859cb9 100644 --- a/mysys/my_bitmap.cc +++ b/mysys/my_bitmap.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -151,8 +151,8 @@ static inline uint get_first_not_set(uint32 value, uint word_pos) } -my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe) +bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, + bool thread_safe) { DBUG_ENTER("bitmap_init"); if (!buf) @@ -222,7 +222,7 @@ void bitmap_free(MY_BITMAP *map) !=0 bit was set */ -my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit) +bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit) { uchar *value= ((uchar*) map->bitmap) + (bitmap_bit / 8); uchar bit= 1 << ((bitmap_bit) & 7); @@ -245,9 +245,9 @@ my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit) !=0 bit was set */ -my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) +bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) { - my_bool res; + bool res; DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); bitmap_lock(map); res= bitmap_fast_test_and_set(map, bitmap_bit); @@ -268,7 +268,7 @@ my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) !=0 bit was set */ -static my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit) +static bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit) { uchar *byte= (uchar*) map->bitmap + (bitmap_bit / 8); uchar bit= 1 << ((bitmap_bit) & 7); @@ -278,9 +278,9 @@ static my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit) } -my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit) +bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit) { - my_bool res; + bool res; DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); bitmap_lock(map); res= bitmap_fast_test_and_clear(map, bitmap_bit); @@ -327,7 +327,7 @@ void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size) } -my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size) +bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size) { uint prefix_bits= prefix_size % 32; my_bitmap_map *word_ptr= map->bitmap, last_word; @@ -370,7 +370,7 @@ my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size) } -my_bool bitmap_is_set_all(const MY_BITMAP *map) +bool bitmap_is_set_all(const MY_BITMAP *map) { my_bitmap_map *data_ptr= map->bitmap; my_bitmap_map *end= map->last_word_ptr; @@ -385,7 +385,7 @@ my_bool bitmap_is_set_all(const MY_BITMAP *map) } -my_bool bitmap_is_clear_all(const MY_BITMAP *map) +bool bitmap_is_clear_all(const MY_BITMAP *map) { my_bitmap_map *data_ptr= map->bitmap; my_bitmap_map *end= map->last_word_ptr; @@ -401,7 +401,7 @@ my_bool bitmap_is_clear_all(const MY_BITMAP *map) /* Return TRUE if map1 is a subset of map2 */ -my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2) +bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2) { my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; @@ -424,7 +424,7 @@ my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2) /* True if bitmaps has any common bits */ -my_bool bitmap_is_overlapping(const MY_BITMAP *map1, const MY_BITMAP *map2) +bool bitmap_is_overlapping(const MY_BITMAP *map1, const MY_BITMAP *map2) { my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; diff --git a/mysys/my_chmod.cc b/mysys/my_chmod.cc index b7eabe27c07b..56e6956c3d53 100644 --- a/mysys/my_chmod.cc +++ b/mysys/my_chmod.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -85,7 +85,7 @@ MY_MODE get_file_perm(ulong perm_flags) @retval FALSE : File permission changed successfully */ -my_bool my_chmod(const char *filename, ulong perm_flags, myf my_flags) +bool my_chmod(const char *filename, ulong perm_flags, myf my_flags) { int ret_val; MY_MODE file_perm; diff --git a/mysys/my_compare.cc b/mysys/my_compare.cc index 3f3e500da9e7..d0f55806e7ff 100644 --- a/mysys/my_compare.cc +++ b/mysys/my_compare.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) int ha_compare_text(const CHARSET_INFO *charset_info, uchar *a, uint a_length, - uchar *b, uint b_length, my_bool part_key) + uchar *b, uint b_length, bool part_key) { if (!part_key) return charset_info->coll->strnncollsp(charset_info, a, a_length, @@ -41,7 +41,7 @@ int ha_compare_text(const CHARSET_INFO *charset_info, uchar *a, uint a_length, static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, - my_bool part_key, my_bool skip_end_space) + bool part_key, bool skip_end_space) { uint length= MY_MIN(a_length, b_length); uchar *end= a+ length; @@ -186,8 +186,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, if (piks && (flag=ha_compare_text(keyseg->charset,a,a_length,b,b_length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0)))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+=a_length; b+=b_length; @@ -198,8 +198,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, uint length=(uint) (end-a), a_length=length, b_length=length; if (piks && (flag= ha_compare_text(keyseg->charset, a, a_length, b, b_length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0)))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a=end; b+=length; @@ -216,8 +216,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, if (piks && (flag=compare_bin(a,a_length,b,b_length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0),1))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0),1))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+=a_length; b+=b_length; @@ -228,8 +228,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, uint length=keyseg->length; if (piks && (flag=compare_bin(a,length,b,length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0),0))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0),0))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+=length; b+=length; @@ -245,8 +245,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, if (piks && (flag= ha_compare_text(keyseg->charset,a,a_length,b,b_length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0)))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+= a_length; b+= b_length; @@ -262,8 +262,8 @@ int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a, if (piks && (flag=compare_bin(a,a_length,b,b_length, - (my_bool) ((nextflag & SEARCH_PREFIX) && - next_key_length <= 0), 0))) + (bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0), 0))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+=a_length; b+=b_length; diff --git a/mysys/my_compress.cc b/mysys/my_compress.cc index f4a7580abed1..fa86a44a0c8e 100644 --- a/mysys/my_compress.cc +++ b/mysys/my_compress.cc @@ -46,7 +46,7 @@ 0 ok. In this case 'len' contains the size of the compressed packet */ -my_bool my_compress(uchar *packet, size_t *len, size_t *complen) +bool my_compress(uchar *packet, size_t *len, size_t *complen) { DBUG_ENTER("my_compress"); if (*len < MIN_COMPRESS_LENGTH) @@ -116,7 +116,7 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) real data. */ -my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) +bool my_uncompress(uchar *packet, size_t len, size_t *complen) { uLongf tmp_complen; DBUG_ENTER("my_uncompress"); diff --git a/mysys/my_conio.cc b/mysys/my_conio.cc index adc0dd2cfefe..67c1a7c8cc85 100644 --- a/mysys/my_conio.cc +++ b/mysys/my_conio.cc @@ -50,7 +50,7 @@ extern CHARSET_INFO my_charset_utf16le_bin; @retval 0 if file is not Windows console @retval 1 if file is Windows console */ -my_bool +bool my_win_is_console(FILE *file) { DWORD mode; diff --git a/mysys/my_copy.cc b/mysys/my_copy.cc index 11c9b7bc62e5..9f0844def5c3 100644 --- a/mysys/my_copy.cc +++ b/mysys/my_copy.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ int my_copy(const char *from, const char *to, myf MyFlags) { size_t Count; - my_bool new_file_stat= 0; /* 1 if we could stat "to" */ + bool new_file_stat= 0; /* 1 if we could stat "to" */ int create_flag; File from_file,to_file; uchar buff[IO_SIZE]; diff --git a/mysys/my_error.cc b/mysys/my_error.cc index ac39bf74d42d..0b462d00b7fe 100644 --- a/mysys/my_error.cc +++ b/mysys/my_error.cc @@ -371,7 +371,7 @@ extern "C" int my_error_register(const char* (*get_errmsg) (int), @retval FALSE OK */ -my_bool my_error_unregister(int first, int last) +bool my_error_unregister(int first, int last) { struct my_err_head *meh_p; struct my_err_head **search_meh_pp; diff --git a/mysys/my_gethwaddr.cc b/mysys/my_gethwaddr.cc index bbdc119a7c68..e8aa5c65d7b5 100644 --- a/mysys/my_gethwaddr.cc +++ b/mysys/my_gethwaddr.cc @@ -45,7 +45,7 @@ #include #include -my_bool my_gethwaddr(uchar *to) +bool my_gethwaddr(uchar *to) { size_t len; char *buf, *next, *end; @@ -86,7 +86,7 @@ my_bool my_gethwaddr(uchar *to) #define MAX_IFS 64 -my_bool my_gethwaddr(uchar *to) +bool my_gethwaddr(uchar *to) { int fd= -1; int res= 1; @@ -177,13 +177,13 @@ typedef DWORD (WINAPI *pfnGetAdaptersAddresses)(IN ULONG Family, @retval 0 OK @retval <>0 FAILED */ -my_bool my_gethwaddr(uchar *to) +bool my_gethwaddr(uchar *to) { PIP_ADAPTER_ADDRESSES pAdapterAddresses; PIP_ADAPTER_ADDRESSES pCurrAddresses; IP_ADAPTER_ADDRESSES adapterAddresses; ULONG address_len; - my_bool return_val= 1; + bool return_val= 1; static pfnGetAdaptersAddresses fnGetAdaptersAddresses= (pfnGetAdaptersAddresses)-1; @@ -246,7 +246,7 @@ my_bool my_gethwaddr(uchar *to) #else /* __FreeBSD__ || __linux__ || _WIN32 */ /* just fail */ -my_bool my_gethwaddr(uchar *to MY_ATTRIBUTE((unused))) +bool my_gethwaddr(uchar *to MY_ATTRIBUTE((unused))) { return 1; } diff --git a/mysys/my_getwd.cc b/mysys/my_getwd.cc index 8723fed9a6bf..59c369d3117d 100644 --- a/mysys/my_getwd.cc +++ b/mysys/my_getwd.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -168,7 +168,7 @@ int test_if_hard_path(const char *dir_name) FALSE name does not contain a path. */ -my_bool has_path(const char *name) +bool has_path(const char *name) { return MY_TEST(strchr(name, FN_LIBCHAR)) #if FN_LIBCHAR != '/' diff --git a/mysys/my_init.cc b/mysys/my_init.cc index c92a209d0500..cf022e02b582 100644 --- a/mysys/my_init.cc +++ b/mysys/my_init.cc @@ -69,14 +69,14 @@ /* WSAStartup needs winsock library*/ #pragma comment(lib, "ws2_32") -my_bool have_tcpip=0; +bool have_tcpip=0; static void my_win_init(); #endif #define SCALE_SEC 100 #define SCALE_USEC 10000 -my_bool my_init_done= FALSE; +bool my_init_done= FALSE; ulong my_thread_stack_size= 65536; MYSQL_FILE *mysql_stdin= NULL; static MYSQL_FILE instrumented_stdin; @@ -123,7 +123,7 @@ int set_crt_report_leaks() @retval FALSE Success @retval TRUE Error. Couldn't initialize environment */ -my_bool my_init() +bool my_init() { char *str; @@ -397,7 +397,7 @@ static void win_init_registry() #define WINSOCK2KEY "SYSTEM\\CurrentControlSet\\Services\\Winsock2\\Parameters" #define WINSOCKKEY "SYSTEM\\CurrentControlSet\\Services\\Winsock\\Parameters" -static my_bool win32_have_tcpip() +static bool win32_have_tcpip() { HKEY hTcpipRegKey; if (RegOpenKeyEx ( HKEY_LOCAL_MACHINE, TCPIPKEY, 0, KEY_READ, @@ -417,7 +417,7 @@ static my_bool win32_have_tcpip() } -static my_bool win32_init_tcp_ip() +static bool win32_init_tcp_ip() { if (win32_have_tcpip()) { diff --git a/mysys/my_largepage.cc b/mysys/my_largepage.cc index f333f1479597..7411202e25a7 100644 --- a/mysys/my_largepage.cc +++ b/mysys/my_largepage.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ static uint my_get_large_page_size_int(void); static uchar* my_large_malloc_int(size_t size, myf my_flags); -static my_bool my_large_free_int(uchar* ptr); +static bool my_large_free_int(uchar* ptr); /* Gets the size of large pages from the OS */ @@ -165,7 +165,7 @@ uchar* my_large_malloc_int(size_t size, myf my_flags) /* Linux-specific large pages deallocator */ -my_bool my_large_free_int(uchar *ptr) +bool my_large_free_int(uchar *ptr) { DBUG_ENTER("my_large_free_int"); DBUG_RETURN(shmdt(ptr) == 0); diff --git a/mysys/my_static.cc b/mysys/my_static.cc index ec1572524c95..61b6a4b9b99b 100644 --- a/mysys/my_static.cc +++ b/mysys/my_static.cc @@ -87,8 +87,8 @@ uint my_once_extra=ONCE_ALLOC_INIT; /* Memory to alloc / block */ /* from my_largepage.c */ #ifdef HAVE_LINUX_LARGE_PAGES -my_bool my_use_large_pages= 0; -uint my_large_page_size= 0; +bool my_use_large_pages= 0; +uint my_large_page_size= 0; #endif /* from errors.c */ @@ -152,6 +152,6 @@ ulonglong query_performance_frequency, query_performance_offset, #endif /* How to disable options */ -my_bool my_disable_locking=0; -my_bool my_enable_symlinks= 1; +bool my_disable_locking=0; +bool my_enable_symlinks= 1; diff --git a/mysys/my_string.cc b/mysys/my_string.cc index 7d7a6e52d647..110efd7d4384 100644 --- a/mysys/my_string.cc +++ b/mysys/my_string.cc @@ -30,8 +30,8 @@ #include "mysql/service_mysql_alloc.h" #include "mysys_priv.h" -my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, - size_t init_alloc, size_t alloc_increment) +bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, + size_t init_alloc, size_t alloc_increment) { size_t length; DBUG_ENTER("init_dynamic_string"); @@ -56,7 +56,7 @@ my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, } -my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str) +bool dynstr_set(DYNAMIC_STRING *str, const char *init_str) { uint length=0; DBUG_ENTER("dynstr_set"); @@ -82,7 +82,7 @@ my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str) } -my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size) +bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size) { DBUG_ENTER("dynstr_realloc"); @@ -99,14 +99,14 @@ my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size) } -my_bool dynstr_append(DYNAMIC_STRING *str, const char *append) +bool dynstr_append(DYNAMIC_STRING *str, const char *append) { return dynstr_append_mem(str,append,(uint) strlen(append)); } -my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, - size_t length) +bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, + size_t length) { char *new_ptr; if (str->length+length >= str->max_length) @@ -127,7 +127,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, } -my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) +bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) { str->length-=n; str->str[str->length]= '\0'; @@ -150,7 +150,7 @@ my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) @return True = Success. */ -my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) +bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) { #ifdef _WIN32 const char *quote_str= "\""; @@ -159,7 +159,7 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) const char *quote_str= "\'"; const uint quote_len= 1; #endif /* _WIN32 */ - my_bool ret= TRUE; + bool ret= TRUE; va_list dirty_text; ret&= dynstr_append_mem(str, quote_str, quote_len); /* Leading quote */ diff --git a/mysys/my_thr_init.cc b/mysys/my_thr_init.cc index 4773cd3b30c1..be7df9fb840a 100644 --- a/mysys/my_thr_init.cc +++ b/mysys/my_thr_init.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,8 +42,8 @@ #include "mysys_priv.h" #include "thr_mutex.h" -static my_bool THR_KEY_mysys_initialized= FALSE; -static my_bool my_thread_global_init_done= FALSE; +static bool THR_KEY_mysys_initialized= FALSE; +static bool my_thread_global_init_done= FALSE; #ifndef DBUG_OFF static uint THR_thread_count= 0; static uint my_thread_end_wait_time= 5; @@ -155,7 +155,7 @@ void my_thread_global_reinit() @retval TRUE error (Couldn't create THR_KEY_mysys) */ -my_bool my_thread_global_init() +bool my_thread_global_init() { int pth_ret; @@ -240,7 +240,7 @@ void my_thread_global_end() { #ifndef DBUG_OFF struct timespec abstime; - my_bool all_threads_killed= TRUE; + bool all_threads_killed= TRUE; set_timespec(&abstime, my_thread_end_wait_time); mysql_mutex_lock(&THR_LOCK_threads); @@ -314,7 +314,7 @@ void my_thread_global_end() @retval TRUE Fatal error; mysys/dbug functions can't be used */ -my_bool my_thread_init() +bool my_thread_init() { #ifndef DBUG_OFF struct st_my_thread_var *tmp; diff --git a/mysys/my_time.cc b/mysys/my_time.cc index 1051e1da203c..9a2f9128c0d5 100644 --- a/mysys/my_time.cc +++ b/mysys/my_time.cc @@ -94,7 +94,7 @@ void set_max_hhmmss(MYSQL_TIME *tm) @param tm OUT The variable to set. @param neg Sign: 1 if negative, 0 if positive. */ -void set_max_time(MYSQL_TIME *tm, my_bool neg) +void set_max_time(MYSQL_TIME *tm, bool neg) { set_zero_time(tm, MYSQL_TIMESTAMP_TIME); set_max_hhmmss(tm); @@ -122,8 +122,8 @@ void set_max_time(MYSQL_TIME *tm, my_bool neg) 1 error */ -my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - my_time_flags_t flags, int *was_cut) +bool check_date(const MYSQL_TIME *ltime, bool not_zero_date, + my_time_flags_t flags, int *was_cut) { if (not_zero_date) { @@ -157,7 +157,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, @retval TRUE if the value is fatally bad. @retval FALSE if the value is Ok. */ -my_bool check_time_mmssff_range(const MYSQL_TIME *ltime) +bool check_time_mmssff_range(const MYSQL_TIME *ltime) { return ltime->minute >= 60 || ltime->second >= 60 || ltime->second_part > 999999; @@ -176,7 +176,7 @@ my_bool check_time_mmssff_range(const MYSQL_TIME *ltime) @retval FALSE if value is Ok. @retval TRUE if value is out of range. */ -my_bool check_time_range_quick(const MYSQL_TIME *ltime) +bool check_time_range_quick(const MYSQL_TIME *ltime) { longlong hour= (longlong) ltime->hour + 24LL * ltime->day; /* The input value should not be fatally bad */ @@ -196,7 +196,7 @@ my_bool check_time_range_quick(const MYSQL_TIME *ltime) @retval FALSE on success @retval TRUE on error */ -my_bool check_datetime_range(const MYSQL_TIME *ltime) +bool check_datetime_range(const MYSQL_TIME *ltime) { /* In case of MYSQL_TIMESTAMP_TIME hour value can be up to TIME_MAX_HOUR. @@ -270,7 +270,7 @@ my_bool check_datetime_range(const MYSQL_TIME *ltime) #define MAX_DATE_PARTS 8 -my_bool +bool str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, my_time_flags_t flags, MYSQL_TIME_STATUS *status) { @@ -278,11 +278,11 @@ str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; uint add_hours= 0, start_loop; ulong not_zero_date, allow_space; - my_bool is_internal_format; + bool is_internal_format; const char *pos, *last_field_pos= NULL; const char *end=str+length; const uchar *format_position; - my_bool found_delimitier= 0, found_space= 0; + bool found_delimitier= 0, found_space= 0; uint frac_pos, frac_len; DBUG_ENTER("str_to_datetime"); DBUG_PRINT("ENTER", ("str: %.*s", (int)length, str)); @@ -384,8 +384,7 @@ str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, zeroes are significant, and where we never process more than six digits. */ - my_bool scan_until_delim= !is_internal_format && - ((i != format_position[6])); + bool scan_until_delim= !is_internal_format && (i != format_position[6]); while (str != end && my_isdigit(&my_charset_latin1,str[0]) && (scan_until_delim || --field_length)) @@ -635,13 +634,13 @@ str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time, 1 error */ -my_bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time, - MYSQL_TIME_STATUS *status) +bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time, + MYSQL_TIME_STATUS *status) { ulong date[5]; ulonglong value; const char *end=str+length, *end_of_days; - my_bool found_days,found_hours; + bool found_days,found_hours; uint state; my_time_status_init(status); @@ -846,7 +845,7 @@ my_bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time, @retval false OK @retval true No. is out of range */ -my_bool +bool number_to_time(longlong nr, MYSQL_TIME *ltime, int *warnings) { if (nr > TIME_MAX_VALUE) @@ -917,7 +916,7 @@ void my_init_time(void) time_t seconds; struct tm *l_time,tm_tmp; MYSQL_TIME my_time; - my_bool not_used; + bool not_used; seconds= (time_t) time((time_t*) 0); localtime_r(&seconds,&tm_tmp); @@ -1017,7 +1016,7 @@ long calc_daynr(uint year,uint month,uint day) */ my_time_t my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone, - my_bool *in_dst_time_gap) + bool *in_dst_time_gap) { uint loop; time_t tmp= 0; diff --git a/mysys/my_windac.cc b/mysys/my_windac.cc index 0a7fe7260b08..db026c18dad3 100644 --- a/mysys/my_windac.cc +++ b/mysys/my_windac.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ 1 otherwise */ -static my_bool is_nt() +static bool is_nt() { return GetVersion() < 0x80000000; } diff --git a/mysys/psi_noop.cc b/mysys/psi_noop.cc index 7f5b411f129a..c61186ef4c28 100644 --- a/mysys/psi_noop.cc +++ b/mysys/psi_noop.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -597,7 +597,7 @@ void set_psi_socket_service(PSI_socket_service_t *psi) // =========================================================================== static PSI_table_share* -get_table_share_noop(my_bool temporary NNN, struct TABLE_SHARE *share NNN) +get_table_share_noop(bool temporary NNN, struct TABLE_SHARE *share NNN) { return NULL; } @@ -608,7 +608,7 @@ static void release_table_share_noop(PSI_table_share* share NNN) } static void -drop_table_share_noop(my_bool temporary NNN, const char *schema_name NNN, +drop_table_share_noop(bool temporary NNN, const char *schema_name NNN, int schema_name_length NNN, const char *table_name NNN, int table_name_length NNN) { @@ -1092,8 +1092,8 @@ get_thread_transaction_locker_noop(PSI_transaction_locker_state *state NNN, const void *xid NNN, const ulonglong *trxid NNN, int isolation_level NNN, - my_bool read_only NNN, - my_bool autocommit NNN) + bool read_only NNN, + bool autocommit NNN) { return NULL; } @@ -1149,7 +1149,7 @@ static void inc_transaction_release_savepoint_noop(PSI_transaction_locker *locke } static void end_transaction_noop(PSI_transaction_locker *locker NNN, - my_bool commit NNN) + bool commit NNN) { return; } diff --git a/mysys/sql_chars.cc b/mysys/sql_chars.cc index c85c498a43e8..eab6eaa346a9 100644 --- a/mysys/sql_chars.cc +++ b/mysys/sql_chars.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ void hint_lex_init_maps(charset_info_st *cs, } -my_bool init_state_maps(charset_info_st *cs) +bool init_state_maps(charset_info_st *cs) { uint i; uchar *ident_map; diff --git a/mysys/stacktrace.cc b/mysys/stacktrace.cc index f46ef1c53a28..d0bea1e569eb 100644 --- a/mysys/stacktrace.cc +++ b/mysys/stacktrace.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -630,7 +630,7 @@ char *my_safe_utoa(int base, ulonglong val, char *buf) char *my_safe_itoa(int base, longlong val, char *buf) { char *orig_buf= buf; - const my_bool is_neg= (val < 0); + const bool is_neg= (val < 0); *buf--= 0; if (is_neg) @@ -681,7 +681,7 @@ char *my_safe_itoa(int base, longlong val, char *buf) } -static const char *check_longlong(const char *fmt, my_bool *have_longlong) +static const char *check_longlong(const char *fmt, bool *have_longlong) { *have_longlong= FALSE; if (*fmt == 'l') @@ -705,7 +705,7 @@ static size_t my_safe_vsnprintf(char *to, size_t size, char *end= start + size - 1; for (; *format; ++format) { - my_bool have_longlong = FALSE; + bool have_longlong = FALSE; if (*format != '%') { if (to == end) /* end of buffer */ diff --git a/mysys/thr_lock.cc b/mysys/thr_lock.cc index a72c2d045880..5b0b9da2c59d 100644 --- a/mysys/thr_lock.cc +++ b/mysys/thr_lock.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -121,7 +121,7 @@ void thr_set_lock_wait_callback(void (*before_wait)(void), } // extern C -static inline my_bool +static inline bool thr_lock_owner_equal(THR_LOCK_INFO *rhs, THR_LOCK_INFO *lhs) { return rhs == lhs; @@ -133,7 +133,7 @@ thr_lock_owner_equal(THR_LOCK_INFO *rhs, THR_LOCK_INFO *lhs) static uint found_errors=0; static int check_lock(struct st_lock_list *list, const char* lock_type, - const char *where, my_bool same_owner, my_bool no_cond) + const char *where, bool same_owner, bool no_cond) { THR_LOCK_DATA *data,**prev; uint count=0; @@ -190,7 +190,7 @@ static int check_lock(struct st_lock_list *list, const char* lock_type, static void check_locks(THR_LOCK *lock, const char *where, - my_bool allow_no_locks) + bool allow_no_locks) { uint old_found_errors=found_errors; DBUG_ENTER("check_locks"); @@ -364,7 +364,7 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, void *param) } -static inline my_bool +static inline bool has_old_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner) { for ( ; data ; data=data->next) @@ -381,7 +381,7 @@ static void wake_up_waiters(THR_LOCK *lock); static enum enum_thr_lock_result wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - my_bool in_wait_list, ulong lock_wait_timeout) + bool in_wait_list, ulong lock_wait_timeout) { struct timespec wait_timeout; enum enum_thr_lock_result result= THR_LOCK_ABORTED; @@ -697,7 +697,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, lock->write_wait.data)); if (!lock->write_wait.data) { /* no scheduled write locks */ - my_bool concurrent_insert= 0; + bool concurrent_insert= 0; if (lock_type == TL_WRITE_CONCURRENT_INSERT) { concurrent_insert= 1; @@ -742,7 +742,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, static inline void free_all_read_locks(THR_LOCK *lock, - my_bool using_concurrent_insert) + bool using_concurrent_insert) { THR_LOCK_DATA *data=lock->read_wait.data; @@ -1352,7 +1352,7 @@ static void test_copy_status(void* to MY_ATTRIBUTE((unused)) , { } -static my_bool test_check_status(void* param MY_ATTRIBUTE((unused))) +static bool test_check_status(void* param MY_ATTRIBUTE((unused))) { return 0; } diff --git a/mysys/thr_mutex.cc b/mysys/thr_mutex.cc index 6581974edbc8..88590ba5864b 100644 --- a/mysys/thr_mutex.cc +++ b/mysys/thr_mutex.cc @@ -30,7 +30,7 @@ #if defined(SAFE_MUTEX) /* This makes a wrapper for mutex handling to make it easier to debug mutex */ -static my_bool safe_mutex_inited= FALSE; +static bool safe_mutex_inited= FALSE; /** While it looks like this function is pointless, it makes it possible to @@ -58,7 +58,7 @@ int safe_mutex_init(my_mutex_t *mp, const native_mutexattr_t *attr, } -int safe_mutex_lock(my_mutex_t *mp, my_bool try_lock, +int safe_mutex_lock(my_mutex_t *mp, bool try_lock, const char *file, uint line) { int error; diff --git a/mysys/tree.cc b/mysys/tree.cc index 51e08999a07d..8b2d311b674f 100644 --- a/mysys/tree.cc +++ b/mysys/tree.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,7 +94,7 @@ static int test_rb_tree(TREE_ELEMENT *element); #endif void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit, - int size, qsort2_cmp compare, my_bool with_delete, + int size, qsort2_cmp compare, bool with_delete, tree_element_free free_element, const void *custom_arg) { DBUG_ENTER("init_tree"); diff --git a/mysys/typelib.cc b/mysys/typelib.cc index bb1e73963196..16abaee72097 100644 --- a/mysys/typelib.cc +++ b/mysys/typelib.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -333,7 +333,7 @@ my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, { const char *end= str + length; my_ulonglong flags_to_set= 0, flags_to_clear= 0, res; - my_bool set_defaults= 0; + bool set_defaults= 0; *err_pos= 0; /* No error yet */ if (str != end) diff --git a/mysys_ssl/my_aes_openssl.cc b/mysys_ssl/my_aes_openssl.cc index 1e1d8de5df66..9d7bd8138521 100644 --- a/mysys_ssl/my_aes_openssl.cc +++ b/mysys_ssl/my_aes_openssl.cc @@ -220,7 +220,7 @@ int my_aes_get_size(uint32 source_length, my_aes_opmode opmode) @retval FALSE IV not needed */ -my_bool my_aes_needs_iv(my_aes_opmode opmode) +bool my_aes_needs_iv(my_aes_opmode opmode) { const EVP_CIPHER *cipher= aes_evp_type(opmode); int iv_length; diff --git a/mysys_ssl/my_aes_yassl.cc b/mysys_ssl/my_aes_yassl.cc index 7f3042d86155..d4dac85bd627 100644 --- a/mysys_ssl/my_aes_yassl.cc +++ b/mysys_ssl/my_aes_yassl.cc @@ -221,7 +221,7 @@ int my_aes_get_size(uint32 source_length, my_aes_opmode) } -my_bool my_aes_needs_iv(my_aes_opmode opmode) +bool my_aes_needs_iv(my_aes_opmode opmode) { MyCipherCtx enc(opmode); diff --git a/mysys_ssl/my_default.cc b/mysys_ssl/my_default.cc index a0d248db29d0..4b21590a1d85 100644 --- a/mysys_ssl/my_default.cc +++ b/mysys_ssl/my_default.cc @@ -141,8 +141,8 @@ inline static void set_args_separator(char** arg) in order to separate arguments received from config file and command line. */ -my_bool my_getopt_use_args_separator= FALSE; -my_bool my_getopt_is_args_separator(const char* arg) +bool my_getopt_use_args_separator= FALSE; +bool my_getopt_is_args_separator(const char* arg) { return (arg == args_separator); } @@ -156,10 +156,10 @@ static const char *my_login_path= 0; static char my_defaults_file_buffer[FN_REFLEN]; static char my_defaults_extra_file_buffer[FN_REFLEN]; -static my_bool defaults_already_read= FALSE; +static bool defaults_already_read= FALSE; /* Set to TRUE, if --no-defaults is found. */ -my_bool no_defaults= FALSE; +bool no_defaults= FALSE; /* Which directories are searched for options (and in which order) */ @@ -195,15 +195,15 @@ struct handle_option_ctx static int search_default_file(Process_option_func func, void *func_ctx, const char *dir, const char *config_file, - my_bool is_login_file); + bool is_login_file); static int search_default_file_with_ext(Process_option_func func, void *func_ctx, const char *dir, const char *ext, const char *config_file, int recursion_level, - my_bool is_login_file); -static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file, - my_bool is_login_file); + bool is_login_file); +static bool mysql_file_getline(char *str, int size, MYSQL_FILE *file, + bool is_login_file); /** Create the list of default directories. @@ -305,7 +305,7 @@ fn_expand(const char *filename, char *result_buf) int my_search_option_files(const char *conf_file, int *argc, char ***argv, uint *args_used, Process_option_func func, void *func_ctx, const char **default_directories, - my_bool is_login_file, my_bool found_no_defaults) + bool is_login_file, bool found_no_defaults) { const char **dirs, *forced_default_file, *forced_extra_defaults; int error= 0; @@ -560,7 +560,7 @@ int get_defaults_options(int argc, char **argv, char **extra_defaults, char **group_suffix, char **login_path, - my_bool found_no_defaults) + bool found_no_defaults) { int org_argc= argc, prev_argc= 0, default_option_count= 0; *defaults= *extra_defaults= *group_suffix= *login_path= 0; @@ -638,7 +638,7 @@ int load_defaults(const char *conf_file, const char **groups, } /** A global to turn off or on reading the mylogin file. On by default */ -my_bool my_defaults_read_login_file= TRUE; +bool my_defaults_read_login_file= TRUE; /* Read options from configurations files @@ -681,7 +681,7 @@ int my_load_defaults(const char *conf_file, const char **groups, { My_args my_args(key_memory_defaults); TYPELIB group; - my_bool found_print_defaults= 0; + bool found_print_defaults= 0; uint args_used= 0; int error= 0; MEM_ROOT alloc; @@ -689,7 +689,7 @@ int my_load_defaults(const char *conf_file, const char **groups, struct handle_option_ctx ctx; const char **dirs; char my_login_file[FN_REFLEN]; - my_bool found_no_defaults= false; + bool found_no_defaults= false; uint args_sep= my_getopt_use_args_separator ? 1 : 0; DBUG_ENTER("load_defaults"); @@ -824,11 +824,11 @@ static int search_default_file(Process_option_func opt_handler, void *handler_ctx, const char *dir, const char *config_file, - my_bool is_login_file) + bool is_login_file) { char **ext; const char *empty_list[]= { "", 0 }; - my_bool have_ext= fn_ext(config_file)[0] != 0; + bool have_ext= fn_ext(config_file)[0] != 0; const char **exts_to_use= have_ext ? empty_list : f_extensions; for (ext= (char**) exts_to_use; *ext; ext++) @@ -922,7 +922,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, const char *ext, const char *config_file, int recursion_level, - my_bool is_login_file) + bool is_login_file) { char name[FN_REFLEN + 10], buff[4096], curr_gr[4096], *ptr, *end, **tmp_ext; char *value, option[4096+2], tmp[FN_REFLEN]; @@ -931,7 +931,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, const int max_recursion_level= 10; MYSQL_FILE *fp; uint line=0; - my_bool found_group=0; + bool found_group=0; uint i, rc; MY_DIR *search_dir; FILEINFO *search_file; @@ -1213,8 +1213,8 @@ static char *remove_end_comment(char *ptr) 0 Error */ -static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file, - my_bool is_login_file) +static bool mysql_file_getline(char *str, int size, MYSQL_FILE *file, + bool is_login_file) { uchar cipher[4096], len_buf[MAX_CIPHER_STORE_LEN]; static unsigned char my_key[LOGIN_KEY_LEN]; @@ -1264,7 +1264,7 @@ static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file, void my_print_default_files(const char *conf_file) { const char *empty_list[]= { "", 0 }; - my_bool have_ext= fn_ext(conf_file)[0] != 0; + bool have_ext= fn_ext(conf_file)[0] != 0; const char **exts_to_use= have_ext ? empty_list : f_extensions; char name[FN_REFLEN], **ext; @@ -1559,7 +1559,7 @@ static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) char buf[FN_REFLEN]; size_t len; char *p; - my_bool err MY_ATTRIBUTE((unused)); + bool err MY_ATTRIBUTE((unused)); len= normalize_dirname(buf, dir); if (!(p= strmake_root(alloc, buf, len))) @@ -1740,7 +1740,7 @@ int my_default_get_login_file(char *file_name, size_t file_name_size) 1 - Failed to stat. 2 - Success. */ -int check_file_permissions(const char *file_name, my_bool is_login_file) +int check_file_permissions(const char *file_name, bool is_login_file) { #if !defined(_WIN32) MY_STAT stat_info; diff --git a/mysys_ssl/my_getopt.cc b/mysys_ssl/my_getopt.cc index 54de3239e7c1..c84adb06d722 100644 --- a/mysys_ssl/my_getopt.cc +++ b/mysys_ssl/my_getopt.cc @@ -43,18 +43,18 @@ typedef void (*init_func_p)(const struct my_option *option, void *variable, my_error_reporter my_getopt_error_reporter= &my_message_local; -static my_bool getopt_compare_strings(const char *, const char *, uint); +static bool getopt_compare_strings(const char *, const char *, uint); static longlong getopt_ll(char *arg, const struct my_option *optp, int *err); static ulonglong getopt_ull(char *, const struct my_option *, int *); static double getopt_double(char *arg, const struct my_option *optp, int *err); static void init_variables(const struct my_option *, init_func_p); static void init_one_value(const struct my_option *, void *, longlong); static void fini_one_value(const struct my_option *, void *, longlong); -static int setval(const struct my_option *, void *, char *, my_bool); +static int setval(const struct my_option *, void *, char *, bool); static void setval_source(const struct my_option *, void *); static char *check_struct_option(char *cur_arg, char *key_name); -static my_bool get_bool_argument(const char *argument, - bool *error); +static bool get_bool_argument(const char *argument, + bool *error); /* The following three variables belong to same group and the number and @@ -76,14 +76,14 @@ char *enabled_my_option= (char*) "1"; it by itself */ -my_bool my_getopt_print_errors= 1; +bool my_getopt_print_errors= 1; /* This is a flag that can be set in client programs. 1 means that my_getopt will skip over options it does not know how to handle. */ -my_bool my_getopt_skip_unknown= 0; +bool my_getopt_skip_unknown= 0; static my_getopt_value getopt_get_addr; @@ -214,16 +214,16 @@ double getopt_ulonglong2double(ulonglong v) int my_handle_options(int *argc, char ***argv, const struct my_option *longopts, my_get_one_option get_one_option, - const char **command_list, my_bool ignore_unknown_option) + const char **command_list, bool ignore_unknown_option) { uint argvpos= 0, length; - my_bool end_of_options= 0, must_be_var, set_maximum_value, - option_is_loose; + bool end_of_options= 0, must_be_var, set_maximum_value, + option_is_loose; char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN]; const struct my_option *optp; void *value; int error, i; - my_bool is_cmdline_arg= 1; + bool is_cmdline_arg= 1; int opt_found; /* handle_options() assumes arg0 (program name) always exists */ @@ -435,10 +435,10 @@ int my_handle_options(int *argc, char ***argv, */ (*argc)--; if(!optend) - *((my_bool*) value)= (my_bool) 1; + *((bool*) value)= true; else { - my_bool ret= 0; + bool ret= 0; bool error= 0; ret= get_bool_argument(optend, &error); if(error) @@ -450,10 +450,10 @@ int my_handle_options(int *argc, char ***argv, continue; } else - *((my_bool*) value)= ret; + *((bool*) value)= ret; } if (get_one_option && get_one_option(optp->id, optp, - *((my_bool*) value) ? + *((bool*) value) ? enabled_my_option : disabled_my_option)) return EXIT_ARGUMENT_INVALID; /* set variables source */ @@ -507,7 +507,7 @@ int my_handle_options(int *argc, char ***argv, if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL && optp->arg_type == NO_ARG) { - *((my_bool*) optp->value)= (my_bool) 1; + *((bool*) optp->value)= true; if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; continue; @@ -529,7 +529,7 @@ int my_handle_options(int *argc, char ***argv, if (optp->arg_type == OPT_ARG) { if (optp->var_type == GET_BOOL) - *((my_bool*) optp->value)= (my_bool) 1; + *((bool*) optp->value)= true; if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; continue; @@ -643,7 +643,7 @@ int my_handle_options(int *argc, char ***argv, void print_cmdline_password_warning() { - static my_bool password_warning_announced= FALSE; + static bool password_warning_announced= FALSE; if (!password_warning_announced) { @@ -712,8 +712,8 @@ static char *check_struct_option(char *cur_arg, char *key_name) @param [out] error Error indicator @return boolean value */ -static my_bool get_bool_argument(const char *argument, - bool *error) +static bool get_bool_argument(const char *argument, + bool *error) { if (!my_strcasecmp(&my_charset_latin1, argument, "true") || !my_strcasecmp(&my_charset_latin1, argument, "on") || @@ -745,7 +745,7 @@ static void setval_source(const struct my_option *opts, void *value) */ static int setval(const struct my_option *opts, void *value, char *argument, - my_bool set_maximum_value) + bool set_maximum_value) { int err= 0, res= 0; bool error= 0; @@ -796,7 +796,7 @@ static int setval(const struct my_option *opts, void *value, char *argument, switch (var_type) { case GET_BOOL: /* If argument differs from 0, enable option, else disable */ - *((my_bool*) value)= get_bool_argument(argument, &error); + *((bool*) value)= get_bool_argument(argument, &error); if(error) my_getopt_error_reporter(WARNING_LEVEL, "option '%s': boolean value '%s' wasn't recognized. Set to OFF.", @@ -956,8 +956,8 @@ int findopt(char *optpat, uint length, 2.) Returns -1 if strings differ, 0 if they are equal */ -my_bool getopt_compare_strings(const char *s, const char *t, - uint length) +bool getopt_compare_strings(const char *s, const char *t, + uint length) { char const *end= s + length; for (;s != end ; s++, t++) @@ -1103,10 +1103,10 @@ ulonglong max_of_int_range(int var_type) */ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, - my_bool *fix) + bool *fix) { longlong old= num; - my_bool adjusted= FALSE; + bool adjusted= FALSE; char buf1[255], buf2[255]; ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L); const longlong max_of_type= @@ -1144,7 +1144,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, return num; } -static inline my_bool is_negative_num(char* num) +static inline bool is_negative_num(char* num) { while (my_isspace(&my_charset_latin1, *num)) num++; @@ -1180,9 +1180,9 @@ static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err) ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - my_bool *fix) + bool *fix) { - my_bool adjusted= FALSE; + bool adjusted= FALSE; ulonglong old= num; char buf1[255], buf2[255]; const ulonglong max_of_type= @@ -1225,9 +1225,9 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, } double getopt_double_limit_value(double num, const struct my_option *optp, - my_bool *fix) + bool *fix) { - my_bool adjusted= FALSE; + bool adjusted= FALSE; double old= num; double min, max; @@ -1295,7 +1295,7 @@ static void init_one_value(const struct my_option *option, void *variable, DBUG_ENTER("init_one_value"); switch ((option->var_type & GET_TYPE_MASK)) { case GET_BOOL: - *((my_bool*) variable)= (my_bool) value; + *((bool*) variable)= (bool) value; break; case GET_INT: *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL); @@ -1608,7 +1608,7 @@ void my_print_variables_ex(const struct my_option *options, FILE* file) "(No default value)"); break; case GET_BOOL: - fprintf(file, "%s\n", *((my_bool*) value) ? "TRUE" : "FALSE"); + fprintf(file, "%s\n", *((bool*) value) ? "TRUE" : "FALSE"); break; case GET_INT: fprintf(file, "%d\n", *((int*) value)); diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c index 5386b098b6a9..593eae179bbc 100644 --- a/plugin/audit_null/audit_null.c +++ b/plugin/audit_null/audit_null.c @@ -337,7 +337,7 @@ static void process_event_record(MYSQL_THD thd, LEX_CSTRING event_name, } static int process_command(MYSQL_THD thd, LEX_CSTRING event_command, - my_bool consume_event) + bool consume_event) { LEX_CSTRING abort_ret_command= { C_STRING_WITH_LEN("ABORT_RET") }; @@ -401,7 +401,7 @@ static int audit_null_notify(MYSQL_THD thd, LEX_CSTRING event_token= get_token(&order_str); LEX_CSTRING event_data= get_token(&order_str); LEX_CSTRING event_command= get_token(&order_str); - my_bool consume_event= TRUE; + bool consume_event= TRUE; /* prone to races, oh well */ number_of_calls++; diff --git a/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc b/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc index 1f7e2c949338..7f220e32c66d 100644 --- a/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc +++ b/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -46,7 +46,7 @@ static char* mci_eng_lib_path = NULL; static char* mci_memcached_option = NULL; static unsigned int mci_r_batch_size = 1048576; static unsigned int mci_w_batch_size = 32; -static my_bool mci_enable_binlog = false; +static bool mci_enable_binlog = false; static MYSQL_SYSVAR_STR(engine_lib_name, mci_engine_library, PLUGIN_VAR_READONLY | PLUGIN_VAR_MEMALLOC, diff --git a/plugin/keyring/buffer.cc b/plugin/keyring/buffer.cc index e8450296d247..764781910521 100644 --- a/plugin/keyring/buffer.cc +++ b/plugin/keyring/buffer.cc @@ -32,7 +32,7 @@ namespace keyring DBUG_ASSERT(size == 0 && position == 0); } - my_bool Buffer::get_next_key(IKey **key) + bool Buffer::get_next_key(IKey **key) { *key= NULL; @@ -53,7 +53,7 @@ namespace keyring return FALSE; } - my_bool Buffer::has_next_key() + bool Buffer::has_next_key() { return position < size; } diff --git a/plugin/keyring/buffer.h b/plugin/keyring/buffer.h index fedeac473184..f3d36459448a 100644 --- a/plugin/keyring/buffer.h +++ b/plugin/keyring/buffer.h @@ -43,8 +43,8 @@ class Buffer : public ISerialized_object } void free(); - my_bool get_next_key(IKey **key); - my_bool has_next_key(); + bool get_next_key(IKey **key); + bool has_next_key(); void reserve(size_t memory_size); uchar *data; diff --git a/plugin/keyring/buffered_file_io.cc b/plugin/keyring/buffered_file_io.cc index 479eabad23bf..bd3e1395e8bb 100644 --- a/plugin/keyring/buffered_file_io.cc +++ b/plugin/keyring/buffered_file_io.cc @@ -81,7 +81,7 @@ std::string* Buffered_file_io::get_backup_filename() return &backup_filename; } -my_bool Buffered_file_io::open_backup_file(File *backup_file) +bool Buffered_file_io::open_backup_file(File *backup_file) { *backup_file= file_io.open(keyring_backup_file_data_key, get_backup_filename()->c_str(), O_RDONLY, MYF(0)); @@ -91,7 +91,7 @@ my_bool Buffered_file_io::open_backup_file(File *backup_file) return FALSE; } -my_bool Buffered_file_io::check_file_structure(File file, size_t file_size) +bool Buffered_file_io::check_file_structure(File file, size_t file_size) { if(std::find_if(checkers.begin(), checkers.end(), [&](Checker *checker) { return checker->check_file_structure(file, file_size, &digest) == FALSE; @@ -104,7 +104,7 @@ my_bool Buffered_file_io::check_file_structure(File file, size_t file_size) } //Only called when keyring is initalizing -my_bool Buffered_file_io::load_file_into_buffer(File file, Buffer *buffer) +bool Buffered_file_io::load_file_into_buffer(File file, Buffer *buffer) { if (file_io.seek(file, 0, MY_SEEK_END, MYF(MY_WME)) == MY_FILEPOS_ERROR) return TRUE; @@ -139,7 +139,7 @@ my_bool Buffered_file_io::load_file_into_buffer(File file, Buffer *buffer) if backup is malformed - remove it, else if backup is good restore keyring file from it. */ -my_bool Buffered_file_io::recreate_keyring_from_backup_if_backup_exists() +bool Buffered_file_io::recreate_keyring_from_backup_if_backup_exists() { Buffer buffer; File backup_file; @@ -175,7 +175,7 @@ my_bool Buffered_file_io::recreate_keyring_from_backup_if_backup_exists() if backup is malformed - remove it, else if backup is good restore keyring file from it. */ -my_bool Buffered_file_io::check_if_keyring_file_can_be_opened_or_created() +bool Buffered_file_io::check_if_keyring_file_can_be_opened_or_created() { File file= file_io.open(keyring_file_data_key, this->keyring_filename.c_str(), O_RDWR | O_CREAT, MYF(MY_WME)); @@ -190,7 +190,7 @@ my_bool Buffered_file_io::check_if_keyring_file_can_be_opened_or_created() return FALSE; } -my_bool Buffered_file_io::init(std::string *keyring_filename) +bool Buffered_file_io::init(std::string *keyring_filename) { DBUG_ASSERT(keyring_filename->empty() == FALSE); #ifdef HAVE_PSI_INTERFACE @@ -201,9 +201,9 @@ my_bool Buffered_file_io::init(std::string *keyring_filename) check_if_keyring_file_can_be_opened_or_created(); } -my_bool Buffered_file_io::flush_buffer_to_file(Buffer *buffer, - Digest *buffer_digest, - File file) +bool Buffered_file_io::flush_buffer_to_file(Buffer *buffer, + Digest *buffer_digest, + File file) { if (file_io.write(file, reinterpret_cast(file_version.c_str()), file_version.length(), MYF(MY_WME)) == file_version.length() && @@ -219,7 +219,7 @@ my_bool Buffered_file_io::flush_buffer_to_file(Buffer *buffer, return TRUE; } -my_bool Buffered_file_io::check_keyring_file_structure(File keyring_file) +bool Buffered_file_io::check_keyring_file_structure(File keyring_file) { if (keyring_file >= 0) //keyring file exists { @@ -236,7 +236,7 @@ my_bool Buffered_file_io::check_keyring_file_structure(File keyring_file) dummy_digest, SHA256_DIGEST_LENGTH) != 0; } -my_bool Buffered_file_io::flush_to_backup(ISerialized_object *serialized_object) +bool Buffered_file_io::flush_to_backup(ISerialized_object *serialized_object) { //First open backup file then check keyring file. This way we make sure that //media, where keyring file is written, is not replaced with some other media @@ -274,12 +274,12 @@ my_bool Buffered_file_io::flush_to_backup(ISerialized_object *serialized_object) file_io.close(backup_file, MYF(MY_WME)) < 0; } -my_bool Buffered_file_io::remove_backup(myf myFlags) +bool Buffered_file_io::remove_backup(myf myFlags) { return file_io.remove(get_backup_filename()->c_str(), myFlags); } -my_bool Buffered_file_io::flush_buffer_to_storage(Buffer *buffer, File file) +bool Buffered_file_io::flush_buffer_to_storage(Buffer *buffer, File file) { Digest buffer_digest; if (file_io.truncate(file, MYF(MY_WME)) || @@ -292,7 +292,7 @@ my_bool Buffered_file_io::flush_buffer_to_storage(Buffer *buffer, File file) return FALSE; } -my_bool Buffered_file_io::flush_to_storage(ISerialized_object *serialized_object) +bool Buffered_file_io::flush_to_storage(ISerialized_object *serialized_object) { Buffer *buffer= dynamic_cast(serialized_object); DBUG_ASSERT(buffer != NULL); @@ -321,7 +321,7 @@ ISerializer* Buffered_file_io::get_serializer() return &hash_to_buffer_serializer; } -my_bool Buffered_file_io::get_serialized_object(ISerialized_object **serialized_object) +bool Buffered_file_io::get_serialized_object(ISerialized_object **serialized_object) { File file= file_io.open(keyring_file_data_key, keyring_filename.c_str(), O_CREAT | O_RDWR, MYF(MY_WME)); @@ -343,7 +343,7 @@ my_bool Buffered_file_io::get_serialized_object(ISerialized_object **serialized_ return FALSE; } -my_bool Buffered_file_io::has_next_serialized_object() +bool Buffered_file_io::has_next_serialized_object() { return FALSE; } diff --git a/plugin/keyring/buffered_file_io.h b/plugin/keyring/buffered_file_io.h index 07fe4e225320..18d8ef7296f7 100644 --- a/plugin/keyring/buffered_file_io.h +++ b/plugin/keyring/buffered_file_io.h @@ -40,32 +40,32 @@ class Buffered_file_io : public IKeyring_io ~Buffered_file_io(); - my_bool init(std::string *keyring_filename); + bool init(std::string *keyring_filename); - my_bool flush_to_backup(ISerialized_object *serialized_object); - my_bool flush_to_storage(ISerialized_object *serialized_object); + bool flush_to_backup(ISerialized_object *serialized_object); + bool flush_to_storage(ISerialized_object *serialized_object); ISerializer* get_serializer(); - my_bool get_serialized_object(ISerialized_object **serialized_object); - my_bool has_next_serialized_object(); + bool get_serialized_object(ISerialized_object **serialized_object); + bool has_next_serialized_object(); protected: - virtual my_bool remove_backup(myf myFlags); + virtual bool remove_backup(myf myFlags); Buffer buffer; Digest digest; size_t memory_needed_for_buffer; private: - my_bool recreate_keyring_from_backup_if_backup_exists(); + bool recreate_keyring_from_backup_if_backup_exists(); std::string* get_backup_filename(); - my_bool open_backup_file(File *backup_file); - my_bool load_file_into_buffer(File file, Buffer *buffer); - my_bool flush_buffer_to_storage(Buffer *buffer, File file); - my_bool flush_buffer_to_file(Buffer *buffer, Digest *buffer_digest, - File file); - my_bool check_keyring_file_structure(File keyring_file); - my_bool check_file_structure(File file, size_t file_size); - my_bool check_if_keyring_file_can_be_opened_or_created(); + bool open_backup_file(File *backup_file); + bool load_file_into_buffer(File file, Buffer *buffer); + bool flush_buffer_to_storage(Buffer *buffer, File file); + bool flush_buffer_to_file(Buffer *buffer, Digest *buffer_digest, + File file); + bool check_keyring_file_structure(File keyring_file); + bool check_file_structure(File file, size_t file_size); + bool check_if_keyring_file_can_be_opened_or_created(); std::string keyring_filename; std::string backup_filename; diff --git a/plugin/keyring/checker/checker.cc b/plugin/keyring/checker/checker.cc index b9a4549d2596..8ec1b53d7043 100644 --- a/plugin/keyring/checker/checker.cc +++ b/plugin/keyring/checker/checker.cc @@ -25,7 +25,7 @@ namespace keyring { const my_off_t Checker::EOF_TAG_SIZE= 3; const std::string Checker::eofTAG= "EOF"; -my_bool Checker::check_file_structure(File file, size_t file_size, Digest *digest) +bool Checker::check_file_structure(File file, size_t file_size, Digest *digest) { if (file_size == 0) return is_empty_file_correct(digest) == FALSE; @@ -36,7 +36,7 @@ my_bool Checker::check_file_structure(File file, size_t file_size, Digest *diges is_dgst_correct(file, digest) == FALSE; } -my_bool Checker::is_empty_file_correct(Digest *digest) +bool Checker::is_empty_file_correct(Digest *digest) { return strlen(dummy_digest) == digest->length && strncmp(dummy_digest, reinterpret_cast(digest->value), @@ -44,7 +44,7 @@ my_bool Checker::is_empty_file_correct(Digest *digest) digest->length)) == 0; } -my_bool Checker::is_file_tag_correct(File file) +bool Checker::is_file_tag_correct(File file) { uchar tag[EOF_TAG_SIZE+1]; mysql_file_seek(file, 0, MY_SEEK_END, MYF(0)); @@ -59,7 +59,7 @@ my_bool Checker::is_file_tag_correct(File file) return eofTAG == reinterpret_cast(tag); } -my_bool Checker::is_file_version_correct(File file) +bool Checker::is_file_version_correct(File file) { boost::movelib::unique_ptr version(new uchar[file_version.length()+1]); version.get()[file_version.length()]= '\0'; diff --git a/plugin/keyring/checker/checker.h b/plugin/keyring/checker/checker.h index a319345cff01..b208dbd58686 100644 --- a/plugin/keyring/checker/checker.h +++ b/plugin/keyring/checker/checker.h @@ -36,19 +36,19 @@ class Checker : public keyring::Keyring_alloc file_version(file_version) {} virtual ~Checker() {} - virtual my_bool check_file_structure(File file, size_t file_size, Digest *dgst); + virtual bool check_file_structure(File file, size_t file_size, Digest *dgst); static const my_off_t EOF_TAG_SIZE; static const std::string eofTAG; protected: - virtual my_bool is_empty_file_correct(Digest *digest); - virtual my_bool is_file_size_correct(size_t file_size)= 0; - virtual my_bool is_file_tag_correct(File file); - virtual my_bool is_file_version_correct(File file); - virtual my_bool is_dgst_correct(File file, Digest *dgst)= 0; + virtual bool is_empty_file_correct(Digest *digest); + virtual bool is_file_size_correct(size_t file_size)= 0; + virtual bool is_file_tag_correct(File file); + virtual bool is_file_version_correct(File file); + virtual bool is_dgst_correct(File file, Digest *dgst)= 0; - virtual my_bool file_seek_to_tag(File file)= 0; + virtual bool file_seek_to_tag(File file)= 0; std::string file_version; }; diff --git a/plugin/keyring/checker/checker_ver_1_0.cc b/plugin/keyring/checker/checker_ver_1_0.cc index 647e46a015c4..6f0e96683504 100644 --- a/plugin/keyring/checker/checker_ver_1_0.cc +++ b/plugin/keyring/checker/checker_ver_1_0.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,16 +18,16 @@ namespace keyring { -my_bool CheckerVer_1_0::is_file_size_correct(size_t file_size) +bool CheckerVer_1_0::is_file_size_correct(size_t file_size) { return file_size >= ((size_t)EOF_TAG_SIZE + file_version.length()); } -my_bool CheckerVer_1_0::file_seek_to_tag(File file) +bool CheckerVer_1_0::file_seek_to_tag(File file) { return mysql_file_seek(file, -static_cast(EOF_TAG_SIZE), MY_SEEK_END, MYF(0)) == MY_FILEPOS_ERROR; } -my_bool CheckerVer_1_0::is_dgst_correct(File file, Digest *digest) +bool CheckerVer_1_0::is_dgst_correct(File file, Digest *digest) { digest->is_empty= TRUE; return TRUE; diff --git a/plugin/keyring/checker/checker_ver_1_0.h b/plugin/keyring/checker/checker_ver_1_0.h index 708cfd0538ef..d1b3ffa5db57 100644 --- a/plugin/keyring/checker/checker_ver_1_0.h +++ b/plugin/keyring/checker/checker_ver_1_0.h @@ -28,9 +28,9 @@ class CheckerVer_1_0 : public Checker CheckerVer_1_0() : Checker(keyring_file_version_1_0) {} protected: - my_bool is_file_size_correct(size_t file_size); - my_bool file_seek_to_tag(File file); - my_bool is_dgst_correct(File file, Digest *digest); + bool is_file_size_correct(size_t file_size); + bool file_seek_to_tag(File file); + bool is_dgst_correct(File file, Digest *digest); }; }//namespace keyring diff --git a/plugin/keyring/checker/checker_ver_2_0.cc b/plugin/keyring/checker/checker_ver_2_0.cc index 978b5375d0a2..6e9564be16c1 100644 --- a/plugin/keyring/checker/checker_ver_2_0.cc +++ b/plugin/keyring/checker/checker_ver_2_0.cc @@ -22,11 +22,11 @@ namespace keyring { -my_bool CheckerVer_2_0::is_file_size_correct(size_t file_size) +bool CheckerVer_2_0::is_file_size_correct(size_t file_size) { return file_size >= ((size_t)EOF_TAG_SIZE + file_version.length() + SHA256_DIGEST_LENGTH); } -my_bool CheckerVer_2_0::file_seek_to_tag(File file) +bool CheckerVer_2_0::file_seek_to_tag(File file) { return mysql_file_seek(file, -static_cast(EOF_TAG_SIZE+SHA256_DIGEST_LENGTH), MY_SEEK_END, MYF(0)) == MY_FILEPOS_ERROR; @@ -36,7 +36,7 @@ my_bool CheckerVer_2_0::file_seek_to_tag(File file) //in case dgst argument is empty it will assign a digest read from the file //(if it exists) to dgst argument -my_bool CheckerVer_2_0::is_dgst_correct(File file, Digest *digest) +bool CheckerVer_2_0::is_dgst_correct(File file, Digest *digest) { static Digest dgst_read_from_file; diff --git a/plugin/keyring/checker/checker_ver_2_0.h b/plugin/keyring/checker/checker_ver_2_0.h index 114ab4e99972..04d81e5e6b16 100644 --- a/plugin/keyring/checker/checker_ver_2_0.h +++ b/plugin/keyring/checker/checker_ver_2_0.h @@ -29,9 +29,9 @@ class CheckerVer_2_0 : public Checker CheckerVer_2_0() : Checker(keyring_file_version_2_0) {} protected: - my_bool is_file_size_correct(size_t file_size); - my_bool file_seek_to_tag(File file); - my_bool is_dgst_correct(File file, Digest *dgst); + bool is_file_size_correct(size_t file_size); + bool file_seek_to_tag(File file); + bool is_dgst_correct(File file, Digest *dgst); }; }//namespace keyring diff --git a/plugin/keyring/common/i_keyring_io.h b/plugin/keyring/common/i_keyring_io.h index 92d44f2ab8ee..54f9dcdaaf82 100644 --- a/plugin/keyring/common/i_keyring_io.h +++ b/plugin/keyring/common/i_keyring_io.h @@ -25,13 +25,13 @@ namespace keyring { class IKeyring_io : public Keyring_alloc { public: - virtual my_bool init(std::string *keyring_storage_url)= 0; - virtual my_bool flush_to_backup(ISerialized_object *serialized_object)= 0; - virtual my_bool flush_to_storage(ISerialized_object *serialized_object)=0; + virtual bool init(std::string *keyring_storage_url)= 0; + virtual bool flush_to_backup(ISerialized_object *serialized_object)= 0; + virtual bool flush_to_storage(ISerialized_object *serialized_object)=0; virtual ISerializer *get_serializer()= 0; - virtual my_bool get_serialized_object(ISerialized_object **serialized_object)= 0; - virtual my_bool has_next_serialized_object()= 0; + virtual bool get_serialized_object(ISerialized_object **serialized_object)= 0; + virtual bool has_next_serialized_object()= 0; virtual ~IKeyring_io() {} }; diff --git a/plugin/keyring/common/i_keyring_key.h b/plugin/keyring/common/i_keyring_key.h index 969a25f0b5a2..493f05a69800 100644 --- a/plugin/keyring/common/i_keyring_key.h +++ b/plugin/keyring/common/i_keyring_key.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,12 +33,12 @@ struct IKey : public Keyring_alloc virtual void xor_data()= 0; virtual void set_key_data(uchar *key_data, size_t key_data_size)= 0; virtual void set_key_type(const std::string *key_type)= 0; - virtual my_bool load_from_buffer(uchar* buffer, size_t *buffer_position, + virtual bool load_from_buffer(uchar* buffer, size_t *buffer_position, size_t input_buffer_size)= 0; virtual void store_in_buffer(uchar* buffer, size_t *buffer_position) const = 0; - virtual my_bool is_key_type_valid()= 0; - virtual my_bool is_key_id_valid()= 0; - virtual my_bool is_key_valid()= 0; + virtual bool is_key_type_valid()= 0; + virtual bool is_key_id_valid()= 0; + virtual bool is_key_valid()= 0; virtual ~IKey() {} }; diff --git a/plugin/keyring/common/i_keys_container.h b/plugin/keyring/common/i_keys_container.h index 9c3769d36d21..6bea26981ba8 100644 --- a/plugin/keyring/common/i_keys_container.h +++ b/plugin/keyring/common/i_keys_container.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,10 +27,10 @@ class IKeys_container : public Keyring_alloc IKeys_container() : keyring_io(NULL) {} - virtual my_bool init(IKeyring_io* keyring_io, std::string keyring_storage_url)= 0; - virtual my_bool store_key(IKey *key)= 0; + virtual bool init(IKeyring_io* keyring_io, std::string keyring_storage_url)= 0; + virtual bool store_key(IKey *key)= 0; virtual IKey* fetch_key(IKey *key)= 0; - virtual my_bool remove_key(IKey *key)= 0; + virtual bool remove_key(IKey *key)= 0; virtual std::string get_keyring_storage_url()= 0; virtual void set_keyring_io(IKeyring_io *keyring_io)= 0; diff --git a/plugin/keyring/common/i_serialized_object.h b/plugin/keyring/common/i_serialized_object.h index 0baaf20b29db..2c461d803c2c 100644 --- a/plugin/keyring/common/i_serialized_object.h +++ b/plugin/keyring/common/i_serialized_object.h @@ -33,8 +33,8 @@ namespace keyring ISerialized_object() : key_operation(NONE) {} - virtual my_bool get_next_key(IKey **key)= 0; - virtual my_bool has_next_key()= 0; + virtual bool get_next_key(IKey **key)= 0; + virtual bool has_next_key()= 0; virtual Key_operation get_key_operation() { return key_operation; diff --git a/plugin/keyring/common/keyring.h b/plugin/keyring/common/keyring.h index bb2e591f4e5e..064cc09df646 100644 --- a/plugin/keyring/common/keyring.h +++ b/plugin/keyring/common/keyring.h @@ -39,7 +39,7 @@ namespace keyring extern mysql_rwlock_t LOCK_keyring; extern std::unique_ptr keys; -extern my_bool is_keys_container_initialized; +extern bool is_keys_container_initialized; extern std::unique_ptr logger; extern std::unique_ptr keyring_file_data; @@ -47,23 +47,23 @@ extern std::unique_ptr keyring_file_data; void keyring_init_psi_keys(void); #endif //HAVE_PSI_INTERFACE -my_bool init_keyring_locks(); +bool init_keyring_locks(); void update_keyring_file_data(MYSQL_THD thd MY_ATTRIBUTE((unused)), struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), void *var_ptr MY_ATTRIBUTE((unused)), const void *save_ptr); -my_bool mysql_key_fetch(std::unique_ptr key_to_fetch, char **key_type, - void **key, size_t *key_len); -my_bool mysql_key_store(std::unique_ptr key_to_store); -my_bool mysql_key_remove(std::unique_ptr key_to_remove); +bool mysql_key_fetch(std::unique_ptr key_to_fetch, char **key_type, + void **key, size_t *key_len); +bool mysql_key_store(std::unique_ptr key_to_store); +bool mysql_key_remove(std::unique_ptr key_to_remove); -my_bool check_key_for_writting(IKey* key, std::string error_for); +bool check_key_for_writting(IKey* key, std::string error_for); template -my_bool mysql_key_fetch(const char *key_id, char **key_type, const char *user_id, - void **key, size_t *key_len) +bool mysql_key_fetch(const char *key_id, char **key_type, const char *user_id, + void **key, size_t *key_len) { try { @@ -79,8 +79,8 @@ my_bool mysql_key_fetch(const char *key_id, char **key_type, const char *user_id } template -my_bool mysql_key_store(const char *key_id, const char *key_type, - const char *user_id, const void *key, size_t key_len) +bool mysql_key_store(const char *key_id, const char *key_type, + const char *user_id, const void *key, size_t key_len) { try { @@ -96,7 +96,7 @@ my_bool mysql_key_store(const char *key_id, const char *key_type, } template -my_bool mysql_key_remove(const char *key_id, const char *user_id) +bool mysql_key_remove(const char *key_id, const char *user_id) { try { diff --git a/plugin/keyring/common/keyring_impl.cc b/plugin/keyring/common/keyring_impl.cc index 56d9dc537ffa..d4ec811ab561 100644 --- a/plugin/keyring/common/keyring_impl.cc +++ b/plugin/keyring/common/keyring_impl.cc @@ -32,7 +32,7 @@ namespace keyring mysql_rwlock_t LOCK_keyring; std::unique_ptr keys(nullptr); -my_bool is_keys_container_initialized= FALSE; +bool is_keys_container_initialized= FALSE; std::unique_ptr logger(nullptr); std::unique_ptr keyring_file_data(nullptr); @@ -60,7 +60,7 @@ void keyring_init_psi_keys(void) } #endif //HAVE_PSI_INTERFACE -my_bool init_keyring_locks() +bool init_keyring_locks() { if (mysql_rwlock_init(keyring::key_LOCK_keyring, &LOCK_keyring)) return TRUE; @@ -83,8 +83,8 @@ void update_keyring_file_data(MYSQL_THD thd MY_ATTRIBUTE((unused)), mysql_rwlock_unlock(&LOCK_keyring); } -my_bool mysql_key_fetch(std::unique_ptr key_to_fetch, char **key_type, - void **key, size_t *key_len) +bool mysql_key_fetch(std::unique_ptr key_to_fetch, char **key_type, + void **key, size_t *key_len) { if (is_keys_container_initialized == FALSE) return TRUE; @@ -112,7 +112,7 @@ my_bool mysql_key_fetch(std::unique_ptr key_to_fetch, char **key_type, return FALSE; } -my_bool check_key_for_writting(IKey* key, std::string error_for) +bool check_key_for_writting(IKey* key, std::string error_for) { std::string error_msg= "Error while "; error_msg+= error_for; @@ -131,7 +131,7 @@ my_bool check_key_for_writting(IKey* key, std::string error_for) return FALSE; } -my_bool mysql_key_store(std::unique_ptr key_to_store) +bool mysql_key_store(std::unique_ptr key_to_store) { if (is_keys_container_initialized == FALSE) return TRUE; @@ -153,7 +153,7 @@ my_bool mysql_key_store(std::unique_ptr key_to_store) return FALSE; } -my_bool mysql_key_remove(std::unique_ptr key_to_remove) +bool mysql_key_remove(std::unique_ptr key_to_remove) { bool retval= false; if (is_keys_container_initialized == FALSE) diff --git a/plugin/keyring/common/keyring_key.cc b/plugin/keyring/common/keyring_key.cc index e1b7b505e7ec..996094ae53c4 100644 --- a/plugin/keyring/common/keyring_key.cc +++ b/plugin/keyring/common/keyring_key.cc @@ -85,9 +85,9 @@ void Key::store_in_buffer(uchar* buffer, size_t *buffer_position) const DBUG_ASSERT(*buffer_position % sizeof(size_t) == 0); } -my_bool Key::load_string_from_buffer(const uchar *buffer, size_t *buffer_position, - size_t key_pod_size, std::string *string, - size_t string_length) +bool Key::load_string_from_buffer(const uchar *buffer, size_t *buffer_position, + size_t key_pod_size, std::string *string, + size_t string_length) { if (key_pod_size < *buffer_position + string_length) return TRUE; @@ -98,8 +98,8 @@ my_bool Key::load_string_from_buffer(const uchar *buffer, size_t *buffer_positio return FALSE; } -my_bool Key::load_field_size(const uchar *buffer, size_t *buffer_position, - size_t key_pod_size, size_t *field_length) +bool Key::load_field_size(const uchar *buffer, size_t *buffer_position, + size_t key_pod_size, size_t *field_length) { if (key_pod_size < *buffer_position + sizeof(size_t)) return TRUE; @@ -109,8 +109,8 @@ my_bool Key::load_field_size(const uchar *buffer, size_t *buffer_position, return FALSE; } -my_bool Key::load_from_buffer(uchar* buffer, size_t *number_of_bytes_read_from_buffer, - size_t input_buffer_size) +bool Key::load_from_buffer(uchar* buffer, size_t *number_of_bytes_read_from_buffer, + size_t input_buffer_size) { size_t key_pod_size; size_t key_id_length; @@ -179,18 +179,18 @@ void Key::xor_data() key.get()[i]^= obfuscate_str[l]; } -my_bool Key::is_key_id_valid() +bool Key::is_key_id_valid() { return key_id.length() > 0; } -my_bool Key::is_key_type_valid() +bool Key::is_key_type_valid() { return key_type.length() && (key_type == "AES" || key_type == "RSA" || key_type == "DSA"); } -my_bool Key::is_key_valid() +bool Key::is_key_valid() { return is_key_id_valid() || is_key_type_valid(); } diff --git a/plugin/keyring/common/keyring_key.h b/plugin/keyring/common/keyring_key.h index f108d5d647c0..46e9495a5009 100644 --- a/plugin/keyring/common/keyring_key.h +++ b/plugin/keyring/common/keyring_key.h @@ -32,8 +32,8 @@ struct Key : IKey ~Key(); - my_bool load_from_buffer(uchar* buffer, size_t *buffer_position, - size_t input_buffer_size); + bool load_from_buffer(uchar* buffer, size_t *buffer_position, + size_t input_buffer_size); void store_in_buffer(uchar* buffer, size_t *buffer_position) const; std::string* get_key_signature() const; std::string* get_key_type(); @@ -44,22 +44,22 @@ struct Key : IKey void xor_data(); void set_key_data(uchar *key_data, size_t key_data_size); void set_key_type(const std::string *key_type); - my_bool is_key_type_valid(); - my_bool is_key_id_valid(); - my_bool is_key_valid(); + bool is_key_type_valid(); + bool is_key_id_valid(); + bool is_key_valid(); private: Key(const Key& other); void create_key_signature() const; - my_bool load_string_from_buffer(const uchar *buffer, size_t *buffer_position, - size_t key_pod_size, std::string *string, - size_t string_length); + bool load_string_from_buffer(const uchar *buffer, size_t *buffer_position, + size_t key_pod_size, std::string *string, + size_t string_length); inline void store_field_length(uchar *buffer, size_t *buffer_position, size_t length) const; inline void store_field(uchar *buffer, size_t *buffer_position, const char *field, size_t field_length) const; - my_bool load_field_size(const uchar *buffer, size_t *buffer_position, - size_t key_pod_size, size_t *field_length); + bool load_field_size(const uchar *buffer, size_t *buffer_position, + size_t key_pod_size, size_t *field_length); protected: std::string key_id; std::string key_type; diff --git a/plugin/keyring/common/keys_container.cc b/plugin/keyring/common/keys_container.cc index 6314754e90e3..cd509dd76052 100644 --- a/plugin/keyring/common/keys_container.cc +++ b/plugin/keyring/common/keys_container.cc @@ -50,7 +50,7 @@ Keys_container::~Keys_container() delete keyring_io; } -my_bool Keys_container::init(IKeyring_io* keyring_io, std::string keyring_storage_url) +bool Keys_container::init(IKeyring_io* keyring_io, std::string keyring_storage_url) { this->keyring_io= keyring_io; this->keyring_storage_url= keyring_storage_url; @@ -77,14 +77,14 @@ std::string Keys_container::get_keyring_storage_url() return keyring_storage_url; } -my_bool Keys_container::store_key_in_hash(IKey *key) +bool Keys_container::store_key_in_hash(IKey *key) { if (my_hash_insert(&keys_hash, (uchar *) key)) return TRUE; return FALSE; } -my_bool Keys_container::store_key(IKey* key) +bool Keys_container::store_key(IKey* key) { if (flush_to_backup() || store_key_in_hash(key)) return TRUE; @@ -122,16 +122,16 @@ IKey*Keys_container::fetch_key(IKey *key) return key; } -my_bool Keys_container::remove_key_from_hash(IKey *key) +bool Keys_container::remove_key_from_hash(IKey *key) { - my_bool retVal= TRUE; + bool retVal= TRUE; keys_hash.free_element= NULL; //Prevent my_hash_delete from removing key from memory retVal= my_hash_delete(&keys_hash, reinterpret_cast(key)); keys_hash.free_element= free_hash_key; return retVal; } -my_bool Keys_container::remove_key(IKey *key) +bool Keys_container::remove_key(IKey *key) { IKey* fetched_key_to_delete= get_key_from_hash(key); if (fetched_key_to_delete == NULL || flush_to_backup() || @@ -156,9 +156,9 @@ void Keys_container::free_keys_hash() my_hash_free(&keys_hash); } -my_bool Keys_container::load_keys_from_keyring_storage() +bool Keys_container::load_keys_from_keyring_storage() { - my_bool was_error= FALSE; + bool was_error= FALSE; ISerialized_object *serialized_keys= NULL; was_error= keyring_io->get_serialized_object(&serialized_keys); while(was_error == FALSE && serialized_keys != NULL) @@ -186,7 +186,7 @@ my_bool Keys_container::load_keys_from_keyring_storage() return was_error; } -my_bool Keys_container::flush_to_storage(IKey *key, Key_operation operation) +bool Keys_container::flush_to_storage(IKey *key, Key_operation operation) { ISerialized_object *serialized_object= keyring_io->get_serializer()->serialize(&keys_hash, key, operation); @@ -201,7 +201,7 @@ my_bool Keys_container::flush_to_storage(IKey *key, Key_operation operation) return FALSE; } -my_bool Keys_container::flush_to_backup() +bool Keys_container::flush_to_backup() { ISerialized_object *serialized_object= keyring_io->get_serializer()->serialize(&keys_hash, NULL, NONE); diff --git a/plugin/keyring/common/keys_container.h b/plugin/keyring/common/keys_container.h index ce726ca27100..68c4adc8a6b6 100644 --- a/plugin/keyring/common/keys_container.h +++ b/plugin/keyring/common/keys_container.h @@ -36,10 +36,10 @@ class Keys_container : public IKeys_container { public: Keys_container(ILogger* logger); - my_bool init(IKeyring_io* keyring_io, std::string keyring_storage_url); - my_bool store_key(IKey *key); + bool init(IKeyring_io* keyring_io, std::string keyring_storage_url); + bool store_key(IKey *key); IKey* fetch_key(IKey *key); - my_bool remove_key(IKey *key); + bool remove_key(IKey *key); std::string get_keyring_storage_url(); void set_keyring_io(IKeyring_io *keyring_io); @@ -52,13 +52,13 @@ class Keys_container : public IKeys_container protected: Keys_container(const Keys_container &); - my_bool load_keys_from_keyring_storage(); + bool load_keys_from_keyring_storage(); void free_keys_hash(); IKey *get_key_from_hash(IKey *key); - my_bool store_key_in_hash(IKey *key); - my_bool remove_key_from_hash(IKey *key); - virtual my_bool flush_to_backup(); - virtual my_bool flush_to_storage(IKey *key, Key_operation operation); + bool store_key_in_hash(IKey *key); + bool remove_key_from_hash(IKey *key); + virtual bool flush_to_backup(); + virtual bool flush_to_storage(IKey *key, Key_operation operation); HASH keys_hash; ILogger* logger; diff --git a/plugin/keyring/digest.cc b/plugin/keyring/digest.cc index 27e59e5bfb22..7bf9a01eb3c7 100644 --- a/plugin/keyring/digest.cc +++ b/plugin/keyring/digest.cc @@ -60,7 +60,7 @@ namespace keyring is_empty= FALSE; } - my_bool Digest::operator==(const Digest &digest) + bool Digest::operator==(const Digest &digest) { return this->is_empty == digest.is_empty && this->length == digest.length && diff --git a/plugin/keyring/digest.h b/plugin/keyring/digest.h index 71dad2e0705d..31a6a4251661 100644 --- a/plugin/keyring/digest.h +++ b/plugin/keyring/digest.h @@ -37,12 +37,12 @@ class Digest ~Digest(); void assign(const char *value); - my_bool operator==(const Digest &digest); + bool operator==(const Digest &digest); Digest& operator=(const Digest &digest); void compute(uchar* memory, size_t memory_size); unsigned char *value; - my_bool is_empty; + bool is_empty; unsigned int length; protected: void set_digest_kind(DigestKind digest_kind); diff --git a/plugin/keyring/file_io.cc b/plugin/keyring/file_io.cc index fe96a6d2e3d9..5a9ffa392e95 100644 --- a/plugin/keyring/file_io.cc +++ b/plugin/keyring/file_io.cc @@ -32,7 +32,7 @@ namespace keyring { -my_bool is_super_user() +bool is_super_user() { THD *thd = current_thd; MYSQL_SECURITY_CONTEXT sec_ctx; @@ -160,7 +160,7 @@ int File_io::fstat(File file, MY_STAT *stat_area, myf myFlags) return result; } -my_bool File_io::remove(const char *filename, myf myFlags) +bool File_io::remove(const char *filename, myf myFlags) { if (::remove(filename) != 0 && (myFlags & MY_WME)) { @@ -176,7 +176,7 @@ my_bool File_io::remove(const char *filename, myf myFlags) return FALSE; } -my_bool File_io::truncate(File file, myf myFlags) +bool File_io::truncate(File file, myf myFlags) { #ifdef _WIN32 LARGE_INTEGER length; diff --git a/plugin/keyring/file_io.h b/plugin/keyring/file_io.h index 520d47fb848b..8eb77f3952b4 100644 --- a/plugin/keyring/file_io.h +++ b/plugin/keyring/file_io.h @@ -37,8 +37,8 @@ namespace keyring my_off_t tell(File file, myf flags); int fstat(File file, MY_STAT *stat_area, myf myFlags); int sync(File file, myf myFlags); - my_bool truncate(File file, myf myFlags); - my_bool remove(const char *filename, myf myFlags); + bool truncate(File file, myf myFlags); + bool remove(const char *filename, myf myFlags); protected: ILogger *logger; diff --git a/plugin/keyring/hash_to_buffer_serializer.cc b/plugin/keyring/hash_to_buffer_serializer.cc index 67608a2b2706..591b6f0abb0d 100644 --- a/plugin/keyring/hash_to_buffer_serializer.cc +++ b/plugin/keyring/hash_to_buffer_serializer.cc @@ -20,8 +20,8 @@ namespace keyring { - my_bool Hash_to_buffer_serializer::store_key_in_buffer(const IKey* key, - Buffer *buffer) + bool Hash_to_buffer_serializer::store_key_in_buffer(const IKey* key, + Buffer *buffer) { if (buffer->size < buffer->position + key->get_key_pod_size()) return TRUE; @@ -29,8 +29,8 @@ namespace keyring return FALSE; } - my_bool Hash_to_buffer_serializer::store_keys_in_buffer(HASH *keys_hash, - Buffer *buffer) + bool Hash_to_buffer_serializer::store_keys_in_buffer(HASH *keys_hash, + Buffer *buffer) { for (uint i= 0 ; i < keys_hash->records ; ++i) { diff --git a/plugin/keyring/hash_to_buffer_serializer.h b/plugin/keyring/hash_to_buffer_serializer.h index cf06d2d01696..63462ea7d2f2 100644 --- a/plugin/keyring/hash_to_buffer_serializer.h +++ b/plugin/keyring/hash_to_buffer_serializer.h @@ -36,8 +36,8 @@ namespace keyring protected: size_t memory_needed_for_buffer; - my_bool store_keys_in_buffer(HASH *keys_hash, Buffer *buffer); - my_bool store_key_in_buffer(const IKey* key, Buffer *buffer); + bool store_keys_in_buffer(HASH *keys_hash, Buffer *buffer); + bool store_key_in_buffer(const IKey* key, Buffer *buffer); }; } diff --git a/plugin/keyring/keyring-test/keyring-test.cc b/plugin/keyring/keyring-test/keyring-test.cc index a4b5c35adbbe..dc6c27e1c49b 100644 --- a/plugin/keyring/keyring-test/keyring-test.cc +++ b/plugin/keyring/keyring-test/keyring-test.cc @@ -19,9 +19,9 @@ #include #include "../keyring.cc" -my_bool random_keys= FALSE; -my_bool verbose; -my_bool generate_random_keys_data= FALSE; +bool random_keys= FALSE; +bool verbose; +bool generate_random_keys_data= FALSE; int number_of_keys_added= 0; int number_of_keys_fetched= 0; int number_of_keys_removed= 0; @@ -48,7 +48,7 @@ void* generate(void *arg) strcpy(key_type, "AES"); sprintf(user, "User#%d", key_nr); - my_bool result= FALSE; + bool result= FALSE; if((result= mysql_key_generate(reinterpret_cast(key_id), reinterpret_cast(key_type), @@ -101,7 +101,7 @@ void* store(void *arg) strcpy(key_type, "AES"); sprintf(user, "User#%d", key_nr); - my_bool result= FALSE; + bool result= FALSE; if((result= mysql_key_store(reinterpret_cast(key_id), reinterpret_cast(key_type), @@ -145,7 +145,7 @@ void* fetch(void *arg) void *key_data= NULL; size_t key_len= 0; - my_bool result= TRUE; + bool result= TRUE; if((result= mysql_key_fetch(reinterpret_cast(key_id), &key_type, reinterpret_cast(user), &key_data, @@ -195,7 +195,7 @@ void* remove(void *arg) sprintf(key_id, "Key#%d", key_nr); sprintf(user, "User#%d", key_nr); - my_bool result= TRUE; + bool result= TRUE; if((result= mysql_key_remove(reinterpret_cast(key_id), reinterpret_cast(user))) == FALSE) diff --git a/plugin/keyring/keyring.cc b/plugin/keyring/keyring.cc index 75fb8e9bdbb5..5104abbb45f9 100644 --- a/plugin/keyring/keyring.cc +++ b/plugin/keyring/keyring.cc @@ -37,7 +37,7 @@ using keyring::Keys_container; using keyring::Logger; static -my_bool create_keyring_dir_if_does_not_exist(const char *keyring_file_path) +bool create_keyring_dir_if_does_not_exist(const char *keyring_file_path) { if (!keyring_file_path || strlen(keyring_file_path) == 0) return TRUE; @@ -189,26 +189,26 @@ static int keyring_deinit(void *arg MY_ATTRIBUTE((unused))) return 0; } -static my_bool mysql_key_fetch(const char *key_id, char **key_type, const char *user_id, - void **key, size_t *key_len) +static bool mysql_key_fetch(const char *key_id, char **key_type, const char *user_id, + void **key, size_t *key_len) { return mysql_key_fetch(key_id, key_type, user_id, key, key_len); } -static my_bool mysql_key_store(const char *key_id, const char *key_type, - const char *user_id, const void *key, size_t key_len) +static bool mysql_key_store(const char *key_id, const char *key_type, + const char *user_id, const void *key, size_t key_len) { return mysql_key_store(key_id, key_type, user_id, key, key_len); } -static my_bool mysql_key_remove(const char *key_id, const char *user_id) +static bool mysql_key_remove(const char *key_id, const char *user_id) { return mysql_key_remove(key_id, user_id); } -static my_bool mysql_key_generate(const char *key_id, const char *key_type, - const char *user_id, size_t key_len) +static bool mysql_key_generate(const char *key_id, const char *key_type, + const char *user_id, size_t key_len) { try { diff --git a/plugin/keyring_udf/keyring_udf.cc b/plugin/keyring_udf/keyring_udf.cc index adac02d40afb..6693f1f44cb4 100644 --- a/plugin/keyring_udf/keyring_udf.cc +++ b/plugin/keyring_udf/keyring_udf.cc @@ -34,7 +34,7 @@ #define PLUGIN_EXPORT extern "C" #endif -static my_bool is_keyring_udf_initialized= FALSE; +static bool is_keyring_udf_initialized= FALSE; static int keyring_udf_init(void *p) { @@ -75,7 +75,7 @@ mysql_declare_plugin(keyring_udf) } mysql_declare_plugin_end; -static my_bool get_current_user(std::string *current_user) +static bool get_current_user(std::string *current_user) { THD *thd= current_thd; MYSQL_SECURITY_CONTEXT sec_ctx; @@ -114,8 +114,8 @@ static uint get_args_count_from_validation_request(int to_validate) return args_count; } -static my_bool validate(UDF_ARGS *args, uint expected_arg_count, - int to_validate, char *message) +static bool validate(UDF_ARGS *args, uint expected_arg_count, + int to_validate, char *message) { THD *thd= current_thd; MYSQL_SECURITY_CONTEXT sec_ctx; @@ -190,10 +190,10 @@ static my_bool validate(UDF_ARGS *args, uint expected_arg_count, return FALSE; } -static my_bool keyring_udf_func_init(UDF_INIT *initid, UDF_ARGS *args, char *message, - int to_validate, - const boost::optional max_lenth_to_return, - const size_t size_of_memory_to_allocate) +static bool keyring_udf_func_init(UDF_INIT *initid, UDF_ARGS *args, char *message, + int to_validate, + const boost::optional max_lenth_to_return, + const size_t size_of_memory_to_allocate) { initid->ptr= NULL; uint expected_arg_count= get_args_count_from_validation_request(to_validate); @@ -219,7 +219,7 @@ static my_bool keyring_udf_func_init(UDF_INIT *initid, UDF_ARGS *args, char *mes } PLUGIN_EXPORT -my_bool keyring_key_store_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_store_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, (VALIDATE_KEY_ID | VALIDATE_KEY_TYPE | VALIDATE_KEY), 1, 0); } @@ -257,8 +257,8 @@ long long keyring_key_store(UDF_INIT *initid, UDF_ARGS *args, char *is_null, return 1; } -static my_bool fetch(const char* function_name, char *key_id, char **a_key, - char **a_key_type, size_t *a_key_len) +static bool fetch(const char* function_name, char *key_id, char **a_key, + char **a_key_type, size_t *a_key_len) { std::string current_user; if (get_current_user(¤t_user)) @@ -298,7 +298,7 @@ static my_bool fetch(const char* function_name, char *key_id, char **a_key, } PLUGIN_EXPORT -my_bool keyring_key_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, VALIDATE_KEY_ID, MAX_KEYRING_UDF_KEY_TEXT_LENGTH, MAX_KEYRING_UDF_KEY_TEXT_LENGTH); @@ -349,7 +349,7 @@ char *keyring_key_fetch(UDF_INIT *initid, UDF_ARGS *args, char *result, } PLUGIN_EXPORT -my_bool keyring_key_type_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_type_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, VALIDATE_KEY_ID, KEYRING_UDF_KEY_TYPE_LENGTH, KEYRING_UDF_KEY_TYPE_LENGTH); @@ -401,7 +401,7 @@ char *keyring_key_type_fetch(UDF_INIT *initid, UDF_ARGS *args, char *result, } PLUGIN_EXPORT -my_bool keyring_key_length_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_length_fetch_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, VALIDATE_KEY_ID, boost::none, 0); @@ -443,7 +443,7 @@ long long keyring_key_length_fetch(UDF_INIT *initid, UDF_ARGS *args, char *is_nu } PLUGIN_EXPORT -my_bool keyring_key_remove_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_remove_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, VALIDATE_KEY_ID, 1, 0); @@ -479,7 +479,7 @@ long long keyring_key_remove(UDF_INIT *initid, UDF_ARGS *args, char *is_null, } PLUGIN_EXPORT -my_bool keyring_key_generate_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool keyring_key_generate_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return keyring_udf_func_init(initid, args, message, (VALIDATE_KEY_ID | VALIDATE_KEY_TYPE | VALIDATE_KEY_LENGTH), diff --git a/plugin/password_validation/validate_password.cc b/plugin/password_validation/validate_password.cc index 5cdd433bace4..6d2150708096 100644 --- a/plugin/password_validation/validate_password.cc +++ b/plugin/password_validation/validate_password.cc @@ -110,7 +110,7 @@ static ulong validate_password_policy; static char *validate_password_dictionary_file; static char *validate_password_dictionary_file_last_parsed= NULL; static long long validate_password_dictionary_file_words_count= 0; -static my_bool check_user_name; +static bool check_user_name; /** Activate the new dictionary diff --git a/plugin/rewriter/rewriter_plugin.cc b/plugin/rewriter/rewriter_plugin.cc index 05381f778f3f..3aa99b0c6f25 100644 --- a/plugin/rewriter/rewriter_plugin.cc +++ b/plugin/rewriter/rewriter_plugin.cc @@ -104,7 +104,7 @@ static st_mysql_show_var rewriter_plugin_status_vars[]= static int sys_var_verbose; /// Enabled. -static my_bool sys_var_enabled; +static bool sys_var_enabled; /// Updater function for the status variable ..._verbose. static void update_verbose(MYSQL_THD, struct st_mysql_sys_var *, void *, diff --git a/plugin/rewriter/rewriter_udf.cc b/plugin/rewriter/rewriter_udf.cc index 8c9569ca76c8..3dfb5c35967e 100644 --- a/plugin/rewriter/rewriter_udf.cc +++ b/plugin/rewriter/rewriter_udf.cc @@ -29,7 +29,7 @@ extern "C" { -my_bool load_rewrite_rules_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool load_rewrite_rules_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (get_rewriter_plugin_info() != NULL) return 0; diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index d7db8549ea02..7f5b334d8834 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -34,7 +34,7 @@ #define TIME_BILLION 1000000000 /* This indicates whether semi-synchronous replication is enabled. */ -my_bool rpl_semi_sync_master_enabled; +bool rpl_semi_sync_master_enabled; unsigned long rpl_semi_sync_master_timeout; unsigned long rpl_semi_sync_master_trace_level; char rpl_semi_sync_master_status = 0; @@ -52,7 +52,7 @@ unsigned long long rpl_semi_sync_master_net_wait_num = 0; unsigned long rpl_semi_sync_master_clients = 0; unsigned long long rpl_semi_sync_master_net_wait_time = 0; unsigned long long rpl_semi_sync_master_trx_wait_time = 0; -my_bool rpl_semi_sync_master_wait_no_slave = 1; +bool rpl_semi_sync_master_wait_no_slave = 1; unsigned int rpl_semi_sync_master_wait_for_slave_count= 1; @@ -204,7 +204,7 @@ int ActiveTranx::insert_tranx_node(const char *log_file_name, } bool ActiveTranx::is_tranx_end_pos(const char *log_file_name, - my_off_t log_file_pos) + my_off_t log_file_pos) { const char *kWho = "ActiveTranx::is_tranx_end_pos"; function_enter(kWho); diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h index 34ff75321bde..2caaa4b6dfef 100644 --- a/plugin/semisync/semisync_master.h +++ b/plugin/semisync/semisync_master.h @@ -872,7 +872,7 @@ class ReplSemiSyncMaster }; /* System and status variables for the master component */ -extern my_bool rpl_semi_sync_master_enabled; +extern bool rpl_semi_sync_master_enabled; extern char rpl_semi_sync_master_status; extern unsigned long rpl_semi_sync_master_clients; extern unsigned long rpl_semi_sync_master_timeout; @@ -898,5 +898,5 @@ extern unsigned long long rpl_semi_sync_master_trx_wait_time; 0 : stop waiting if detected no avaialable semi-sync slave. 1 (default) : keep waiting until timeout even no available semi-sync slave. */ -extern my_bool rpl_semi_sync_master_wait_no_slave; +extern bool rpl_semi_sync_master_wait_no_slave; #endif /* SEMISYNC_MASTER_H */ diff --git a/plugin/semisync/semisync_slave.cc b/plugin/semisync/semisync_slave.cc index 114162a47205..0ecc4a2e8ec4 100644 --- a/plugin/semisync/semisync_slave.cc +++ b/plugin/semisync/semisync_slave.cc @@ -24,7 +24,7 @@ #include "my_dbug.h" #include "mysql.h" -my_bool rpl_semi_sync_slave_enabled; +bool rpl_semi_sync_slave_enabled; char rpl_semi_sync_slave_status= 0; unsigned long rpl_semi_sync_slave_trace_level; diff --git a/plugin/semisync/semisync_slave.h b/plugin/semisync/semisync_slave.h index 06ba1835edcc..876b2b82695b 100644 --- a/plugin/semisync/semisync_slave.h +++ b/plugin/semisync/semisync_slave.h @@ -91,7 +91,7 @@ class ReplSemiSyncSlave /* System and status variables for the slave component */ -extern my_bool rpl_semi_sync_slave_enabled; +extern bool rpl_semi_sync_slave_enabled; extern unsigned long rpl_semi_sync_slave_trace_level; extern char rpl_semi_sync_slave_status; diff --git a/plugin/test_service_sql_api/test_session_detach.cc b/plugin/test_service_sql_api/test_session_detach.cc index bdecb457b270..b34d973f3086 100644 --- a/plugin/test_service_sql_api/test_session_detach.cc +++ b/plugin/test_service_sql_api/test_session_detach.cc @@ -71,7 +71,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_session_info.cc b/plugin/test_service_sql_api/test_session_info.cc index 5392b7101b52..bdf893e56a46 100644 --- a/plugin/test_service_sql_api/test_session_info.cc +++ b/plugin/test_service_sql_api/test_session_info.cc @@ -94,7 +94,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_sql_2_sessions.cc b/plugin/test_service_sql_api/test_sql_2_sessions.cc index b6088e3dace1..640d0e85a2f5 100644 --- a/plugin/test_service_sql_api/test_sql_2_sessions.cc +++ b/plugin/test_service_sql_api/test_sql_2_sessions.cc @@ -95,7 +95,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_sql_9_sessions.cc b/plugin/test_service_sql_api/test_sql_9_sessions.cc index ffb23833856a..5cc66d6bd4fd 100644 --- a/plugin/test_service_sql_api/test_sql_9_sessions.cc +++ b/plugin/test_service_sql_api/test_sql_9_sessions.cc @@ -53,7 +53,7 @@ st_send_field_n sql_field[64]; MYSQL_SESSION session[9]; void *plugin_ctx=NULL; bool session_ret= false; -my_bool fail= false; +bool fail= false; COM_DATA cmd; int row_count= 0; @@ -154,7 +154,7 @@ static int sql_get_longlong(void * ctx, longlong value, uint is_unsigned){ struct st_test_decimal_t { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; } test_decimal[64][64]; char test_dec_str[256][64][64]; @@ -187,7 +187,7 @@ struct st_test_date { unsigned int year, month, day, hour, minute, second; unsigned long second_part; /**< microseconds */ - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; } test_date[64][64]; @@ -210,7 +210,7 @@ struct st_my_time { unsigned int year, month, day, hour, minute, second; unsigned long second_part; /**< microseconds */ - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; uint decimals; } test_time[64][64]; @@ -235,7 +235,7 @@ struct st_my_datetime { unsigned int year, month, day, hour, minute, second; unsigned long second_part; /**< microseconds */ - my_bool neg; + bool neg; enum enum_mysql_timestamp_type time_type; uint decimals; } test_datetime[64][64]; diff --git a/plugin/test_service_sql_api/test_sql_cmds_1.cc b/plugin/test_service_sql_api/test_sql_cmds_1.cc index 461ee675b53f..19861fde47da 100644 --- a/plugin/test_service_sql_api/test_sql_cmds_1.cc +++ b/plugin/test_service_sql_api/test_sql_cmds_1.cc @@ -359,7 +359,7 @@ static void test_com_query(void *p) MYSQL_SESSION st_session; void *plugin_ctx=NULL; bool session_ret= false; - my_bool fail= false; + bool fail= false; COM_DATA cmd; Callback_data cbd; diff --git a/plugin/test_service_sql_api/test_sql_errors.cc b/plugin/test_service_sql_api/test_sql_errors.cc index 61dd3945cd55..017b1d3a075d 100644 --- a/plugin/test_service_sql_api/test_sql_errors.cc +++ b/plugin/test_service_sql_api/test_sql_errors.cc @@ -97,7 +97,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_sql_lock.cc b/plugin/test_service_sql_api/test_sql_lock.cc index 76c70ff5664a..33e75867459c 100644 --- a/plugin/test_service_sql_api/test_sql_lock.cc +++ b/plugin/test_service_sql_api/test_sql_lock.cc @@ -72,7 +72,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_sql_processlist.cc b/plugin/test_service_sql_api/test_sql_processlist.cc index ff7f9e4485da..dd30d091c30d 100644 --- a/plugin/test_service_sql_api/test_sql_processlist.cc +++ b/plugin/test_service_sql_api/test_sql_processlist.cc @@ -86,7 +86,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/test_service_sql_api/test_sql_shutdown.cc b/plugin/test_service_sql_api/test_sql_shutdown.cc index 4df98395575c..4da4d9a2dc3f 100644 --- a/plugin/test_service_sql_api/test_sql_shutdown.cc +++ b/plugin/test_service_sql_api/test_sql_shutdown.cc @@ -77,7 +77,7 @@ struct st_send_field_n struct st_decimal_n { int intg, frac, len; - my_bool sign; + bool sign; decimal_digit_t buf[256]; }; diff --git a/plugin/udf_services/test_udf_services.cc b/plugin/udf_services/test_udf_services.cc index fe5f84039de8..9093487719b2 100644 --- a/plugin/udf_services/test_udf_services.cc +++ b/plugin/udf_services/test_udf_services.cc @@ -72,7 +72,7 @@ mysql_declare_plugin_end; @retval FALSE success @retval TRUE Failure. Error in the message argument */ -PLUGIN_EXPORT my_bool +PLUGIN_EXPORT bool test_udf_services_udf_init(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args MY_ATTRIBUTE((unused)), char *message MY_ATTRIBUTE((unused))) diff --git a/plugin/version_token/version_token.cc b/plugin/version_token/version_token.cc index 2de24b9684b2..e0f7103588ea 100644 --- a/plugin/version_token/version_token.cc +++ b/plugin/version_token/version_token.cc @@ -216,39 +216,39 @@ static void set_vtoken_string_length() // UDF -PLUGIN_EXPORT my_bool version_tokens_set_init(UDF_INIT *initid, UDF_ARGS *args, +PLUGIN_EXPORT bool version_tokens_set_init(UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT char *version_tokens_set(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -PLUGIN_EXPORT my_bool version_tokens_show_init(UDF_INIT *initid, UDF_ARGS *args, +PLUGIN_EXPORT bool version_tokens_show_init(UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT void version_tokens_show_deinit(UDF_INIT *initid); PLUGIN_EXPORT char *version_tokens_show(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -PLUGIN_EXPORT my_bool version_tokens_edit_init(UDF_INIT *initid, UDF_ARGS *args, +PLUGIN_EXPORT bool version_tokens_edit_init(UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT char *version_tokens_edit(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -PLUGIN_EXPORT my_bool version_tokens_delete_init(UDF_INIT *initid, +PLUGIN_EXPORT bool version_tokens_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT char *version_tokens_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -PLUGIN_EXPORT my_bool version_tokens_lock_shared_init( +PLUGIN_EXPORT bool version_tokens_lock_shared_init( UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT long long version_tokens_lock_shared( UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); -PLUGIN_EXPORT my_bool version_tokens_lock_exclusive_init( +PLUGIN_EXPORT bool version_tokens_lock_exclusive_init( UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT long long version_tokens_lock_exclusive( UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); -PLUGIN_EXPORT my_bool version_tokens_unlock_init( +PLUGIN_EXPORT bool version_tokens_unlock_init( UDF_INIT *initid, UDF_ARGS *args, char *message); PLUGIN_EXPORT long long version_tokens_unlock( UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); @@ -702,7 +702,7 @@ static bool is_hash_inited(const char *function, char *error) VERSION_TOKENS_SET(tokens_list varchar) */ -PLUGIN_EXPORT my_bool version_tokens_set_init(UDF_INIT* initid, UDF_ARGS* args, +PLUGIN_EXPORT bool version_tokens_set_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { THD *thd= current_thd; @@ -796,7 +796,7 @@ PLUGIN_EXPORT char *version_tokens_set(UDF_INIT *initid, UDF_ARGS *args, VERSION_TOKENS_EDIT(tokens_list varchar) */ -PLUGIN_EXPORT my_bool version_tokens_edit_init(UDF_INIT *initid, UDF_ARGS *args, +PLUGIN_EXPORT bool version_tokens_edit_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { THD *thd= current_thd; @@ -880,7 +880,7 @@ PLUGIN_EXPORT char *version_tokens_edit(UDF_INIT *initid, UDF_ARGS *args, VERSION_TOKENS_DELETE(tokens_list varchar) */ -PLUGIN_EXPORT my_bool version_tokens_delete_init(UDF_INIT *initid, +PLUGIN_EXPORT bool version_tokens_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { THD *thd= current_thd; @@ -985,7 +985,7 @@ PLUGIN_EXPORT char *version_tokens_delete(UDF_INIT *initid, UDF_ARGS *args, VERSION_TOKENS_SHOW() */ -PLUGIN_EXPORT my_bool version_tokens_show_init(UDF_INIT *initid, UDF_ARGS *args, +PLUGIN_EXPORT bool version_tokens_show_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { int i= 0; @@ -1084,7 +1084,7 @@ PLUGIN_EXPORT char *version_tokens_show(UDF_INIT *initid, UDF_ARGS *args, return result_str; } -static inline my_bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *message) +static inline bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *message) { initid->maybe_null= FALSE; initid->decimals= 0; @@ -1129,7 +1129,7 @@ static inline my_bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *messa return FALSE; } -PLUGIN_EXPORT my_bool version_tokens_lock_shared_init( +PLUGIN_EXPORT bool version_tokens_lock_shared_init( UDF_INIT *initid, UDF_ARGS *args, char *message) { return init_acquire(initid, args, message); @@ -1158,7 +1158,7 @@ PLUGIN_EXPORT long long version_tokens_lock_shared( } -PLUGIN_EXPORT my_bool version_tokens_lock_exclusive_init( +PLUGIN_EXPORT bool version_tokens_lock_exclusive_init( UDF_INIT *initid, UDF_ARGS *args, char *message) { return init_acquire(initid, args, message); @@ -1186,7 +1186,7 @@ PLUGIN_EXPORT long long version_tokens_lock_exclusive( LOCKING_SERVICE_WRITE, (unsigned long) timeout); } -PLUGIN_EXPORT my_bool version_tokens_unlock_init( +PLUGIN_EXPORT bool version_tokens_unlock_init( UDF_INIT *initid, UDF_ARGS *args, char *message) { THD *thd= current_thd; diff --git a/rapid/plugin/group_replication/src/plugin.cc b/rapid/plugin/group_replication/src/plugin.cc index 824afd31764c..da15b10eeeb6 100644 --- a/rapid/plugin/group_replication/src/plugin.cc +++ b/rapid/plugin/group_replication/src/plugin.cc @@ -66,7 +66,7 @@ char *group_seeds_var= NULL; char *force_members_var= NULL; bool force_members_running= false; static mysql_mutex_t force_members_running_mutex; -my_bool bootstrap_group_var= false; +bool bootstrap_group_var= false; ulong poll_spin_loops_var= 0; ulong ssl_mode_var= 0; @@ -110,10 +110,10 @@ Compatibility_module* compatibility_mgr= NULL; /* Plugin group related options */ const char *group_replication_plugin_name= "group_replication"; char *group_name_var= NULL; -my_bool start_group_replication_at_boot_var= true; +bool start_group_replication_at_boot_var= true; rpl_sidno group_sidno; -my_bool single_primary_mode_var= FALSE; -my_bool enforce_update_everywhere_checks_var= TRUE; +bool single_primary_mode_var= FALSE; +bool enforce_update_everywhere_checks_var= TRUE; /* Applier module related */ bool known_server_reset; @@ -132,7 +132,7 @@ static const int RECOVERY_SSL_CRLPATH_OPT= 7; std::map recovery_ssl_opt_map; // SSL options -my_bool recovery_use_ssl_var= false; +bool recovery_use_ssl_var= false; char* recovery_ssl_ca_var= NULL; char* recovery_ssl_capath_var= NULL; char* recovery_ssl_cert_var= NULL; @@ -140,7 +140,7 @@ char* recovery_ssl_cipher_var= NULL; char* recovery_ssl_key_var= NULL; char* recovery_ssl_crl_var= NULL; char* recovery_ssl_crlpath_var= NULL; -my_bool recovery_ssl_verify_server_cert_var= false; +bool recovery_ssl_verify_server_cert_var= false; ulong recovery_completion_policy_var; ulong recovery_retry_count_var= 0; @@ -183,10 +183,10 @@ int flow_control_certifier_threshold_var= DEFAULT_FLOW_CONTROL_THRESHOLD; int flow_control_applier_threshold_var= DEFAULT_FLOW_CONTROL_THRESHOLD; /* Downgrade options */ -my_bool allow_local_lower_version_join_var= 0; +bool allow_local_lower_version_join_var= 0; /* Allow errand transactions */ -my_bool allow_local_disjoint_gtids_join_var= 0; +bool allow_local_disjoint_gtids_join_var= 0; /* Certification latch */ Wait_ticket *certification_latch; @@ -1605,8 +1605,8 @@ update_ssl_use(MYSQL_THD thd, SYS_VAR *var, { DBUG_ENTER("update_ssl_use"); - bool use_ssl_val= *((my_bool *) save); - (*(my_bool *) var_ptr)= (*(my_bool *) save); + bool use_ssl_val= *((bool *) save); + (*(bool *) var_ptr)= (*(bool *) save); if (recovery_module != NULL) { @@ -1717,8 +1717,8 @@ update_ssl_server_cert_verification(MYSQL_THD thd, SYS_VAR *var, { DBUG_ENTER("update_ssl_server_cert_verification"); - bool ssl_verify_server_cert= *((my_bool *) save); - (*(my_bool *) var_ptr)= (*(my_bool *) save); + bool ssl_verify_server_cert= *((bool *) save); + (*(bool *) var_ptr)= (*(bool *) save); if (recovery_module != NULL) { @@ -1980,7 +1980,7 @@ static int check_gtid_assignment_block_size(MYSQL_THD thd, SYS_VAR *var, static bool get_bool_value_using_type_lib(struct st_mysql_value *value, - my_bool &resulting_value) + bool &resulting_value) { DBUG_ENTER("get_bool_value_using_type_lib"); longlong value_to_check; @@ -2025,7 +2025,7 @@ check_single_primary_mode(MYSQL_THD thd, SYS_VAR *var, struct st_mysql_value *value) { DBUG_ENTER("check_single_primary_mode"); - my_bool single_primary_mode_val; + bool single_primary_mode_val; if (!get_bool_value_using_type_lib(value, single_primary_mode_val)) DBUG_RETURN(1); @@ -2047,7 +2047,7 @@ check_single_primary_mode(MYSQL_THD thd, SYS_VAR *var, DBUG_RETURN(1); } - *(my_bool *)save = single_primary_mode_val; + *(bool *)save = single_primary_mode_val; DBUG_RETURN(0); } @@ -2058,7 +2058,7 @@ check_enforce_update_everywhere_checks(MYSQL_THD thd, SYS_VAR *var, struct st_mysql_value *value) { DBUG_ENTER("check_enforce_update_everywhere_checks"); - my_bool enforce_update_everywhere_checks_val; + bool enforce_update_everywhere_checks_val; if (!get_bool_value_using_type_lib(value, enforce_update_everywhere_checks_val)) DBUG_RETURN(1); @@ -2080,7 +2080,7 @@ check_enforce_update_everywhere_checks(MYSQL_THD thd, SYS_VAR *var, DBUG_RETURN(1); } - *(my_bool *)save = enforce_update_everywhere_checks_val; + *(bool *)save = enforce_update_everywhere_checks_val; DBUG_RETURN(0); } diff --git a/rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h b/rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h index 075a181e2ab8..44bc4cfffac5 100644 --- a/rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h +++ b/rapid/plugin/x/mysqlxtest_src/mysqlx/mysql.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,8 @@ #ifndef _MYSQLX_H_ #define _MYSQLX_H_ -typedef char my_bool; +#include + #if !defined(_WIN32) #define STDCALL #else @@ -98,8 +99,8 @@ typedef struct st_mysql_res { MYSQL_ROW row; MYSQL_ROW current_row; unsigned int field_count, current_field; - my_bool eof; - my_bool unbuffered_fetch_cancelled; + bool eof; + bool unbuffered_fetch_cancelled; } MYSQL_RES; @@ -110,7 +111,7 @@ typedef struct st_mysql_res { unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); -my_bool STDCALL mysql_eof(MYSQL_RES *res); +bool STDCALL mysql_eof(MYSQL_RES *res); MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr); MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); @@ -134,12 +135,12 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL * STDCALL mysql_init(MYSQL *mysql); -my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, - const char *cert, const char *ca, - const char *capath, const char *cipher); +bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, + const char *cert, const char *ca, + const char *capath, const char *cipher); const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, - const char *passwd, const char *db); +bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, + const char *passwd, const char *db); MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, diff --git a/rapid/plugin/x/mysqlxtest_src/mysqlx/mysqlx_priv.h b/rapid/plugin/x/mysqlxtest_src/mysqlx/mysqlx_priv.h index 899032c56473..94a571200772 100644 --- a/rapid/plugin/x/mysqlxtest_src/mysqlx/mysqlx_priv.h +++ b/rapid/plugin/x/mysqlxtest_src/mysqlx/mysqlx_priv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -37,7 +37,7 @@ typedef struct st_mysql int last_error_no; char *last_error; - my_bool free_me; /* If free in mysql_close */ + bool free_me; /* If free in mysql_close */ #if 0 NET net; /* Communication parameters */ unsigned char *connector_fd; /* ConnectorFd for SSL */ @@ -61,7 +61,7 @@ typedef struct st_mysql struct st_mysql_options options; enum mysql_status status; - my_bool reconnect; /* set to 1 if automatic reconnect */ + bool reconnect; /* set to 1 if automatic reconnect */ LIST *stmts; /* list of all statements */ @@ -71,7 +71,7 @@ typedef struct st_mysql Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag from mysql_stmt_close if close had to cancel result set of this object. */ - my_bool *unbuffered_fetch_owner; + bool *unbuffered_fetch_owner; /* needed for embedded server - no net buffer to store the 'info' */ char *info_buffer; void *extension; diff --git a/rapid/plugin/x/ngs/include/ngs/protocol/row_builder.h b/rapid/plugin/x/ngs/include/ngs/protocol/row_builder.h index bb7651c12c46..4d80b72241f7 100644 --- a/rapid/plugin/x/ngs/include/ngs/protocol/row_builder.h +++ b/rapid/plugin/x/ngs/include/ngs/protocol/row_builder.h @@ -48,7 +48,7 @@ namespace ngs void end_row(); void add_null_field(); - void add_longlong_field(longlong value, my_bool unsigned_flag); + void add_longlong_field(longlong value, bool unsigned_flag); void add_decimal_field(const decimal_t * value); void add_decimal_field(const char * const value, size_t length); void add_double_field(double value); diff --git a/rapid/plugin/x/ngs/src/protocol/row_builder.cc b/rapid/plugin/x/ngs/src/protocol/row_builder.cc index 81b5ea632fb7..2a36aa440045 100644 --- a/rapid/plugin/x/ngs/src/protocol/row_builder.cc +++ b/rapid/plugin/x/ngs/src/protocol/row_builder.cc @@ -93,7 +93,7 @@ void Row_builder::add_null_field() } -void Row_builder::add_longlong_field(longlong value, my_bool unsigned_flag) +void Row_builder::add_longlong_field(longlong value, bool unsigned_flag) { ADD_FIELD_HEADER(); diff --git a/rapid/plugin/x/src/streaming_command_delegate.cc b/rapid/plugin/x/src/streaming_command_delegate.cc index 06a2cbffd0b5..cc396ce20f3a 100644 --- a/rapid/plugin/x/src/streaming_command_delegate.cc +++ b/rapid/plugin/x/src/streaming_command_delegate.cc @@ -264,7 +264,7 @@ int Streaming_command_delegate::get_null() int Streaming_command_delegate::get_integer(longlong value) { - my_bool unsigned_flag = (m_field_types[m_proto->row_builder().get_num_fields()].flags & UNSIGNED_FLAG) != 0; + bool unsigned_flag = (m_field_types[m_proto->row_builder().get_num_fields()].flags & UNSIGNED_FLAG) != 0; return get_longlong(value, unsigned_flag); } diff --git a/sql-common/client.cc b/sql-common/client.cc index 01c8792bde0b..55ce11748c6e 100644 --- a/sql-common/client.cc +++ b/sql-common/client.cc @@ -291,7 +291,7 @@ void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate) @c my_net_init() and net_end() */ -static my_bool my_net_is_inited(NET *net) +static bool my_net_is_inited(NET *net) { return net->buff != NULL; } @@ -359,7 +359,7 @@ static HANDLE create_named_pipe(MYSQL *mysql, DWORD connect_timeout, char pipe_name[1024]; DWORD dwMode; int i; - my_bool testing_named_pipes=0; + bool testing_named_pipes=0; const char *host= *arg_host, *unix_socket= *arg_unix_socket; if ( ! unix_socket || (unix_socket)[0] == 0x00) @@ -742,7 +742,7 @@ void read_ok_ex(MYSQL *mysql, ulong length) struct charset_info_st *saved_cs; char charset_name[64]; - my_bool is_charset; + bool is_charset; STATE_INFO *info= NULL; enum enum_session_state_type type; @@ -1063,8 +1063,8 @@ void read_ok_ex(MYSQL *mysql, ulong length) */ ulong -cli_safe_read_with_ok(MYSQL *mysql, my_bool parse_ok, - my_bool *is_data_packet) +cli_safe_read_with_ok(MYSQL *mysql, bool parse_ok, + bool *is_data_packet) { NET *net= &mysql->net; ulong len=0; @@ -1208,7 +1208,7 @@ cli_safe_read_with_ok(MYSQL *mysql, my_bool parse_ok, @retval The length of the packet that was read or packet_error in case of error. In case of error its description is stored in mysql handle. */ -ulong cli_safe_read(MYSQL *mysql, my_bool *is_data_packet) +ulong cli_safe_read(MYSQL *mysql, bool *is_data_packet) { return cli_safe_read_with_ok(mysql, 0, is_data_packet); } @@ -1224,15 +1224,15 @@ void free_rows(MYSQL_DATA *cur) } } -my_bool +bool cli_advanced_command(MYSQL *mysql, enum enum_server_command command, const uchar *header, size_t header_length, - const uchar *arg, size_t arg_length, my_bool skip_check, + const uchar *arg, size_t arg_length, bool skip_check, MYSQL_STMT *stmt) { NET *net= &mysql->net; - my_bool result= 1; - my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; + bool result= 1; + bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; DBUG_ENTER("cli_advanced_command"); if (mysql->net.vio == 0) @@ -1400,10 +1400,10 @@ void free_old_query(MYSQL *mysql) is set in this case, FALSE otherwise. */ -static my_bool flush_one_result(MYSQL *mysql) +static bool flush_one_result(MYSQL *mysql) { ulong packet_length; - my_bool is_data_packet; + bool is_data_packet; DBUG_ASSERT(mysql->status != MYSQL_STATUS_READY); @@ -1458,9 +1458,9 @@ static my_bool flush_one_result(MYSQL *mysql) based on what we got from network. */ -static my_bool opt_flush_ok_packet(MYSQL *mysql, my_bool *is_ok_packet) +static bool opt_flush_ok_packet(MYSQL *mysql, bool *is_ok_packet) { - my_bool is_data_packet; + bool is_data_packet; ulong packet_length= cli_safe_read(mysql, &is_data_packet); if (packet_length == packet_error) @@ -1492,7 +1492,7 @@ static my_bool opt_flush_ok_packet(MYSQL *mysql, my_bool *is_ok_packet) Flush result set sent from server */ -static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results) +static void cli_flush_use_result(MYSQL *mysql, bool flush_all_results) { /* Clear the current execution status */ DBUG_ENTER("cli_flush_use_result"); @@ -1506,7 +1506,7 @@ static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results) while (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) { - my_bool is_ok_packet; + bool is_ok_packet; if (opt_flush_ok_packet(mysql, &is_ok_packet)) DBUG_VOID_RETURN; /* An error occurred. */ if (is_ok_packet) @@ -1550,7 +1550,7 @@ static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results) #ifdef _WIN32 -static my_bool is_NT(void) +static bool is_NT(void) { char *os=getenv("OS"); return (os && !strcmp(os, "Windows_NT")) ? 1 : 0; @@ -2102,7 +2102,7 @@ static void cli_fetch_lengths(ulong *to, MYSQL_ROW column, */ static int -unpack_field(MYSQL *mysql, MEM_ROOT *alloc, my_bool default_value, +unpack_field(MYSQL *mysql, MEM_ROOT *alloc, bool default_value, uint server_capabilities, MYSQL_ROWS *row, MYSQL_FIELD *field) { ulong lengths[9]; /* Max length of each field */ @@ -2208,7 +2208,7 @@ unpack_field(MYSQL *mysql, MEM_ROOT *alloc, my_bool default_value, MYSQL_FIELD * unpack_fields(MYSQL *mysql, MYSQL_ROWS *data,MEM_ROOT *alloc,uint fields, - my_bool default_value, uint server_capabilities) + bool default_value, uint server_capabilities) { MYSQL_ROWS *row; MYSQL_FIELD *field,*result; @@ -2345,7 +2345,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, MYSQL_DATA *result; MYSQL_ROWS **prev_ptr,*cur; NET *net = &mysql->net; - my_bool is_data_packet; + bool is_data_packet; DBUG_ENTER("cli_read_rows"); if ((pkt_len= cli_safe_read(mysql, &is_data_packet)) == packet_error) @@ -2460,7 +2460,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths) { uint field; ulong pkt_len,len; - my_bool is_data_packet; + bool is_data_packet; uchar *pos, *prev_pos, *end_pos; NET *net= &mysql->net; @@ -2635,7 +2635,7 @@ void mysql_extension_free(struct st_mysql_extension* ext) NB! Errors are not reported until you do mysql_real_connect. */ -my_bool STDCALL +bool STDCALL mysql_ssl_set(MYSQL *mysql MY_ATTRIBUTE((unused)) , const char *key MY_ATTRIBUTE((unused)), const char *cert MY_ATTRIBUTE((unused)), @@ -2643,7 +2643,7 @@ mysql_ssl_set(MYSQL *mysql MY_ATTRIBUTE((unused)) , const char *capath MY_ATTRIBUTE((unused)), const char *cipher MY_ATTRIBUTE((unused))) { - my_bool result= 0; + bool result= 0; DBUG_ENTER("mysql_ssl_set"); #if defined(HAVE_OPENSSL) result= @@ -2853,7 +2853,7 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c before calling mysql_real_connect ! */ -static my_bool cli_read_query_result(MYSQL *mysql); +static bool cli_read_query_result(MYSQL *mysql); static MYSQL_RES *cli_use_result(MYSQL *mysql); int cli_read_change_user_result(MYSQL *mysql) @@ -4018,9 +4018,9 @@ static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio, } -my_bool libmysql_cleartext_plugin_enabled= 0; +bool libmysql_cleartext_plugin_enabled= 0; -static my_bool check_plugin_enabled(MYSQL *mysql, auth_plugin_t *plugin) +static bool check_plugin_enabled(MYSQL *mysql, auth_plugin_t *plugin) { if (plugin == &clear_password_client_plugin && (!libmysql_cleartext_plugin_enabled && @@ -4283,7 +4283,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *scramble_plugin; ulong pkt_length; NET *net= &mysql->net; - my_bool scramble_buffer_allocated= FALSE; + bool scramble_buffer_allocated= FALSE; #ifdef _WIN32 HANDLE hPipe=INVALID_HANDLE_VALUE; #endif @@ -4942,7 +4942,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, char **ptr= mysql->options.init_commands->begin(); char **end_command= mysql->options.init_commands->end(); - my_bool reconnect=mysql->reconnect; + bool reconnect=mysql->reconnect; mysql->reconnect=0; for (; ptr < end_command; ptr++) @@ -4989,7 +4989,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, } -my_bool mysql_reconnect(MYSQL *mysql) +bool mysql_reconnect(MYSQL *mysql) { MYSQL tmp_mysql; DBUG_ENTER("mysql_reconnect"); @@ -5486,7 +5486,7 @@ void STDCALL mysql_close(MYSQL *mysql) } -static my_bool cli_read_query_result(MYSQL *mysql) +static bool cli_read_query_result(MYSQL *mysql) { uchar *pos; ulong field_count; @@ -5861,14 +5861,14 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) MYF(MY_WME)); break; case MYSQL_SECURE_AUTH: - if (!*(my_bool *) arg) + if (!*(bool *) arg) DBUG_RETURN(1); break; case MYSQL_REPORT_DATA_TRUNCATION: - mysql->options.report_data_truncation= MY_TEST(*(my_bool *) arg); + mysql->options.report_data_truncation= MY_TEST(*(bool *) arg); break; case MYSQL_OPT_RECONNECT: - mysql->reconnect= *(my_bool *) arg; + mysql->reconnect= *(bool *) arg; break; case MYSQL_OPT_BIND: my_free(mysql->options.ci.bind_address); @@ -6004,7 +6004,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) case MYSQL_ENABLE_CLEARTEXT_PLUGIN: ENSURE_EXTENSIONS_PRESENT(&mysql->options); mysql->options.extension->enable_cleartext_plugin= - (*(my_bool*) arg) ? TRUE : FALSE; + (*(bool*) arg) ? TRUE : FALSE; break; case MYSQL_OPT_RETRY_COUNT: ENSURE_EXTENSIONS_PRESENT(&mysql->options); @@ -6012,7 +6012,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) (*(uint*) arg); break; case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: - if (*(my_bool*) arg) + if (*(bool*) arg) mysql->options.client_flag|= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; else mysql->options.client_flag&= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; @@ -6049,7 +6049,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_PROTOCOL, MYSQL_OPT_SSL_MODE, MYSQL_OPT_RETRY_COUNT - my_bool + bool MYSQL_OPT_COMPRESS, MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SECURE_AUTH, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, @@ -6094,7 +6094,7 @@ mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg) *((uint *)arg)= mysql->options.write_timeout; break; case MYSQL_OPT_COMPRESS: - *((my_bool *)arg) = mysql->options.compress ? TRUE : FALSE; + *((bool *)arg) = mysql->options.compress ? TRUE : FALSE; break; case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/ *((uint *)arg)= (mysql->options.client_flag & CLIENT_LOCAL_FILES) ? @@ -6123,17 +6123,17 @@ mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg) #endif break; case MYSQL_OPT_USE_REMOTE_CONNECTION: - *((my_bool *)arg)= + *((bool *)arg)= (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION) ? TRUE : FALSE; break; case MYSQL_OPT_USE_EMBEDDED_CONNECTION: - *((my_bool *)arg) = + *((bool *)arg) = (mysql->options.methods_to_use == MYSQL_OPT_USE_EMBEDDED_CONNECTION) ? TRUE : FALSE; break; case MYSQL_OPT_GUESS_CONNECTION: - *((my_bool *)arg) = + *((bool *)arg) = (mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION) ? TRUE : FALSE; break; @@ -6141,13 +6141,13 @@ mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg) *((char **)arg) = mysql->options.ci.client_ip; break; case MYSQL_SECURE_AUTH: - *((my_bool *)arg)= TRUE; + *((bool *)arg)= TRUE; break; case MYSQL_REPORT_DATA_TRUNCATION: - *((my_bool *)arg)= mysql->options.report_data_truncation; + *((bool *)arg)= mysql->options.report_data_truncation; break; case MYSQL_OPT_RECONNECT: - *((my_bool *)arg)= mysql->reconnect; + *((bool *)arg)= mysql->reconnect; break; case MYSQL_OPT_BIND: *((char **)arg)= mysql->options.ci.bind_address; @@ -6200,12 +6200,12 @@ mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg) mysql->options.extension->server_public_key_path : NULL; break; case MYSQL_ENABLE_CLEARTEXT_PLUGIN: - *((my_bool *)arg)= (mysql->options.extension && + *((bool *)arg)= (mysql->options.extension && mysql->options.extension->enable_cleartext_plugin) ? TRUE : FALSE; break; case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: - *((my_bool*)arg)= (mysql->options.client_flag & + *((bool*)arg)= (mysql->options.client_flag & CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS) ? TRUE : FALSE; break; diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index ca99b729e5c6..1f6f2b92e308 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -93,7 +93,7 @@ struct st_client_plugin_int { struct st_mysql_client_plugin *plugin; }; -static my_bool initialized= 0; +static bool initialized= 0; static MEM_ROOT mem_root; static const char *plugin_declarations_sym= "_mysql_client_plugin_declaration_"; diff --git a/sql-common/net_serv.cc b/sql-common/net_serv.cc index 9b35b2738b5f..871e425e9b38 100644 --- a/sql-common/net_serv.cc +++ b/sql-common/net_serv.cc @@ -78,11 +78,11 @@ extern void thd_increment_bytes_received(size_t length); #define VIO_SOCKET_ERROR ((size_t) -1) -static my_bool net_write_buff(NET *, const uchar *, size_t); +static bool net_write_buff(NET *, const uchar *, size_t); /** Init with packet info. */ -my_bool my_net_init(NET *net, Vio* vio) +bool my_net_init(NET *net, Vio* vio) { DBUG_ENTER("my_net_init"); net->vio = vio; @@ -130,7 +130,7 @@ void net_claim_memory_ownership(NET *net) /** Realloc the packet buffer. */ -my_bool net_realloc(NET *net, size_t length) +bool net_realloc(NET *net, size_t length) { uchar *buff; size_t pkt_length; @@ -184,7 +184,7 @@ my_bool net_realloc(NET *net, size_t length) */ void net_clear(NET *net, - my_bool check_buffer MY_ATTRIBUTE((unused))) + bool check_buffer MY_ATTRIBUTE((unused))) { DBUG_ENTER("net_clear"); @@ -201,9 +201,9 @@ void net_clear(NET *net, /** Flush write_buffer if not empty. */ -my_bool net_flush(NET *net) +bool net_flush(NET *net) { - my_bool error= 0; + bool error= 0; DBUG_ENTER("net_flush"); if (net->buff != net->write_pos) { @@ -228,10 +228,10 @@ my_bool net_flush(NET *net) @retval FALSE Operation should not be retried. Fatal error. */ -static my_bool +static bool net_should_retry(NET *net, uint *retry_count) { - my_bool retry; + bool retry; #ifndef MYSQL_SERVER /* @@ -359,7 +359,7 @@ net_should_retry(NET *net, uint *retry_count) @note If compression is used, the original packet is modified! */ -my_bool my_net_write(NET *net, const uchar *packet, size_t len) +bool my_net_write(NET *net, const uchar *packet, size_t len) { uchar buff[NET_HEADER_SIZE]; int rc; @@ -433,7 +433,7 @@ my_bool my_net_write(NET *net, const uchar *packet, size_t len) 1 error */ -my_bool +bool net_write_command(NET *net,uchar command, const uchar *header, size_t head_len, const uchar *packet, size_t len) @@ -504,7 +504,7 @@ net_write_command(NET *net,uchar command, 1 */ -static my_bool +static bool net_write_buff(NET *net, const uchar *packet, size_t len) { ulong left_length; @@ -565,7 +565,7 @@ net_write_buff(NET *net, const uchar *packet, size_t len) @return TRUE on error, FALSE on success. */ -static my_bool +static bool net_write_raw_loop(NET *net, const uchar *buf, size_t count) { unsigned int retry_count= 0; @@ -676,10 +676,10 @@ compress_packet(NET *net, const uchar *packet, size_t *length) @return TRUE on error, FALSE on success. */ -my_bool +bool net_write_packet(NET *net, const uchar *packet, size_t length) { - my_bool res; + bool res; DBUG_ENTER("net_write_packet"); #if defined(MYSQL_SERVER) @@ -732,7 +732,7 @@ net_write_packet(NET *net, const uchar *packet, size_t length) @return TRUE on error, FALSE on success. */ -static my_bool net_read_raw_loop(NET *net, size_t count) +static bool net_read_raw_loop(NET *net, size_t count) { bool eof= false; unsigned int retry_count= 0; @@ -803,11 +803,11 @@ static my_bool net_read_raw_loop(NET *net, size_t count) @return TRUE on error, FALSE on success. */ -static my_bool net_read_packet_header(NET *net) +static bool net_read_packet_header(NET *net) { uchar pkt_nr; size_t count= NET_HEADER_SIZE; - my_bool rc; + bool rc; if (net->compress) count+= COMP_HEADER_SIZE; diff --git a/sql/auth/auth_common.h b/sql/auth/auth_common.h index 0af879cca073..fb0d5600f647 100644 --- a/sql/auth/auth_common.h +++ b/sql/auth/auth_common.h @@ -615,11 +615,11 @@ class Acl_load_user_table_schema_factory }; extern bool mysql_user_table_is_in_short_password_format; -extern my_bool disconnect_on_expired_password; +extern bool disconnect_on_expired_password; extern const char *any_db; // Special symbol for check_access /** controls the extra checks on plugin availability for mysql.user records */ -extern my_bool validate_user_plugins; +extern bool validate_user_plugins; /* Function Declarations */ @@ -675,16 +675,16 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr); int wild_case_compare(CHARSET_INFO *cs, const char *str, size_t str_len, const char *wildstr, size_t wildstr_len); bool hostname_requires_resolving(const char *hostname); -my_bool acl_init(bool dont_read_acl_tables); +bool acl_init(bool dont_read_acl_tables); void acl_free(bool end=0); -my_bool acl_reload(THD *thd); +bool acl_reload(THD *thd); bool check_engine_type_for_acl_table(THD *thd); bool grant_init(bool skip_grant_tables); void grant_free(void); -my_bool grant_reload(THD *thd); +bool grant_reload(THD *thd); bool roles_init_from_tables(THD *thd); ulong acl_get(THD *thd, const char *host, const char *ip, - const char *user, const char *db, my_bool db_is_pattern); + const char *user, const char *db, bool db_is_pattern); bool is_acl_user(THD *thd, const char *host, const char *user); bool acl_getroot(THD *thd, Security_context *sctx, char *user, char *host, char *ip, const char *db); @@ -758,7 +758,7 @@ bool is_secure_transport(int vio_type); bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables); bool check_single_table_access(THD *thd, ulong privilege, - TABLE_LIST *tables, bool no_errors); + TABLE_LIST *tables, bool no_errors); bool check_routine_access(THD *thd, ulong want_access, const char *db, char *name, bool is_proc, bool no_errors); bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table); @@ -810,7 +810,7 @@ typedef enum ssl_artifacts_status ulong get_global_acl_cache_size(); #if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL) -extern my_bool opt_auto_generate_certs; +extern bool opt_auto_generate_certs; bool do_auto_cert_generation(ssl_artifacts_status auto_detection_status); #endif /* HAVE_OPENSSL && !HAVE_YASSL */ diff --git a/sql/auth/auth_internal.h b/sql/auth/auth_internal.h index 41f0aff82f79..70d571a7116c 100644 --- a/sql/auth/auth_internal.h +++ b/sql/auth/auth_internal.h @@ -102,7 +102,7 @@ bool rsa_auth_status(); void rebuild_check_host(void); ACL_USER * find_acl_user(const char *host, const char *user, - my_bool exact); + bool exact); ACL_PROXY_USER * acl_find_proxy_user(const char *user, const char *host, const char *ip, diff --git a/sql/auth/password.c b/sql/auth/password.c index 8aac28e87d38..207b5361206a 100644 --- a/sql/auth/password.c +++ b/sql/auth/password.c @@ -323,7 +323,7 @@ scramble(char *to, const char *message, const char *password) !0 password is invalid */ -static my_bool +static bool check_scramble_sha1(const uchar *scramble_arg, const char *message, const uint8 *hash_stage2) { @@ -342,7 +342,7 @@ check_scramble_sha1(const uchar *scramble_arg, const char *message, return MY_TEST(memcmp(hash_stage2, hash_stage2_reassured, SHA1_HASH_SIZE)); } -my_bool +bool check_scramble(const uchar *scramble_arg, const char *message, const uint8 *hash_stage2) { diff --git a/sql/auth/service_security_context.cc b/sql/auth/service_security_context.cc index 528a67867ce0..2bf6db0133f9 100644 --- a/sql/auth/service_security_context.cc +++ b/sql/auth/service_security_context.cc @@ -187,7 +187,7 @@ my_svc_bool security_context_lookup(MYSQL_SECURITY_CONTEXT ctx, const char *ip, const char *db) { THD *tmp_thd= NULL; - my_bool retval; + bool retval; if (current_thd == NULL) { tmp_thd= create_thd(false, true, false, PSI_NOT_INSTRUMENTED); diff --git a/sql/auth/sql_auth_cache.cc b/sql/auth/sql_auth_cache.cc index ebaf3ab2015d..73fb4c76eac6 100644 --- a/sql/auth/sql_auth_cache.cc +++ b/sql/auth/sql_auth_cache.cc @@ -123,7 +123,7 @@ bool initialized=0; bool acl_cache_initialized= false; bool allow_all_hosts=1; uint grant_version=0; /* Version of priv tables */ -my_bool validate_user_plugins= TRUE; +bool validate_user_plugins= TRUE; #define IP_ADDR_STRLEN (3 + 1 + 3 + 1 + 3 + 1 + 3) #define ACL_KEY_LENGTH (IP_ADDR_STRLEN + 1 + NAME_LEN + \ @@ -889,7 +889,7 @@ bool GRANT_TABLE::init(TABLE *col_privs) */ ACL_USER * -find_acl_user(const char *host, const char *user, my_bool exact) +find_acl_user(const char *host, const char *user, bool exact) { DBUG_ENTER("find_acl_user"); DBUG_PRINT("enter",("host: '%s' user: '%s'",host,user)); @@ -1110,7 +1110,7 @@ insert_entry_in_db_cache(THD *thd, acl_entry *entry) */ ulong acl_get(THD *thd, const char *host, const char *ip, - const char *user, const char *db, my_bool db_is_pattern) + const char *user, const char *db, bool db_is_pattern) { ulong host_access= ~(ulong)0, db_access= 0; size_t key_length, copy_length; @@ -1569,10 +1569,10 @@ void roles_init(THD *thd) 1 Could not initialize grant's */ -my_bool acl_init(bool dont_read_acl_tables) +bool acl_init(bool dont_read_acl_tables) { THD *thd; - my_bool return_val; + bool return_val; DBUG_ENTER("acl_init"); init_acl_cache(); @@ -1651,11 +1651,11 @@ my_bool acl_init(bool dont_read_acl_tables) TRUE Error */ -static my_bool acl_load(THD *thd, TABLE_LIST *tables) +static bool acl_load(THD *thd, TABLE_LIST *tables) { TABLE *table; READ_RECORD read_record_info; - my_bool return_val= TRUE; + bool return_val= TRUE; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; char tmp_name[NAME_LEN+1]; sql_mode_t old_sql_mode= thd->variables.sql_mode; @@ -2483,12 +2483,12 @@ static bool is_expected_or_transient_error(THD *thd) TRUE Failure */ -my_bool acl_reload(THD *thd) +bool acl_reload(THD *thd) { TABLE_LIST tables[3]; MEM_ROOT old_mem; - my_bool return_val= TRUE; + bool return_val= TRUE; Prealloced_array *old_acl_users= NULL; Prealloced_array *old_acl_dbs= NULL; Prealloced_arraytable->file->has_transactions(); + bool trans= table->table->file->has_transactions(); if (table->lock_descriptor().type >= TL_WRITE_ALLOW_WRITE) { diff --git a/sql/conn_handler/init_net_server_extension.cc b/sql/conn_handler/init_net_server_extension.cc index c6af0a7c3efe..2fcfc05d0c3b 100644 --- a/sql/conn_handler/init_net_server_extension.cc +++ b/sql/conn_handler/init_net_server_extension.cc @@ -62,7 +62,7 @@ static void net_before_header_psi(struct st_net *net, void *user_data, } static void net_after_header_psi(struct st_net *net, void *user_data, - size_t /* unused: count */, my_bool rc) + size_t /* unused: count */, bool rc) { THD *thd; thd= static_cast (user_data); diff --git a/sql/dd/dd_upgrade.cc b/sql/dd/dd_upgrade.cc index 6cc199de6f31..78f0635266da 100644 --- a/sql/dd/dd_upgrade.cc +++ b/sql/dd/dd_upgrade.cc @@ -2015,7 +2015,7 @@ static bool migrate_table_to_dd(THD *thd, } // Check presence of old data types - my_bool avoid_temporal_upgrade_saved= avoid_temporal_upgrade; + bool avoid_temporal_upgrade_saved= avoid_temporal_upgrade; avoid_temporal_upgrade= false; error= check_table_for_old_types(table); avoid_temporal_upgrade= avoid_temporal_upgrade_saved; @@ -2753,7 +2753,7 @@ static bool update_event_timing_fields(THD *thd, TABLE *table, { MYSQL_TIME time; my_time_t last_executed; - my_bool not_used= FALSE; + bool not_used= FALSE; table->field[ET_FIELD_LAST_EXECUTED]->get_date(&time, TIME_NO_ZERO_DATE); last_executed= my_tz_OFFSET0->TIME_to_gmt_sec(&time, ¬_used); @@ -2809,7 +2809,7 @@ static bool set_status_and_interval_for_event(THD *thd, TABLE *table, Event_parse_data *et_parse_data) { char *ptr; - my_bool not_used= FALSE; + bool not_used= FALSE; MYSQL_TIME time; if (!table->field[ET_FIELD_INTERVAL_EXPR]->is_null()) @@ -2913,7 +2913,7 @@ static bool migrate_event_to_dd(THD *thd, TABLE *event_table) else et_parse_data.comment.length= strlen(et_parse_data.comment.str); - my_bool not_used= FALSE; + bool not_used= FALSE; et_parse_data.starts_null= event_table->field[ET_FIELD_STARTS]->is_null(); if (!et_parse_data.starts_null) { diff --git a/sql/dd/impl/bootstrapper.cc b/sql/dd/impl/bootstrapper.cc index d523b63f0350..e601d229e4fa 100644 --- a/sql/dd/impl/bootstrapper.cc +++ b/sql/dd/impl/bootstrapper.cc @@ -93,7 +93,7 @@ tables only from SE but not from Dictionary cache. This flag is used to avoid deletion of dd::Table objects from cache. */ -my_bool dd_upgrade_flag= false; +bool dd_upgrade_flag= false; /* The variable is used to differentiate the actions within SE during a @@ -104,7 +104,7 @@ my_bool dd_upgrade_flag= false; se_private_data should not be retrieved from InnoDB in case dd::Table objects are being created to check if we are upgrading or restarting. */ -my_bool dd_upgrade_skip_se= false; +bool dd_upgrade_skip_se= false; // Execute a single SQL query. @@ -260,7 +260,7 @@ bool store_single_schema_table_meta_data(THD *thd, false on success true when fails to store the metadata. */ -my_bool store_schema_table_meta_data(THD *thd, plugin_ref plugin, void *unused) +bool store_schema_table_meta_data(THD *thd, plugin_ref plugin, void *unused) { // Fetch schema ID of IS schema. const dd::Schema *IS_schema_obj= nullptr; diff --git a/sql/dd/impl/raw/raw_record.cc b/sql/dd/impl/raw/raw_record.cc index 1911183f47cb..54106418f278 100644 --- a/sql/dd/impl/raw/raw_record.cc +++ b/sql/dd/impl/raw/raw_record.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -272,7 +272,7 @@ Object_id Raw_record::read_ref_id(int field_no) const my_time_t Raw_record::read_time(int field_no) const { MYSQL_TIME time; - my_bool not_used; + bool not_used; field(field_no)->get_date(&time, TIME_DATETIME_ONLY); return my_tz_OFFSET0->TIME_to_gmt_sec(&time,¬_used); diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 0b837f444f2e..a44ebd3518ff 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -516,7 +516,7 @@ add_interval(MYSQL_TIME *ltime, const Time_zone *time_zone, if (date_add_interval(ltime, scale, interval)) return 0; - my_bool not_used; + bool not_used; return time_zone->TIME_to_gmt_sec(ltime, ¬_used); } diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index d482a6632aee..10572854146f 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -106,9 +106,9 @@ class Event_queue_element : public Event_basic my_time_t m_execute_at; my_time_t m_starts; my_time_t m_ends; - my_bool m_starts_null; - my_bool m_ends_null; - my_bool m_execute_at_null; + bool m_starts_null; + bool m_ends_null; + bool m_execute_at_null; longlong m_expression; interval_type m_interval; diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc index e5c64e71650c..9a2199033340 100644 --- a/sql/event_parse_data.cc +++ b/sql/event_parse_data.cc @@ -212,7 +212,7 @@ Event_parse_data::check_dates(THD *thd, int previous_on_completion) int Event_parse_data::init_execute_at(THD *thd) { - my_bool not_used; + bool not_used; MYSQL_TIME ltime; my_time_t ltime_utc; @@ -382,7 +382,7 @@ Event_parse_data::init_interval(THD *thd) int Event_parse_data::init_starts(THD *thd) { - my_bool not_used; + bool not_used; MYSQL_TIME ltime; my_time_t ltime_utc; @@ -436,7 +436,7 @@ Event_parse_data::init_starts(THD *thd) int Event_parse_data::init_ends(THD *thd) { - my_bool not_used; + bool not_used; MYSQL_TIME ltime; my_time_t ltime_utc; diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h index 1e77124081ec..6d2239fbbaa4 100644 --- a/sql/event_parse_data.h +++ b/sql/event_parse_data.h @@ -86,9 +86,9 @@ class Event_parse_data : public Sql_alloc my_time_t starts; my_time_t ends; my_time_t execute_at; - my_bool starts_null; - my_bool ends_null; - my_bool execute_at_null; + bool starts_null; + bool ends_null; + bool execute_at_null; sp_name *identifier; Item* item_expression; diff --git a/sql/events.cc b/sql/events.cc index 2948c4ec4e74..9fa8d0bb748b 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2017 Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -819,7 +819,7 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) */ bool -Events::init(my_bool opt_noacl_or_bootstrap) +Events::init(bool opt_noacl_or_bootstrap) { THD *thd; diff --git a/sql/events.h b/sql/events.h index 96f53be8a65c..86fff3141da1 100644 --- a/sql/events.h +++ b/sql/events.h @@ -118,7 +118,7 @@ class Events /* A hack needed for Event_queue_element */ static Event_db_repository *get_db_repository() { return db_repository; } - static bool init(my_bool opt_noacl); + static bool init(bool opt_noacl); static void deinit(); diff --git a/sql/field.cc b/sql/field.cc index 9323a8bbe38f..b87b36d31e47 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1542,7 +1542,7 @@ bool Field::warn_if_overflow(int op_result) This is used for printing bit_fields as numbers while debugging. */ -String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val) +String *Field::val_int_as_str(String *val_buffer, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_READ; const CHARSET_INFO *cs= &my_charset_bin; @@ -7099,7 +7099,7 @@ type_conversion_status Field_str::store(double nr) char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; uint local_char_length= field_length / charset()->mbmaxlen; size_t length= 0; - my_bool error= (local_char_length == 0); + bool error= (local_char_length == 0); // my_gcvt() requires width > 0, and we may have a CHAR(0) column. if (!error) diff --git a/sql/field.h b/sql/field.h index f8e810268fc0..2ef6e62c3efe 100644 --- a/sql/field.h +++ b/sql/field.h @@ -933,7 +933,7 @@ class Field: public Proto_field, public Sql_alloc This trickery is used to decrease a number of malloc calls. */ virtual String *val_str(String*,String *)=0; - String *val_int_as_str(String *val_buffer, my_bool unsigned_flag); + String *val_int_as_str(String *val_buffer, bool unsigned_flag); /* str_needs_quotes() returns TRUE if the value returned by val_str() needs to be quoted when used in constructing an SQL query. @@ -1944,7 +1944,7 @@ class Field_longstr :public Field_str /* base class for float and double and decimal (old one) */ class Field_real :public Field_num { public: - my_bool not_fixed; + bool not_fixed; Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar auto_flags_arg, @@ -2470,7 +2470,7 @@ class Field_double :public Field_real { NONE, field_name_arg, dec_arg, 0, 0) {} Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, - uint8 dec_arg, my_bool not_fixed_arg) + uint8 dec_arg, bool not_fixed_arg) :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, NONE, field_name_arg, dec_arg, 0, 0) {not_fixed= not_fixed_arg; } @@ -4619,7 +4619,7 @@ class Copy_field :public Sql_alloc { public: uchar *from_ptr,*to_ptr; uchar *from_null_ptr,*to_null_ptr; - my_bool *null_row; + bool *null_row; uint from_bit,to_bit; String tmp; // For items diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a9cf106fb8ff..501bc98d1d73 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -105,9 +105,9 @@ static char* opt_ndb_recv_thread_cpu_mask; static char* opt_ndb_index_stat_option; static char* opt_ndb_connectstring; static uint opt_ndb_nodeid; -static my_bool opt_ndb_read_backup; +static bool opt_ndb_read_backup; static ulong opt_ndb_data_node_neighbour; -static my_bool opt_ndb_fully_replicated; +static bool opt_ndb_fully_replicated; #define MYSQL_VERSION_NDB_DEFAULT_COLUMN_FORMAT_DYNAMIC 50711 enum ndb_default_colum_format_enum { @@ -14942,7 +14942,7 @@ uint ndb_get_commitcount(THD *thd, const char *norm_name, */ -static my_bool +static bool ndbcluster_cache_retrieval_allowed(THD *thd, const char *full_name, uint full_name_len, ulonglong *engine_data) @@ -15029,7 +15029,7 @@ ndbcluster_cache_retrieval_allowed(THD *thd, FALSE No, don't cach the query */ -my_bool +bool ha_ndbcluster::register_query_cache_table(THD *thd, char *full_name, size_t full_name_len, @@ -16013,7 +16013,7 @@ multi_range_max_ranges(int num_ranges, ulong bufsize) /* Return the size in HANDLER_BUFFER of a variable-sized entry. */ static ulong -multi_range_entry_size(my_bool use_keyop, ulong reclength) +multi_range_entry_size(bool use_keyop, ulong reclength) { /* Space for type byte. */ ulong len= 1; @@ -16045,7 +16045,7 @@ multi_range_entry_type(uchar *p) static uchar * multi_range_next_entry(uchar *p, ulong reclength) { - my_bool use_keyop= multi_range_entry_type(p) < enum_ordered_range; + bool use_keyop= multi_range_entry_type(p) < enum_ordered_range; return p + multi_range_entry_size(use_keyop, reclength); } @@ -16081,7 +16081,7 @@ multi_range_put_custom(HANDLER_BUFFER *buffer, int range_no, char *custom) If a scan is not needed, we use a faster primary/unique key operation instead. */ -static my_bool +static bool read_multi_needs_scan(NDB_INDEX_TYPE cur_index_type, const KEY *key_info, const KEY_MULTI_RANGE *r, bool is_pushed) { @@ -16442,7 +16442,7 @@ int ha_ndbcluster::multi_range_start_retrievals(uint starting_range) { if (range_no >= max_range) break; - my_bool need_scan= + bool need_scan= read_multi_needs_scan(cur_index_type, key_info, &mrr_cur_range, is_pushed); if (row_buf + multi_range_entry_size(!need_scan, reclength) > end_of_buffer) break; @@ -20500,7 +20500,7 @@ static MYSQL_SYSVAR_ULONG( 0 /* block */ ); -my_bool opt_ndb_log_update_as_write; +bool opt_ndb_log_update_as_write; static MYSQL_SYSVAR_BOOL( log_update_as_write, /* name */ opt_ndb_log_update_as_write, /* var */ @@ -20514,7 +20514,7 @@ static MYSQL_SYSVAR_BOOL( ); -my_bool opt_ndb_log_updated_only; +bool opt_ndb_log_updated_only; static MYSQL_SYSVAR_BOOL( log_updated_only, /* name */ opt_ndb_log_updated_only, /* var */ @@ -20528,7 +20528,7 @@ static MYSQL_SYSVAR_BOOL( 1 /* default */ ); -my_bool opt_ndb_log_empty_update; +bool opt_ndb_log_empty_update; static MYSQL_SYSVAR_BOOL( log_empty_update, /* name */ opt_ndb_log_empty_update, /* var */ @@ -20544,7 +20544,7 @@ static MYSQL_SYSVAR_BOOL( 0 /* default */ ); -my_bool opt_ndb_log_orig; +bool opt_ndb_log_orig; static MYSQL_SYSVAR_BOOL( log_orig, /* name */ opt_ndb_log_orig, /* var */ @@ -20558,7 +20558,7 @@ static MYSQL_SYSVAR_BOOL( ); -my_bool opt_ndb_log_bin; +bool opt_ndb_log_bin; static MYSQL_SYSVAR_BOOL( log_bin, /* name */ opt_ndb_log_bin, /* var */ @@ -20571,7 +20571,7 @@ static MYSQL_SYSVAR_BOOL( ); -my_bool opt_ndb_log_binlog_index; +bool opt_ndb_log_binlog_index; static MYSQL_SYSVAR_BOOL( log_binlog_index, /* name */ opt_ndb_log_binlog_index, /* var */ @@ -20584,7 +20584,7 @@ static MYSQL_SYSVAR_BOOL( ); -static my_bool opt_ndb_log_empty_epochs; +static bool opt_ndb_log_empty_epochs; static MYSQL_SYSVAR_BOOL( log_empty_epochs, /* name */ opt_ndb_log_empty_epochs, /* var */ @@ -20600,7 +20600,7 @@ bool ndb_log_empty_epochs(void) return opt_ndb_log_empty_epochs; } -my_bool opt_ndb_log_apply_status; +bool opt_ndb_log_apply_status; static MYSQL_SYSVAR_BOOL( log_apply_status, /* name */ opt_ndb_log_apply_status, /* var */ @@ -20612,7 +20612,7 @@ static MYSQL_SYSVAR_BOOL( ); -my_bool opt_ndb_log_transaction_id; +bool opt_ndb_log_transaction_id; static MYSQL_SYSVAR_BOOL( log_transaction_id, /* name */ opt_ndb_log_transaction_id, /* var */ @@ -20623,7 +20623,7 @@ static MYSQL_SYSVAR_BOOL( 0 /* default */ ); -my_bool opt_ndb_clear_apply_status; +bool opt_ndb_clear_apply_status; static MYSQL_SYSVAR_BOOL( clear_apply_status, /* name */ opt_ndb_clear_apply_status, /* var */ diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 9326e03fc042..f6fd07116ba2 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -360,19 +360,20 @@ static void set_tabname(const char *pathname, char *tabname); */ int ndb_err(NdbTransaction*); - my_bool register_query_cache_table(THD *thd, char *table_key, - size_t key_length, - qc_engine_callback *engine_callback, - ulonglong *engine_data); -enum_alter_inplace_result + bool register_query_cache_table(THD *thd, char *table_key, + size_t key_length, + qc_engine_callback *engine_callback, + ulonglong *engine_data); + + enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info); -bool parse_comment_changes(NdbDictionary::Table *new_tab, - const NdbDictionary::Table *old_tab, - HA_CREATE_INFO *create_info, - THD *thd, - bool & max_rows_changed) const; + bool parse_comment_changes(NdbDictionary::Table *new_tab, + const NdbDictionary::Table *old_tab, + HA_CREATE_INFO *create_info, + THD *thd, + bool & max_rows_changed) const; bool prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 10881c1b3d07..d22042ab7f0b 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -49,18 +49,18 @@ #include "derror.h" // ER_THD #include "log.h" // sql_print_* -extern my_bool opt_ndb_log_orig; -extern my_bool opt_ndb_log_bin; -extern my_bool opt_ndb_log_update_as_write; -extern my_bool opt_ndb_log_updated_only; -extern my_bool opt_ndb_log_binlog_index; -extern my_bool opt_ndb_log_apply_status; +extern bool opt_ndb_log_orig; +extern bool opt_ndb_log_bin; +extern bool opt_ndb_log_update_as_write; +extern bool opt_ndb_log_updated_only; +extern bool opt_ndb_log_binlog_index; +extern bool opt_ndb_log_apply_status; extern ulong opt_ndb_extra_logging; extern st_ndb_slave_state g_ndb_slave_state; -extern my_bool opt_ndb_log_transaction_id; -extern my_bool log_bin_use_v1_row_events; -extern my_bool opt_ndb_log_empty_update; -extern my_bool opt_ndb_clear_apply_status; +extern bool opt_ndb_log_transaction_id; +extern bool log_bin_use_v1_row_events; +extern bool opt_ndb_log_empty_update; +extern bool opt_ndb_clear_apply_status; bool ndb_log_empty_epochs(void); @@ -153,9 +153,9 @@ static mysql_cond_t injector_data_cond; Flag showing if the ndb binlog should be created, if so == TRUE FALSE if not */ -my_bool ndb_binlog_running= FALSE; -static my_bool ndb_binlog_tables_inited= FALSE; //injector_data_mutex, relaxed -static my_bool ndb_binlog_is_ready= FALSE; //injector_data_mutex, relaxed +bool ndb_binlog_running= FALSE; +static bool ndb_binlog_tables_inited= FALSE; //injector_data_mutex, relaxed +static bool ndb_binlog_is_ready= FALSE; //injector_data_mutex, relaxed bool ndb_binlog_is_read_only(void) @@ -207,8 +207,8 @@ static ulonglong ndb_latest_received_binlog_epoch= 0; NDB_SHARE *ndb_apply_status_share= NULL; static NDB_SHARE *ndb_schema_share= NULL; //Need injector_data_mutex -extern my_bool opt_log_slave_updates; -static my_bool g_ndb_log_slave_updates; +extern bool opt_log_slave_updates; +static bool g_ndb_log_slave_updates; static bool g_injector_v1_warning_emitted = false; diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h index d5f5a7ba3adf..4a3249b06c5e 100644 --- a/sql/ha_ndbcluster_binlog.h +++ b/sql/ha_ndbcluster_binlog.h @@ -104,7 +104,7 @@ bool ndb_binlog_is_read_only(void); extern NDB_SHARE *ndb_apply_status_share; -extern my_bool ndb_binlog_running; +extern bool ndb_binlog_running; /* Prints ndb binlog status string in buf */ size_t ndbcluster_show_status_binlog(char* buf, size_t buf_size); diff --git a/sql/ha_ndbinfo.cc b/sql/ha_ndbinfo.cc index cfefb1d6abc8..8a410bfbf4b6 100644 --- a/sql/ha_ndbinfo.cc +++ b/sql/ha_ndbinfo.cc @@ -97,7 +97,7 @@ static MYSQL_SYSVAR_UINT( 0 /* block */ ); -static my_bool opt_ndbinfo_offline; +static bool opt_ndbinfo_offline; static void @@ -106,8 +106,8 @@ offline_update(THD* thd, struct st_mysql_sys_var* var, { DBUG_ENTER("offline_update"); - const my_bool new_offline = - (*(static_cast(save)) != 0); + const bool new_offline = + (*(static_cast(save)) != 0); if (new_offline == opt_ndbinfo_offline) { // No change diff --git a/sql/handler.cc b/sql/handler.cc index a5d67916de5d..7518cb79f0d1 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -323,9 +323,9 @@ st_handler_tablename mysqld_system_tables[]= { // Called for each SE to check if given db.table_name is a system table. -static my_bool check_engine_system_table_handlerton(THD *unused, - plugin_ref plugin, - void *arg); +static bool check_engine_system_table_handlerton(THD *unused, + plugin_ref plugin, + void *arg); static int ha_discover(THD *thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen); @@ -982,8 +982,8 @@ void ha_end() my_free(handler_errmsgs); } -static my_bool dropdb_handlerton(THD *unused1, plugin_ref plugin, - void *path) +static bool dropdb_handlerton(THD *unused1, plugin_ref plugin, + void *path) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && hton->drop_database) @@ -998,8 +998,8 @@ void ha_drop_database(char* path) } -static my_bool closecon_handlerton(THD *thd, plugin_ref plugin, - void *unused) +static bool closecon_handlerton(THD *thd, plugin_ref plugin, + void *unused) { handlerton *hton= plugin_data(plugin); /* @@ -1027,7 +1027,7 @@ void ha_close_connection(THD* thd) } -static my_bool kill_handlerton(THD *thd, plugin_ref plugin, void *) +static bool kill_handlerton(THD *thd, plugin_ref plugin, void *) { handlerton *hton= plugin_data(plugin); @@ -1049,7 +1049,7 @@ void ha_kill_connection(THD *thd) /** Invoke handlerton::pre_dd_shutdown() on a plugin. @param plugin storage engine plugin @retval FALSE (always) */ -static my_bool pre_dd_shutdown_handlerton(THD *, plugin_ref plugin, void *) +static bool pre_dd_shutdown_handlerton(THD *, plugin_ref plugin, void *) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && hton->pre_dd_shutdown) @@ -1431,7 +1431,7 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg, ht_arg->db_type != DB_TYPE_BINLOG) { const XID *xid= trn_ctx->xid_state()->get_xid(); - my_bool autocommit= !thd->in_multi_stmt_transaction_mode(); + bool autocommit= !thd->in_multi_stmt_transaction_mode(); thd->m_transaction_psi= MYSQL_START_TRANSACTION(&thd->m_transaction_state, xid, trxid, thd->tx_isolation, thd->tx_read_only, autocommit); @@ -2425,8 +2425,8 @@ int ha_release_savepoint(THD *thd, SAVEPOINT *sv) } -static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin, - void *arg) +static bool snapshot_handlerton(THD *thd, plugin_ref plugin, + void *arg) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && @@ -2456,8 +2456,8 @@ int ha_start_consistent_snapshot(THD *thd) } -static my_bool flush_handlerton(THD *thd, plugin_ref plugin, - void *arg) +static bool flush_handlerton(THD *thd, plugin_ref plugin, + void *arg) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && hton->flush_logs && @@ -4987,7 +4987,7 @@ handler::ha_enable_indexes(uint mode) */ int -handler::ha_discard_or_import_tablespace(my_bool discard, +handler::ha_discard_or_import_tablespace(bool discard, dd::Table *table_def) { DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || @@ -5572,9 +5572,9 @@ bool ha_check_if_supported_system_table(handlerton *hton, const char *db, @retval false There was no match found. Other SE's will be checked to find a match. */ -static my_bool check_engine_system_table_handlerton(THD *unused, - plugin_ref plugin, - void *arg) +static bool check_engine_system_table_handlerton(THD *unused, + plugin_ref plugin, + void *arg) { st_sys_tbl_chk_params *check_params= (st_sys_tbl_chk_params*) arg; handlerton *hton= plugin_data(plugin); @@ -5629,8 +5629,8 @@ static my_bool check_engine_system_table_handlerton(THD *unused, } -static my_bool rm_tmp_tables_handlerton(THD *thd, plugin_ref plugin, - void *files) +static bool rm_tmp_tables_handlerton(THD *thd, plugin_ref plugin, + void *files) { handlerton *hton= plugin_data(plugin); @@ -5804,8 +5804,8 @@ struct st_discover_args size_t *frmlen; }; -static my_bool discover_handlerton(THD *thd, plugin_ref plugin, - void *arg) +static bool discover_handlerton(THD *thd, plugin_ref plugin, + void *arg) { st_discover_args *vargs= (st_discover_args *)arg; handlerton *hton= plugin_data(plugin); @@ -5854,8 +5854,8 @@ struct st_find_files_args List *files; }; -static my_bool find_files_handlerton(THD *thd, plugin_ref plugin, - void *arg) +static bool find_files_handlerton(THD *thd, plugin_ref plugin, + void *arg) { st_find_files_args *vargs= (st_find_files_args *)arg; handlerton *hton= plugin_data(plugin); @@ -5899,7 +5899,7 @@ struct st_table_exists_in_engine_args int err; }; -static my_bool table_exists_in_engine_handlerton(THD *thd, plugin_ref plugin, +static bool table_exists_in_engine_handlerton(THD *thd, plugin_ref plugin, void *arg) { st_table_exists_in_engine_args *vargs= (st_table_exists_in_engine_args *)arg; @@ -5938,7 +5938,7 @@ struct st_make_pushed_join_args int err; // Error code to return. }; -static my_bool make_pushed_join_handlerton(THD *thd, plugin_ref plugin, +static bool make_pushed_join_handlerton(THD *thd, plugin_ref plugin, void *arg) { st_make_pushed_join_args *vargs= (st_make_pushed_join_args *)arg; @@ -5988,7 +5988,7 @@ struct binlog_func_st /** @brief Listing handlertons first to avoid recursive calls and deadlock */ -static my_bool binlog_func_list(THD *thd, plugin_ref plugin, void *arg) +static bool binlog_func_list(THD *thd, plugin_ref plugin, void *arg) { hton_list_st *hton_list= (hton_list_st *)arg; handlerton *hton= plugin_data(plugin); @@ -6006,7 +6006,7 @@ static my_bool binlog_func_list(THD *thd, plugin_ref plugin, void *arg) return FALSE; } -static my_bool binlog_func_foreach(THD *thd, binlog_func_st *bfn) +static bool binlog_func_foreach(THD *thd, binlog_func_st *bfn) { hton_list_st hton_list; uint i, sz; @@ -6056,9 +6056,9 @@ struct binlog_log_query_st const char *table_name; }; -static my_bool binlog_log_query_handlerton2(THD *thd, - handlerton *hton, - void *args) +static bool binlog_log_query_handlerton2(THD *thd, + handlerton *hton, + void *args) { struct binlog_log_query_st *b= (struct binlog_log_query_st*)args; if (hton->state == SHOW_OPTION_YES && hton->binlog_log_query) @@ -6071,9 +6071,9 @@ static my_bool binlog_log_query_handlerton2(THD *thd, return FALSE; } -static my_bool binlog_log_query_handlerton(THD *thd, - plugin_ref plugin, - void *args) +static bool binlog_log_query_handlerton(THD *thd, + plugin_ref plugin, + void *args) { return binlog_log_query_handlerton2(thd, plugin_data(plugin), args); @@ -7872,8 +7872,8 @@ uint calculate_key_len(TABLE *table, uint key, @retval pointer pointer to TYPELIB structure */ -static my_bool exts_handlerton(THD *unused, plugin_ref plugin, - void *arg) +static bool exts_handlerton(THD *unused, plugin_ref plugin, + void *arg) { List *found_exts= (List *) arg; handlerton *hton= plugin_data(plugin); @@ -7940,8 +7940,8 @@ static bool stat_print(THD *thd, const char *type, size_t type_len, } -static my_bool showstat_handlerton(THD *thd, plugin_ref plugin, - void *arg) +static bool showstat_handlerton(THD *thd, plugin_ref plugin, + void *arg) { enum ha_stat_type stat= *(enum ha_stat_type *) arg; handlerton *hton= plugin_data(plugin); @@ -8781,7 +8781,7 @@ bool handler::my_eval_gcolumn_expr_with_open(THD *thd, bool handler::my_eval_gcolumn_expr(THD *thd, TABLE *table, - const MY_BITMAP *const fields, + const MY_BITMAP *const fields, uchar *record) { DBUG_ENTER("my_eval_gcolumn_expr"); @@ -8813,7 +8813,7 @@ struct HTON_NOTIFY_PARAMS }; -static my_bool +static bool notify_exclusive_mdl_helper(THD *thd, plugin_ref plugin, void *arg) { handlerton *hton= plugin_data(plugin); @@ -8885,7 +8885,7 @@ bool ha_notify_exclusive_mdl(THD *thd, const MDL_key *mdl_key, } -static my_bool +static bool notify_alter_table_helper(THD *thd, plugin_ref plugin, void *arg) { handlerton *hton= plugin_data(plugin); diff --git a/sql/handler.h b/sql/handler.h index 2819456260d4..5c40c111d4db 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -89,9 +89,9 @@ namespace dd { typedef struct sdi_vector sdi_vector_t; } -typedef my_bool (*qc_engine_callback)(THD *thd, const char *table_key, - uint key_length, - ulonglong *engine_data); +typedef bool (*qc_engine_callback)(THD *thd, const char *table_key, + uint key_length, + ulonglong *engine_data); typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len, const char *file, size_t file_len, @@ -3484,7 +3484,7 @@ class handler :public Sql_alloc bool ha_check_and_repair(THD *thd); int ha_disable_indexes(uint mode); int ha_enable_indexes(uint mode); - int ha_discard_or_import_tablespace(my_bool discard, dd::Table *table_def); + int ha_discard_or_import_tablespace(bool discard, dd::Table *table_def); int ha_rename_table(const char *from, const char *to, const dd::Table *from_table_def, dd::Table *to_table_def); @@ -4420,7 +4420,7 @@ class handler :public Sql_alloc cached */ - virtual my_bool + virtual bool register_query_cache_table(THD *thd MY_ATTRIBUTE((unused)), char *table_key MY_ATTRIBUTE((unused)), size_t key_length MY_ATTRIBUTE((unused)), @@ -5292,7 +5292,7 @@ class handler :public Sql_alloc @retval != 0 Error. */ - virtual int discard_or_import_tablespace(my_bool discard MY_ATTRIBUTE((unused)), + virtual int discard_or_import_tablespace(bool discard MY_ATTRIBUTE((unused)), dd::Table *table_def MY_ATTRIBUTE((unused))) { set_my_errno(HA_ERR_WRONG_COMMAND); @@ -5399,7 +5399,7 @@ class handler :public Sql_alloc @retval false on success */ static bool my_eval_gcolumn_expr(THD *thd, TABLE *table, - const MY_BITMAP *const fields, + const MY_BITMAP *const fields, uchar *record); /* This must be implemented if the handlerton's partition_flags() is set. */ diff --git a/sql/hash_filo.h b/sql/hash_filo.h index ee6a053b16ff..a7377a5d0be4 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -147,7 +147,7 @@ class hash_filo return entry; } - my_bool add(hash_filo_element *entry) + bool add(hash_filo_element *entry) { if (!m_size) return 1; if (cache.records == m_size) diff --git a/sql/item.h b/sql/item.h index a68fa7157deb..8abc7f634d87 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4813,7 +4813,7 @@ class Item_int_with_ref :public Item_int } public: Item_int_with_ref(enum_field_types field_type, longlong i, Item *ref_arg, - my_bool unsigned_arg) + bool unsigned_arg) : Item_int(i), ref(ref_arg) { set_data_type(field_type); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index e96119a1951d..cc2e48a7bb86 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2822,7 +2822,7 @@ longlong Item_func_interval::val_int() { uint mid= (start + end + 1) / 2; interval_range *range= intervals + mid; - my_bool cmp_result; + bool cmp_result; /* The values in the range intervall may have different types, Only do a decimal comparision of the first argument is a decimal diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 5f7a8099caf4..6508ac165627 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -989,7 +989,7 @@ class Item_func_interval final : public Item_int_func typedef Item_int_func super; Item_row *row; - my_bool use_decimal_comparison; + bool use_decimal_comparison; interval_range *intervals; public: Item_func_interval(const POS &pos, MEM_ROOT *mem_root, Item *expr1, @@ -1277,7 +1277,7 @@ class in_longlong :public in_vector void value_to_item(uint pos, Item *item) override { ((Item_int*) item)->value= base[pos].val; - ((Item_int*) item)->unsigned_flag= (my_bool) + ((Item_int*) item)->unsigned_flag= (bool) base[pos].unsigned_flag; } Item_result result_type() const override { return INT_RESULT; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 994d0e2a5784..d83ca498e6e3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -7745,7 +7745,7 @@ longlong Item_func_get_system_var::val_int() case SHOW_BOOL: return get_sys_var_safe(thd); case SHOW_MY_BOOL: - return get_sys_var_safe(thd); + return get_sys_var_safe(thd); case SHOW_DOUBLE: { double dval= val_real(); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3faf958f4949..70a5a3a2533e 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -529,7 +529,7 @@ static bool extract_date_time(const Date_time_format *format, */ bool make_date_time(Date_time_format *format, MYSQL_TIME *l_time, - timestamp_type type, String *str) + timestamp_type type, String *str) { char intbuff[15]; uint hours_i; @@ -2269,7 +2269,7 @@ bool Item_func_from_unixtime::resolve_type(THD *thd) bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime, - my_time_flags_t fuzzy_date + my_time_flags_t fuzzy_date MY_ATTRIBUTE((unused))) { THD *thd= current_thd; @@ -2337,7 +2337,7 @@ bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime, } { - my_bool not_used; + bool not_used; uint second_part= ltime->second_part; my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); /* my_time_tmp is guranteed to be in the allowed range */ diff --git a/sql/keyring_service.cc b/sql/keyring_service.cc index 1276d7ffd320..4055ae9b7d82 100644 --- a/sql/keyring_service.cc +++ b/sql/keyring_service.cc @@ -38,10 +38,10 @@ struct Key_data void **key_to_fetch; size_t key_len_to_store; size_t *key_len_to_fetch; - my_bool result; + bool result; }; -static my_bool key_fetch(THD*, plugin_ref plugin, void *arg) +static bool key_fetch(THD*, plugin_ref plugin, void *arg) { Key_data *key_data= reinterpret_cast(arg); plugin= my_plugin_lock(NULL, &plugin); @@ -58,7 +58,7 @@ static my_bool key_fetch(THD*, plugin_ref plugin, void *arg) return TRUE; } -static my_bool key_store(THD*, plugin_ref plugin, void *arg) +static bool key_store(THD*, plugin_ref plugin, void *arg) { Key_data *key_data= reinterpret_cast(arg); plugin= my_plugin_lock(NULL, &plugin); @@ -75,7 +75,7 @@ static my_bool key_store(THD*, plugin_ref plugin, void *arg) return TRUE; } -static my_bool key_remove(THD*, plugin_ref plugin, void *arg) +static bool key_remove(THD*, plugin_ref plugin, void *arg) { Key_data *key_data= reinterpret_cast(arg); plugin= my_plugin_lock(NULL, &plugin); @@ -91,7 +91,7 @@ static my_bool key_remove(THD*, plugin_ref plugin, void *arg) return TRUE; } -static my_bool key_generate(THD*, plugin_ref plugin, void *arg) +static bool key_generate(THD*, plugin_ref plugin, void *arg) { Key_data *key_data= reinterpret_cast(arg); plugin= my_plugin_lock(NULL, &plugin); diff --git a/sql/locking_service_udf.cc b/sql/locking_service_udf.cc index a580dbaa8272..feebba2d5fc0 100644 --- a/sql/locking_service_udf.cc +++ b/sql/locking_service_udf.cc @@ -33,7 +33,7 @@ */ // Common initialization code for get_read_lock and get_write_lock -static inline my_bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *message) +static inline bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *message) { initid->maybe_null= FALSE; initid->decimals= 0; @@ -73,8 +73,8 @@ static inline my_bool init_acquire(UDF_INIT *initid, UDF_ARGS *args, char *messa C_MODE_START -my_bool service_get_read_locks_init(UDF_INIT *initid, UDF_ARGS *args, - char *message) +bool service_get_read_locks_init(UDF_INIT *initid, UDF_ARGS *args, + char *message) { return init_acquire(initid, args, message); } @@ -95,8 +95,8 @@ long long service_get_read_locks(UDF_INIT *initid, UDF_ARGS *args, } -my_bool service_get_write_locks_init(UDF_INIT *initid, UDF_ARGS *args, - char *message) +bool service_get_write_locks_init(UDF_INIT *initid, UDF_ARGS *args, + char *message) { return init_acquire(initid, args, message); } @@ -117,8 +117,8 @@ long long service_get_write_locks(UDF_INIT *initid, UDF_ARGS *args, } -my_bool service_release_locks_init(UDF_INIT *initid, UDF_ARGS *args, - char *message) +bool service_release_locks_init(UDF_INIT *initid, UDF_ARGS *args, + char *message) { initid->maybe_null= FALSE; initid->decimals= 0; diff --git a/sql/log_event.cc b/sql/log_event.cc index 09e5430ac141..70fd194396d4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -961,10 +961,10 @@ void Log_event::init_show_field_list(List* field_list) @return true (positive) or false (negative) */ -my_bool Log_event::need_checksum() +bool Log_event::need_checksum() { DBUG_ENTER("Log_event::need_checksum"); - my_bool ret= FALSE; + bool ret= FALSE; /* few callers of Log_event::write (incl FD::write, FD constructing code on the slave side, Rotate relay log @@ -1368,16 +1368,16 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, mysql_mutex_t* log_lock, const Format_description_log_event *description_event, - my_bool crc_check) + bool crc_check) #else Log_event* Log_event::read_log_event(IO_CACHE* file, const Format_description_log_event *description_event, - my_bool crc_check, + bool crc_check, read_log_event_filter_function f) #endif { - DBUG_ENTER("Log_event::read_log_event(IO_CACHE *[, mysql_mutex_t *], Format_description_log_event *, my_bool)"); + DBUG_ENTER("Log_event::read_log_event(IO_CACHE *[, mysql_mutex_t *], Format_description_log_event *, bool)"); DBUG_ASSERT(description_event != 0); char head[LOG_EVENT_MINIMAL_HEADER_LEN]; /* @@ -1491,11 +1491,11 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, Log_event* Log_event::read_log_event(const char* buf, uint event_len, const char **error, const Format_description_log_event *description_event, - my_bool crc_check) + bool crc_check) { Log_event* ev= NULL; enum_binlog_checksum_alg alg; - DBUG_ENTER("Log_event::read_log_event(char *, uint, char **, Format_description_log_event *, my_bool)"); + DBUG_ENTER("Log_event::read_log_event(char *, uint, char **, Format_description_log_event *, bool)"); DBUG_ASSERT(description_event != 0); DBUG_PRINT("info", ("binlog_version: %d", description_event->binlog_version)); DBUG_DUMP("data", (unsigned char*) buf, event_len); @@ -8010,7 +8010,7 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length) FALSE otherwise. */ static -my_bool is_any_column_signaled_for_table(TABLE *table, MY_BITMAP *cols) +bool is_any_column_signaled_for_table(TABLE *table, MY_BITMAP *cols) { DBUG_ENTER("is_any_column_signaled_for_table"); @@ -8057,7 +8057,7 @@ my_bool is_any_column_signaled_for_table(TABLE *table, MY_BITMAP *cols) for the given key, FALSE otherwise. */ static -my_bool are_all_columns_signaled_for_key(KEY *keyinfo, MY_BITMAP *cols) +bool are_all_columns_signaled_for_key(KEY *keyinfo, MY_BITMAP *cols) { DBUG_ENTER("are_all_columns_signaled_for_key"); diff --git a/sql/log_event.h b/sql/log_event.h index 43402c9c1dce..f55031768748 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -609,7 +609,7 @@ class Log_event */ bool write_header(IO_CACHE* file, size_t data_length); bool write_footer(IO_CACHE* file); - my_bool need_checksum(); + bool need_checksum(); public: @@ -709,7 +709,7 @@ class Log_event mysql_mutex_t* log_lock, const Format_description_log_event *description_event, - my_bool crc_check); + bool crc_check); /* This function will read the common header into the buffer. @@ -823,7 +823,7 @@ class Log_event /* avoid having to link mysqlbinlog against libpthread */ static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event - *description_event, my_bool crc_check, + *description_event, bool crc_check, read_log_event_filter_function f); /* print*() functions are used by mysqlbinlog */ virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0; @@ -945,7 +945,7 @@ class Log_event static Log_event* read_log_event(const char* buf, uint event_len, const char **error, const Format_description_log_event - *description_event, my_bool crc_check); + *description_event, bool crc_check); /** Returns the human readable name of the given event type. */ diff --git a/sql/my_decimal.h b/sql/my_decimal.h index e73c88a39dd0..2385e0618657 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -366,7 +366,7 @@ int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec, uint fixed_dec, char filler, String *str); inline -int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag, +int my_decimal2int(uint mask, const my_decimal *d, bool unsigned_flag, longlong *l) { my_decimal rounded; @@ -428,7 +428,7 @@ int double2my_decimal(uint mask, double val, my_decimal *d) inline -int int2my_decimal(uint mask, longlong i, my_bool unsigned_flag, my_decimal *d) +int int2my_decimal(uint mask, longlong i, bool unsigned_flag, my_decimal *d) { return d->check_result(mask, (unsigned_flag ? ulonglong2decimal((ulonglong)i, d) : diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b124f9bc353c..ad9104c87d8b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -636,11 +636,11 @@ const char *first_keyword= "first", *binary_keyword= "BINARY"; const char *my_localhost= "localhost"; bool opt_large_files= sizeof(my_off_t) > 4; -static my_bool opt_autocommit; ///< for --autocommit command-line option +static bool opt_autocommit; ///< for --autocommit command-line option /* Used with --help for detailed option */ -my_bool opt_help= 0, opt_verbose= 0; +bool opt_help= 0, opt_verbose= 0; arg_cmp_func Arg_comparator::comparator_matrix[5][2] = {{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string}, @@ -725,10 +725,10 @@ static bool lower_case_table_names_used= 0; #if !defined(_WIN32) static bool socket_listener_active= false; static int pipe_write_fd= -1; -static my_bool opt_daemonize= 0; +static bool opt_daemonize= 0; #endif -static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; -static my_bool opt_short_log_format= 0; +static bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; +static bool opt_short_log_format= 0; static char *mysqld_user, *mysqld_chroot; static char *default_character_set_name; static char *character_set_filesystem_name; @@ -753,15 +753,15 @@ LEX_STRING opt_init_connect, opt_init_slave; bool opt_bin_log, opt_ignore_builtin_innodb= 0; bool opt_general_log, opt_slow_log, opt_general_log_raw; ulonglong log_output_options; -my_bool opt_log_queries_not_using_indexes= 0; +bool opt_log_queries_not_using_indexes= 0; ulong opt_log_throttle_queries_not_using_indexes= 0; bool opt_disable_networking=0, opt_skip_show_db=0; bool opt_skip_name_resolve=0; -my_bool opt_character_set_client_handshake= 1; +bool opt_character_set_client_handshake= 1; bool server_id_supplied = false; static bool opt_endinfo; bool using_udf_functions; -my_bool locked_in_memory; +bool locked_in_memory; bool opt_using_transactions; ulong opt_tc_log_size; int32 volatile connection_events_loop_aborted_flag; @@ -787,22 +787,22 @@ ulong log_error_verbosity= 3; // have a non-zero value during early start-up ulong slow_start_timeout; #endif -my_bool opt_initialize= 0; -my_bool opt_skip_slave_start = 0; ///< If set, slave is not autostarted -my_bool opt_reckless_slave = 0; -my_bool opt_enable_named_pipe= 0; -my_bool opt_local_infile, opt_slave_compressed_protocol; -my_bool opt_safe_user_create = 0; -my_bool opt_show_slave_auth_info; -my_bool opt_log_slave_updates= 0; +bool opt_initialize= 0; +bool opt_skip_slave_start = 0; ///< If set, slave is not autostarted +bool opt_reckless_slave = 0; +bool opt_enable_named_pipe= 0; +bool opt_local_infile, opt_slave_compressed_protocol; +bool opt_safe_user_create = 0; +bool opt_show_slave_auth_info; +bool opt_log_slave_updates= 0; char *opt_slave_skip_errors; -my_bool opt_slave_allow_batching= 0; +bool opt_slave_allow_batching= 0; /** compatibility option: - index usage hints (USE INDEX without a FOR clause) behave as in 5.0 */ -my_bool old_mode; +bool old_mode; /* Legacy global handlerton. These will be removed (please do not add more). @@ -814,22 +814,22 @@ handlerton *innodb_hton; char *opt_disabled_storage_engines; uint opt_server_id_bits= 0; ulong opt_server_id_mask= 0; -my_bool read_only= 0, opt_readonly= 0; -my_bool super_read_only= 0, opt_super_readonly= 0; -my_bool opt_require_secure_transport= 0; -my_bool relay_log_purge; -my_bool relay_log_recovery; -my_bool opt_allow_suspicious_udfs; -my_bool opt_secure_auth= 0; +bool read_only= 0, opt_readonly= 0; +bool super_read_only= 0, opt_super_readonly= 0; +bool opt_require_secure_transport= 0; +bool relay_log_purge; +bool relay_log_recovery; +bool opt_allow_suspicious_udfs; +bool opt_secure_auth= 0; char* opt_secure_file_priv; -my_bool opt_log_slow_admin_statements= 0; -my_bool opt_log_slow_slave_statements= 0; -my_bool lower_case_file_system= 0; -my_bool opt_large_pages= 0; -my_bool opt_super_large_pages= 0; -my_bool opt_myisam_use_mmap= 0; -my_bool offline_mode= 0; -my_bool opt_log_builtin_as_identified_by_password= 0; +bool opt_log_slow_admin_statements= 0; +bool opt_log_slow_slave_statements= 0; +bool lower_case_file_system= 0; +bool opt_large_pages= 0; +bool opt_super_large_pages= 0; +bool opt_myisam_use_mmap= 0; +bool offline_mode= 0; +bool opt_log_builtin_as_identified_by_password= 0; uint opt_large_page_size= 0; uint default_password_lifetime= 0; @@ -838,27 +838,27 @@ mysql_mutex_t LOCK_default_password_lifetime; #if defined(ENABLED_DEBUG_SYNC) MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout= 0; #endif /* defined(ENABLED_DEBUG_SYNC) */ -my_bool opt_old_style_user_limits= 0, trust_function_creators= 0; -my_bool check_proxy_users= 0, mysql_native_password_proxy_users= 0, sha256_password_proxy_users= 0; +bool opt_old_style_user_limits= 0, trust_function_creators= 0; +bool check_proxy_users= 0, mysql_native_password_proxy_users= 0, sha256_password_proxy_users= 0; /* True if there is at least one per-hour limit for some user, so we should check them before each query (and possibly reset counters when hour is changed). False otherwise. */ volatile bool mqh_used = 0; -my_bool opt_noacl= 0; -my_bool sp_automatic_privileges= 1; +bool opt_noacl= 0; +bool sp_automatic_privileges= 1; ulong opt_binlog_rows_event_max_size; ulong binlog_checksum_options; -my_bool opt_master_verify_checksum= 0; -my_bool opt_slave_sql_verify_checksum= 1; +bool opt_master_verify_checksum= 0; +bool opt_slave_sql_verify_checksum= 1; const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; -my_bool binlog_gtid_simple_recovery; +bool binlog_gtid_simple_recovery; ulong binlog_error_action; const char *binlog_error_action_list[]= {"IGNORE_ERROR", "ABORT_SERVER", NullS}; uint32 gtid_executed_compression_period= 0; -my_bool opt_log_unsafe_statements; +bool opt_log_unsafe_statements; #ifdef HAVE_INITGROUPS volatile sig_atomic_t calling_initgroups= 0; /**< Used in SIGSEGV handler. */ @@ -890,7 +890,7 @@ ulonglong slave_type_conversions_options; ulong opt_mts_slave_parallel_workers; ulonglong opt_mts_pending_jobs_size_max; ulonglong slave_rows_search_algorithms_options; -my_bool opt_slave_preserve_commit_order; +bool opt_slave_preserve_commit_order; #ifndef DBUG_OFF uint slave_rows_last_search_algorithm_used; #endif @@ -915,7 +915,7 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong max_connections, max_connect_errors; ulong rpl_stop_slave_timeout= LONG_TIMEOUT; -my_bool log_bin_use_v1_row_events= 0; +bool log_bin_use_v1_row_events= 0; bool thread_cache_size_specified= false; bool host_cache_size_specified= false; bool table_definition_cache_specified= false; @@ -951,9 +951,9 @@ ulong stored_program_cache_size= 0; Compatibility option to prevent auto upgrade of old temporals during certain ALTER TABLE operations. */ -my_bool avoid_temporal_upgrade; +bool avoid_temporal_upgrade; -my_bool persisted_globals_load= TRUE; +bool persisted_globals_load= TRUE; const double log_10[] = { 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, @@ -1125,7 +1125,7 @@ char *opt_general_logname, *opt_slow_logname, *opt_bin_logname; /* Static variables */ -static my_bool opt_myisam_log; +static bool opt_myisam_log; static int cleanup_done; static ulong opt_specialflag; char *opt_binlog_index_name; @@ -1250,7 +1250,7 @@ static mysql_mutex_t LOCK_handler_count; static mysql_cond_t COND_handler_count; static HANDLE hEventShutdown; char *shared_memory_base_name= default_shared_memory_base_name; -my_bool opt_enable_shared_memory; +bool opt_enable_shared_memory; static char shutdown_event_name[40]; static NTService Service; ///< Service object for WinNT #endif /* _WIN32 */ @@ -1263,7 +1263,7 @@ static const char* default_dbug_option; ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE; Query_cache query_cache; -my_bool opt_use_ssl= 1; +bool opt_use_ssl= 1; char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL, *opt_ssl_cipher= NULL, *opt_ssl_key= NULL, *opt_ssl_crl= NULL, *opt_ssl_crlpath= NULL, *opt_tls_version= NULL; @@ -1279,7 +1279,7 @@ SSL *ssl_acceptor; static int mysql_init_variables(void); static int get_options(int *argc_ptr, char ***argv_ptr); static void add_terminator(vector *options); -extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *); +extern "C" bool mysqld_get_one_option(int, const struct my_option *, char *); static void set_server_version(void); static int init_thread_environment(); static char *get_relative_path(const char *path); @@ -6749,7 +6749,7 @@ static int show_slave_running(THD*, SHOW_VAR *var, char *buff) { var->type= SHOW_MY_BOOL; var->value= buff; - *((my_bool *)buff)= (my_bool) (mi && + *((bool *)buff)= (bool) (mi && mi->slave_running == MYSQL_SLAVE_RUN_CONNECT && mi->rli->slave_running); } @@ -7760,7 +7760,7 @@ static int mysql_init_variables(void) return 0; } -my_bool +bool mysqld_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -8034,8 +8034,8 @@ mysqld_get_one_option(int optid, performance_schema_instrument = '%='OFF'' */ char *name= argument,*p= NULL, *val= NULL; - my_bool quote= false; /* true if quote detected */ - my_bool error= true; /* false if no errors detected */ + bool quote= false; /* true if quote detected */ + bool error= true; /* false if no errors detected */ const int PFS_BUFFER_SIZE= 128; char orig_argument[PFS_BUFFER_SIZE+1]; orig_argument[0]= 0; diff --git a/sql/mysqld.h b/sql/mysqld.h index 4b33942fd333..ca878387a002 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -128,23 +128,23 @@ enum_server_operational_state get_server_state(); extern bool opt_large_files, server_id_supplied; extern bool opt_bin_log; -extern my_bool opt_log_slave_updates; -extern my_bool opt_log_unsafe_statements; +extern bool opt_log_slave_updates; +extern bool opt_log_unsafe_statements; extern bool opt_general_log, opt_slow_log, opt_general_log_raw; extern ulonglong log_output_options; -extern my_bool opt_log_queries_not_using_indexes; +extern bool opt_log_queries_not_using_indexes; extern ulong opt_log_throttle_queries_not_using_indexes; extern bool opt_disable_networking, opt_skip_show_db; extern bool opt_skip_name_resolve; -extern my_bool opt_help; -extern my_bool opt_verbose; +extern bool opt_help; +extern bool opt_verbose; extern bool opt_ignore_builtin_innodb; -extern my_bool opt_character_set_client_handshake; +extern bool opt_character_set_client_handshake; extern MYSQL_PLUGIN_IMPORT int32 volatile connection_events_loop_aborted_flag; -extern my_bool opt_initialize; -extern my_bool opt_safe_user_create; -extern my_bool opt_local_infile, opt_myisam_use_mmap; -extern my_bool opt_slave_compressed_protocol; +extern bool opt_initialize; +extern bool opt_safe_user_create; +extern bool opt_local_infile, opt_myisam_use_mmap; +extern bool opt_slave_compressed_protocol; extern ulong slave_exec_mode_options; enum enum_slave_type_conversions { SLAVE_TYPE_CONVERSIONS_ALL_LOSSY, @@ -153,33 +153,33 @@ enum enum_slave_type_conversions { SLAVE_TYPE_CONVERSIONS_ALL_LOSSY, SLAVE_TYPE_CONVERSIONS_ALL_SIGNED}; extern ulonglong slave_type_conversions_options; -extern my_bool read_only, opt_readonly; -extern my_bool super_read_only, opt_super_readonly; -extern my_bool lower_case_file_system; +extern bool read_only, opt_readonly; +extern bool super_read_only, opt_super_readonly; +extern bool lower_case_file_system; enum enum_slave_rows_search_algorithms { SLAVE_ROWS_TABLE_SCAN = (1U << 0), SLAVE_ROWS_INDEX_SCAN = (1U << 1), SLAVE_ROWS_HASH_SCAN = (1U << 2)}; extern ulonglong slave_rows_search_algorithms_options; -extern my_bool opt_require_secure_transport; +extern bool opt_require_secure_transport; -extern my_bool opt_slave_preserve_commit_order; +extern bool opt_slave_preserve_commit_order; #ifndef DBUG_OFF extern uint slave_rows_last_search_algorithm_used; #endif extern ulong mts_parallel_option; #ifdef _WIN32 -extern my_bool opt_enable_named_pipe; -extern my_bool opt_enable_shared_memory; +extern bool opt_enable_named_pipe; +extern bool opt_enable_shared_memory; #endif -extern my_bool opt_allow_suspicious_udfs; -extern my_bool opt_secure_auth; +extern bool opt_allow_suspicious_udfs; +extern bool opt_secure_auth; extern char* opt_secure_file_priv; -extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements; -extern my_bool sp_automatic_privileges, opt_noacl; -extern my_bool opt_old_style_user_limits, trust_function_creators; -extern my_bool check_proxy_users, mysql_native_password_proxy_users, sha256_password_proxy_users; +extern bool opt_log_slow_admin_statements, opt_log_slow_slave_statements; +extern bool sp_automatic_privileges, opt_noacl; +extern bool opt_old_style_user_limits, trust_function_creators; +extern bool check_proxy_users, mysql_native_password_proxy_users, sha256_password_proxy_users; extern char *shared_memory_base_name, *mysqld_unix_port; extern char *default_tz_name; extern Time_zone *default_tz; @@ -187,7 +187,7 @@ extern char *default_storage_engine; extern char *default_tmp_storage_engine; extern ulong internal_tmp_disk_storage_engine; extern bool using_udf_functions; -extern my_bool locked_in_memory; +extern bool locked_in_memory; extern bool opt_using_transactions; extern ulong current_pid; extern ulong expire_logs_days; @@ -196,10 +196,10 @@ extern uint sync_binlog_period, sync_relaylog_period, opt_mts_checkpoint_period, opt_mts_checkpoint_group; extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size; extern ulong tc_log_page_waits; -extern my_bool relay_log_purge; -extern my_bool relay_log_recovery; -extern my_bool offline_mode; -extern my_bool opt_log_builtin_as_identified_by_password; +extern bool relay_log_purge; +extern bool relay_log_recovery; +extern bool offline_mode; +extern bool opt_log_builtin_as_identified_by_password; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port; @@ -237,13 +237,13 @@ extern ulong tablespace_def_size; extern MYSQL_PLUGIN_IMPORT ulong max_connections; extern ulong max_digest_length; extern ulong max_connect_errors, connect_timeout; -extern my_bool opt_slave_allow_batching; +extern bool opt_slave_allow_batching; extern ulong slave_trans_retries; extern uint slave_net_timeout; extern ulong opt_mts_slave_parallel_workers; extern ulonglong opt_mts_pending_jobs_size_max; extern ulong rpl_stop_slave_timeout; -extern my_bool log_bin_use_v1_row_events; +extern bool log_bin_use_v1_row_events; extern ulong what_to_log,flush_time; extern ulong max_prepared_stmt_count, prepared_stmt_count; extern ulong open_files_limit; @@ -257,10 +257,10 @@ extern ulong slave_max_allowed_packet; extern ulong opt_binlog_rows_event_max_size; extern ulong binlog_checksum_options; extern const char *binlog_checksum_type_names[]; -extern my_bool opt_master_verify_checksum; -extern my_bool opt_slave_sql_verify_checksum; +extern bool opt_master_verify_checksum; +extern bool opt_slave_sql_verify_checksum; extern uint32 gtid_executed_compression_period; -extern my_bool binlog_gtid_simple_recovery; +extern bool binlog_gtid_simple_recovery; extern ulong binlog_error_action; extern ulong locked_account_connection_count; enum enum_binlog_error_action @@ -303,10 +303,10 @@ extern bool mysqld_server_started; extern "C" MYSQL_PLUGIN_IMPORT int orig_argc; extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv; extern my_thread_attr_t connection_attrib; -extern my_bool old_mode; -extern my_bool avoid_temporal_upgrade; -extern my_bool dd_upgrade_flag; -extern my_bool dd_upgrade_skip_se; +extern bool old_mode; +extern bool avoid_temporal_upgrade; +extern bool dd_upgrade_flag; +extern bool dd_upgrade_skip_se; extern LEX_STRING opt_init_connect, opt_init_slave; extern ulong connection_errors_internal; extern ulong connection_errors_peer_addr; @@ -321,7 +321,7 @@ extern char *opt_log_syslog_facility; extern uint host_cache_size; extern ulong log_error_verbosity; -extern my_bool persisted_globals_load; +extern bool persisted_globals_load; extern LEX_CSTRING sql_statement_names[(uint) SQLCOM_END + 1]; @@ -598,7 +598,7 @@ extern PSI_statement_info stmt_info_rpl; extern struct st_VioSSLFd * ssl_acceptor_fd; #endif /* HAVE_OPENSSL */ -extern my_bool opt_large_pages; +extern bool opt_large_pages; extern uint opt_large_page_size; extern char lc_messages_dir[FN_REFLEN]; extern char *lc_messages_dir_ptr; diff --git a/sql/ndb_share.h b/sql/ndb_share.h index a729158bae4d..d01aa007f8e7 100644 --- a/sql/ndb_share.h +++ b/sql/ndb_share.h @@ -147,7 +147,7 @@ inline void set_binlog_nologging(NDB_SHARE *share) DBUG_PRINT("info", ("set_binlog_nologging")); share->flags|= NSF_NO_BINLOG; } -inline my_bool get_binlog_nologging(NDB_SHARE *share) +inline bool get_binlog_nologging(NDB_SHARE *share) { return (share->flags & NSF_NO_BINLOG) != 0; } inline void set_binlog_updated_only(NDB_SHARE *share) { @@ -159,7 +159,7 @@ inline void set_binlog_full(NDB_SHARE *share) DBUG_PRINT("info", ("set_binlog_full")); share->flags|= NSF_BINLOG_FULL; } -inline my_bool get_binlog_full(NDB_SHARE *share) +inline bool get_binlog_full(NDB_SHARE *share) { return (share->flags & NSF_BINLOG_FULL) != 0; } inline void set_binlog_use_write(NDB_SHARE *share) { @@ -171,7 +171,7 @@ inline void set_binlog_use_update(NDB_SHARE *share) DBUG_PRINT("info", ("set_binlog_use_update")); share->flags|= NSF_BINLOG_USE_UPDATE; } -inline my_bool get_binlog_use_update(NDB_SHARE *share) +inline bool get_binlog_use_update(NDB_SHARE *share) { return (share->flags & NSF_BINLOG_USE_UPDATE) != 0; } diff --git a/sql/opt_hints.h b/sql/opt_hints.h index 031c8a736ef4..1eb2ddee207b 100644 --- a/sql/opt_hints.h +++ b/sql/opt_hints.h @@ -101,7 +101,7 @@ class Opt_hints_map : public Sql_alloc @return true if hint is specified */ - my_bool is_specified(opt_hints_enum type_arg) const + bool is_specified(opt_hints_enum type_arg) const { return hints_specified.is_set(type_arg); } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 568d74346c3c..6a74aae5ef2f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3809,11 +3809,11 @@ typedef struct st_part_prune_param used in partitioning) Used to maintain current values of cur_part_fields and cur_subpart_fields */ - my_bool *is_part_keypart; + bool *is_part_keypart; /* Same as above for subpartitioning */ - my_bool *is_subpart_keypart; + bool *is_subpart_keypart; - my_bool ignore_part_fields; /* Ignore rest of partioning fields */ + bool ignore_part_fields; /* Ignore rest of partioning fields */ /*************************************************************** Following fields form find_used_partitions() recursion context: @@ -4851,9 +4851,9 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) total_parts)) || !(ppar->arg_stack= (SEL_ARG**)alloc_root(alloc, sizeof(SEL_ARG*)* total_parts)) || - !(ppar->is_part_keypart= (my_bool*)alloc_root(alloc, sizeof(my_bool)* - total_parts)) || - !(ppar->is_subpart_keypart= (my_bool*)alloc_root(alloc, sizeof(my_bool)* + !(ppar->is_part_keypart= (bool*)alloc_root(alloc, sizeof(bool)* + total_parts)) || + !(ppar->is_subpart_keypart= (bool*)alloc_root(alloc, sizeof(bool)* total_parts))) return TRUE; diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 82585ec6e4ba..a4816fd77e85 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -190,7 +190,7 @@ parse_string(const char *ptr, const char *end, MEM_ROOT *mem_root, TRUE error */ -static my_bool +static bool read_escaped_string(const char *ptr, const char *eol, LEX_STRING *str) { char *write_pos= str->str; @@ -382,7 +382,7 @@ bool get_file_options_ulllist(const char *&ptr, const char *end, const char *lin */ -my_bool +bool File_parser::parse(uchar* base, MEM_ROOT *mem_root, struct File_option *parameters, uint required, Unknown_key_hook *hook) const diff --git a/sql/parse_file.h b/sql/parse_file.h index 555ad885348d..a39450703696 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -92,16 +92,16 @@ class File_parser: public Sql_alloc { const char *start, *end; LEX_STRING file_type; - my_bool content_ok; + bool content_ok; public: File_parser() :start(0), end(0), content_ok(0) { file_type.str= 0; file_type.length= 0; } - my_bool ok() { return content_ok; } + bool ok() { return content_ok; } const LEX_STRING *type() const { return &file_type; } - my_bool parse(uchar* base, MEM_ROOT *mem_root, - struct File_option *parameters, uint required, - Unknown_key_hook *hook) const; + bool parse(uchar* base, MEM_ROOT *mem_root, + struct File_option *parameters, uint required, + Unknown_key_hook *hook) const; friend File_parser *sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, diff --git a/sql/partitioning/partition_handler.h b/sql/partitioning/partition_handler.h index 2ee5d580fc03..05a939c6597a 100644 --- a/sql/partitioning/partition_handler.h +++ b/sql/partitioning/partition_handler.h @@ -82,7 +82,7 @@ typedef struct st_part_name_def uchar *partition_name; uint length; uint32 part_id; - my_bool is_subpart; + bool is_subpart; } PART_NAME_DEF; diff --git a/sql/rpl_master.cc b/sql/rpl_master.cc index 45bcc2cddfab..755ae466f33a 100644 --- a/sql/rpl_master.cc +++ b/sql/rpl_master.cc @@ -65,7 +65,7 @@ int max_binlog_dump_events = 0; // unlimited -my_bool opt_sporadic_binlog_dump_fail = 0; +bool opt_sporadic_binlog_dump_fail = 0; #define SLAVE_LIST_CHUNK 128 HASH slave_list; diff --git a/sql/rpl_master.h b/sql/rpl_master.h index a5886d96f5d8..42d545c7e6a4 100644 --- a/sql/rpl_master.h +++ b/sql/rpl_master.h @@ -29,8 +29,8 @@ class THD; extern bool server_id_supplied; extern int max_binlog_dump_events; -extern my_bool opt_sporadic_binlog_dump_fail; -extern my_bool opt_show_slave_auth_info; +extern bool opt_sporadic_binlog_dump_fail; +extern bool opt_show_slave_auth_info; typedef struct st_slave_info { diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index e621fe83b774..0803d1b10235 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -502,8 +502,8 @@ bool Master_info::read_info(Rpl_info_handler *from) DBUG_RETURN(true); } - ssl= (my_bool) MY_TEST(temp_ssl); - ssl_verify_server_cert= (my_bool) MY_TEST(temp_ssl_verify_server_cert); + ssl= (bool) MY_TEST(temp_ssl); + ssl_verify_server_cert= (bool) MY_TEST(temp_ssl_verify_server_cert); master_log_pos= (my_off_t) temp_master_log_pos; auto_position= MY_TEST(temp_auto_position); diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index c2c9cb75eabf..94622fec1c29 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -250,11 +250,11 @@ friend class Rpl_info_factory; strmake(start_plugin_dir, src, sizeof(start_plugin_dir) - 1); } - my_bool ssl; // enables use of SSL connection if true + bool ssl; // enables use of SSL connection if true char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN]; char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN], tls_version[FN_REFLEN]; char ssl_crl[FN_REFLEN], ssl_crlpath[FN_REFLEN]; - my_bool ssl_verify_server_cert; + bool ssl_verify_server_cert; MYSQL* mysql; uint32 file_id; /* for 3.23 load data infile */ diff --git a/sql/rpl_rli_pdb.cc b/sql/rpl_rli_pdb.cc index 8a7234bfb800..494827707d14 100644 --- a/sql/rpl_rli_pdb.cc +++ b/sql/rpl_rli_pdb.cc @@ -1012,7 +1012,7 @@ Slave_worker *map_db_to_worker(const char *dbname, Relay_log_info *rli, map the database to a worker my inserting an entry into the hash map. */ - my_bool ret; + bool ret; char *db= NULL; mysql_mutex_unlock(&rli->slave_worker_hash_lock); diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc index da8af8f4caae..6315df9c7ed4 100644 --- a/sql/rpl_slave.cc +++ b/sql/rpl_slave.cc @@ -150,7 +150,7 @@ MY_BITMAP slave_error_mask; char slave_skip_error_names[SHOW_VAR_FUNC_BUFF_SIZE]; char* slave_load_tmpdir = 0; -my_bool replicate_same_server_id; +bool replicate_same_server_id; ulonglong relay_log_space_limit = 0; const char *relay_log_index= 0; diff --git a/sql/rpl_slave.h b/sql/rpl_slave.h index f58a900bc956..e01f69121515 100644 --- a/sql/rpl_slave.h +++ b/sql/rpl_slave.h @@ -252,8 +252,8 @@ extern char *slave_load_tmpdir; extern char *master_info_file, *relay_log_info_file; extern char *opt_relay_logname, *opt_relaylog_index_name; extern char *opt_binlog_index_name; -extern my_bool opt_skip_slave_start, opt_reckless_slave; -extern my_bool opt_log_slave_updates; +extern bool opt_skip_slave_start, opt_reckless_slave; +extern bool opt_log_slave_updates; extern char *opt_slave_skip_errors; extern ulonglong relay_log_space_limit; @@ -402,7 +402,7 @@ extern "C" void *handle_slave_io(void *arg); extern "C" void *handle_slave_sql(void *arg); bool net_request_file(NET* net, const char* fname); -extern my_bool replicate_same_server_id; +extern bool replicate_same_server_id; extern int disconnect_slave_event_count, abort_slave_event_count ; diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 297d0a6f101b..74965b3d3c05 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -341,7 +341,7 @@ class table_def This function returns whether the field on the master can be null. This value is derived from field->maybe_null(). */ - my_bool maybe_null(uint index) const + bool maybe_null(uint index) const { DBUG_ASSERT(index < m_size); return ((m_null_bits[(index / 8)] & diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc index f3ce6ca75b88..2c5dad795183 100644 --- a/sql/sql_audit.cc +++ b/sql/sql_audit.cc @@ -1012,7 +1012,7 @@ int mysql_audit_notify(THD *thd, @return FALSE is always returned. */ -static my_bool acquire_lookup_mask(THD *thd, plugin_ref plugin, void *arg) +static bool acquire_lookup_mask(THD *thd, plugin_ref plugin, void *arg) { st_mysql_subscribe_event *evt= static_cast(arg); st_mysql_audit *audit= plugin_data(plugin); @@ -1035,7 +1035,7 @@ static my_bool acquire_lookup_mask(THD *thd, plugin_ref plugin, void *arg) @return This function always returns FALSE. */ -static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg) +static bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg) { st_mysql_subscribe_event *evt= static_cast(arg); st_mysql_audit *data= plugin_data(plugin); @@ -1288,7 +1288,7 @@ int initialize_audit_plugin(st_plugin_int *plugin) @retval FALSE always */ -static my_bool calc_class_mask(THD *thd, plugin_ref plugin, void *arg) +static bool calc_class_mask(THD *thd, plugin_ref plugin, void *arg) { st_mysql_audit *data= plugin_data(plugin); if (data) @@ -1363,7 +1363,7 @@ static int plugins_dispatch(THD *thd, plugin_ref plugin, void *arg) event_generic->event); } -static my_bool plugins_dispatch_bool(THD *thd, plugin_ref plugin, void *arg) +static bool plugins_dispatch_bool(THD *thd, plugin_ref plugin, void *arg) { return plugins_dispatch(thd, plugin, arg) ? TRUE : FALSE; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 84659f8a397c..78356fbfea1e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2426,7 +2426,7 @@ void close_temporary(THD *thd, TABLE *table, bool free_share, bool delete_table) */ bool rename_temporary_table(THD* thd, TABLE *table, const char *db, - const char *table_name) + const char *table_name) { char *key; size_t key_length; @@ -8886,8 +8886,8 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref, FALSE OK */ bool setup_natural_join_row_types(THD *thd, - List *from_clause, - Name_resolution_context *context) + List *from_clause, + Name_resolution_context *context) { DBUG_ENTER("setup_natural_join_row_types"); thd->where= "from clause"; @@ -9833,7 +9833,7 @@ bool mysql_rm_tmp_tables(void) List_iterator files_it; MEM_ROOT files_root; LEX_STRING *file_str; - my_bool result= true; + bool result= true; DBUG_ENTER("mysql_rm_tmp_tables"); if (!(thd= new THD)) diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 7b37dc8db0b9..4d6b253496ae 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -84,14 +84,14 @@ template class Bitmap } void subtract(const Bitmap& map2) { bitmap_subtract(&map, &map2.map); } void merge(const Bitmap& map2) { bitmap_union(&map, &map2.map); } - my_bool is_set(uint n) const { return bitmap_is_set(&map, n); } - my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); } - my_bool is_clear_all() const { return bitmap_is_clear_all(&map); } - my_bool is_set_all() const { return bitmap_is_set_all(&map); } - my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); } - my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); } - my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } - my_bool operator!=(const Bitmap& map2) const { return !(*this == map2); } + bool is_set(uint n) const { return bitmap_is_set(&map, n); } + bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); } + bool is_clear_all() const { return bitmap_is_clear_all(&map); } + bool is_set_all() const { return bitmap_is_set_all(&map); } + bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); } + bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); } + bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } + bool operator!=(const Bitmap& map2) const { return !(*this == map2); } char *print(char *buf) const { char *s=buf; @@ -149,9 +149,9 @@ template <> class Bitmap<64> void intersect_extended(ulonglong map2) { map&= map2; } void subtract(const Bitmap<64>& map2) { map&= ~map2.map; } void merge(const Bitmap<64>& map2) { map|= map2.map; } - my_bool is_set(uint n) const + bool is_set(uint n) const { DBUG_ASSERT(n < 64); return MY_TEST(map & (((ulonglong)1) << n)); } - my_bool is_prefix(uint n) const + bool is_prefix(uint n) const { DBUG_ASSERT(n <= 64); if (n < 64) @@ -159,13 +159,13 @@ template <> class Bitmap<64> else return map == ~(ulonglong)1; } - my_bool is_clear_all() const { return map == (ulonglong)0; } - my_bool is_set_all() const { return map == ~(ulonglong)0; } - my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } - my_bool is_overlapping(const Bitmap<64>& map2) const + bool is_clear_all() const { return map == (ulonglong)0; } + bool is_set_all() const { return map == ~(ulonglong)0; } + bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } + bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; } - my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } - my_bool operator!=(const Bitmap<64>& map2) const { return !(*this == map2); } + bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } + bool operator!=(const Bitmap<64>& map2) const { return !(*this == map2); } char *print(char *buf) const { longlong2str(map,buf,16); return buf; } ulonglong to_ulonglong() const { return map; } }; diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 68438d7953c0..2c9cc7d49237 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -47,9 +47,9 @@ static const ulong QUERY_CACHE_MIN_RESULT_DATA_SIZE= 1024*4; typedef size_t TABLE_COUNTER_TYPE; -typedef my_bool (*qc_engine_callback)(THD *thd, const char *table_key, - uint key_length, - ulonglong *engine_data); +typedef bool (*qc_engine_callback)(THD *thd, const char *table_key, + uint key_length, + ulonglong *engine_data); /** libmysql convenience wrapper to insert data into query cache. diff --git a/sql/sql_class.h b/sql/sql_class.h index 01c14cbd9476..4ef339c06c91 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1587,7 +1587,7 @@ class THD :public MDL_context_owner, Transaction_ctx *m_trx; /// Transaction read-only state. - my_bool m_tx_read_only; + bool m_tx_read_only; /// THD options. ulonglong m_thd_option_bits; @@ -2369,7 +2369,7 @@ class THD :public MDL_context_owner, /* Used by the sys_var class to store temporary values */ union { - my_bool my_bool_value; + bool bool_value; long long_value; ulong ulong_value; ulonglong ulonglong_value; @@ -2751,8 +2751,8 @@ class THD :public MDL_context_owner, bool allocate_lex_string); bool convert_string(LEX_STRING *to, const CHARSET_INFO *to_cs, - const char *from, size_t from_length, - const CHARSET_INFO *from_cs); + const char *from, size_t from_length, + const CHARSET_INFO *from_cs); bool convert_string(String *s, const CHARSET_INFO *from_cs, const CHARSET_INFO *to_cs); diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 1614a21c778c..09b566bec85e 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -514,7 +514,7 @@ static int check_connection(THD *thd) if (!thd->m_main_security_ctx.host().length) // If TCP/IP connection { - my_bool peer_rc; + bool peer_rc; char ip[NI_MAXHOST]; LEX_CSTRING main_sctx_ip; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 24be494ab427..80ffaa59c342 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -104,7 +104,7 @@ static bool find_unknown_and_remove_deletable_files(THD *thd, MY_DIR *dirp, static bool find_db_tables(THD *thd, const char *db, TABLE_LIST **tables); static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path); -static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error); +static bool rm_dir_w_symlink(const char *org_path, bool send_error); static void mysql_change_db_impl(THD *thd, const LEX_CSTRING &new_db_name, ulong new_db_access, @@ -1000,7 +1000,7 @@ static bool find_db_tables(THD *thd, const char *db, TABLE_LIST **tables) 1 ERROR */ -static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error) +static bool rm_dir_w_symlink(const char *org_path, bool send_error) { char tmp_path[FN_REFLEN], *pos; char *path= tmp_path; diff --git a/sql/sql_initialize.cc b/sql/sql_initialize.cc index 51ef760f7e83..e044e4433620 100644 --- a/sql/sql_initialize.cc +++ b/sql/sql_initialize.cc @@ -50,7 +50,7 @@ static const char *initialization_cmds[] = char insert_user_buffer[sizeof(INSERT_USER_CMD) + GENERATED_PASSWORD_LENGTH * 2]; -my_bool opt_initialize_insecure= FALSE; +bool opt_initialize_insecure= FALSE; static const char *initialization_data[] = { diff --git a/sql/sql_initialize.h b/sql/sql_initialize.h index 9342c0e2ddbb..2eb9c4e1b3fb 100644 --- a/sql/sql_initialize.h +++ b/sql/sql_initialize.h @@ -37,7 +37,7 @@ class Compiled_in_command_iterator : public bootstrap::Command_iterator bool is_active; }; -extern my_bool opt_initialize_insecure; +extern bool opt_initialize_insecure; bool initialize_create_data_directory(const char *data_home); #endif /* SQL_INITIALIZE_H */ diff --git a/sql/sql_optimizer.cc b/sql/sql_optimizer.cc index 5e2b78d33c17..476a12485aca 100644 --- a/sql/sql_optimizer.cc +++ b/sql/sql_optimizer.cc @@ -1470,7 +1470,7 @@ int test_if_order_by_key(ORDER_with_src *order_src, TABLE *table, uint idx, key_part_map const_key_parts=table->const_key_parts[idx]; int reverse=0; uint key_parts; - my_bool on_pk_suffix= FALSE; + bool on_pk_suffix= FALSE; // Whether [extented] key has key parts with mixed ASC/DESC order bool mixed_order= false; // Order direction of the first key part @@ -7556,7 +7556,7 @@ add_key_fields(JOIN *join, Key_field **key_fields, uint *and_level, case Item_func::OPTIMIZE_OP: { bool equal_func=(cond_func->functype() == Item_func::EQ_FUNC || - cond_func->functype() == Item_func::EQUAL_FUNC); + cond_func->functype() == Item_func::EQUAL_FUNC); if (is_local_field (cond_func->arguments()[0])) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d7333c5d694b..dea6ebe4b42d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1144,8 +1144,8 @@ bool do_command(THD *thd) @retval TRUE The statement should be denied. @retval FALSE The statement isn't updating any relevant tables. */ -static my_bool deny_updates_if_read_only_option(THD *thd, - TABLE_LIST *all_tables) +static bool deny_updates_if_read_only_option(THD *thd, + TABLE_LIST *all_tables) { DBUG_ENTER("deny_updates_if_read_only_option"); @@ -1160,24 +1160,24 @@ static my_bool deny_updates_if_read_only_option(THD *thd, if (lex->sql_command == SQLCOM_UPDATE_MULTI) DBUG_RETURN(FALSE); - const my_bool create_temp_tables= + const bool create_temp_tables= (lex->sql_command == SQLCOM_CREATE_TABLE) && (lex->create_info->options & HA_LEX_CREATE_TMP_TABLE); - const my_bool create_real_tables= + const bool create_real_tables= (lex->sql_command == SQLCOM_CREATE_TABLE) && !(lex->create_info->options & HA_LEX_CREATE_TMP_TABLE); - const my_bool drop_temp_tables= + const bool drop_temp_tables= (lex->sql_command == SQLCOM_DROP_TABLE) && lex->drop_temporary; - const my_bool update_real_tables= + const bool update_real_tables= ((create_real_tables || some_non_temp_table_to_be_updated(thd, all_tables)) && !(create_temp_tables || drop_temp_tables)); - const my_bool create_or_drop_databases= + const bool create_or_drop_databases= (lex->sql_command == SQLCOM_CREATE_DB) || (lex->sql_command == SQLCOM_DROP_DB); @@ -5306,13 +5306,13 @@ bool mysql_test_parse_for_slave(THD *thd) bool Alter_info::add_field(THD *thd, const LEX_STRING *field_name, enum_field_types type, - const char *length, const char *decimals, - uint type_modifier, - Item *default_value, Item *on_update_value, + const char *length, const char *decimals, + uint type_modifier, + Item *default_value, Item *on_update_value, LEX_STRING *comment, - const char *change, + const char *change, List *interval_list, const CHARSET_INFO *cs, - uint uint_geom_type, + uint uint_geom_type, Generated_column *gcol_info, const char *opt_after) { diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 5167603d4192..85ea1354dcde 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -539,9 +539,9 @@ class sys_var_pluginvar: public sys_var static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv); static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, const char *list); -static my_bool check_if_option_is_deprecated(int optid, - const struct my_option *opt, - char *argument); +static bool check_if_option_is_deprecated(int optid, + const struct my_option *opt, + char *argument); static int test_plugin_options(MEM_ROOT *, st_plugin_int *, int *, char **); static bool register_builtin(st_mysql_plugin *, st_plugin_int *, @@ -2594,8 +2594,8 @@ bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, #define EXTRA_OPTIONS 3 /* options for: 'foo', 'plugin-foo' and NULL */ -typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_bool_t, my_bool); -typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, my_bool); +typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_bool_t, bool); +typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, bool); typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_str_t, char *); typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_str_t, char *); @@ -2648,7 +2648,7 @@ static int check_func_bool(THD*, st_mysql_sys_var*, goto err; result= (int) tmp; } - *(my_bool *) save= result ? TRUE : FALSE; + *(bool *) save= result ? TRUE : FALSE; return 0; err: return 1; @@ -2658,7 +2658,7 @@ static int check_func_bool(THD*, st_mysql_sys_var*, static int check_func_int(THD *thd, st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed1, fixed2; + bool fixed1, fixed2; long long orig, val; struct my_option options; value->val_int(value, &orig); @@ -2687,7 +2687,7 @@ static int check_func_int(THD *thd, st_mysql_sys_var *var, static int check_func_long(THD *thd, st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed1, fixed2; + bool fixed1, fixed2; long long orig, val; struct my_option options; value->val_int(value, &orig); @@ -2716,7 +2716,7 @@ static int check_func_long(THD *thd, st_mysql_sys_var *var, static int check_func_longlong(THD *thd, st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed1, fixed2; + bool fixed1, fixed2; long long orig, val; struct my_option options; value->val_int(value, &orig); @@ -2838,7 +2838,7 @@ static int check_func_double(THD *thd, st_mysql_sys_var *var, void *save, st_mysql_value *value) { double v; - my_bool fixed; + bool fixed; struct my_option option; value->val_real(value, &v); @@ -2852,7 +2852,7 @@ static int check_func_double(THD *thd, st_mysql_sys_var *var, static void update_func_bool(THD*, st_mysql_sys_var*, void *tgt, const void *save) { - *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; + *(bool *) tgt= *(bool *) save ? TRUE : FALSE; } @@ -3007,7 +3007,7 @@ static st_bookmark *register_var(const char *plugin, const char *name, switch (flags & PLUGIN_VAR_TYPEMASK) { case PLUGIN_VAR_BOOL: - size= sizeof(my_bool); + size= sizeof(bool); break; case PLUGIN_VAR_INT: size= sizeof(int); @@ -3248,9 +3248,9 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) construct_options to their respective types. */ -static my_bool *mysql_sys_var_bool(THD* thd, int offset) +static bool *mysql_sys_var_bool(THD* thd, int offset) { - return (my_bool *) intern_sys_var_ptr(thd, offset, true); + return (bool *) intern_sys_var_ptr(thd, offset, true); } static int *mysql_sys_var_int(THD* thd, int offset) @@ -3815,7 +3815,7 @@ bool sys_var_pluginvar::is_default(THD *thd, set_var *var) case PLUGIN_VAR_SET: return (((sysvar_set_t*) plugin_var)->def_val == *(ulong *)tgt); case PLUGIN_VAR_BOOL: - return (((sysvar_bool_t*) plugin_var)->def_val == *(my_bool *)tgt); + return (((sysvar_bool_t*) plugin_var)->def_val == *(bool *)tgt); case PLUGIN_VAR_STR: return !strcmp((char*)(((sysvar_str_t*) plugin_var)->def_val),*(char **)tgt); @@ -3833,7 +3833,7 @@ bool sys_var_pluginvar::is_default(THD *thd, set_var *var) case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL: return (((thdvar_set_t*) plugin_var)->def_val == *(ulong *)tgt); case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL: - return (((thdvar_bool_t*) plugin_var)->def_val == *(my_bool *)tgt); + return (((thdvar_bool_t*) plugin_var)->def_val == *(bool *)tgt); case PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL: return !strcmp((char*)(((thdvar_str_t*) plugin_var)->def_val),*(char **)tgt); @@ -4046,10 +4046,10 @@ static void plugin_opt_set_limits(struct my_option *options, options->arg_type= OPT_ARG; } -extern "C" my_bool get_one_plugin_option(int, const struct my_option*, - char *); +extern "C" bool get_one_plugin_option(int, const struct my_option*, + char *); -my_bool get_one_plugin_option(int, const struct my_option*, char*) +bool get_one_plugin_option(int, const struct my_option*, char*) { return 0; } @@ -4380,9 +4380,9 @@ static my_option *construct_help_options(MEM_ROOT *mem_root, @retval 0 Success */ -static my_bool check_if_option_is_deprecated(int optid, - const struct my_option *opt, - char *argument MY_ATTRIBUTE((unused))) +static bool check_if_option_is_deprecated(int optid, + const struct my_option *opt, + char *argument MY_ATTRIBUTE((unused))) { if (optid == -1) { diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 0afcb67f8ece..03429acba8e6 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -181,9 +181,9 @@ extern void plugin_thdvar_safe_update(THD *thd, st_mysql_sys_var *var, extern bool check_valid_path(const char *path, size_t length); extern void alloc_and_copy_thd_dynamic_variables(THD *thd, bool global_lock); -typedef my_bool (plugin_foreach_func)(THD *thd, - plugin_ref plugin, - void *arg); +typedef bool (plugin_foreach_func)(THD *thd, + plugin_ref plugin, + void *arg); #define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D) extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, int type, uint state_mask, void *arg); diff --git a/sql/sql_query_rewrite.cc b/sql/sql_query_rewrite.cc index 87ded5b073ee..dfd81624c03d 100644 --- a/sql/sql_query_rewrite.cc +++ b/sql/sql_query_rewrite.cc @@ -96,7 +96,7 @@ void enable_digest_if_any_plugin_needs_it(THD *thd, Parser_state *ps) } -bool invoke_post_parse_rewrite_plugins(THD *thd, my_bool is_prepared) +bool invoke_post_parse_rewrite_plugins(THD *thd, bool is_prepared) { Diagnostics_area *plugin_da= thd->get_query_rewrite_plugin_da(); plugin_da->reset_diagnostics_area(); diff --git a/sql/sql_query_rewrite.h b/sql/sql_query_rewrite.h index 75aa9358c418..45c5831f21b4 100644 --- a/sql/sql_query_rewrite.h +++ b/sql/sql_query_rewrite.h @@ -49,6 +49,6 @@ void enable_digest_if_any_plugin_needs_it(THD *thd, Parser_state *ps); @param[in] thd The session with the query to be rewritten. @param is_prepared True if the query was a prepared statement. */ -bool invoke_post_parse_rewrite_plugins(THD *thd, my_bool is_prepared); +bool invoke_post_parse_rewrite_plugins(THD *thd, bool is_prepared); #endif /* SQL_QUERY_REWRITE_INCLUDED */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8f8b33ff6c1a..f85219b3a93a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1689,7 +1689,7 @@ void calc_used_field_length(TABLE *table, if (null_fields || uneven_bit_fields) rec_length+= (table->s->null_fields + 7) / 8; if (table->is_nullable()) - rec_length+= sizeof(my_bool); + rec_length+= sizeof(bool); if (blobs) { uint blob_length=(uint) (table->file->stats.mean_rec_length- @@ -3706,7 +3706,7 @@ bool JOIN::alloc_func_list() bool JOIN::make_sum_func_list(List &field_list, List &send_result_set_metadata, - bool before_group_by, bool recompute) + bool before_group_by, bool recompute) { List_iterator_fast it(field_list); Item_sum **func; @@ -3834,7 +3834,7 @@ bool JOIN::rollup_process_const_fields() */ bool JOIN::rollup_make_fields(List &fields_arg, List &sel_fields, - Item_sum ***func) + Item_sum ***func) { List_iterator_fast it(fields_arg); Item *first_field= sel_fields.head(); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f10d53963005..cb9219d082c6 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -220,8 +220,8 @@ static size_t make_version_string(char *buf, size_t buf_length, uint version) return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff); } -static my_bool show_plugins(THD *thd, plugin_ref plugin, - void *arg) +static bool show_plugins(THD *thd, plugin_ref plugin, + void *arg) { TABLE *table= (TABLE*) arg; struct st_mysql_plugin *plug= plugin_decl(plugin); @@ -1941,14 +1941,14 @@ void append_definer(THD *thd, String *buffer, const LEX_CSTRING &definer_user, static int view_store_create_info(THD *thd, TABLE_LIST *table, String *buff) { - my_bool compact_view_name= TRUE; - my_bool compact_view_format= TRUE; - my_bool foreign_db_mode= (thd->variables.sql_mode & (MODE_POSTGRESQL | - MODE_ORACLE | - MODE_MSSQL | - MODE_DB2 | - MODE_MAXDB | - MODE_ANSI)) != 0; + bool compact_view_name= TRUE; + bool compact_view_format= TRUE; + bool foreign_db_mode= (thd->variables.sql_mode & (MODE_POSTGRESQL | + MODE_ORACLE | + MODE_MSSQL | + MODE_DB2 | + MODE_MAXDB | + MODE_ANSI)) != 0; if (!thd->db().str || strcmp(thd->db().str, table->view_db.str)) /* @@ -2770,7 +2770,7 @@ const char* get_one_variable_ext(THD *running_thd, THD *target_thd, break; case SHOW_MY_BOOL: - end= my_stpcpy(buff, *(my_bool*) value ? "ON" : "OFF"); + end= my_stpcpy(buff, *(bool*) value ? "ON" : "OFF"); value_charset= system_charset_info; break; @@ -3416,8 +3416,8 @@ struct st_add_schema_table }; -static my_bool add_schema_table(THD *thd, plugin_ref plugin, - void* p_data) +static bool add_schema_table(THD *thd, plugin_ref plugin, + void* p_data) { LEX_STRING *file_name= 0; st_add_schema_table *data= (st_add_schema_table *)p_data; @@ -4619,8 +4619,8 @@ static int get_schema_tmp_table_columns_record(THD *thd, TABLE_LIST *tables, } -static my_bool iter_schema_engines(THD *thd, plugin_ref plugin, - void *ptable) +static bool iter_schema_engines(THD *thd, plugin_ref plugin, + void *ptable) { TABLE *table= (TABLE *) ptable; handlerton *hton= plugin_data(plugin); @@ -5409,8 +5409,8 @@ struct schema_table_ref 0 table not found 1 found the schema table */ -static my_bool find_schema_table_in_plugin(THD*, plugin_ref plugin, - void* p_table) +static bool find_schema_table_in_plugin(THD*, plugin_ref plugin, + void* p_table) { schema_table_ref *p_schema_table= (schema_table_ref *)p_table; const char* table_name= p_schema_table->table_name; @@ -6035,8 +6035,8 @@ struct run_hton_fill_schema_table_args Item *cond; }; -static my_bool run_hton_fill_schema_table(THD *thd, plugin_ref plugin, - void *arg) +static bool run_hton_fill_schema_table(THD *thd, plugin_ref plugin, + void *arg) { struct run_hton_fill_schema_table_args *args= (run_hton_fill_schema_table_args *) arg; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2bef6e6ec7f6..ce4308d32a69 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2528,8 +2528,8 @@ bool lock_trigger_names(THD *thd, */ -bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, - my_bool drop_temporary) +bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists, + bool drop_temporary) { bool error; Drop_table_error_handler err_handler; @@ -6638,7 +6638,7 @@ bool validate_comment_length(THD *thd, const char *comment_str, */ static bool set_table_default_charset(THD *thd, - HA_CREATE_INFO *create_info, + HA_CREATE_INFO *create_info, const char *db) { /* @@ -7625,7 +7625,7 @@ mysql_rename_table(THD *thd, handlerton *base, const char *old_db, Remove the old table share from the pfs table share array. The new table share will be created when the renamed table is first accessed. */ - my_bool temp_table= (my_bool)is_prefix(old_name, tmp_file_prefix); + bool temp_table= (bool)is_prefix(old_name, tmp_file_prefix); PSI_TABLE_CALL(drop_table_share) (temp_table, old_db, static_cast(strlen(old_db)), old_name, static_cast(strlen(old_name))); diff --git a/sql/sql_table.h b/sql/sql_table.h index a405087b2ad0..fe4bb3e3c139 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -238,8 +238,8 @@ bool mysql_rename_table(THD *thd, handlerton *base, const char *old_db, bool mysql_checksum_table(THD* thd, TABLE_LIST* table_list, HA_CHECK_OPT* check_opt); -bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, - my_bool drop_temporary); +bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists, + bool drop_temporary); bool mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, bool drop_temporary, bool drop_database, bool *dropped_non_atomic_flag, @@ -265,10 +265,10 @@ int write_bin_log(THD *thd, bool clear_error, const char *query, size_t query_length, bool is_trans= FALSE); bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, - DDL_LOG_MEMORY_ENTRY **active_entry); + DDL_LOG_MEMORY_ENTRY **active_entry); bool write_execute_ddl_log_entry(uint first_entry, - bool complete, - DDL_LOG_MEMORY_ENTRY **active_entry); + bool complete, + DDL_LOG_MEMORY_ENTRY **active_entry); bool deactivate_ddl_log_entry(uint entry_no); void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry); void release_ddl_log(); diff --git a/sql/sql_time.cc b/sql/sql_time.cc index e0eafc1d66ec..61fddfda74b2 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -332,7 +332,7 @@ bool datetime_add_nanoseconds_adjust_frac(MYSQL_TIME *ltime, uint nanoseconds, @retval False on success. No real failure case here. */ bool time_add_nanoseconds_adjust_frac(MYSQL_TIME *ltime, uint nanoseconds, - int *warnings, bool truncate) + int *warnings, bool truncate) { if (truncate) return time_add_nanoseconds_with_truncate(ltime, nanoseconds, warnings); @@ -758,7 +758,7 @@ bool my_longlong_to_time_with_warn(longlong nr, MYSQL_TIME *ltime) @retval Number seconds in UTC since start of Unix Epoch corresponding to t. @retval 0 - t contains datetime value which is out of TIMESTAMP range. */ -my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_gap) +my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, bool *in_dst_time_gap) { my_time_t timestamp; @@ -824,7 +824,7 @@ bool datetime_with_no_zero_in_date_to_timeval(THD *thd, return false; } - my_bool in_dst_time_gap; + bool in_dst_time_gap; if (!(tm->tv_sec= TIME_to_timestamp(thd, ltime, &in_dst_time_gap))) { /* @@ -981,7 +981,7 @@ void calc_time_from_sec(MYSQL_TIME *to, longlong seconds, long microseconds) */ bool parse_date_time_format(timestamp_type format_type, - Date_time_format *date_time_format) + Date_time_format *date_time_format) { const char *format= date_time_format->format.str; size_t format_length= date_time_format->format.length; diff --git a/sql/sql_time.h b/sql/sql_time.h index c674dcfb3645..b1d5874eff82 100644 --- a/sql/sql_time.h +++ b/sql/sql_time.h @@ -65,7 +65,7 @@ ulong convert_period_to_month(ulong period); ulong convert_month_to_period(ulong month); void mix_date_and_time(MYSQL_TIME *ldate, const MYSQL_TIME *ltime); void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day); -my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *not_exist); +my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, bool *not_exist); bool datetime_with_no_zero_in_date_to_timeval(THD *thd, const MYSQL_TIME *t, struct timeval *tm, int *warnings); diff --git a/sql/sql_tmp_table.cc b/sql/sql_tmp_table.cc index 66d5c50a1317..494a341fe038 100644 --- a/sql/sql_tmp_table.cc +++ b/sql/sql_tmp_table.cc @@ -2196,7 +2196,7 @@ bool open_tmp_table(TABLE *table) static bool create_myisam_tmp_table(TABLE *table, KEY *keyinfo, MI_COLUMNDEF *start_recinfo, MI_COLUMNDEF **recinfo, - ulonglong options, my_bool big_tables) + ulonglong options, bool big_tables) { int error; MI_KEYDEF keydef; @@ -2398,7 +2398,7 @@ static void trace_tmp_table(Opt_trace_context *trace, const TABLE *table) bool instantiate_tmp_table(THD *thd, TABLE *table, KEY *keyinfo, MI_COLUMNDEF *start_recinfo, MI_COLUMNDEF **recinfo, - ulonglong options, my_bool big_tables) + ulonglong options, bool big_tables) { TABLE_SHARE *const share= table->s; #ifndef DBUG_OFF @@ -2577,7 +2577,7 @@ void free_tmp_table(THD *thd, TABLE *entry) bool create_ondisk_from_heap(THD *thd, TABLE *wtable, MI_COLUMNDEF *start_recinfo, MI_COLUMNDEF **recinfo, - int error, bool ignore_last_dup, + int error, bool ignore_last_dup, bool *is_duplicate) { int write_err= 0; diff --git a/sql/sql_tmp_table.h b/sql/sql_tmp_table.h index 5afa8703f56d..8b121cba2366 100644 --- a/sql/sql_tmp_table.h +++ b/sql/sql_tmp_table.h @@ -61,7 +61,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List &field_list); bool create_ondisk_from_heap(THD *thd, TABLE *table, MI_COLUMNDEF *start_recinfo, MI_COLUMNDEF **recinfo, - int error, bool ignore_last_dup, + int error, bool ignore_last_dup, bool *is_duplicate); void free_tmp_table(THD *thd, TABLE *entry); TABLE *create_duplicate_weedout_tmp_table(THD *thd, @@ -70,7 +70,7 @@ TABLE *create_duplicate_weedout_tmp_table(THD *thd, bool instantiate_tmp_table(THD *thd, TABLE *table, KEY *keyinfo, MI_COLUMNDEF *start_recinfo, MI_COLUMNDEF **recinfo, - ulonglong options, my_bool big_tables); + ulonglong options, bool big_tables); Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, Mem_root_array *copy_func, Field **from_field, Field **default_field, diff --git a/sql/sql_udf.h b/sql/sql_udf.h index bfcc1746e500..770c770d2818 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -42,7 +42,7 @@ enum Item_udftype {UDFTYPE_FUNCTION=1,UDFTYPE_AGGREGATE}; typedef void (*Udf_func_clear)(UDF_INIT *, uchar *, uchar *); typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *); typedef void (*Udf_func_deinit)(UDF_INIT*); -typedef my_bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *); +typedef bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *); typedef void (*Udf_func_any)(); typedef double (*Udf_func_double)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *); typedef longlong (*Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, uchar *, @@ -88,7 +88,7 @@ class udf_handler :public Sql_alloc { return u_d ? u_d->returns : STRING_RESULT;} bool get_arguments(); bool fix_fields(THD *thd, Item_result_field *item, - uint arg_count, Item **args); + uint arg_count, Item **args); void cleanup(); double val(bool *null_value) { diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 43c0976dfcc7..9c5322f7725c 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -2019,7 +2019,7 @@ bool Query_result_update::optimize() tmp_param->group_parts=1; tmp_param->group_length= table->file->ref_length; /* small table, ignore SQL_BIG_TABLES */ - my_bool save_big_tables= thd->variables.big_tables; + bool save_big_tables= thd->variables.big_tables; thd->variables.big_tables= FALSE; tmp_tables[cnt]=create_tmp_table(thd, tmp_param, temp_fields, &group, 0, 0, diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index b7f0c79646c8..3d27c4780a4c 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -204,7 +204,7 @@ static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), \ NULL, sys_var::PARSE_EARLY -static Sys_var_mybool Sys_pfs_enabled( +static Sys_var_bool Sys_pfs_enabled( "performance_schema", "Enable the performance schema.", READ_ONLY GLOBAL_VAR(pfs_param.m_enabled), @@ -220,105 +220,105 @@ static Sys_var_charptr Sys_pfs_instrument( DEFAULT(""), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_stages_current( +static Sys_var_bool Sys_pfs_consumer_events_stages_current( "performance_schema_consumer_events_stages_current", "Default startup value for the events_stages_current consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_current_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_stages_history( +static Sys_var_bool Sys_pfs_consumer_events_stages_history( "performance_schema_consumer_events_stages_history", "Default startup value for the events_stages_history consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_stages_history_long( +static Sys_var_bool Sys_pfs_consumer_events_stages_history_long( "performance_schema_consumer_events_stages_history_long", "Default startup value for the events_stages_history_long consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_long_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_statements_current( +static Sys_var_bool Sys_pfs_consumer_events_statements_current( "performance_schema_consumer_events_statements_current", "Default startup value for the events_statements_current consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_current_enabled), CMD_LINE(OPT_ARG), DEFAULT(TRUE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_statements_history( +static Sys_var_bool Sys_pfs_consumer_events_statements_history( "performance_schema_consumer_events_statements_history", "Default startup value for the events_statements_history consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_enabled), CMD_LINE(OPT_ARG), DEFAULT(TRUE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_statements_history_long( +static Sys_var_bool Sys_pfs_consumer_events_statements_history_long( "performance_schema_consumer_events_statements_history_long", "Default startup value for the events_statements_history_long consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_long_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_transactions_current( +static Sys_var_bool Sys_pfs_consumer_events_transactions_current( "performance_schema_consumer_events_transactions_current", "Default startup value for the events_transactions_current consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_transactions_current_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_transactions_history( +static Sys_var_bool Sys_pfs_consumer_events_transactions_history( "performance_schema_consumer_events_transactions_history", "Default startup value for the events_transactions_history consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_transactions_history_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_transactions_history_long( +static Sys_var_bool Sys_pfs_consumer_events_transactions_history_long( "performance_schema_consumer_events_transactions_history_long", "Default startup value for the events_transactions_history_long consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_transactions_history_long_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_waits_current( +static Sys_var_bool Sys_pfs_consumer_events_waits_current( "performance_schema_consumer_events_waits_current", "Default startup value for the events_waits_current consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_current_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_waits_history( +static Sys_var_bool Sys_pfs_consumer_events_waits_history( "performance_schema_consumer_events_waits_history", "Default startup value for the events_waits_history consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_events_waits_history_long( +static Sys_var_bool Sys_pfs_consumer_events_waits_history_long( "performance_schema_consumer_events_waits_history_long", "Default startup value for the events_waits_history_long consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_long_enabled), CMD_LINE(OPT_ARG), DEFAULT(FALSE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_global_instrumentation( +static Sys_var_bool Sys_pfs_consumer_global_instrumentation( "performance_schema_consumer_global_instrumentation", "Default startup value for the global_instrumentation consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_global_instrumentation_enabled), CMD_LINE(OPT_ARG), DEFAULT(TRUE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_thread_instrumentation( +static Sys_var_bool Sys_pfs_consumer_thread_instrumentation( "performance_schema_consumer_thread_instrumentation", "Default startup value for the thread_instrumentation consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_thread_instrumentation_enabled), CMD_LINE(OPT_ARG), DEFAULT(TRUE), PFS_TRAILING_PROPERTIES); -static Sys_var_mybool Sys_pfs_consumer_statement_digest( +static Sys_var_bool Sys_pfs_consumer_statement_digest( "performance_schema_consumer_statements_digest", "Default startup value for the statements_digest consumer.", READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_consumer_statement_digest_enabled), @@ -720,7 +720,7 @@ static Sys_var_ulong Sys_auto_increment_offset( VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1), NO_MUTEX_GUARD, IN_BINLOG); -static Sys_var_mybool Sys_automatic_sp_privileges( +static Sys_var_bool Sys_automatic_sp_privileges( "automatic_sp_privileges", "Creating and dropping stored procedures alters ACLs", GLOBAL_VAR(sp_automatic_privileges), @@ -1093,7 +1093,7 @@ static bool binlog_direct_check(sys_var *self, THD *thd, set_var *var) return false; } -static Sys_var_mybool Sys_binlog_direct( +static Sys_var_bool Sys_binlog_direct( "binlog_direct_non_transactional_updates", "Causes updates to non-transactional engines using statement format to " "be written directly to binary log. Before using this option make sure " @@ -1114,7 +1114,7 @@ static Sys_var_mybool Sys_binlog_direct( explicit_defaults_for_timestamp, hence this options is defined as SESSION_VAR rather than GLOBAL_VAR. */ -static Sys_var_mybool Sys_explicit_defaults_for_timestamp( +static Sys_var_bool Sys_explicit_defaults_for_timestamp( "explicit_defaults_for_timestamp", "This option causes CREATE TABLE to create all TIMESTAMP columns " "as NULL with DEFAULT NULL attribute, Without this option, " @@ -1247,13 +1247,13 @@ static Sys_var_enum Sys_rli_repository( NOT_IN_BINLOG, ON_CHECK(relay_log_info_repository_check), ON_UPDATE(0)); -static Sys_var_mybool Sys_binlog_rows_query( +static Sys_var_bool Sys_binlog_rows_query( "binlog_rows_query_log_events", "Allow writing of Rows_query_log events into binary log.", SESSION_VAR(binlog_rows_query_log_events), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_binlog_order_commits( +static Sys_var_bool Sys_binlog_order_commits( "binlog_order_commits", "Issue internal commit calls in the same order as transactions are" " written to the binary log. Default is to order commits.", @@ -1696,7 +1696,7 @@ static Sys_var_ulong Sys_expire_logs_days( GLOBAL_VAR(expire_logs_days), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 99), DEFAULT(0), BLOCK_SIZE(1)); -static Sys_var_mybool Sys_flush( +static Sys_var_bool Sys_flush( "flush", "Flush MyISAM tables to disk between SQL commands", GLOBAL_VAR(myisam_flush), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -1757,7 +1757,7 @@ static Sys_var_charptr Sys_ft_stopword_file( READ_ONLY GLOBAL_VAR(ft_stopword_file), CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(0)); -static Sys_var_mybool Sys_ignore_builtin_innodb( +static Sys_var_bool Sys_ignore_builtin_innodb( "ignore_builtin_innodb", "IGNORED. This option will be removed in future releases. " "Disable initialization of builtin InnoDB plugin", @@ -1849,7 +1849,7 @@ static Sys_var_keycache Sys_key_cache_age_threshold( BLOCK_SIZE(100), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_keycache_param)); -static Sys_var_mybool Sys_large_files_support( +static Sys_var_bool Sys_large_files_support( "large_files_support", "Whether mysqld was compiled with options for large file support", READ_ONLY GLOBAL_VAR(opt_large_files), @@ -1861,7 +1861,7 @@ static Sys_var_uint Sys_large_page_size( READ_ONLY GLOBAL_VAR(opt_large_page_size), NO_CMD_LINE, VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); -static Sys_var_mybool Sys_large_pages( +static Sys_var_bool Sys_large_pages( "large_pages", "Enable support for large pages", READ_ONLY GLOBAL_VAR(opt_large_pages), IF_WIN(NO_CMD_LINE, CMD_LINE(OPT_ARG)), DEFAULT(FALSE)); @@ -1872,7 +1872,7 @@ static Sys_var_charptr Sys_language( CMD_LINE(REQUIRED_ARG, OPT_LC_MESSAGES_DIRECTORY), IN_FS_CHARSET, DEFAULT(0)); -static Sys_var_mybool Sys_local_infile( +static Sys_var_bool Sys_local_infile( "local_infile", "Enable LOAD DATA LOCAL INFILE", GLOBAL_VAR(opt_local_infile), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); @@ -1883,14 +1883,14 @@ static Sys_var_ulong Sys_lock_wait_timeout( VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(LONG_TIMEOUT), BLOCK_SIZE(1)); #ifdef HAVE_MLOCKALL -static Sys_var_mybool Sys_locked_in_memory( +static Sys_var_bool Sys_locked_in_memory( "locked_in_memory", "Whether mysqld was locked in memory with --memlock", READ_ONLY GLOBAL_VAR(locked_in_memory), NO_CMD_LINE, DEFAULT(FALSE)); #endif /* this says NO_CMD_LINE, as command-line option takes a string, not a bool */ -static Sys_var_mybool Sys_log_bin( +static Sys_var_bool Sys_log_bin( "log_bin", "Whether the binary log is enabled", READ_ONLY GLOBAL_VAR(opt_bin_log), NO_CMD_LINE, DEFAULT(FALSE)); @@ -1963,7 +1963,7 @@ static Sys_var_enum Sys_binlog_error_action( "continue, or abort.", GLOBAL_VAR(binlog_error_action), CMD_LINE(REQUIRED_ARG), binlog_error_action_list, DEFAULT(ABORT_SERVER)); -static Sys_var_mybool Sys_trust_function_creators( +static Sys_var_bool Sys_trust_function_creators( "log_bin_trust_function_creators", "If set to FALSE (the default), then when --log-bin is used, creation " "of a stored function (or trigger) is allowed only to users having the " @@ -1975,7 +1975,7 @@ static Sys_var_mybool Sys_trust_function_creators( GLOBAL_VAR(trust_function_creators), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_check_proxy_users( +static Sys_var_bool Sys_check_proxy_users( "check_proxy_users", "If set to FALSE (the default), then proxy user identity will not be " "mapped for authentication plugins which support mapping from grant " @@ -1985,7 +1985,7 @@ static Sys_var_mybool Sys_check_proxy_users( GLOBAL_VAR(check_proxy_users), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_mysql_native_password_proxy_users( +static Sys_var_bool Sys_mysql_native_password_proxy_users( "mysql_native_password_proxy_users", "If set to FALSE (the default), then the mysql_native_password " "plugin will not signal for authenticated users to be checked for mapping " @@ -1995,7 +1995,7 @@ static Sys_var_mybool Sys_mysql_native_password_proxy_users( GLOBAL_VAR(mysql_native_password_proxy_users), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_sha256_password_proxy_users( +static Sys_var_bool Sys_sha256_password_proxy_users( "sha256_password_proxy_users", "If set to FALSE (the default), then the sha256_password authentication " "plugin will not signal for authenticated users to be checked for mapping " @@ -2005,7 +2005,7 @@ static Sys_var_mybool Sys_sha256_password_proxy_users( GLOBAL_VAR(sha256_password_proxy_users), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_use_v1_row_events( +static Sys_var_bool Sys_use_v1_row_events( "log_bin_use_v1_row_events", "If equal to 1 then version 1 row events are written to a row based " "binary log. If equal to 0, then the latest version of events are " @@ -2022,21 +2022,21 @@ static Sys_var_charptr Sys_log_error( NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), NULL, sys_var::PARSE_EARLY); -static Sys_var_mybool Sys_log_queries_not_using_indexes( +static Sys_var_bool Sys_log_queries_not_using_indexes( "log_queries_not_using_indexes", "Log queries that are executed without benefit of any index to the " "slow log if it is open", GLOBAL_VAR(opt_log_queries_not_using_indexes), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_log_slow_admin_statements( +static Sys_var_bool Sys_log_slow_admin_statements( "log_slow_admin_statements", "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to " "the slow log if it is open.", GLOBAL_VAR(opt_log_slow_admin_statements), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_log_slow_slave_statements( +static Sys_var_bool Sys_log_slow_slave_statements( "log_slow_slave_statements", "Log slow statements executed by slave thread to the slow log if it is open.", GLOBAL_VAR(opt_log_slow_slave_statements), @@ -2115,7 +2115,7 @@ static Sys_var_enum Sys_log_timestamps( timestamp_type_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG); -static Sys_var_mybool Sys_log_statements_unsafe_for_binlog( +static Sys_var_bool Sys_log_statements_unsafe_for_binlog( "log_statements_unsafe_for_binlog", "Log statements considered unsafe when using statement based binary logging.", GLOBAL_VAR(opt_log_unsafe_statements), @@ -2134,7 +2134,7 @@ static bool check_syslog_tag(sys_var *self, THD *THD, set_var *var) (strchr(var->save_result.string_value.str, FN_LIBCHAR) != NULL)); } -static Sys_var_mybool Sys_log_syslog_enable( +static Sys_var_bool Sys_log_syslog_enable( "log_syslog", "Errors, warnings, and similar issues eligible for MySQL's error log " "file may additionally be sent to the host operating system's system " @@ -2191,7 +2191,7 @@ static Sys_var_charptr Sys_log_syslog_facility( IN_SYSTEM_CHARSET, DEFAULT("daemon"), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_syslog_facility), ON_UPDATE(fix_syslog_facility)); -static Sys_var_mybool Sys_log_syslog_log_pid( +static Sys_var_bool Sys_log_syslog_log_pid( "log_syslog_include_pid", "When logging issues using the host operating system's syslog, " "include this MySQL server's process ID (PID). This setting does " @@ -2240,7 +2240,7 @@ static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type) TL_WRITE_LOW_PRIORITY : TL_WRITE); return false; } -static Sys_var_mybool Sys_low_priority_updates( +static Sys_var_bool Sys_low_priority_updates( "low_priority_updates", "INSERT/DELETE/UPDATE has lower priority than selects", SESSION_VAR(low_priority_updates), @@ -2248,7 +2248,7 @@ static Sys_var_mybool Sys_low_priority_updates( DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_low_prio_updates)); -static Sys_var_mybool Sys_lower_case_file_system( +static Sys_var_bool Sys_lower_case_file_system( "lower_case_file_system", "Case sensitivity of file names on the file system where the " "data directory is located", @@ -2583,7 +2583,7 @@ static Sys_var_ulong Sys_min_examined_row_limit( VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); #ifdef _WIN32 -static Sys_var_mybool Sys_named_pipe( +static Sys_var_bool Sys_named_pipe( "named_pipe", "Enable the named pipe (NT)", READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -2686,15 +2686,15 @@ static Sys_var_ulong Sys_net_retry_count( BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_net_retry_count)); -static Sys_var_mybool Sys_new_mode( +static Sys_var_bool Sys_new_mode( "new", "Use very new possible \"unsafe\" functions", SESSION_VAR(new_mode), CMD_LINE(OPT_ARG, 'n'), DEFAULT(FALSE)); -static Sys_var_mybool Sys_old_mode( +static Sys_var_bool Sys_old_mode( "old", "Use compatible behavior", READ_ONLY GLOBAL_VAR(old_mode), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_old_alter_table( +static Sys_var_bool Sys_old_alter_table( "old_alter_table", "Use old, non-optimized alter table", SESSION_VAR(old_alter_table), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -2847,7 +2847,7 @@ static Sys_var_flagset Sys_optimizer_switch( optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL)); -static Sys_var_mybool Sys_var_end_markers_in_json( +static Sys_var_bool Sys_var_end_markers_in_json( "end_markers_in_json", "In JSON output (\"EXPLAIN FORMAT=JSON\" and optimizer trace), " "if variable is set to 1, repeats the structure's key (if it has one) " @@ -3007,7 +3007,7 @@ static bool check_require_secure_transport(sys_var *self, THD *thd, set_var *var static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type) { bool result= true; - my_bool new_read_only= read_only; // make a copy before releasing a mutex + bool new_read_only= read_only; // make a copy before releasing a mutex DBUG_ENTER("sys_var_opt_readonly::update"); if (read_only == FALSE || read_only == opt_readonly) @@ -3092,7 +3092,7 @@ static bool fix_super_read_only(sys_var *self, THD *thd, enum_var_type type) DBUG_RETURN(false); } bool result= true; - my_bool new_super_read_only = super_read_only; /* make a copy before releasing a mutex */ + bool new_super_read_only = super_read_only; /* make a copy before releasing a mutex */ /* set read_only to ON if it is OFF, letting fix_read_only() handle its own locking needs @@ -3135,7 +3135,7 @@ static bool fix_super_read_only(sys_var *self, THD *thd, enum_var_type type) DBUG_RETURN(result); } -static Sys_var_mybool Sys_require_secure_transport( +static Sys_var_bool Sys_require_secure_transport( "require_secure_transport", "When this option is enabled, connections attempted using insecure " "transport will be rejected. Secure transports are SSL/TLS, " @@ -3154,7 +3154,7 @@ static Sys_var_mybool Sys_require_secure_transport( transition (especially when transitioning from false to true) and synchronizes both booleans in the end. */ -static Sys_var_mybool Sys_readonly( +static Sys_var_bool Sys_readonly( "read_only", "Make all non-temporary tables read-only, with the exception for " "replication (slave) threads and users with the SUPER privilege", @@ -3165,7 +3165,7 @@ static Sys_var_mybool Sys_readonly( /** Setting super_read_only to ON triggers read_only to also be set to ON. */ -static Sys_var_mybool Sys_super_readonly( +static Sys_var_bool Sys_super_readonly( "super_read_only", "Make all non-temporary tables read-only, with the exception for " "replication (slave) threads. Users with the SUPER privilege are " @@ -3243,7 +3243,7 @@ static Sys_var_ulong Sys_query_prealloc_size( ON_UPDATE(fix_thd_mem_root)); #if defined (_WIN32) -static Sys_var_mybool Sys_shared_memory( +static Sys_var_bool Sys_shared_memory( "shared_memory", "Enable the shared memory", READ_ONLY GLOBAL_VAR(opt_enable_shared_memory), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -3255,23 +3255,23 @@ static Sys_var_charptr Sys_shared_memory_base_name( #endif // this has to be NO_CMD_LINE as the command-line option has a different name -static Sys_var_mybool Sys_skip_external_locking( +static Sys_var_bool Sys_skip_external_locking( "skip_external_locking", "Don't use system (external) locking", READ_ONLY GLOBAL_VAR(my_disable_locking), NO_CMD_LINE, DEFAULT(TRUE)); -static Sys_var_mybool Sys_skip_networking( +static Sys_var_bool Sys_skip_networking( "skip_networking", "Don't allow connection with TCP/IP", READ_ONLY GLOBAL_VAR(opt_disable_networking), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_skip_name_resolve( +static Sys_var_bool Sys_skip_name_resolve( "skip_name_resolve", "Don't resolve hostnames. All hostnames are IP's or 'localhost'.", READ_ONLY GLOBAL_VAR(opt_skip_name_resolve), CMD_LINE(OPT_ARG, OPT_SKIP_RESOLVE), DEFAULT(FALSE)); -static Sys_var_mybool Sys_skip_show_database( +static Sys_var_bool Sys_skip_show_database( "skip_show_database", "Don't allow 'SHOW DATABASE' commands", READ_ONLY GLOBAL_VAR(opt_skip_show_db), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -3403,7 +3403,7 @@ static Sys_var_enum Sys_query_cache_type( query_cache_type_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_query_cache_type)); -static Sys_var_mybool Sys_query_cache_wlock_invalidate( +static Sys_var_bool Sys_query_cache_wlock_invalidate( "query_cache_wlock_invalidate", "Invalidate queries in query cache on LOCK for write", SESSION_VAR(query_cache_wlock_invalidate), CMD_LINE(OPT_ARG), @@ -3416,7 +3416,7 @@ on_check_opt_secure_auth(sys_var *self, THD *thd, set_var *var) return (!var->save_result.ulonglong_value); } -static Sys_var_mybool Sys_secure_auth( +static Sys_var_bool Sys_secure_auth( "secure_auth", "Disallow authentication for accounts that have old (pre-4.1) " "passwords. Deprecated. Always TRUE.", @@ -3461,7 +3461,7 @@ static Sys_var_uint Sys_server_id_bits( GLOBAL_VAR(opt_server_id_bits), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 32), DEFAULT(32), BLOCK_SIZE(1)); -static Sys_var_mybool Sys_slave_compressed_protocol( +static Sys_var_bool Sys_slave_compressed_protocol( "slave_compressed_protocol", "Use compression on master/slave protocol", GLOBAL_VAR(opt_slave_compressed_protocol), CMD_LINE(OPT_ARG), @@ -3496,7 +3496,7 @@ static Sys_var_set Slave_type_conversions( slave_type_conversions_name, DEFAULT(0)); -static Sys_var_mybool Sys_slave_sql_verify_checksum( +static Sys_var_bool Sys_slave_sql_verify_checksum( "slave_sql_verify_checksum", "Force checksum verification of replication events after reading them " "from relay log. Note: Events are always checksum-verified by slave on " @@ -3574,7 +3574,7 @@ static Sys_var_enum Mts_parallel_type( NOT_IN_BINLOG, ON_CHECK(check_slave_stopped), ON_UPDATE(NULL)); -static Sys_var_mybool Sys_slave_preserve_commit_order( +static Sys_var_bool Sys_slave_preserve_commit_order( "slave_preserve_commit_order", "Force slave workers to make commits in the same order as on the master. " "Disabled by default.", @@ -4002,7 +4002,7 @@ static Sys_var_enum_binlog_checksum Binlog_checksum_enum( binlog_checksum_type_names, DEFAULT(binary_log::BINLOG_CHECKSUM_ALG_CRC32), NO_MUTEX_GUARD, NOT_IN_BINLOG); -static Sys_var_mybool Sys_master_verify_checksum( +static Sys_var_bool Sys_master_verify_checksum( "master_verify_checksum", "Force checksum verification of logged events in binary log before " "sending them to slaves or printing them in output of SHOW BINLOG EVENTS. " @@ -4252,7 +4252,7 @@ static Sys_var_charptr Sys_ssl_crlpath( IN_FS_CHARSET, DEFAULT(0)); #if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL) -static Sys_var_mybool Sys_auto_generate_certs( +static Sys_var_bool Sys_auto_generate_certs( "auto_generate_certs", "Auto generate SSL certificates at server startup if --ssl is set to " "ON and none of the other SSL system variables are specified and " @@ -4484,7 +4484,7 @@ static bool check_tx_read_only(sys_var *self, THD *thd, set_var *var) bool Sys_var_tx_read_only::session_update(THD *thd, set_var *var) { - if (var->type == OPT_SESSION && Sys_var_mybool::session_update(thd, var)) + if (var->type == OPT_SESSION && Sys_var_bool::session_update(thd, var)) return true; if (var->type == OPT_DEFAULT || !(thd->in_active_multi_stmt_transaction() || thd->in_sub_stmt)) @@ -4518,7 +4518,7 @@ uchar *Sys_var_sql_log_bin::global_value_ptr(THD *thd, LEX_STRING *base) "@@global.sql_log_bin", "the constant 1 " "(since @@global.sql_log_bin is always equal to 1)"); - return Sys_var_mybool::global_value_ptr(thd, base); + return Sys_var_bool::global_value_ptr(thd, base); } @@ -4695,7 +4695,7 @@ static Sys_var_bit Sys_autocommit( NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_autocommit)); export sys_var *Sys_autocommit_ptr= &Sys_autocommit; // for sql_yacc.yy -static Sys_var_mybool Sys_big_tables( +static Sys_var_bool Sys_big_tables( "big_tables", "Allow big result sets by saving all " "temporary sets on file (Solves most 'table full' errors)", SESSION_VAR(big_tables), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -5085,7 +5085,7 @@ static Sys_var_uint Sys_repl_report_port( READ_ONLY GLOBAL_VAR(report_port), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 65535), DEFAULT(0), BLOCK_SIZE(1)); -static Sys_var_mybool Sys_keep_files_on_create( +static Sys_var_bool Sys_keep_files_on_create( "keep_files_on_create", "Don't overwrite stale .MYD and .MYI even if no directory is specified", SESSION_VAR(keep_files_on_create), CMD_LINE(OPT_ARG), @@ -5283,7 +5283,7 @@ static bool fix_general_log_state(sys_var *self, THD *thd, enum_var_type type) return res; } } -static Sys_var_mybool Sys_general_log( +static Sys_var_bool Sys_general_log( "general_log", "Log connections and queries to a table or log file. " "Defaults to logging to a file hostname.log, " "or if --log-output=TABLE is used, to a table mysql.general_log.", @@ -5313,7 +5313,7 @@ static bool fix_slow_log_state(sys_var *self, THD *thd, enum_var_type type) return res; } } -static Sys_var_mybool Sys_slow_query_log( +static Sys_var_bool Sys_slow_query_log( "slow_query_log", "Log slow queries to a table or log file. Defaults logging to a file " "hostname-slow.log or a table mysql.slow_log if --log-output=TABLE is " @@ -5341,7 +5341,7 @@ static Sys_var_set Sys_log_output( log_output_names, DEFAULT(LOG_FILE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_not_empty_set), ON_UPDATE(fix_log_output)); -static Sys_var_mybool Sys_log_slave_updates( +static Sys_var_bool Sys_log_slave_updates( "log_slave_updates", "Tells the slave to log the updates from " "the slave thread to the binary log. You will need to turn it on if " "you plan to daisy-chain the slaves", @@ -5392,19 +5392,19 @@ static Sys_var_charptr Sys_relay_log_info_file( READ_ONLY GLOBAL_VAR(relay_log_info_file), CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(0)); -static Sys_var_mybool Sys_relay_log_purge( +static Sys_var_bool Sys_relay_log_purge( "relay_log_purge", "if disabled - do not purge relay logs. " "if enabled - purge them as soon as they are no more needed", GLOBAL_VAR(relay_log_purge), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -static Sys_var_mybool Sys_relay_log_recovery( +static Sys_var_bool Sys_relay_log_recovery( "relay_log_recovery", "Enables automatic relay log recovery " "right after the database startup, which means that the IO Thread " "starts re-fetching from the master right after the last transaction " "processed", READ_ONLY GLOBAL_VAR(relay_log_recovery), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_slave_allow_batching( +static Sys_var_bool Sys_slave_allow_batching( "slave_allow_batching", "Allow slave to batch requests", GLOBAL_VAR(opt_slave_allow_batching), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); @@ -5706,7 +5706,7 @@ const char *fixup_enforce_gtid_consistency_command_line(char *value_arg) return Sys_enforce_gtid_consistency.fixup_command_line(value_arg); } -static Sys_var_mybool Sys_binlog_gtid_simple_recovery( +static Sys_var_bool Sys_binlog_gtid_simple_recovery( "binlog_gtid_simple_recovery", "If this option is enabled, the server does not open more than " "two binary logs when initializing GTID_PURGED and " @@ -5777,7 +5777,7 @@ static bool check_pseudo_slave_mode(sys_var *self, THD *thd, set_var *var) end: return FALSE; } -static Sys_var_mybool Sys_pseudo_slave_mode( +static Sys_var_bool Sys_pseudo_slave_mode( "pseudo_slave_mode", "SET pseudo_slave_mode= 0,1 are commands that mysqlbinlog " "adds to beginning and end of binary log dumps. While zero " @@ -5970,13 +5970,13 @@ static Sys_var_uint Sys_gtid_executed_compression_period( CMD_LINE(OPT_ARG), VALID_RANGE(0, UINT_MAX32), DEFAULT(1000), BLOCK_SIZE(1)); -static Sys_var_mybool Sys_disconnect_on_expired_password( +static Sys_var_bool Sys_disconnect_on_expired_password( "disconnect_on_expired_password", "Give clients that don't signal password expiration support execution time error(s) instead of connection error", READ_ONLY GLOBAL_VAR(disconnect_on_expired_password), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -static Sys_var_mybool Sys_validate_user_plugins( +static Sys_var_bool Sys_validate_user_plugins( "validate_user_plugins", "Turns on additional validation of authentication plugins assigned " "to user accounts. ", @@ -6027,7 +6027,7 @@ static bool update_session_track_schema(sys_var *self, THD *thd, DBUG_RETURN(thd->session_tracker.get_tracker(CURRENT_SCHEMA_TRACKER)->update(thd)); } -static Sys_var_mybool Sys_session_track_schema( +static Sys_var_bool Sys_session_track_schema( "session_track_schema", "Track changes to the 'default schema'.", SESSION_VAR(session_track_schema), @@ -6067,7 +6067,7 @@ static bool update_session_track_state_change(sys_var *self, THD *thd, DBUG_RETURN(thd->session_tracker.get_tracker(SESSION_STATE_CHANGE_TRACKER)->update(thd)); } -static Sys_var_mybool Sys_session_track_state_change( +static Sys_var_bool Sys_session_track_state_change( "session_track_state_change", "Track changes to the 'session state'.", SESSION_VAR(session_track_state_change), @@ -6085,7 +6085,7 @@ static bool handle_offline_mode(sys_var *self, THD *thd, enum_var_type type) } static PolyLock_mutex PLock_offline_mode(&LOCK_offline_mode); -static Sys_var_mybool Sys_offline_mode( +static Sys_var_bool Sys_offline_mode( "offline_mode", "Make the server into offline mode", GLOBAL_VAR(offline_mode), CMD_LINE(OPT_ARG), DEFAULT(FALSE), @@ -6103,14 +6103,14 @@ static Sys_var_enum Sys_information_schema_stats( information_schema_stats_names, DEFAULT(static_cast(dd::info_schema::enum_stats::CACHED))); -static Sys_var_mybool Sys_log_builtin_as_identified_by_password( +static Sys_var_bool Sys_log_builtin_as_identified_by_password( "log_builtin_as_identified_by_password", "Controls logging of CREATE/ALTER/GRANT and SET PASSWORD user statements " "in replication binlogs, general query logs and audit logs.", GLOBAL_VAR(opt_log_builtin_as_identified_by_password), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_avoid_temporal_upgrade( +static Sys_var_bool Sys_avoid_temporal_upgrade( "avoid_temporal_upgrade", "When this option is enabled, the pre-5.6.4 temporal types are " "not upgraded to the new format for ALTER TABLE requests ADD/CHANGE/MODIFY" @@ -6122,7 +6122,7 @@ static Sys_var_mybool Sys_avoid_temporal_upgrade( ON_CHECK(0), ON_UPDATE(0), DEPRECATED("")); -static Sys_var_mybool Sys_show_old_temporals( +static Sys_var_bool Sys_show_old_temporals( "show_old_temporals", "When this option is enabled, the pre-5.6.4 temporal types will " "be marked in the 'SHOW CREATE TABLE' and 'INFORMATION_SCHEMA.COLUMNS' " @@ -6141,7 +6141,7 @@ static Sys_var_charptr Sys_disabled_storage_engines( CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, DEFAULT("")); -static Sys_var_mybool Sys_persisted_globals_load( +static Sys_var_bool Sys_persisted_globals_load( "persisted_globals_load", "When this option is enabled, config file mysqld-auto.cnf is read " "and applied to server, else this file is ignored even if present.", diff --git a/sql/sys_vars.h b/sql/sys_vars.h index ab211f86f0c2..87759cb0374c 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -201,7 +201,7 @@ class Sys_var_integer: public sys_var } bool do_check(THD *thd, set_var *var) { - my_bool fixed= FALSE; + bool fixed= FALSE; longlong v; ulonglong uv; @@ -341,7 +341,7 @@ class Sys_var_typelib: public sys_var typelib.type_lengths= 0; // only used by Fields_enum and Field_set option.typelib= &typelib; } - bool do_check(THD*, set_var *var) // works for enums and my_bool + bool do_check(THD*, set_var *var) // works for enums and bool { char buff[STRING_BUFFER_USUAL_SIZE]; String str(buff, sizeof(buff), system_charset_info), *res; @@ -433,15 +433,15 @@ class Sys_var_enum: public Sys_var_typelib The class for boolean variables - a variant of ENUM variables with the fixed list of values of { OFF , ON } - Backing store: my_bool + Backing store: bool */ -class Sys_var_mybool: public Sys_var_typelib +class Sys_var_bool: public Sys_var_typelib { public: - Sys_var_mybool(const char *name_arg, + Sys_var_bool(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, - my_bool def_val, PolyLock *lock=0, + bool def_val, PolyLock *lock=0, enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, @@ -453,27 +453,26 @@ class Sys_var_mybool: public Sys_var_typelib substitute, parse_flag) { option.var_type= GET_BOOL; - global_var(my_bool)= def_val; - DBUG_ASSERT(def_val < 2); + global_var(bool)= def_val; DBUG_ASSERT(getopt.arg_type == OPT_ARG || getopt.id == -1); - DBUG_ASSERT(size == sizeof(my_bool)); + DBUG_ASSERT(size == sizeof(bool)); } bool session_update(THD *thd, set_var *var) { - session_var(thd, my_bool)= - static_cast(var->save_result.ulonglong_value); + session_var(thd, bool)= + static_cast(var->save_result.ulonglong_value); return false; } bool global_update(THD*, set_var *var) { - global_var(my_bool)= - static_cast(var->save_result.ulonglong_value); + global_var(bool)= + static_cast(var->save_result.ulonglong_value); return false; } void session_save_default(THD *thd, set_var *var) { var->save_result.ulonglong_value= - static_cast(*(my_bool *)global_value_ptr(thd, 0)); + static_cast(*(bool *)global_value_ptr(thd, 0)); } void global_save_default(THD*, set_var *var) { var->save_result.ulonglong_value= option.def_value; } @@ -1187,7 +1186,7 @@ class Sys_var_double: public sys_var } bool do_check(THD *thd, set_var *var) { - my_bool fixed; + bool fixed; double v= var->value->val_real(); var->save_result.double_value= getopt_double_limit_value(v, &option, &fixed); @@ -1221,13 +1220,13 @@ class Sys_var_double: public sys_var Caller need not pass in a variable as we make up the value on the fly, that is, we derive it from the global test_flags bit vector. - Backing store: my_bool + Backing store: bool */ class Sys_var_test_flag: public Sys_var_mybool { private: - my_bool test_flag_value; - uint test_flag_mask; + bool test_flag_value; + uint test_flag_mask; public: Sys_var_test_flag(const char *name_arg, const char *comment, uint mask) : Sys_var_mybool(name_arg, comment, READ_ONLY GLOBAL_VAR(test_flag_value), @@ -1732,7 +1731,7 @@ class Sys_var_bit: public Sys_var_typelib Sys_var_bit(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, - ulonglong bitmask_arg, my_bool def_val, PolyLock *lock=0, + ulonglong bitmask_arg, bool def_val, PolyLock *lock=0, enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, @@ -1746,7 +1745,6 @@ class Sys_var_bit: public Sys_var_typelib reverse_semantics= my_count_bits(bitmask_arg) > 1; bitmask= reverse_semantics ? ~bitmask_arg : bitmask_arg; set(global_var_ptr(), def_val); - DBUG_ASSERT(def_val < 2); DBUG_ASSERT(getopt.id == -1); // force NO_CMD_LINE DBUG_ASSERT(size == sizeof(ulonglong)); } @@ -1766,17 +1764,17 @@ class Sys_var_bit: public Sys_var_typelib { var->save_result.ulonglong_value= option.def_value; } uchar *session_value_ptr(THD *running_thd, THD *target_thd, LEX_STRING*) { - running_thd->sys_var_tmp.my_bool_value= - static_cast(reverse_semantics ^ - ((session_var(target_thd, ulonglong) & bitmask) != 0)); - return (uchar*) &running_thd->sys_var_tmp.my_bool_value; + running_thd->sys_var_tmp.bool_value= + static_cast(reverse_semantics ^ + ((session_var(target_thd, ulonglong) & bitmask) != 0)); + return (uchar*) &running_thd->sys_var_tmp.bool_value; } uchar *global_value_ptr(THD *thd, LEX_STRING*) { - thd->sys_var_tmp.my_bool_value= - static_cast(reverse_semantics ^ - ((global_var(ulonglong) & bitmask) != 0)); - return (uchar*) &thd->sys_var_tmp.my_bool_value; + thd->sys_var_tmp.bool_value= + static_cast(reverse_semantics ^ + ((global_var(ulonglong) & bitmask) != 0)); + return (uchar*) &thd->sys_var_tmp.bool_value; } }; @@ -2158,7 +2156,7 @@ class Sys_var_tx_read_only: public Sys_var_mybool public: Sys_var_tx_read_only(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, - my_bool def_val, PolyLock *lock, + bool def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func) :Sys_var_mybool(name_arg, comment, flag_args, off, size, getopt, @@ -2178,7 +2176,7 @@ class Sys_var_sql_log_bin: public Sys_var_mybool public: Sys_var_sql_log_bin(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, - my_bool def_val, PolyLock *lock, + bool def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, on_update_function on_update_func) diff --git a/sql/system_variables.h b/sql/system_variables.h index 96158b1d7d69..395a5bc547a6 100644 --- a/sql/system_variables.h +++ b/sql/system_variables.h @@ -147,7 +147,7 @@ struct System_variables ulonglong max_heap_table_size; ulonglong tmp_table_size; ulonglong long_query_time; - my_bool end_markers_in_json; + bool end_markers_in_json; /* A bitmap for switching optimizations on/off */ ulonglong optimizer_switch; ulonglong optimizer_trace; ///< bitmap to tune optimizer tracing @@ -201,9 +201,9 @@ struct System_variables ulong binlog_format; ///< binlog format for this thd (see enum_binlog_format) ulong rbr_exec_mode_options; // see enum_rbr_exec_mode - my_bool binlog_direct_non_trans_update; + bool binlog_direct_non_trans_update; ulong binlog_row_image; // see enum_binlog_row_image - my_bool sql_log_bin; + bool sql_log_bin; // see enum_transaction_write_set_hashing_algorithm ulong transaction_write_set_extraction; ulong completion_type; @@ -221,15 +221,15 @@ struct System_variables /** Default transaction access mode. READ ONLY (true) or READ WRITE (false). */ - my_bool tx_read_only; - my_bool low_priority_updates; - my_bool new_mode; - my_bool query_cache_wlock_invalidate; - my_bool keep_files_on_create; + bool tx_read_only; + bool low_priority_updates; + bool new_mode; + bool query_cache_wlock_invalidate; + bool keep_files_on_create; - my_bool old_alter_table; + bool old_alter_table; uint old_passwords; - my_bool big_tables; + bool big_tables; plugin_ref table_plugin; plugin_ref temp_table_plugin; @@ -257,14 +257,14 @@ struct System_variables default clause. i.e., when set columns are defined as NULL, instead of NOT NULL by default. */ - my_bool explicit_defaults_for_timestamp; + bool explicit_defaults_for_timestamp; - my_bool sysdate_is_now; - my_bool binlog_rows_query_log_events; + bool sysdate_is_now; + bool binlog_rows_query_log_events; double long_query_time_double; - my_bool pseudo_slave_mode; + bool pseudo_slave_mode; Gtid_specification gtid_next; Gtid_set_or_null gtid_next_list; @@ -273,8 +273,8 @@ struct System_variables ulong max_execution_time; char *track_sysvars_ptr; - my_bool session_track_schema; - my_bool session_track_state_change; + bool session_track_schema; + bool session_track_state_change; ulong session_track_transaction_info; ulong information_schema_stats; // see dd::info_schema::enum_information_... @@ -284,7 +284,7 @@ struct System_variables the old format using comments for SHOW CREATE TABLE and in I_S.COLUMNS 'COLUMN_TYPE' field. */ - my_bool show_old_temporals; + bool show_old_temporals; // Used for replication delay and lag monitoring uint64 original_commit_timestamp; }; diff --git a/sql/table.cc b/sql/table.cc index 1fc21326ccf0..89543ac4c42f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3867,7 +3867,7 @@ Table_check_intact::check(THD *thd, TABLE *table, const TABLE_FIELD_DEF *table_def) { uint i; - my_bool error= FALSE; + bool error= FALSE; const TABLE_FIELD_TYPE *field_def= table_def->field; DBUG_ENTER("table_check_intact"); DBUG_PRINT("info",("table: %s expected_count: %d", @@ -7142,7 +7142,7 @@ int TABLE_LIST::fetch_number_of_rows() */ static bool add_derived_key(List &derived_key_list, Field *field, - table_map ref_by_tbl) + table_map ref_by_tbl) { uint key= 0; Derived_key *entry= 0; diff --git a/sql/table.h b/sql/table.h index 753331ee654d..7e45077c6cf1 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1310,7 +1310,7 @@ struct TABLE If true, this table is inner w.r.t. some outer join operation, all columns are nullable (in the query), and null_row may be true. */ - my_bool nullable; + bool nullable; uint8 m_status; /* What's in record[0] */ public: @@ -1319,65 +1319,65 @@ struct TABLE NULL, including columns declared as "not null" (see nullable). @todo make it private, currently join buffering changes it through a pointer */ - my_bool null_row; + bool null_row; - my_bool copy_blobs; /* copy_blobs when storing */ + bool copy_blobs; /* copy_blobs when storing */ /* TODO: Each of the following flags take up 8 bits. They can just as easily be put into one single unsigned long and instead of taking up 18 bytes, it would take up 4. */ - my_bool force_index; + bool force_index; /** Flag set when the statement contains FORCE INDEX FOR ORDER BY See TABLE_LIST::process_index_hints(). */ - my_bool force_index_order; + bool force_index_order; /** Flag set when the statement contains FORCE INDEX FOR GROUP BY See TABLE_LIST::process_index_hints(). */ - my_bool force_index_group; - my_bool distinct; - my_bool const_table; + bool force_index_group; + bool distinct; + bool const_table; /// True if writes to this table should not write rows and just write keys. - my_bool no_rows; + bool no_rows; /** If set, the optimizer has found that row retrieval should access index tree only. */ - my_bool key_read; + bool key_read; /** Certain statements which need the full row, set this to ban index-only access. */ - my_bool no_keyread; + bool no_keyread; /** If set, indicate that the table is not replicated by the server. */ - my_bool no_replicate; - my_bool fulltext_searched; - my_bool no_cache; + bool no_replicate; + bool fulltext_searched; + bool no_cache; /* To signal that the table is associated with a HANDLER statement */ - my_bool open_by_handler; + bool open_by_handler; /* To indicate that a non-null value of the auto_increment field was provided by the user or retrieved from the current record. Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode. */ - my_bool auto_increment_field_not_null; - my_bool alias_name_used; /* true if table_name is alias */ - my_bool get_fields_in_item_tree; /* Signal to fix_field */ + bool auto_increment_field_not_null; + bool alias_name_used; /* true if table_name is alias */ + bool get_fields_in_item_tree; /* Signal to fix_field */ /** This table must be reopened and is not to be reused. NOTE: The TABLE will not be reopened during LOCK TABLES in close_thread_tables!!! */ - my_bool m_needs_reopen; + bool m_needs_reopen; private: /** For tmp tables. TRUE <=> tmp table has been instantiated. diff --git a/sql/tztime.cc b/sql/tztime.cc index de800bfc488f..3b4a9171243a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -190,7 +190,7 @@ typedef struct st_time_zone_info } TIME_ZONE_INFO; -static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage); +static bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage); #if defined(TZINFO2SQL) @@ -212,7 +212,7 @@ static const char* const MAGIC_STRING_FOR_INVALID_ZONEINFO_FILE= 0 - Ok 1 - Error */ -static my_bool +static bool tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) { uchar *p; @@ -391,7 +391,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) 0 Ok 1 Error */ -static my_bool +static bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) { my_time_t cur_t= MY_TIME_T_MIN; @@ -950,7 +950,7 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) */ static my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, const TIME_ZONE_INFO *sp, - my_bool *in_dst_time_gap) + bool *in_dst_time_gap) { my_time_t local_t; uint saved_seconds; @@ -1077,7 +1077,7 @@ class Time_zone_system : public Time_zone public: Time_zone_system() {} /* Remove gcc warning */ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, - my_bool *in_dst_time_gap) const; + bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; @@ -1109,7 +1109,7 @@ class Time_zone_system : public Time_zone Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_system::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const +Time_zone_system::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const { long not_used; return my_system_gmt_sec(t, ¬_used, in_dst_time_gap); @@ -1172,7 +1172,7 @@ class Time_zone_utc : public Time_zone public: Time_zone_utc() {} /* Remove gcc warning */ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, - my_bool *in_dst_time_gap) const; + bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; @@ -1198,7 +1198,7 @@ class Time_zone_utc : public Time_zone 0 */ my_time_t -Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const +Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const { /* Should be never called */ DBUG_ASSERT(0); @@ -1262,7 +1262,7 @@ 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, - my_bool *in_dst_time_gap) const; + bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; private: @@ -1311,7 +1311,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_db::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const +Time_zone_db::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const { return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap); } @@ -1359,7 +1359,7 @@ 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, - my_bool *in_dst_time_gap) const; + bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; /* @@ -1411,7 +1411,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const +Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const { my_time_t local_t; int shift= 0; @@ -1651,14 +1651,14 @@ static void init_tz_psi_keys(void) 0 - ok 1 - Error */ -my_bool -my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) +bool +my_tz_init(THD *org_thd, const char *default_tzname, bool bootstrap) { THD *thd; TABLE_LIST tz_tables[1+MY_TZ_TABLES_COUNT]; TABLE *table; Tz_names_entry *tmp_tzname; - my_bool return_val= 1; + bool return_val= 1; LEX_CSTRING db= { C_STRING_WITH_LEN("mysql") }; int res; DBUG_ENTER("my_tz_init"); @@ -2246,11 +2246,11 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) 0 - Ok 1 - String doesn't contain valid time zone offset */ -static my_bool +static bool str_to_offset(const char *str, size_t length, long *offset) { const char *end= str + length; - my_bool negative; + bool negative; ulong number_tmp; long offset_tmp; @@ -2548,7 +2548,7 @@ char *root_name_end; 0 - Ok, 1 - Fatal error */ -static my_bool +static bool scan_tz_dir(char * name_end) { MY_DIR *cur_dir; diff --git a/sql/tztime.h b/sql/tztime.h index 8e911915417d..162065f2dd92 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -51,7 +51,7 @@ class Time_zone: public Sql_alloc falls into spring time-gap (or lefts it untouched otherwise). */ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, - my_bool *in_dst_time_gap) const = 0; + bool *in_dst_time_gap) const = 0; /** Converts time in my_time_t representation to local time in broken down MYSQL_TIME representation. @@ -87,7 +87,7 @@ extern Time_zone * my_tz_UTC; extern Time_zone * my_tz_SYSTEM; extern Time_zone * my_tz_OFFSET0; extern Time_zone * my_tz_find(THD *thd, const String *name); -extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap); +extern bool my_tz_init(THD *org_thd, const char *default_tzname, bool bootstrap); extern void my_tz_free(); extern my_time_t sec_since_epoch_TIME(MYSQL_TIME *t); diff --git a/sql/udf_example.cc b/sql/udf_example.cc index 7f01cfe14ce7..0d4db15c1e5a 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -144,27 +144,27 @@ static native_mutex_t LOCK_hostname; /* These must be right or mysqld will not find the symbol! */ C_MODE_START -my_bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message); void metaphon_deinit(UDF_INIT *initid); char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error); -my_bool myfunc_double_init(UDF_INIT *, UDF_ARGS *args, char *message); +bool myfunc_double_init(UDF_INIT *, UDF_ARGS *args, char *message); double myfunc_double(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); -my_bool myfunc_int_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool myfunc_int_init(UDF_INIT *initid, UDF_ARGS *args, char *message); longlong myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); -my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message); void sequence_deinit(UDF_INIT *initid); longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); -my_bool avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ); +bool avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ); void avgcost_deinit( UDF_INIT* initid ); void avgcost_reset( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); void avgcost_clear( UDF_INIT* initid, char* is_null, char *error ); void avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); double avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message); char *is_const(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error); C_MODE_END @@ -174,7 +174,7 @@ C_MODE_END ** Arguments: ** initid Points to a structure that the init function should fill. ** This argument is given to all other functions. -** my_bool maybe_null 1 if function can return NULL +** bool maybe_null 1 if function can return NULL ** Default value is 1 if any of the arguments ** is declared maybe_null. ** unsigned int decimals Number of decimals. @@ -209,7 +209,7 @@ C_MODE_END #define MAXMETAPH 8 -my_bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT) { @@ -529,7 +529,7 @@ char *metaphon(UDF_INIT *initid MY_ATTRIBUTE((unused)), ** This function should return the result. ***************************************************************************/ -my_bool myfunc_double_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool myfunc_double_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { uint i; @@ -622,9 +622,9 @@ longlong myfunc_int(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args, At least one of _init/_deinit is needed unless the server is started with --allow_suspicious_udfs. */ -my_bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)), - UDF_ARGS *args MY_ATTRIBUTE((unused)), - char *message MY_ATTRIBUTE((unused))) +bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)), + UDF_ARGS *args MY_ATTRIBUTE((unused)), + char *message MY_ATTRIBUTE((unused))) { return 0; } @@ -634,7 +634,7 @@ my_bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)), or 1 if no arguments have been given */ -my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count > 1) { @@ -698,11 +698,11 @@ longlong sequence(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args, #endif C_MODE_START -my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message); void lookup_deinit(UDF_INIT *initid); char *lookup(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message); +bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message); void reverse_lookup_deinit(UDF_INIT *initid); char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); @@ -717,7 +717,7 @@ C_MODE_END ****************************************************************************/ -my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT) { @@ -791,7 +791,7 @@ char *lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args, ** four numbers. ****************************************************************************/ -my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count == 1) args->arg_type[0]= STRING_RESULT; @@ -909,7 +909,7 @@ struct avgcost_data /* ** Average Cost Aggregate Function. */ -my_bool +bool avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ) { struct avgcost_data* data; @@ -1048,14 +1048,14 @@ avgcost( UDF_INIT* initid, UDF_ARGS* args MY_ATTRIBUTE((unused)), return data->totalprice/(double)data->totalquantity; } -my_bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args, - char *message); +bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args, + char *message); char *myfunc_argument_name(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *null_value, char *error); -my_bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args, - char *message) +bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args, + char *message) { if (args->arg_count != 1) { @@ -1088,7 +1088,7 @@ char *myfunc_argument_name(UDF_INIT *initid MY_ATTRIBUTE((unused)), -my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 1) { @@ -1116,7 +1116,7 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)), extern "C" -my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if (args->arg_count != 1) { @@ -1152,7 +1152,7 @@ char * check_const_len(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)), C_MODE_START -my_bool my_median_init (UDF_INIT *initid, UDF_ARGS *args, char *message); +bool my_median_init (UDF_INIT *initid, UDF_ARGS *args, char *message); void my_median_deinit(UDF_INIT* initid); void my_median_add (UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error); @@ -1168,7 +1168,7 @@ struct My_median_data }; -my_bool my_median_init (UDF_INIT *initid, UDF_ARGS *args, char *message) +bool my_median_init (UDF_INIT *initid, UDF_ARGS *args, char *message) { My_median_data *data= new (std::nothrow) My_median_data; if (!data) @@ -1227,7 +1227,7 @@ longlong my_median(UDF_INIT* initid, UDF_ARGS* args, } C_MODE_START -my_bool my_cpp11_re_match_init (UDF_INIT *initid, UDF_ARGS *args, char *message); +bool my_cpp11_re_match_init (UDF_INIT *initid, UDF_ARGS *args, char *message); void my_cpp11_re_match_deinit(UDF_INIT* initid); long long my_cpp11_re_match (UDF_INIT* initid, UDF_ARGS* args, @@ -1235,8 +1235,8 @@ long long my_cpp11_re_match (UDF_INIT* initid, UDF_ARGS* args, C_MODE_END -my_bool my_cpp11_re_match_init (UDF_INIT *initid, UDF_ARGS *args, - char *message) +bool my_cpp11_re_match_init (UDF_INIT *initid, UDF_ARGS *args, + char *message) { initid->maybe_null= TRUE; diff --git a/sql/xa.cc b/sql/xa.cc index ebbbb52d61d0..67f7bc31ff8a 100644 --- a/sql/xa.cc +++ b/sql/xa.cc @@ -104,8 +104,8 @@ void xid_t::set(my_xid xid) } -static my_bool xacommit_handlerton(THD *unused1, plugin_ref plugin, - void *arg) +static bool xacommit_handlerton(THD *unused1, plugin_ref plugin, + void *arg) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && hton->recover) @@ -115,8 +115,8 @@ static my_bool xacommit_handlerton(THD *unused1, plugin_ref plugin, } -static my_bool xarollback_handlerton(THD *unused1, plugin_ref plugin, - void *arg) +static bool xarollback_handlerton(THD *unused1, plugin_ref plugin, + void *arg) { handlerton *hton= plugin_data(plugin); if (hton->state == SHOW_OPTION_YES && hton->recover) @@ -142,8 +142,8 @@ struct xarecover_st }; -static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin, - void *arg) +static bool xarecover_handlerton(THD *unused, plugin_ref plugin, + void *arg) { handlerton *hton= plugin_data(plugin); struct xarecover_st *info= (struct xarecover_st *) arg; @@ -1324,7 +1324,7 @@ bool applier_reset_xa_trans(THD *thd) @return FALSE on success, TRUE otherwise. */ -my_bool detach_native_trx(THD *thd, plugin_ref plugin, void *unused) +bool detach_native_trx(THD *thd, plugin_ref plugin, void *unused) { handlerton *hton= plugin_data(plugin); diff --git a/sql/xa.h b/sql/xa.h index e04e76bca783..5951896601e4 100644 --- a/sql/xa.h +++ b/sql/xa.h @@ -651,8 +651,8 @@ struct st_plugin_int *plugin_find_by_type(const LEX_CSTRING &plugin, int type); @return FALSE on success, TRUE otherwise. */ -my_bool detach_native_trx(THD *thd, plugin_ref plugin, - void *unused); +bool detach_native_trx(THD *thd, plugin_ref plugin, + void *unused); /** Reset some transaction state information and delete corresponding diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index ae240812094f..54f369f74ed3 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -82,7 +82,7 @@ static int write_meta_file(File meta_file, ha_rows rows, bool dirty); extern "C" void tina_get_status(void* param, int concurrent_insert); extern "C" void tina_update_status(void* param); -extern "C" my_bool tina_check_status(void* param); +extern "C" bool tina_check_status(void* param); /* Stuff for shares */ mysql_mutex_t tina_mutex; @@ -887,7 +887,7 @@ void tina_update_status(void* param) } /* this should exist and return 0 for concurrent insert to work */ -my_bool tina_check_status(void*) +bool tina_check_status(void*) { return 0; } diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 1ebd9c6d3c9a..e1efd2e5aa5d 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -39,7 +39,7 @@ typedef struct st_tina_share { Below flag is needed to make log tables work with concurrent insert. For more details see comment to ha_tina::update_status. */ - my_bool is_log_table; + bool is_log_table; /* Here we save the length of the file for readers. This is updated by inserts, updates and deletes. The var is initialized along with the diff --git a/storage/heap/_check.c b/storage/heap/_check.c index d30b33deb155..903bd66862a0 100644 --- a/storage/heap/_check.c +++ b/storage/heap/_check.c @@ -22,9 +22,9 @@ #include "my_inttypes.h" static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, - ulong blength, my_bool print_status); + ulong blength, bool print_status); static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records, - my_bool print_status); + bool print_status); /* @@ -43,7 +43,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records, 1 error */ -int heap_check_heap(HP_INFO *info, my_bool print_status) +int heap_check_heap(HP_INFO *info, bool print_status) { int error; uint key; @@ -101,7 +101,7 @@ int heap_check_heap(HP_INFO *info, my_bool print_status) static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, - ulong blength, my_bool print_status) + ulong blength, bool print_status) { int error; ulong i,found,max_links,seek,links; @@ -163,7 +163,7 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, } static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records, - my_bool print_status) + bool print_status) { HP_KEYDEF *keydef= info->s->keydef + keynr; int error= 0; diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index f6375f722ab2..faa3ed1a709f 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -111,7 +111,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked, (!(file= heap_open(name, mode)) && my_errno() == ENOENT)) { HP_CREATE_INFO create_info; - my_bool created_new_share; + bool created_new_share; int rc; file= 0; if (heap_prepare_hp_create_info(table, single_instance, @@ -722,7 +722,7 @@ int ha_heap::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info, dd::Table*) { int error; - my_bool created; + bool created; HP_CREATE_INFO hp_create_info; DBUG_ASSERT(!single_instance); @@ -758,7 +758,7 @@ void ha_heap::get_auto_increment(ulonglong, ulonglong, ulonglong, bool ha_heap::check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) + uint table_changes) { /* Check that auto_increment value was not changed */ if ((info->used_fields & HA_CREATE_USED_AUTO && diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index 4226f4b1f6a1..416f05ac19d8 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -32,7 +32,7 @@ class ha_heap: public handler uint records_changed; uint key_stat_version; /// True if only one ha_heap is to exist for the table. - my_bool single_instance; + bool single_instance; public: ha_heap(handlerton *hton, TABLE_SHARE *table); ~ha_heap() {} diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h index ba99deea03c1..7916f5abef6e 100644 --- a/storage/heap/heapdef.h +++ b/storage/heap/heapdef.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,7 +97,7 @@ extern uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key, extern uint hp_rb_key_length(HP_KEYDEF *keydef, const uchar *key); extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key); extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key); -extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const uchar *record); +extern bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const uchar *record); extern int hp_close(HP_INFO *info); extern void hp_clear(HP_SHARE *info); extern void hp_clear_keys(HP_SHARE *info); diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index 6ce03cd69f8d..2e43e8cfd148 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -30,7 +30,7 @@ static void init_block(HP_BLOCK *block,uint reclength,ulong min_records, /* Create a heap table */ int heap_create(const char *name, HP_CREATE_INFO *create_info, - HP_SHARE **res, my_bool *created_new_share) + HP_SHARE **res, bool *created_new_share) { uint i, j, key_segs, max_length, length; HP_SHARE *share= 0; @@ -313,7 +313,7 @@ void heap_drop_table(HP_INFO *info) void hp_free(HP_SHARE *share) { - my_bool not_internal_table= (share->open_list.data != NULL); + bool not_internal_table= (share->open_list.data != NULL); if (not_internal_table) /* If not internal table */ heap_share_list= list_delete(heap_share_list, &share->open_list); hp_clear(share); /* Remove blocks from memory */ diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c index 2b53b5f18369..fb75c32f9332 100644 --- a/storage/heap/hp_hash.c +++ b/storage/heap/hp_hash.c @@ -790,7 +790,7 @@ uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key) 0 otherwise */ -my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const uchar *record) +bool hp_if_null_in_key(HP_KEYDEF *keydef, const uchar *record) { HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c index 701dad35508a..5a2ed1409b21 100644 --- a/storage/heap/hp_open.c +++ b/storage/heap/hp_open.c @@ -93,7 +93,7 @@ HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode) Dereference a HEAP share and free it if it's not referenced. We needn't check open_count for single instances. */ -void heap_release_share(HP_SHARE *share, my_bool single_instance) +void heap_release_share(HP_SHARE *share, bool single_instance) { /* Couldn't open table; Remove the newly created table */ if (single_instance) diff --git a/storage/heap/hp_test1.c b/storage/heap/hp_test1.c index be72a6504481..861807fb15a9 100644 --- a/storage/heap/hp_test1.c +++ b/storage/heap/hp_test1.c @@ -41,7 +41,7 @@ int main(int argc, char **argv) HA_KEYSEG keyseg[4]; HP_CREATE_INFO hp_create_info; HP_SHARE *tmp_share; - my_bool unused; + bool unused; MY_INIT(argv[0]); filename= "test1"; diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c index b7899524dfc0..50e26c4124e8 100644 --- a/storage/heap/hp_test2.c +++ b/storage/heap/hp_test2.c @@ -35,7 +35,7 @@ static void endprog(int sig_number) MY_ATTRIBUTE((noreturn)); static uint flag=0,verbose=0,testflag=0,recant=10000,silent=0; static uint keys=MAX_KEYS; static uint16 key1[1001]; -static my_bool key3[MAX_RECORDS]; +static bool key3[MAX_RECORDS]; static int reclength=39; @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) HEAP_PTR position= 0; HP_CREATE_INFO hp_create_info; CHARSET_INFO *cs= &my_charset_latin1; - my_bool unused; + bool unused; MY_INIT(argv[0]); /* init my_sys library & pthreads */ filename= "test2"; diff --git a/storage/heap/hp_update.c b/storage/heap/hp_update.c index 48a3b221f953..9330327ff48b 100644 --- a/storage/heap/hp_update.c +++ b/storage/heap/hp_update.c @@ -25,7 +25,7 @@ int heap_update(HP_INFO *info, const uchar *old, const uchar *heap_new) { HP_KEYDEF *keydef, *end, *p_lastinx; uchar *pos; - my_bool auto_key_changed= 0; + bool auto_key_changed= 0; HP_SHARE *share= info->s; DBUG_ENTER("heap_update"); diff --git a/storage/innobase/api/api0api.cc b/storage/innobase/api/api0api.cc index d6e04d5ac8ca..4d0114a16ab1 100644 --- a/storage/innobase/api/api0api.cc +++ b/storage/innobase/api/api0api.cc @@ -53,13 +53,13 @@ InnoDB Native API #include "trx0roll.h" /** configure variable for binlog option with InnoDB APIs */ -my_bool ib_binlog_enabled = FALSE; +bool ib_binlog_enabled = FALSE; /** configure variable for MDL option with InnoDB APIs */ -my_bool ib_mdl_enabled = FALSE; +bool ib_mdl_enabled = FALSE; /** configure variable for disable rowlock with InnoDB APIs */ -my_bool ib_disable_row_lock = FALSE; +bool ib_disable_row_lock = FALSE; /** configure variable for Transaction isolation levels */ ulong ib_trx_level_setting = IB_TRX_READ_UNCOMMITTED; diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index 11ec18f35233..acb467da1d30 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -48,7 +48,7 @@ Created 2/17/1996 Heikki Tuuri /** Is search system enabled. Search system is protected by array of latches. */ -my_bool btr_search_enabled = true; +bool btr_search_enabled = true; /** Number of adaptive hash index partition. */ ulong btr_ahi_parts = 8; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 2eb9cf2d64d8..6437b59afbce 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -323,7 +323,7 @@ static ulint buf_dbg_counter = 0; #ifdef UNIV_DEBUG /** This is used to enable multiple buffer pool instances with small buffer pool size. */ -my_bool srv_buf_pool_debug; +bool srv_buf_pool_debug; #endif /* UNIV_DEBUG */ #if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 8a22f9c96d2b..068618611794 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -192,7 +192,7 @@ struct page_cleaner_t { static page_cleaner_t* page_cleaner = NULL; #ifdef UNIV_DEBUG -my_bool innodb_page_cleaner_disabled_debug; +bool innodb_page_cleaner_disabled_debug; #endif /* UNIV_DEBUG */ /** If LRU list of a buf_pool is less than this size then LRU eviction @@ -3084,7 +3084,7 @@ buf_flush_page_cleaner_disabled_debug_update( return; } - if (!*static_cast(save)) { + if (!*static_cast(save)) { if (!innodb_page_cleaner_disabled_debug) { return; } diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 2bb4f2aa32ab..fac1d84bb083 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1394,7 +1394,7 @@ buf_LRU_get_free_block( if (started_monitor) { srv_print_innodb_monitor = - static_cast(mon_value_was); + static_cast(mon_value_was); } block->skip_flush_check = false; diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index b918f41a9ef0..2b339fd94449 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -1589,7 +1589,7 @@ dict_create_or_check_foreign_constraint_tables(void) /*================================================*/ { trx_t* trx; - my_bool srv_file_per_table_backup; + bool srv_file_per_table_backup; dberr_t err; dberr_t sys_foreign_err; dberr_t sys_foreign_cols_err; @@ -1722,7 +1722,7 @@ dberr_t dict_create_or_check_sys_virtual() { trx_t* trx; - my_bool srv_file_per_table_backup; + bool srv_file_per_table_backup; dberr_t err; /* Note: The master thread has not been started at this point. */ @@ -2242,7 +2242,7 @@ dict_create_or_check_sys_tablespace(void) /*=====================================*/ { trx_t* trx; - my_bool srv_file_per_table_backup; + bool srv_file_per_table_backup; dberr_t err; dberr_t sys_tablespaces_err; dberr_t sys_datafiles_err; diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 3f6d47bbee81..877445f3afeb 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -105,7 +105,7 @@ dict_load_table_low( /* If this flag is TRUE, then we will load the cluster index's (and tables') metadata even if it is marked as "corrupted". */ -my_bool srv_load_corrupted = FALSE; +bool srv_load_corrupted = FALSE; #ifdef UNIV_DEBUG /****************************************************************//** diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc index 0f9807343c55..1ef174c5f436 100644 --- a/storage/innobase/dict/dict0stats_bg.cc +++ b/storage/innobase/dict/dict0stats_bg.cc @@ -47,7 +47,7 @@ os_event_t dict_stats_event = NULL; #ifdef UNIV_DEBUG /** Used by SET GLOBAL innodb_dict_stats_disabled_debug = 1; */ -my_bool innodb_dict_stats_disabled_debug; +bool innodb_dict_stats_disabled_debug; static os_event_t dict_stats_disabled_event; #endif /* UNIV_DEBUG */ @@ -381,7 +381,7 @@ dict_stats_disabled_debug_update( /* This method is protected by mutex, as every SET GLOBAL .. */ ut_ad(dict_stats_disabled_event != NULL); - const bool disable = *static_cast(save); + const bool disable = *static_cast(save); const int64_t sig_count = os_event_reset(dict_stats_disabled_event); diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 1ea71ae86d30..40cfbc99db23 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -239,7 +239,7 @@ struct fts_msg_t { ulong fts_num_word_optimize; // FIXME -my_bool fts_enable_diag_print; +bool fts_enable_diag_print; /** ZLib compressed block size.*/ static ulint FTS_ZIP_BLOCK_SIZE = 1024; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 152f9d513b19..7a04be7670ab 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -201,11 +201,11 @@ static char* innobase_server_stopword_table = NULL; /* Below we have boolean-valued start-up parameters, and their default values */ -static my_bool innobase_use_doublewrite = TRUE; -static my_bool innobase_rollback_on_timeout = FALSE; -static my_bool innobase_create_status_file = FALSE; -my_bool innobase_stats_on_metadata = TRUE; -static my_bool innodb_optimize_fulltext_only = FALSE; +static bool innobase_use_doublewrite = TRUE; +static bool innobase_rollback_on_timeout = FALSE; +static bool innobase_create_status_file = FALSE; +bool innobase_stats_on_metadata = TRUE; +static bool innodb_optimize_fulltext_only = FALSE; static char* innodb_version_str = (char*) INNODB_VERSION_STR; @@ -2244,7 +2244,7 @@ innobase_convert_from_table_id( /********************************************************************** Check if the length of the identifier exceeds the maximum allowed. return true when length of identifier is too long. */ -my_bool +bool innobase_check_identifier_length( /*=============================*/ const char* id) /* in: FK identifier to check excluding the @@ -3147,7 +3147,7 @@ the InnoDB trx_sys->mutex. does not mean we should invalidate the query cache: invalidation is called explicitly */ static -my_bool +bool innobase_query_caching_of_table_permitted( /*======================================*/ THD* thd, /*!< in: thd of the user who is trying to @@ -3168,7 +3168,7 @@ innobase_query_caching_of_table_permitted( /* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every plain SELECT if AUTOCOMMIT is not on. */ - return(static_cast(false)); + return(false); } innobase_srv_conc_force_exit_innodb(trx); @@ -3200,7 +3200,7 @@ innobase_query_caching_of_table_permitted( then trx2 would have already invalidated the cache. Thus we can trust the result in the cache is ok for this query. */ - return((my_bool)TRUE); + return(true); } /* Normalize the table name to InnoDB format */ @@ -3210,10 +3210,10 @@ innobase_query_caching_of_table_permitted( if (row_search_check_if_query_cache_permitted(trx, norm_name)) { - return(static_cast(true)); + return(true); } - return(static_cast(false)); + return(false); } /*****************************************************************//** @@ -3577,8 +3577,8 @@ system tables in InnoDB. Please don't add any SE-specific system tables here. */ static bool innobase_is_supported_system_table(const char *db, - const char *table_name, - bool is_sql_layer_system_table) + const char *table_name, + bool is_sql_layer_system_table) { static const char* supported_system_tables[]= { "columns_priv", "db", @@ -13125,7 +13125,7 @@ commit time. int ha_innobase::discard_or_import_tablespace( /*======================================*/ - my_bool discard, + bool discard, dd::Table* table_def) { @@ -18042,7 +18042,7 @@ ha_innobase::cmp_ref( Ask InnoDB if a query to a table can be cached. @return TRUE if query caching of the table is permitted */ -my_bool +bool ha_innobase::register_query_cache_table( /*====================================*/ THD* thd, /*!< in: user thread handle */ @@ -18666,7 +18666,7 @@ innodb_adaptive_hash_index_update( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save) { + if (*(bool*) save) { btr_search_enable(); } else { btr_search_disable(true); @@ -18690,11 +18690,11 @@ innodb_cmp_per_index_update( { /* Reset the stats whenever we enable the table INFORMATION_SCHEMA.innodb_cmp_per_index. */ - if (!srv_cmp_per_index_enabled && *(my_bool*) save) { + if (!srv_cmp_per_index_enabled && *(bool*) save) { page_zip_reset_stat_per_index(); } - srv_cmp_per_index_enabled = !!(*(my_bool*) save); + srv_cmp_per_index_enabled = !!(*(bool*) save); } /****************************************************************//** @@ -19594,11 +19594,11 @@ innobase_fts_find_ranking( } #ifdef UNIV_DEBUG -static my_bool innodb_background_drop_list_empty = TRUE; -static my_bool innodb_purge_run_now = TRUE; -static my_bool innodb_purge_stop_now = TRUE; -static my_bool innodb_log_checkpoint_now = TRUE; -static my_bool innodb_buf_flush_list_now = TRUE; +static bool innodb_background_drop_list_empty = TRUE; +static bool innodb_purge_run_now = TRUE; +static bool innodb_purge_stop_now = TRUE; +static bool innodb_log_checkpoint_now = TRUE; +static bool innodb_buf_flush_list_now = TRUE; static uint innodb_merge_threshold_set_all_debug = DICT_INDEX_MERGE_THRESHOLD_DEFAULT; @@ -19638,7 +19638,7 @@ purge_run_now_set( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) { + if (*(bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) { trx_purge_run(); } } @@ -19661,7 +19661,7 @@ purge_stop_now_set( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) { + if (*(bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) { trx_purge_stop(); } } @@ -19683,7 +19683,7 @@ checkpoint_now_set( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save) { + if (*(bool*) save) { while (log_sys->last_checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT + (log_sys->append_on_checkpoint != NULL @@ -19713,7 +19713,7 @@ buf_flush_list_now_set( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save) { + if (*(bool*) save) { buf_flush_sync_all_buf_pools(); } } @@ -19776,9 +19776,9 @@ are queried, e.g.: SELECT @@innodb_buffer_pool_dump_now; SELECT @@innodb_buffer_pool_load_now; SELECT @@innodb_buffer_pool_load_abort; */ -static my_bool innodb_buffer_pool_dump_now = FALSE; -static my_bool innodb_buffer_pool_load_now = FALSE; -static my_bool innodb_buffer_pool_load_abort = FALSE; +static bool innodb_buffer_pool_dump_now = FALSE; +static bool innodb_buffer_pool_load_now = FALSE; +static bool innodb_buffer_pool_load_abort = FALSE; /****************************************************************//** Trigger a dump of the buffer pool if innodb_buffer_pool_dump_now is set @@ -19798,7 +19798,7 @@ buffer_pool_dump_now( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save && !srv_read_only_mode) { + if (*(bool*) save && !srv_read_only_mode) { buf_dump_start(); } } @@ -19821,7 +19821,7 @@ buffer_pool_load_now( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save) { + if (*(bool*) save) { buf_load_start(); } } @@ -19844,7 +19844,7 @@ buffer_pool_load_abort( const void* save) /*!< in: immediate result from check function */ { - if (*(my_bool*) save) { + if (*(bool*) save) { buf_load_abort(); } } @@ -19909,7 +19909,7 @@ innodb_status_output_update( void* var_ptr, const void* save) { - *static_cast(var_ptr) = *static_cast(save); + *static_cast(var_ptr) = *static_cast(save); /* The lock timeout monitor thread also takes care of this output. */ os_event_set(lock_sys->timeout_event); @@ -19928,8 +19928,8 @@ innodb_log_checksums_update( void* var_ptr, const void* save) { - my_bool check = *static_cast(var_ptr) - = *static_cast(save); + bool check = *static_cast(var_ptr) + = *static_cast(save); /* Make sure we are the only log user */ mutex_enter(&log_sys->mutex); diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 2c87de32f5ba..75b86e69ca9a 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -221,7 +221,7 @@ class ha_innobase: public handler int optimize(THD* thd,HA_CHECK_OPT* check_opt); int discard_or_import_tablespace( - my_bool discard, + bool discard, dd::Table* table_def); int extra(ha_extra_function operation); @@ -378,7 +378,7 @@ class ha_innobase: public handler /** Ask handler about permission to cache table during query registration */ - my_bool register_query_cache_table( + bool register_query_cache_table( THD* thd, char* table_key, size_t key_length, @@ -1060,7 +1060,7 @@ void innobase_commit_low( trx_t* trx); -extern my_bool innobase_stats_on_metadata; +extern bool innobase_stats_on_metadata; /** Calculate Record Per Key value. Need to exclude the NULL value if innodb_stats_method is set to "nulls_ignored" diff --git a/storage/innobase/handler/ha_innopart.cc b/storage/innobase/handler/ha_innopart.cc index d94e54f93f43..84ba1fbf50e1 100644 --- a/storage/innobase/handler/ha_innopart.cc +++ b/storage/innobase/handler/ha_innopart.cc @@ -2996,7 +2996,7 @@ commit time. @return 0 or error number. */ int ha_innopart::discard_or_import_tablespace( - my_bool discard, + bool discard, dd::Table* table_def) { int error = 0; diff --git a/storage/innobase/handler/ha_innopart.h b/storage/innobase/handler/ha_innopart.h index 61fac4c4bbbe..51b58808a50f 100644 --- a/storage/innobase/handler/ha_innopart.h +++ b/storage/innobase/handler/ha_innopart.h @@ -220,7 +220,7 @@ class ha_innopart: has changed. @param[in,out] engine_data Data for call_back (not used). @return TRUE if query caching of the table is permitted. */ - my_bool + bool register_query_cache_table( THD* thd, char* table_key, @@ -337,7 +337,7 @@ class ha_innopart: int discard_or_import_tablespace( - my_bool discard, + bool discard, dd::Table* table_def); /** Compare key and rowid. diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index c930ff656c56..e864f1e4df7c 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -34,7 +34,7 @@ Created 7/19/1997 Heikki Tuuri #include "sync0sync.h" #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG -my_bool srv_ibuf_disable_background_merge; +bool srv_ibuf_disable_background_merge; #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ /** Number of bits describing a single page */ diff --git a/storage/innobase/include/api0misc.h b/storage/innobase/include/api0misc.h index 027c0e0221d5..757da50147ed 100644 --- a/storage/innobase/include/api0misc.h +++ b/storage/innobase/include/api0misc.h @@ -36,13 +36,13 @@ InnoDB Native API #include "univ.i" /** Whether binlog is enabled for applications using InnoDB APIs */ -extern my_bool ib_binlog_enabled; +extern bool ib_binlog_enabled; /** Whether MySQL MDL is enabled for applications using InnoDB APIs */ -extern my_bool ib_mdl_enabled; +extern bool ib_mdl_enabled; /** Whether InnoDB row lock is disabled for applications using InnoDB APIs */ -extern my_bool ib_disable_row_lock; +extern bool ib_disable_row_lock; /** configure value for transaction isolation level */ extern ulong ib_trx_level_setting; diff --git a/storage/innobase/include/btr0types.h b/storage/innobase/include/btr0types.h index a09748d3bf70..50c18e222057 100644 --- a/storage/innobase/include/btr0types.h +++ b/storage/innobase/include/btr0types.h @@ -42,7 +42,7 @@ struct btr_search_t; /** Is search system enabled. Search system is protected by array of latches. */ -extern my_bool btr_search_enabled; +extern bool btr_search_enabled; /** Number of adaptive hash index partition. */ extern ulong btr_ahi_parts; diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index 6d0a485042f3..5633bbaf0ee6 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -38,7 +38,7 @@ extern bool buf_page_cleaner_is_active; #ifdef UNIV_DEBUG /** Value of MySQL global variable used to disable page cleaner. */ -extern my_bool innodb_page_cleaner_disabled_debug; +extern bool innodb_page_cleaner_disabled_debug; #endif /* UNIV_DEBUG */ diff --git a/storage/innobase/include/dict0stats_bg.h b/storage/innobase/include/dict0stats_bg.h index 469f72760e0e..8d6b9b1e7072 100644 --- a/storage/innobase/include/dict0stats_bg.h +++ b/storage/innobase/include/dict0stats_bg.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -41,7 +41,7 @@ extern mysql_pfs_key_t dict_stats_recalc_pool_mutex_key; #ifdef UNIV_DEBUG /** Value of MySQL global used to disable dict_stats thread. */ -extern my_bool innodb_dict_stats_disabled_debug; +extern bool innodb_dict_stats_disabled_debug; #endif /* UNIV_DEBUG */ /*****************************************************************//** diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 4f157220b489..0820c2d22e17 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -136,7 +136,7 @@ extern ulong fts_num_word_optimize; /** Variable specifying whether we do additional FTS diagnostic printout in the log */ -extern my_bool fts_enable_diag_print; +extern bool fts_enable_diag_print; /** FTS rank type, which will be between 0 .. 1 inclusive */ typedef float fts_rank_t; diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 921476a51fed..2b40e6d6e14d 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -464,7 +464,7 @@ innobase_next_autoinc( Check if the length of the identifier exceeds the maximum allowed. The input to this function is an identifier in charset my_charset_filename. return true when length of identifier is too long. */ -my_bool +bool innobase_check_identifier_length( /*=============================*/ const char* id); /* in: identifier to check. it must belong diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index 2e6dbaf04bc2..98e18adf87a4 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -43,7 +43,7 @@ Created 5/7/1996 Heikki Tuuri // Forward declaration class ReadView; -extern my_bool innobase_deadlock_detect; +extern bool innobase_deadlock_detect; /*********************************************************************//** Gets the size of a lock struct. diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 95512e55daf0..fcb611ea62b5 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -510,7 +510,7 @@ log_mem_free(void); extern log_t* log_sys; /** Whether to generate and require checksums on the redo log pages */ -extern my_bool innodb_log_checksums; +extern bool innodb_log_checksums; /* Values used as flags */ #define LOG_FLUSH 7652559 diff --git a/storage/innobase/include/os0proc.h b/storage/innobase/include/os0proc.h index 3e69bb67e841..955af0a0e57f 100644 --- a/storage/innobase/include/os0proc.h +++ b/storage/innobase/include/os0proc.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -42,7 +42,7 @@ system with os_mem_alloc_large(). */ extern ulint os_total_large_mem_allocated; /** Whether to use large pages in the buffer pool */ -extern my_bool os_use_large_pages; +extern bool os_use_large_pages; /** Large page size. This may be a boot-time option on some platforms */ extern uint os_large_page_size; diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 711139a72b63..d69ebd481dd1 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -72,7 +72,7 @@ extern uint page_zip_level; /* Whether or not to log compressed page images to avoid possible compression algorithm changes in zlib. */ -extern my_bool page_zip_log_pages; +extern bool page_zip_log_pages; /** Set the size of a compressed page in bytes. @param[in,out] page_zip compressed page diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index b8bc800f220b..20b0d69d5a51 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -152,11 +152,11 @@ extern char* srv_buf_dump_filename; /** Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup. */ -extern my_bool srv_buffer_pool_dump_at_shutdown; -extern my_bool srv_buffer_pool_load_at_startup; +extern bool srv_buffer_pool_dump_at_shutdown; +extern bool srv_buffer_pool_load_at_startup; /* Whether to disable file system cache if it is defined */ -extern my_bool srv_disable_sort_file_cache; +extern bool srv_disable_sort_file_cache; /* If the last data file is auto-extended, we add this many pages to it at a time */ @@ -188,13 +188,13 @@ extern char* srv_data_home; /** Set if InnoDB must operate in read-only mode. We don't do any recovery and open all tables in RO mode instead of RW mode. We don't sync the max trx id to disk either. */ -extern my_bool srv_read_only_mode; +extern bool srv_read_only_mode; /** Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO. */ -extern my_bool high_level_read_only; +extern bool high_level_read_only; /** store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 */ -extern my_bool srv_file_per_table; +extern bool srv_file_per_table; /** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */ extern ulong srv_thread_sleep_delay; /** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/ @@ -209,8 +209,8 @@ extern unsigned long long srv_online_max_size; OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ -extern my_bool srv_use_native_aio; -extern my_bool srv_numa_interleave; +extern bool srv_use_native_aio; +extern bool srv_numa_interleave; #endif /* !UNIV_HOTBACKUP */ /** Server undo tablespaces directory, can be absolute path. */ @@ -235,10 +235,10 @@ extern unsigned long long srv_max_undo_tablespace_size; extern ulong srv_purge_rseg_truncate_frequency; /** Enable or Disable Truncate of UNDO tablespace. */ -extern my_bool srv_undo_log_truncate; +extern bool srv_undo_log_truncate; /** Enable or disable Encrypt of UNDO tablespace. */ -extern my_bool srv_undo_log_encrypt; +extern bool srv_undo_log_encrypt; /** Default size of UNDO tablespace while it is created new. */ extern const page_no_t SRV_UNDO_TABLESPACE_SIZE_IN_PAGES; @@ -246,7 +246,7 @@ extern const page_no_t SRV_UNDO_TABLESPACE_SIZE_IN_PAGES; extern char* srv_log_group_home_dir; /** Enable or Disable Encrypt of REDO tablespace. */ -extern my_bool srv_redo_log_encrypt; +extern bool srv_redo_log_encrypt; #ifndef UNIV_HOTBACKUP /** Maximum number of srv_n_log_files, or innodb_log_files_in_group */ @@ -267,13 +267,13 @@ extern ulong srv_log_buffer_size; extern ulong srv_flush_log_at_trx_commit; extern uint srv_flush_log_at_timeout; extern ulong srv_log_write_ahead_size; -extern my_bool srv_adaptive_flushing; -extern my_bool srv_flush_sync; +extern bool srv_adaptive_flushing; +extern bool srv_flush_sync; /* If this flag is TRUE, then we will load the indexes' (and tables') metadata even if they are marked as "corrupted". Mostly it is for DBA to process corrupted index and table */ -extern my_bool srv_load_corrupted; +extern bool srv_load_corrupted; /** Requested size in bytes */ extern ulint srv_buf_pool_size; @@ -306,7 +306,7 @@ extern ulong srv_buf_pool_dump_pct; extern ulint srv_lock_table_size; extern ulint srv_n_file_io_threads; -extern my_bool srv_random_read_ahead; +extern bool srv_random_read_ahead; extern ulong srv_read_ahead_threshold; extern ulong srv_n_read_io_threads; extern ulong srv_n_write_io_threads; @@ -365,10 +365,10 @@ extern ulong srv_fast_shutdown; extern ibool srv_innodb_status; extern unsigned long long srv_stats_transient_sample_pages; -extern my_bool srv_stats_persistent; +extern bool srv_stats_persistent; extern unsigned long long srv_stats_persistent_sample_pages; -extern my_bool srv_stats_auto_recalc; -extern my_bool srv_stats_include_delete_marked; +extern bool srv_stats_auto_recalc; +extern bool srv_stats_include_delete_marked; extern ibool srv_use_doublewrite_buf; extern ulong srv_doublewrite_batch_size; @@ -381,8 +381,8 @@ extern ulong srv_max_purge_lag_delay; extern ulong srv_replication_delay; /*-------------------------------------------*/ -extern my_bool srv_print_innodb_monitor; -extern my_bool srv_print_innodb_lock_monitor; +extern bool srv_print_innodb_monitor; +extern bool srv_print_innodb_lock_monitor; extern ibool srv_print_verbose_log; extern ibool srv_monitor_active; @@ -407,16 +407,16 @@ extern ulint srv_truncated_status_writes; extern ulint srv_available_rollback_segments; #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG -extern my_bool srv_ibuf_disable_background_merge; +extern bool srv_ibuf_disable_background_merge; #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ #ifdef UNIV_DEBUG -extern my_bool srv_buf_pool_debug; -extern my_bool srv_sync_debug; -extern my_bool srv_purge_view_update_only_debug; +extern bool srv_buf_pool_debug; +extern bool srv_sync_debug; +extern bool srv_purge_view_update_only_debug; /** Value of MySQL global used to disable master thread. */ -extern my_bool srv_master_thread_disabled_debug; +extern bool srv_master_thread_disabled_debug; #endif /* UNIV_DEBUG */ extern ulint srv_fatal_semaphore_wait_threshold; @@ -440,9 +440,9 @@ extern ulong srv_purge_batch_size; extern ulong srv_sync_array_size; /* print all user-level transactions deadlocks to mysqld stderr */ -extern my_bool srv_print_all_deadlocks; +extern bool srv_print_all_deadlocks; -extern my_bool srv_cmp_per_index_enabled; +extern bool srv_cmp_per_index_enabled; /** Status variables to be passed to MySQL */ extern struct export_var_t export_vars; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index e2f57d8204aa..eed5b6b8eb3f 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -52,7 +52,7 @@ Created 5/7/1996 Heikki Tuuri #include "ut0vec.h" /* Flag to enable/disable deadlock detector. */ -my_bool innobase_deadlock_detect = TRUE; +bool innobase_deadlock_detect = TRUE; /** Total number of cached record locks */ static const ulint REC_LOCK_CACHE = 8; diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 35775a8e5312..b0a0444bc09c 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -91,7 +91,7 @@ reduce the size of the log. log_t* log_sys = NULL; /** Whether to generate and require checksums on the redo log pages */ -my_bool innodb_log_checksums; +bool innodb_log_checksums; /** Pointer to the log checksum calculation function */ log_checksum_func_t log_checksum_algorithm_ptr; @@ -2075,7 +2075,7 @@ log_checkpoint( if (write_always) { DEBUG_SYNC_C("wa_checkpoint_middle"); - const my_bool b = TRUE; + const bool b = TRUE; buf_flush_page_cleaner_disabled_debug_update( NULL, NULL, NULL, &b); dict_stats_disabled_debug_update( diff --git a/storage/innobase/os/os0proc.cc b/storage/innobase/os/os0proc.cc index bf7e3aac6b1c..c1da0759cd56 100644 --- a/storage/innobase/os/os0proc.cc +++ b/storage/innobase/os/os0proc.cc @@ -50,7 +50,7 @@ system with os_mem_alloc_large(). */ ulint os_total_large_mem_allocated = 0; /** Whether to use large pages in the buffer pool */ -my_bool os_use_large_pages; +bool os_use_large_pages; /** Large page size. This may be a boot-time option on some platforms */ uint os_large_page_size; diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index b283f8df1830..578add4e9f08 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -77,7 +77,7 @@ uint page_zip_level = DEFAULT_COMPRESSION_LEVEL; /* Whether or not to log compressed page images to avoid possible compression algorithm changes in zlib. */ -my_bool page_zip_log_pages = true; +bool page_zip_log_pages = true; /* Please refer to ../include/page0zip.ic for a description of the compressed page format. */ @@ -1068,7 +1068,7 @@ page_zip_compress( /* A local copy of srv_cmp_per_index_enabled to avoid reading that variable multiple times in this function since it can be changed at anytime. */ - my_bool cmp_per_index_enabled; + bool cmp_per_index_enabled; cmp_per_index_enabled = srv_cmp_per_index_enabled; ut_a(page_is_comp(page)); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 1cdaf657b895..0b9d968b5334 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -58,7 +58,7 @@ Completed by Sunny Bains and Marko Makela #endif /* _WIN32 */ /* Whether to disable file system cache */ -my_bool srv_disable_sort_file_cache; +bool srv_disable_sort_file_cache; /** Class that caches index row tuples made from a single cluster index page scan, and then insert into corresponding index tree */ diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 5e19d88d4f53..9d2d6f8cc3bb 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -121,10 +121,10 @@ Note: If enabled then UNDO tablespace will be selected for truncate. While Server waits for undo-tablespace to truncate if user disables it, truncate action is completed but no new tablespace is marked for truncate (action is never aborted). */ -my_bool srv_undo_log_truncate = FALSE; +bool srv_undo_log_truncate = FALSE; /** Enable or disable Encrypt of UNDO tablespace. */ -my_bool srv_undo_log_encrypt = FALSE; +bool srv_undo_log_encrypt = FALSE; /** Maximum size of undo tablespace. */ unsigned long long srv_max_undo_tablespace_size; @@ -136,10 +136,10 @@ const page_no_t SRV_UNDO_TABLESPACE_SIZE_IN_PAGES = /** Set if InnoDB must operate in read-only mode. We don't do any recovery and open all tables in RO mode instead of RW mode. We don't sync the max trx id to disk either. */ -my_bool srv_read_only_mode; +bool srv_read_only_mode; /** store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 */ -my_bool srv_file_per_table; +bool srv_file_per_table; /** Sort buffer size in index creation */ ulong srv_sort_buf_size = 1048576; @@ -147,18 +147,18 @@ ulong srv_sort_buf_size = 1048576; unsigned long long srv_online_max_size; /** Set if InnoDB operates in read-only mode or innodb-force-recovery is greater than SRV_FORCE_NO_TRX_UNDO. */ -my_bool high_level_read_only; +bool high_level_read_only; /* If this flag is TRUE, then we will use the native aio of the OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ #ifdef _WIN32 -my_bool srv_use_native_aio = TRUE; /* enabled by default on Windows */ +bool srv_use_native_aio = TRUE; /* enabled by default on Windows */ #else -my_bool srv_use_native_aio; +bool srv_use_native_aio; #endif -my_bool srv_numa_interleave = FALSE; +bool srv_numa_interleave = FALSE; #ifdef UNIV_DEBUG /** Force all user tables to use page compression. */ @@ -166,7 +166,7 @@ ulong srv_debug_compress; /** Set when InnoDB has invoked exit(). */ bool innodb_calling_exit; /** Used by SET GLOBAL innodb_master_thread_disabled_debug = X. */ -my_bool srv_master_thread_disabled_debug; +bool srv_master_thread_disabled_debug; /** Event used to inform that master thread is disabled. */ static os_event_t srv_master_thread_disabled_event; /** Debug variable to find if any background threads are adding @@ -178,7 +178,7 @@ extern bool trx_commit_disallowed; char* srv_log_group_home_dir = NULL; /** Enable or disable Encrypt of REDO tablespace. */ -my_bool srv_redo_log_encrypt = FALSE; +bool srv_redo_log_encrypt = FALSE; ulong srv_n_log_files = SRV_N_LOG_FILES_MAX; /** At startup, this is the current redo log file size. @@ -204,10 +204,10 @@ page_size_t univ_page_size(0, 0, false); /* Try to flush dirty pages so as to avoid IO bursts at the checkpoints. */ -my_bool srv_adaptive_flushing = TRUE; +bool srv_adaptive_flushing = TRUE; /* Allow IO bursts at the checkpoints ignoring io_capacity setting. */ -my_bool srv_flush_sync = TRUE; +bool srv_flush_sync = TRUE; /** Maximum number of times allowed to conditionally acquire mutex before switching to blocking wait on the mutex */ @@ -255,7 +255,7 @@ ulong srv_n_read_io_threads; ulong srv_n_write_io_threads; /* Switch to enable random read ahead. */ -my_bool srv_random_read_ahead = FALSE; +bool srv_random_read_ahead = FALSE; /* User settable value of the number of pages that must be present in the buffer cache and accessed sequentially for InnoDB to trigger a readahead request. */ @@ -324,10 +324,10 @@ ulong srv_force_recovery_crash; /** Print all user-level transactions deadlocks to mysqld stderr */ -my_bool srv_print_all_deadlocks = FALSE; +bool srv_print_all_deadlocks = FALSE; /** Enable INFORMATION_SCHEMA.innodb_cmp_per_index */ -my_bool srv_cmp_per_index_enabled = FALSE; +bool srv_cmp_per_index_enabled = FALSE; /** The value of the configuration parameter innodb_fast_shutdown, controlling the InnoDB shutdown. @@ -353,10 +353,10 @@ this many index pages, there are 2 ways to calculate statistics: * quick transient stats, that are used if persistent stats for the given table/index are not found in the innodb database */ unsigned long long srv_stats_transient_sample_pages = 8; -my_bool srv_stats_persistent = TRUE; -my_bool srv_stats_include_delete_marked = FALSE; +bool srv_stats_persistent = TRUE; +bool srv_stats_include_delete_marked = FALSE; unsigned long long srv_stats_persistent_sample_pages = 20; -my_bool srv_stats_auto_recalc = TRUE; +bool srv_stats_auto_recalc = TRUE; ibool srv_use_doublewrite_buf = TRUE; @@ -384,8 +384,8 @@ ulint srv_available_rollback_segments = 0; /* Set the following to 0 if you want InnoDB to write messages on stderr on startup/shutdown. */ ibool srv_print_verbose_log = TRUE; -my_bool srv_print_innodb_monitor = FALSE; -my_bool srv_print_innodb_lock_monitor = FALSE; +bool srv_print_innodb_monitor = FALSE; +bool srv_print_innodb_lock_monitor = FALSE; /* Array of English strings describing the current state of an i/o handler thread */ @@ -577,8 +577,8 @@ char* srv_buf_dump_filename; /** Boolean config knobs that tell InnoDB to dump the buffer pool at shutdown and/or load it during startup. */ -my_bool srv_buffer_pool_dump_at_shutdown = TRUE; -my_bool srv_buffer_pool_load_at_startup = TRUE; +bool srv_buffer_pool_dump_at_shutdown = true; +bool srv_buffer_pool_load_at_startup = true; /** Slot index in the srv_sys->sys_threads array for the purge thread. */ static const ulint SRV_PURGE_SLOT = 1; @@ -1967,7 +1967,7 @@ srv_master_thread_disabled_debug_update( /* This method is protected by mutex, as every SET GLOBAL .. */ ut_ad(srv_master_thread_disabled_event != NULL); - const bool disable = *static_cast(save); + const bool disable = *static_cast(save); const int64_t sig_count = os_event_reset( srv_master_thread_disabled_event); diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index 70386d704261..491999eb03f3 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -1197,7 +1197,7 @@ sync_array_print_long_waits( os_thread_sleep(30000000); - srv_print_innodb_monitor = static_cast(old_val); + srv_print_innodb_monitor = static_cast(old_val); fprintf(stderr, "InnoDB: ###### Diagnostic info printed" " to the standard error stream\n"); diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index 14e5c64b8cf8..0d1055cd0019 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -44,7 +44,7 @@ Created 2012-08-21 Sunny Bains #ifdef UNIV_DEBUG -my_bool srv_sync_debug; +bool srv_sync_debug; /** The global mutex which protects debug info lists of all rw-locks. To modify the debug info list of an rw-lock, this mutex has to be diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 7ef88409c8d2..ae47d16eccd8 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -61,7 +61,7 @@ ulong srv_max_purge_lag_delay = 0; trx_purge_t* purge_sys = NULL; #ifdef UNIV_DEBUG -my_bool srv_purge_view_update_only_debug; +bool srv_purge_view_update_only_debug; bool trx_commit_disallowed = false; #endif /* UNIV_DEBUG */ diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index e1295f1e694c..70b9642680fb 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -365,11 +365,11 @@ static int _ftb_no_dupes_cmp(const void* not_used MY_ATTRIBUTE((unused)), returns 1 if the search was finished (must-word wasn't found) */ -static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) +static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, bool init_search) { int r; int subkeys=1; - my_bool can_go_down; + bool can_go_down; MI_INFO *info=ftb->info; uint off= 0, extra= HA_FT_WLEN + info->s->rec_reflength; uchar *lastkey_buf=ftbw->word+ftbw->off; @@ -431,7 +431,7 @@ static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) info->lastkey_length-extra-1, (uchar*) ftbw->word+1, ftbw->len-1, - (my_bool) (ftbw->flags & FTB_FLAG_TRUNC)); + (bool) (ftbw->flags & FTB_FLAG_TRUNC)); } if (r || info->lastkey_length > max_word_length) /* not found */ @@ -495,7 +495,7 @@ static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) return 0; } -static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) +static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, bool init_search) { int r; MYISAM_SHARE *share= ftb->info->s; @@ -930,7 +930,7 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, ftbw= ftb->list[c]; if (ha_compare_text(ftb->charset, (uchar*)word, len, (uchar*)ftbw->word+1, ftbw->len-1, - (my_bool) (ftbw->flags & FTB_FLAG_TRUNC)) < 0) + (bool) (ftbw->flags & FTB_FLAG_TRUNC)) < 0) b= c; else a= c; @@ -957,7 +957,7 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, ftbw= ftb->list[c]; if (ha_compare_text(ftb->charset, (uchar*)word, len, (uchar*)ftbw->word + 1,ftbw->len - 1, - (my_bool)(ftbw->flags & FTB_FLAG_TRUNC))) + (bool)(ftbw->flags & FTB_FLAG_TRUNC))) { if (ftb->with_scan & FTB_FLAG_TRUNC) continue; diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index 7d3c86740436..87b531c1bd41 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -88,7 +88,7 @@ FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root) DBUG_RETURN(wlist); } -my_bool ft_boolean_check_syntax_string(const uchar *str) +bool ft_boolean_check_syntax_string(const uchar *str) { uint i, j; @@ -211,7 +211,7 @@ uchar ft_get_word(const CHARSET_INFO *cs, uchar **start, uchar *end, uchar ft_simple_get_word(const CHARSET_INFO *cs, uchar **start, const uchar *end, - FT_WORD *word, my_bool skip_stopwords) + FT_WORD *word, bool skip_stopwords) { uchar *doc= *start; uint mwc, length; diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h index 4554120b5d0a..3d5dbda2cff1 100644 --- a/storage/myisam/ftdefs.h +++ b/storage/myisam/ftdefs.h @@ -110,7 +110,7 @@ uint _ft_make_key(MI_INFO *, uint , uchar *, FT_WORD *, my_off_t); uchar ft_get_word(const CHARSET_INFO *, uchar **, uchar *, FT_WORD *, MYSQL_FTPARSER_BOOLEAN_INFO *); uchar ft_simple_get_word(const CHARSET_INFO *, uchar **, const uchar *, - FT_WORD *, my_bool); + FT_WORD *, bool); typedef struct _st_ft_seg_iterator { uint num, len; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 748660ace37f..d5d7c1535c10 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -901,7 +901,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked, int ha_myisam::close(void) { - my_bool closed_share= FALSE; + bool closed_share= FALSE; lock_shared_ha_data(); int err= mi_close_share(file, &closed_share); file= 0; @@ -1360,7 +1360,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT*) const char *errmsg; ulonglong map; TABLE_LIST *table_list= table->pos_in_table_list; - my_bool ignore_leaves= table_list->ignore_leaves; + bool ignore_leaves= table_list->ignore_leaves; char buf[MYSQL_ERRMSG_SIZE]; DBUG_ENTER("ha_myisam::preload_keys"); @@ -2197,7 +2197,7 @@ uint ha_myisam::checksum() const bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) + uint table_changes) { uint options= table->s->db_options_in_use; @@ -2451,7 +2451,7 @@ mysql_declare_plugin_end; @retval FALSE An error occured */ -my_bool +bool ha_myisam::register_query_cache_table(THD *thd MY_ATTRIBUTE((unused)), char *table_name MY_ATTRIBUTE((unused)), size_t table_name_len MY_ATTRIBUTE((unused)), diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index a4a256738e60..f2720f5e8fd0 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -177,11 +177,11 @@ class ha_myisam: public handler int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); - my_bool register_query_cache_table(THD *thd, char *table_key, - size_t key_length, - qc_engine_callback - *engine_callback, - ulonglong *engine_data); + bool register_query_cache_table(THD *thd, char *table_key, + size_t key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data); MI_INFO *file_ptr(void) { return file; diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 7fa4fb36b840..4240c6e58840 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -963,7 +963,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) char llbuff[22],llbuff2[22],llbuff3[22]; ha_checksum intern_record_checksum; ha_checksum key_checksum[HA_MAX_POSSIBLE_KEY]; - my_bool static_row_size; + bool static_row_size; MI_KEYDEF *keyinfo; MI_BLOCK_INFO block_info; DBUG_ENTER("chk_data_link"); @@ -1448,7 +1448,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) then recrate all indexes. */ -static int mi_drop_all_indexes(MI_CHECK *param, MI_INFO *info, my_bool force) +static int mi_drop_all_indexes(MI_CHECK *param, MI_INFO *info, bool force) { MYISAM_SHARE *share= info->s; MI_STATE_INFO *state= &share->state; @@ -1534,7 +1534,7 @@ static int mi_drop_all_indexes(MI_CHECK *param, MI_INFO *info, my_bool force) /* Save new datafile-name in temp_filename */ int mi_repair(MI_CHECK *param, MI_INFO *info, - char * name, int rep_quick, my_bool no_copy_stat) + char * name, int rep_quick, bool no_copy_stat) { int error,got_error; ha_rows start_records,new_header_length; @@ -1625,7 +1625,7 @@ int mi_repair(MI_CHECK *param, MI_INFO *info, param->read_cache.end_of_file=sort_info.filelength= mysql_file_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)); sort_info.dupp=0; - sort_param.fix_datafile= (my_bool) (! rep_quick); + sort_param.fix_datafile= (bool) (! rep_quick); sort_param.master=1; sort_info.max_records= ~(ha_rows) 0; @@ -1675,7 +1675,7 @@ int mi_repair(MI_CHECK *param, MI_INFO *info, if (sort_write_record(&sort_param)) goto err; } - if (error > 0 || write_data_suffix(&sort_info, (my_bool)!rep_quick) || + if (error > 0 || write_data_suffix(&sort_info, (bool)!rep_quick) || flush_io_cache(&info->rec_cache) || param->read_cache.error < 0) goto err; @@ -1941,7 +1941,7 @@ int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file) /* Sort index for more efficent reads */ int mi_sort_index(MI_CHECK *param, MI_INFO *info, char * name, - my_bool no_copy_stat) + bool no_copy_stat) { uint key; MI_KEYDEF *keyinfo; @@ -2232,7 +2232,7 @@ int filecopy(MI_CHECK *param, File to,File from,my_off_t start, */ int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, - const char * name, int rep_quick, my_bool no_copy_stat) + const char * name, int rep_quick, bool no_copy_stat) { int got_error; uint i; @@ -2353,7 +2353,7 @@ int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, sort_param.key_cmp=sort_key_cmp; sort_param.tmpdir=param->tmpdir; sort_param.sort_info=&sort_info; - sort_param.fix_datafile= (my_bool) (! rep_quick); + sort_param.fix_datafile= (bool) (! rep_quick); sort_param.master =1; del=info->state->del; @@ -2444,7 +2444,7 @@ int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, } if (_create_index_by_sort(&sort_param, - (my_bool) (!(param->testflag & T_VERBOSE)), + (bool) (!(param->testflag & T_VERBOSE)), param->sort_buffer_length)) { param->retry_repair=1; @@ -2646,7 +2646,7 @@ int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, */ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, - const char * name, int rep_quick, my_bool no_copy_stat) + const char * name, int rep_quick, bool no_copy_stat) { int got_error; uint i,key, total_key_length, istep; @@ -2907,7 +2907,7 @@ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, } sort_info.total_keys=i; sort_param[0].master= 1; - sort_param[0].fix_datafile= (my_bool)(! rep_quick); + sort_param[0].fix_datafile= (bool)(! rep_quick); sort_param[0].calc_checksum= MY_TEST(param->testflag & T_CALC_CHECKSUM); if (!ftparser_alloc_param(info)) @@ -3367,7 +3367,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) } if (b_type & BLOCK_DELETED) { - my_bool error=0; + bool error=0; if (block_info.block_len+ (uint) (block_info.filepos-pos) < share->base.min_block_length) { @@ -4384,7 +4384,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) /* write suffix to data file if neaded */ -int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile) +int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile) { MI_INFO *info=sort_info->info; @@ -4478,7 +4478,7 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update) */ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, - my_bool repair_only) + bool repair_only) { uchar *record= 0; DBUG_ENTER("update_auto_increment_key"); @@ -4643,7 +4643,7 @@ static ha_checksum mi_byte_checksum(const uchar *buf, uint length) return crc; } -static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) +static bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) { uint key_maxlength=key->maxlength; if (key->flag & HA_FULLTEXT) @@ -4692,8 +4692,8 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) even if the temporary file would be quite big! */ -my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, - ulonglong key_map, my_bool force) +bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, + ulonglong key_map, bool force) { MYISAM_SHARE *share=info->s; MI_KEYDEF *key=share->keyinfo; diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index cf0eed1d718a..98852ea2ea92 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -28,7 +28,7 @@ #include "my_inttypes.h" #include "myisamdef.h" -int mi_close_share(register MI_INFO *info, my_bool *closed_share) +int mi_close_share(register MI_INFO *info, bool *closed_share) { int error=0,flag; MYISAM_SHARE *share=info->s; diff --git a/storage/myisam/mi_dbug.c b/storage/myisam/mi_dbug.c index f62607bb95ef..605856a7e439 100644 --- a/storage/myisam/mi_dbug.c +++ b/storage/myisam/mi_dbug.c @@ -179,7 +179,7 @@ void _mi_print_key(FILE *stream, HA_KEYSEG *keyseg, this mutex is locked by this thread already. */ -my_bool check_table_is_closed(const char *name, const char *where) +bool check_table_is_closed(const char *name, const char *where) { char filename[FN_REFLEN]; LIST *pos; diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index 18e474fd8286..369b7f552423 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -227,7 +227,7 @@ static int d_search(MI_INFO *info, MI_KEYDEF *keyinfo, { int flag,ret_value,save_flag; uint length,nod_flag,search_key_length; - my_bool last_key; + bool last_key; uchar *leaf_buff,*keypos; my_off_t leaf_page= 0, next_block; uchar lastkey[MI_MAX_KEY_BUFF]; @@ -382,7 +382,7 @@ static int d_search(MI_INFO *info, MI_KEYDEF *keyinfo, goto err; } ret_value=_mi_insert(info,keyinfo,key,anc_buff,keypos,lastkey, - (uchar*) 0,(uchar*) 0,(my_off_t) 0,(my_bool) 0); + (uchar*) 0,(uchar*) 0,(my_off_t) 0,(bool) 0); } } if (ret_value == 0 && mi_getint(anc_buff) > keyinfo->block_length) diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 5912652af893..39eda03ec1b3 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -65,7 +65,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, 1 error. */ -my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) +bool mi_dynmap_file(MI_INFO *info, my_off_t size) { DBUG_ENTER("mi_dynmap_file"); if (size == 0 || size > (my_off_t) (~((size_t) 0))) @@ -450,7 +450,7 @@ static int _mi_find_writepos(MI_INFO *info, a big block. */ -static my_bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info) +static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info) { DBUG_ENTER("unlink_deleted_block"); if (block_info->filepos == info->s->state.dellink) @@ -549,7 +549,7 @@ static int delete_dynamic_record(MI_INFO *info, my_off_t filepos, uint length,b_type; MI_BLOCK_INFO block_info,del_block; int error; - my_bool remove_next_block; + bool remove_next_block; DBUG_ENTER("delete_dynamic_record"); /* First add a link from the last block to the new one */ @@ -1097,8 +1097,8 @@ uint _mi_rec_pack(MI_INFO *info, uchar *to, Returns 0 if record is ok. */ -my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff, - ulong packed_length, my_bool with_checksum) +bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff, + ulong packed_length, bool with_checksum) { uint length,new_length,flag,bit,i; uchar *pos,*end,*packpos,*to; @@ -1720,7 +1720,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, int _mi_read_rnd_dynamic_record(MI_INFO *info, uchar *buf, my_off_t filepos, - my_bool skip_deleted_blocks) + bool skip_deleted_blocks) { int block_of_record, info_read, save_errno; uint left_len,b_type; diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 66c76478bfec..16875aa0a50c 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -63,8 +63,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (info->opt_flag & READ_CACHE_USED) { reinit_io_cache(&info->rec_cache,READ_CACHE,0, - (my_bool) (info->lock_type != F_UNLCK), - (my_bool) MY_TEST(info->update & HA_STATE_ROW_CHANGED) + (bool) (info->lock_type != F_UNLCK), + (bool) MY_TEST(info->update & HA_STATE_ROW_CHANGED) ); } info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND | @@ -110,7 +110,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (!(init_io_cache(&info->rec_cache,info->dfile, (uint) MY_MIN(info->state->data_file_length + 1, cache_size), - READ_CACHE,0L,(my_bool) (info->lock_type != F_UNLCK), + READ_CACHE,0L,(bool) (info->lock_type != F_UNLCK), MYF(share->write_flag & MY_WAIT_IF_FULL)))) { info->opt_flag|=READ_CACHE_USED; @@ -124,8 +124,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (info->opt_flag & READ_CACHE_USED) { reinit_io_cache(&info->rec_cache,READ_CACHE,info->nextpos, - (my_bool) (info->lock_type != F_UNLCK), - (my_bool) MY_TEST(info->update & HA_STATE_ROW_CHANGED)); + (bool) (info->lock_type != F_UNLCK), + (bool) MY_TEST(info->update & HA_STATE_ROW_CHANGED)); info->update&= ~HA_STATE_ROW_CHANGED; if (share->concurrent_insert) info->rec_cache.end_of_file=info->state->data_file_length; @@ -145,7 +145,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) !share->state.header.uniques) if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size, WRITE_CACHE,info->state->data_file_length, - (my_bool) (info->lock_type != F_UNLCK), + (bool) (info->lock_type != F_UNLCK), MYF(share->write_flag & MY_WAIT_IF_FULL)))) { info->opt_flag|=WRITE_CACHE_USED; diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index 3c1dc79e969a..580553e74716 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -33,7 +33,7 @@ } while(0) static int _mi_put_key_in_record(MI_INFO *info, uint keynr, - my_bool unpack_blobs, uchar *record); + bool unpack_blobs, uchar *record); /* Make a intern key from a record @@ -56,7 +56,7 @@ uint _mi_make_key(MI_INFO *info, uint keynr, uchar *key, uchar *pos; uchar *start; HA_KEYSEG *keyseg; - my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; + bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; DBUG_ENTER("_mi_make_key"); if (info->s->keyinfo[keynr].flag & HA_SPATIAL) @@ -217,7 +217,7 @@ uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key, uchar *old, { uchar *start_key=key; HA_KEYSEG *keyseg; - my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; + bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; DBUG_ENTER("_mi_pack_key"); /* "one part" rtree key is 2*SPDIMS part key in MyISAM */ @@ -324,7 +324,7 @@ uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key, uchar *old, */ static int _mi_put_key_in_record(MI_INFO *info, uint keynr, - my_bool unpack_blobs, uchar *record) + bool unpack_blobs, uchar *record) { uchar *key; uchar *pos,*key_end; diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index fd5660ce73cb..d3df043850b0 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -376,7 +376,7 @@ void mi_copy_status(void* to,void *from) 1 not ok */ -my_bool mi_check_status(void *param) +bool mi_check_status(void *param) { MI_INFO *info=(MI_INFO*) param; /* @@ -387,7 +387,7 @@ my_bool mi_check_status(void *param) DBUG_PRINT("info",("dellink: %ld r_locks: %u w_locks: %u", (long) info->s->state.dellink, (uint) info->s->r_locks, (uint) info->s->w_locks)); - return (my_bool) !(info->s->state.dellink == HA_OFFSET_ERROR || + return (bool) !(info->s->state.dellink == HA_OFFSET_ERROR || (myisam_concurrent_insert == 2 && info->s->r_locks && info->s->w_locks == 1)); } diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 6d1683c38bb5..60d397a297af 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -523,7 +523,7 @@ MI_INFO *mi_open_share(const char *name, MYISAM_SHARE *old_share, int mode, share->options|= HA_OPTION_READ_ONLY_DATA; info.s=share; if (_mi_read_pack_info(&info, - (my_bool) + (bool) MY_TEST(!(share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_TEMP_COMPRESS_RECORD))))) @@ -998,7 +998,7 @@ uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) } -uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead) +uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead) { uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE]; diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 1d0dc4c4cf66..de1eb0de67ec 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -141,7 +141,7 @@ static mi_bit_type mask[]= /* Read all packed info, allocate memory and fix field structs */ -my_bool _mi_read_pack_info(MI_INFO *info, my_bool fix_keys) +bool _mi_read_pack_info(MI_INFO *info, bool fix_keys) { File file; int diff_length; @@ -1309,7 +1309,7 @@ static uint decode_pos(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree) int _mi_read_rnd_pack_record(MI_INFO *info, uchar *buf, my_off_t filepos, - my_bool skip_deleted_blocks) + bool skip_deleted_blocks) { uint b_type; MI_BLOCK_INFO block_info; @@ -1498,12 +1498,12 @@ static uint max_bit(uint value) #endif static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,uchar *buf); -static int _mi_read_rnd_mempack_record(MI_INFO*, uchar *,my_off_t, my_bool); +static int _mi_read_rnd_mempack_record(MI_INFO*, uchar *,my_off_t, bool); -my_bool _mi_memmap_file(MI_INFO *info) +bool _mi_memmap_file(MI_INFO *info) { MYISAM_SHARE *share=info->s; - my_bool eom; + bool eom; DBUG_ENTER("mi_memmap_file"); @@ -1618,7 +1618,7 @@ static int _mi_read_mempack_record(MI_INFO *info, my_off_t filepos, uchar *buf) /*ARGSUSED*/ static int _mi_read_rnd_mempack_record(MI_INFO *info, uchar *buf, my_off_t filepos, - my_bool skip_deleted_blocks + bool skip_deleted_blocks MY_ATTRIBUTE((unused))) { MI_BLOCK_INFO block_info; diff --git a/storage/myisam/mi_panic.c b/storage/myisam/mi_panic.c index 072461f7ce3a..3098070a2076 100644 --- a/storage/myisam/mi_panic.c +++ b/storage/myisam/mi_panic.c @@ -57,7 +57,7 @@ int mi_panic(enum ha_panic_function flag) if (flush_io_cache(&info->rec_cache)) error=my_errno(); reinit_io_cache(&info->rec_cache,READ_CACHE,0, - (my_bool) (info->lock_type != F_UNLCK),1); + (bool) (info->lock_type != F_UNLCK),1); } if (info->lock_type != F_UNLCK && ! info->was_locked) { diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c index 0ccafd50f7e4..dcbc88bc8a17 100644 --- a/storage/myisam/mi_preload.c +++ b/storage/myisam/mi_preload.c @@ -45,7 +45,7 @@ of the table will be preloaded. */ -int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) +int mi_preload(MI_INFO *info, ulonglong key_map, bool ignore_leaves) { uint i; ulong length, block_length= 0; diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c index 61f36de4d95a..70b466fdcf70 100644 --- a/storage/myisam/mi_range.c +++ b/storage/myisam/mi_range.c @@ -198,7 +198,7 @@ static double _mi_search_pos(MI_INFO *info, { int flag; uint nod_flag, keynr, max_keynr= 0; - my_bool after_key; + bool after_key; uchar *keypos,*buff; double offset; DBUG_ENTER("_mi_search_pos"); diff --git a/storage/myisam/mi_rrnd.c b/storage/myisam/mi_rrnd.c index 6fb2c4c2855f..6e6000b2a711 100644 --- a/storage/myisam/mi_rrnd.c +++ b/storage/myisam/mi_rrnd.c @@ -33,7 +33,7 @@ int mi_rrnd(MI_INFO *info, uchar *buf, my_off_t filepos) { - my_bool skip_deleted_blocks; + bool skip_deleted_blocks; DBUG_ENTER("mi_rrnd"); skip_deleted_blocks=0; diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index b26da911072c..3650582daf96 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -27,9 +27,9 @@ #include "my_inttypes.h" #include "my_macros.h" -static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, - uchar *key, uchar *keypos, - uint *return_key_length); +static bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, + uint *return_key_length); /* Check index */ @@ -71,7 +71,7 @@ int _mi_check_index(MI_INFO *info, int inx) int _mi_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_len, uint nextflag, my_off_t pos) { - my_bool last_key; + bool last_key; int error,flag; uint nod_flag; uchar *keypos,*maxpos; @@ -189,7 +189,7 @@ int _mi_search(MI_INFO *info, MI_KEYDEF *keyinfo, int _mi_bin_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, - uchar *buff MY_ATTRIBUTE((unused)), my_bool *last_key) + uchar *buff MY_ATTRIBUTE((unused)), bool *last_key) { int start,mid,end,save_end; int flag= 0; @@ -252,7 +252,7 @@ int _mi_bin_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, int _mi_seq_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, - uchar *buff, my_bool *last_key) + uchar *buff, bool *last_key) { int flag= 0; uint nod_flag, length= 0, not_used[2]; @@ -296,7 +296,7 @@ int _mi_seq_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, int _mi_prefix_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint nextflag, uchar **ret_pos, - uchar *buff, my_bool *last_key) + uchar *buff, bool *last_key) { /* my_flag is raw comparison result to be changed according to @@ -1091,9 +1091,9 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, /* Get key at position without knowledge of previous key */ /* Returns 0 if ok */ -static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, - uchar *key, uchar *keypos, - uint *return_key_length) +static bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, + uchar *key, uchar *keypos, + uint *return_key_length) { uint nod_flag; DBUG_ENTER("_mi_get_prev_key"); @@ -1481,7 +1481,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, length_pack,new_key_length,diff_flag,pack_marker; uchar *start,*end,*key_end; const uchar *sort_order; - my_bool same_length; + bool same_length; length_pack=s_temp->ref_length=s_temp->n_ref_length=s_temp->n_length=0; same_length=0; keyseg=keyinfo->seg; diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c index 104d87a736f9..0380dc9261f5 100644 --- a/storage/myisam/mi_static.c +++ b/storage/myisam/mi_static.c @@ -39,7 +39,7 @@ char * myisam_log_filename=(char*) "myisam.log"; File myisam_log_file= -1; uint myisam_quick_table_bits=9; ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */ -my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0; +bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0; /* Assume that we are in a single threaded program by default. */ ulong myisam_concurrent_insert= 0; ulonglong myisam_max_temp_length= MAX_FILE_SIZE; diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c index fdf8acd8caef..75caa643bca2 100644 --- a/storage/myisam/mi_statrec.c +++ b/storage/myisam/mi_statrec.c @@ -205,7 +205,7 @@ int _mi_read_static_record(MI_INFO *info, my_off_t pos, int _mi_read_rnd_static_record(MI_INFO *info, uchar *buf, my_off_t filepos, - my_bool skip_deleted_blocks) + bool skip_deleted_blocks) { int locked,error,cache_read; uint cache_length; diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c index f429ea9a1b26..5552b740c886 100644 --- a/storage/myisam/mi_test1.c +++ b/storage/myisam/mi_test1.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ static int create_flag=0; static uint insert_count, update_count, remove_count; static uint pack_keys=0, pack_seg=0, key_length; static uint unique_key=HA_NOSAME; -static my_bool key_cacheing, null_fields, silent, skip_update, opt_unique, +static bool key_cacheing, null_fields, silent, skip_update, opt_unique, verbose; static MI_COLUMNDEF recinfo[4]; static MI_KEYDEF keyinfo[10]; @@ -605,7 +605,7 @@ static struct my_option my_long_options[] = }; -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c index f89d84eb5804..8efeeda0098c 100644 --- a/storage/myisam/mi_unique.c +++ b/storage/myisam/mi_unique.c @@ -23,8 +23,8 @@ #include "my_macros.h" #include "myisamdef.h" -my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, - ha_checksum unique_hash, my_off_t disk_pos) +bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, + ha_checksum unique_hash, my_off_t disk_pos) { my_off_t lastpos=info->lastpos; MI_KEYDEF *key= &info->s->keyinfo[def->key]; @@ -149,7 +149,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) */ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, - my_bool null_are_equal) + bool null_are_equal) { uchar *pos_a, *pos_b; const uchar *end; diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c index 5c1f8eb50851..0d5be2c34088 100644 --- a/storage/myisam/mi_update.c +++ b/storage/myisam/mi_update.c @@ -32,7 +32,7 @@ int mi_update(MI_INFO *info, const uchar *oldrec, uchar *newrec) my_off_t pos; uint i; uchar old_key[MI_MAX_KEY_BUFF],*new_key; - my_bool auto_key_changed=0; + bool auto_key_changed=0; ulonglong changed; MYISAM_SHARE *share=info->s; ha_checksum old_checksum= 0; diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index 03c1d2267a58..1d202fd4790f 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -34,7 +34,7 @@ static int w_search(MI_INFO *info,MI_KEYDEF *keyinfo, uint comp_flag, uchar *key, uint key_length, my_off_t pos, uchar *father_buff, uchar *father_keypos, my_off_t father_page, - my_bool insert_last); + bool insert_last); static int _mi_balance_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, uchar *curr_buff,uchar *father_buff, uchar *father_keypos,my_off_t father_page); @@ -55,7 +55,7 @@ int mi_write(MI_INFO *info, uchar *record) int save_errno; my_off_t filepos; uchar *buff; - my_bool lock_tree= share->concurrent_insert; + bool lock_tree= share->concurrent_insert; DBUG_ENTER("mi_write"); DBUG_PRINT("enter",("isam: %d data: %d",info->s->kfile,info->dfile)); @@ -110,9 +110,9 @@ int mi_write(MI_INFO *info, uchar *record) { if (mi_is_key_active(share->state.key_map, i)) { - my_bool local_lock_tree= (lock_tree && - !(info->bulk_insert && - is_tree_inited(&info->bulk_insert[i]))); + bool local_lock_tree= (lock_tree && + !(info->bulk_insert && + is_tree_inited(&info->bulk_insert[i]))); if (local_lock_tree) { mysql_rwlock_wrlock(&share->key_root_lock[i]); @@ -197,7 +197,7 @@ int mi_write(MI_INFO *info, uchar *record) { if (mi_is_key_active(share->state.key_map, i)) { - my_bool local_lock_tree= (lock_tree && + bool local_lock_tree= (lock_tree && !(info->bulk_insert && is_tree_inited(&info->bulk_insert[i]))); if (local_lock_tree) @@ -345,13 +345,13 @@ int _mi_enlarge_root(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, static int w_search(MI_INFO *info, MI_KEYDEF *keyinfo, uint comp_flag, uchar *key, uint key_length, my_off_t page, uchar *father_buff, uchar *father_keypos, - my_off_t father_page, my_bool insert_last) + my_off_t father_page, bool insert_last) { int error,flag; uint nod_flag, search_key_length; uchar *temp_buff,*keypos; uchar keybuff[MI_MAX_KEY_BUFF]; - my_bool was_last_key; + bool was_last_key; my_off_t next_page, dupp_key_pos; DBUG_ENTER("w_search"); DBUG_PRINT("enter",("page: %ld", (long) page)); @@ -466,7 +466,7 @@ static int w_search(MI_INFO *info, MI_KEYDEF *keyinfo, int _mi_insert(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *anc_buff, uchar *key_pos, uchar *key_buff, uchar *father_buff, uchar *father_key_pos, my_off_t father_page, - my_bool insert_last) + bool insert_last) { uint a_length,nod_flag; int t_length; @@ -593,7 +593,7 @@ int _mi_insert(MI_INFO *info, MI_KEYDEF *keyinfo, int _mi_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *buff, uchar *key_buff, - my_bool insert_last_key) + bool insert_last_key) { uint length,a_length,key_ref_length,t_length,nod_flag,key_length; uchar *key_pos,*pos, *after_key= NULL; @@ -761,7 +761,7 @@ static int _mi_balance_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *curr_buff, uchar *father_buff, uchar *father_key_pos, my_off_t father_page) { - my_bool right; + bool right; uint k_length,father_length,father_keylength,nod_flag,curr_keylength, right_length,left_length,new_right_length,new_left_length,extra_length, length,keys; diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c index e8eb43eefaee..019bd27fd458 100644 --- a/storage/myisam/myisam_ftdump.c +++ b/storage/myisam/myisam_ftdump.c @@ -29,10 +29,10 @@ static void usage() MY_ATTRIBUTE((noreturn)); static void complain(int val); -static my_bool get_one_option(int, const struct my_option *, char *); +static bool get_one_option(int, const struct my_option *, char *); static int count=0, stats=0, dump=0, lstats=0; -static my_bool verbose; +static bool verbose; static char *query=NULL; static uint lengths[256]; @@ -241,7 +241,7 @@ int main(int argc,char *argv[]) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 83a7aa06222c..9c2a377a1233 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -81,11 +81,11 @@ static int myisamchk(MI_CHECK *param, char *filename); static void descript(MI_CHECK *param, MI_INFO *info, char * name); static int mi_sort_records(MI_CHECK *param, MI_INFO *info, char * name, uint sort_key, - my_bool write_info, my_bool update_index); + bool write_info, bool update_index); static int sort_record_index(MI_SORT_PARAM *sort_param, MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page,uchar *buff,uint sortkey, - File new_file, my_bool update_index); + File new_file, bool update_index); MI_CHECK check_param; @@ -486,7 +486,7 @@ TYPELIB myisam_stats_method_typelib= { /* Read options */ -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) @@ -808,7 +808,7 @@ static int myisamchk(MI_CHECK *param, char * filename) MI_INFO *info; File datafile; char llbuff[22],llbuff2[22]; - my_bool state_updated=0; + bool state_updated=0; MYISAM_SHARE *share; DBUG_ENTER("myisamchk"); @@ -874,7 +874,7 @@ static int myisamchk(MI_CHECK *param, char * filename) */ if (param->testflag & (T_FAST | T_CHECK_ONLY_CHANGED)) { - my_bool need_to_check= mi_is_crashed(info) || share->state.open_count != 0; + bool need_to_check= mi_is_crashed(info) || share->state.open_count != 0; if ((param->testflag & (T_REP_ANY | T_SORT_RECORDS)) && ((share->state.changed & (STATE_CHANGED | STATE_CRASHED | @@ -1050,7 +1050,7 @@ static int myisamchk(MI_CHECK *param, char * filename) We can't update the index in mi_sort_records if we have a prefix compressed or fulltext index */ - my_bool update_index=1; + bool update_index=1; for (key=0 ; key < share->base.keys; key++) if (share->keyinfo[key].flag & (HA_BINARY_PACK_KEY|HA_FULLTEXT)) { @@ -1060,7 +1060,7 @@ static int myisamchk(MI_CHECK *param, char * filename) error=mi_sort_records(param,info,filename,param->opt_sort_key, /* what is the following parameter for ? */ - (my_bool) !(param->testflag & T_REP), + (bool) !(param->testflag & T_REP), update_index); datafile=info->dfile; /* This is now locked */ if (!error && !update_index) @@ -1143,7 +1143,7 @@ static int myisamchk(MI_CHECK *param, char * filename) if ((param->testflag & T_AUTO_INC) || ((param->testflag & T_REP_ANY) && info->s->base.auto_key)) update_auto_increment_key(param, info, - (my_bool) !MY_TEST(param->testflag & T_AUTO_INC)); + (bool) !MY_TEST(param->testflag & T_AUTO_INC)); if (!(param->testflag & T_DESCRIPT)) { @@ -1383,7 +1383,7 @@ static void descript(MI_CHECK *param, MI_INFO *info, char * name) for (key=0,uniqueinfo= &share->uniqueinfo[0] ; key < share->state.header.uniques; key++, uniqueinfo++) { - my_bool new_row=0; + bool new_row=0; char null_bit[8],null_pos[8]; printf("%-8d%-5d",key+1,uniqueinfo->key+1); for (keyseg=uniqueinfo->seg ; keyseg->type != HA_KEYTYPE_END ; keyseg++) @@ -1462,8 +1462,8 @@ static void descript(MI_CHECK *param, MI_INFO *info, char * name) static int mi_sort_records(MI_CHECK *param, MI_INFO *info, char * name, uint sort_key, - my_bool write_info, - my_bool update_index) + bool write_info, + bool update_index) { int got_error; uint key; @@ -1634,7 +1634,7 @@ static int mi_sort_records(MI_CHECK *param, static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, uchar *buff, uint sort_key, - File new_file,my_bool update_index) + File new_file,bool update_index) { uint nod_flag,used_length,key_length; uchar *temp_buff,*keypos,*endpos; diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index c6b5a6e54d63..73789e980874 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -46,7 +46,7 @@ typedef struct st_mi_status_info my_off_t key_file_length; my_off_t data_file_length; ha_checksum checksum; - my_bool uncacheable; /* Active concurrent insert */ + bool uncacheable; /* Active concurrent insert */ } MI_STATUS_INFO; typedef struct st_mi_state_info @@ -182,7 +182,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */ int (*write_record)(struct st_myisam_info*, const uchar*); int (*update_record)(struct st_myisam_info*, my_off_t, const uchar*); int (*delete_record)(struct st_myisam_info*); - int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, my_bool); + int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, bool); int (*compare_record)(struct st_myisam_info*, const uchar *); /* Function to use for a row checksum. */ ha_checksum (*calc_checksum)(struct st_myisam_info*, const uchar *); @@ -210,9 +210,9 @@ typedef struct st_mi_isam_share { /* Shared between opens */ myf write_flag; enum data_file_type data_file_type; /* Below flag is needed to make log tables work with concurrent insert */ - my_bool is_log_table; + bool is_log_table; - my_bool changed, /* If changed since lock */ + bool changed, /* If changed since lock */ global_changed, /* If changed since open */ not_flushed, temporary,delay_key_write, @@ -301,20 +301,20 @@ struct st_myisam_info { IO_CACHE rec_cache; /* When cacheing records */ uint preload_buff_size; /* When preloading indexes */ myf lock_wait; /* is 0 or MY_DONT_WAIT */ - my_bool was_locked; /* Was locked in panic */ - my_bool append_insert_at_end; /* Set if concurrent insert */ - my_bool quick_mode; - my_bool page_changed; /* If info->buff can't be used for rnext */ - my_bool buff_used; /* If info->buff has to be reread for rnext */ - uint8 once_flags; /* For MYISAMMRG */ + bool was_locked; /* Was locked in panic */ + bool append_insert_at_end; /* Set if concurrent insert */ + bool quick_mode; + bool page_changed; /* If info->buff can't be used for rnext */ + bool buff_used; /* If info->buff has to be reread for rnext */ + uint8 once_flags; /* For MYISAMMRG */ /* Used in mi_rnext_same to fill rnext_same_key for the first time. */ - my_bool set_rnext_same_key; + bool set_rnext_same_key; index_cond_func_t index_cond_func; /* Index condition function */ void *index_cond_func_arg; /* parameter for the func */ #ifdef _WIN32 - my_bool owned_by_merge; /* This MyISAM table is part of a merge union */ + bool owned_by_merge; /* This MyISAM table is part of a merge union */ #endif THR_LOCK_DATA lock; uchar *rtree_recursion_state; /* For RTREE */ @@ -347,8 +347,8 @@ typedef struct st_mi_sort_param my_off_t pos,max_pos,filepos,start_recpos; uint key, key_length,real_key_length; uint maxbuffers, keys, find_length, sort_keys_length; - my_bool fix_datafile, master; - my_bool calc_checksum; /* calculate table checksum */ + bool fix_datafile, master; + bool calc_checksum; /* calculate table checksum */ MI_KEYDEF *keyinfo; HA_KEYSEG *seg; SORT_INFO *sort_info; @@ -498,7 +498,7 @@ typedef struct st_mi_s_param totlength, part_of_prev_key,prev_length,pack_marker; uchar *key, *prev_key,*next_key_pos; - my_bool store_not_null; + bool store_not_null; } MI_KEY_PARAM; /* Prototypes for intern functions */ @@ -508,7 +508,7 @@ extern int _mi_write_dynamic_record(MI_INFO*, const uchar*); extern int _mi_update_dynamic_record(MI_INFO*, my_off_t, const uchar*); extern int _mi_delete_dynamic_record(MI_INFO *info); extern int _mi_cmp_dynamic_record(MI_INFO *info,const uchar *record); -extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, my_bool); +extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, bool); extern int _mi_write_blob_record(MI_INFO*, const uchar*); extern int _mi_update_blob_record(MI_INFO*, my_off_t, const uchar*); extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos,uchar *buf); @@ -516,7 +516,7 @@ extern int _mi_write_static_record(MI_INFO*, const uchar*); extern int _mi_update_static_record(MI_INFO*, my_off_t, const uchar*); extern int _mi_delete_static_record(MI_INFO *info); extern int _mi_cmp_static_record(MI_INFO *info,const uchar *record); -extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, my_bool); +extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, bool); extern int _mi_ck_write(MI_INFO *info,uint keynr,uchar *key,uint length); extern int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, @@ -525,9 +525,9 @@ extern int _mi_enlarge_root(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, my_off_ extern int _mi_insert(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, uchar *anc_buff,uchar *key_pos,uchar *key_buff, uchar *father_buff, uchar *father_keypos, - my_off_t father_page, my_bool insert_last); + my_off_t father_page, bool insert_last); extern int _mi_split_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, - uchar *buff,uchar *key_buff, my_bool insert_last); + uchar *buff,uchar *key_buff, bool insert_last); extern uchar *_mi_find_half_pos(uint nod_flag,MI_KEYDEF *keyinfo,uchar *page, uchar *key,uint *return_key_length, uchar **after_key); @@ -565,13 +565,13 @@ extern int _mi_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,uint key_len, uint nextflag,my_off_t pos); extern int _mi_bin_search(struct st_myisam_info *info,MI_KEYDEF *keyinfo, uchar *page,uchar *key,uint key_len,uint comp_flag, - uchar * *ret_pos,uchar *buff, my_bool *was_last_key); + uchar * *ret_pos,uchar *buff, bool *was_last_key); extern int _mi_seq_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, uchar *key,uint key_len,uint comp_flag, - uchar **ret_pos,uchar *buff, my_bool *was_last_key); + uchar **ret_pos,uchar *buff, bool *was_last_key); extern int _mi_prefix_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, uchar *key,uint key_len,uint comp_flag, - uchar **ret_pos,uchar *buff, my_bool *was_last_key); + uchar **ret_pos,uchar *buff, bool *was_last_key); extern my_off_t _mi_kpos(uint nod_flag,uchar *after_key); extern void _mi_kpointer(MI_INFO *info,uchar *buff,my_off_t pos); extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag,uchar *after_key); @@ -622,16 +622,16 @@ extern uchar *mi_alloc_rec_buff(MI_INFO *,ulong, uchar**); extern ulong _mi_rec_unpack(MI_INFO *info,uchar *to,uchar *from, ulong reclength); -extern my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos, - ulong packed_length, my_bool with_checkum); +extern bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos, + ulong packed_length, bool with_checkum); extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length, my_off_t next_filepos,uchar **record, ulong *reclength,int *flag); extern void _mi_print_key(FILE *stream,HA_KEYSEG *keyseg,const uchar *key, uint length); -extern my_bool _mi_read_pack_info(MI_INFO *info,my_bool fix_keys); +extern bool _mi_read_pack_info(MI_INFO *info,bool fix_keys); extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,uchar *buf); -extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, my_bool); +extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, bool); extern int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff, uchar *to, uchar *from, ulong reclength); extern ulonglong mi_safe_mul(ulonglong a,ulonglong b); @@ -712,7 +712,7 @@ extern void _myisam_log_record(enum myisam_log_commands command,MI_INFO *info, const uchar *record,my_off_t filepos, int result); extern void mi_report_error(int errcode, const char *file_name); -extern my_bool _mi_memmap_file(MI_INFO *info); +extern bool _mi_memmap_file(MI_INFO *info); extern void _mi_unmap_file(MI_INFO *info); extern uint save_pack_length(uint version, uchar *block_buff, ulong length); extern uint read_pack_length(uint version, const uchar *buf, ulong *length); @@ -728,7 +728,7 @@ extern size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); -uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead); +uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead); uint mi_base_info_write(File file, MI_BASE_INFO *base); uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); int mi_keyseg_write(File file, const HA_KEYSEG *keyseg); @@ -745,29 +745,29 @@ extern int mi_indexes_are_disabled(MI_INFO *info); ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record); ha_checksum mi_checksum(MI_INFO *info, const uchar *buf); ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf); -my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, - ha_checksum unique_hash, my_off_t pos); +bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, + ha_checksum unique_hash, my_off_t pos); ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf); int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos); int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos); int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, - my_bool null_are_equal); + bool null_are_equal); void mi_get_status(void* param, int concurrent_insert); void mi_update_status(void* param); void mi_restore_status(void* param); void mi_copy_status(void* to,void *from); -my_bool mi_check_status(void* param); +bool mi_check_status(void* param); extern MI_INFO *test_if_reopen(char *filename); -my_bool check_table_is_closed(const char *name, const char *where); +bool check_table_is_closed(const char *name, const char *where); int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name, File file_to_dup); int mi_open_keyfile(MYISAM_SHARE *share); void mi_setup_functions(MYISAM_SHARE *share); -my_bool mi_dynmap_file(MI_INFO *info, my_off_t size); +bool mi_dynmap_file(MI_INFO *info, my_off_t size); int mi_munmap_file(MI_INFO *info); void mi_remap_file(MI_INFO *info, my_off_t size); void _mi_report_crashed(MI_INFO *file, const char *message, @@ -790,7 +790,7 @@ void *thr_find_all_keys(void *arg); int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file); int sort_write_record(MI_SORT_PARAM *sort_param); -int _create_index_by_sort(MI_SORT_PARAM *info, my_bool no_messages, ulonglong); +int _create_index_by_sort(MI_SORT_PARAM *info, bool no_messages, ulonglong); extern void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t func, void *func_arg); diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index 89de710f7c64..b62b1cd2f433 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -44,7 +44,7 @@ struct file_info { char *name, *show_name; uchar *record; MI_INFO *isam; - my_bool closed, used; + bool closed, used; ulong accessed; }; @@ -77,7 +77,7 @@ static int reopen_closed_file(TREE *tree,struct file_info *file_info); static int find_record_with_key(struct file_info *file_info,uchar *record); static void printf_log(const char *str,...) MY_ATTRIBUTE((format(printf, 1, 2))); -static my_bool cmp_filename(struct file_info *file_info,char * name); +static bool cmp_filename(struct file_info *file_info,char * name); static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0, recover=0,prefix_remove=0,opt_processes=0; @@ -859,7 +859,7 @@ static void printf_log(const char *format,...) } -static my_bool cmp_filename(struct file_info *file_info, char * name) +static bool cmp_filename(struct file_info *file_info, char * name) { if (!file_info) return 1; diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index beda1840515c..dce26673a313 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -124,14 +124,14 @@ typedef struct st_isam_mrg { uint max_blob_length; my_off_t records; /* true if at least one source file has at least one disabled index */ - my_bool src_file_has_indexes_disabled; + bool src_file_has_indexes_disabled; } PACK_MRG_INFO; extern int main(int argc,char * *argv); static void get_options(int *argc,char ***argv); static MI_INFO *open_isam_file(char *name,int mode); -static my_bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count); +static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count); static int compress(PACK_MRG_INFO *file,char *join_name); static int create_dest_frm(char *source_table, char *dest_table); static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records); @@ -170,7 +170,7 @@ static uint max_bit(uint value); static int compress_isam_file(PACK_MRG_INFO *file,HUFF_COUNTS *huff_counts); static char *make_new_name(char *new_name,char *old_name); static char *make_old_name(char *new_name,char *old_name); -static void init_file_buffer(File file,my_bool read_buffer); +static void init_file_buffer(File file,bool read_buffer); static int flush_buffer(ulong neaded_length); static void end_file_buffer(void); static void write_bits(ulonglong value, uint bits); @@ -191,7 +191,7 @@ static int fakecmp(const void *a, const void *b); static int error_on_write=0,test_only=0,verbose=0,silent=0, write_loop=0,force_pack=0, isamchk_neaded=0; static int tmpfile_createflag=O_RDWR | O_TRUNC | O_EXCL; -static my_bool backup, opt_wait; +static bool backup, opt_wait; /* tree_buff_length is somewhat arbitrary. The bigger it is the better the chance to win in terms of compression factor. On the other hand, @@ -328,7 +328,7 @@ static void usage(void) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { @@ -442,7 +442,7 @@ static MI_INFO *open_isam_file(char *name,int mode) } -static my_bool open_isam_files(PACK_MRG_INFO *mrg, char **names, uint count) +static bool open_isam_files(PACK_MRG_INFO *mrg, char **names, uint count) { uint i,j; mrg->count=0; @@ -889,7 +889,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts) ulong reclength,max_blob_length; uchar *record,*pos,*next_pos,*end_pos,*start_pos; ha_rows record_count; - my_bool static_row_size; + bool static_row_size; HUFF_COUNTS *count,*end_count; TREE_ELEMENT *element; DBUG_ENTER("get_statistic"); @@ -2842,7 +2842,7 @@ static char *make_old_name(char *new_name, char *old_name) /* rutines for bit writing buffer */ -static void init_file_buffer(File file, my_bool read_buffer) +static void init_file_buffer(File file, bool read_buffer) { file_buffer.file=file; file_buffer.buffer= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, diff --git a/storage/myisam/queues.cc b/storage/myisam/queues.cc index 4333b7c9e9fd..8a141283d844 100644 --- a/storage/myisam/queues.cc +++ b/storage/myisam/queues.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -61,7 +61,7 @@ static int resize_queue(QUEUE *queue, PSI_memory_key key, uint max_elements); extern "C" int init_queue(QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, - my_bool max_at_top, + bool max_at_top, int (*compare) (void *, uchar *, uchar *), void *first_cmp_arg) { @@ -106,7 +106,7 @@ extern "C" int init_queue(QUEUE *queue, PSI_memory_key psi_key, */ extern "C" int init_queue_ex(QUEUE *queue, PSI_memory_key psi_key, uint max_elements, - uint offset_to_key, my_bool max_at_top, + uint offset_to_key, bool max_at_top, int (*compare) (void *, uchar *, uchar *), void *first_cmp_arg, uint auto_extent) { @@ -144,7 +144,7 @@ extern "C" int init_queue_ex(QUEUE *queue, PSI_memory_key psi_key, uint max_elem */ extern "C" int reinit_queue(QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, - my_bool max_at_top, + bool max_at_top, int (*compare) (void *, uchar *, uchar *), void *first_cmp_arg) { @@ -255,7 +255,7 @@ void _downheap(QUEUE *queue, uint idx) { uchar *element; uint elements,half_queue,offset_to_key, next_index; - my_bool first= TRUE; + bool first= TRUE; uint start_idx= idx; offset_to_key=queue->offset_to_key; diff --git a/storage/myisam/queues.h b/storage/myisam/queues.h index bea64c8f6f62..3eddaae38999 100644 --- a/storage/myisam/queues.h +++ b/storage/myisam/queues.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,15 +65,15 @@ typedef int (*queue_compare)(void *,uchar *, uchar *); int init_queue(QUEUE *queue, PSI_memory_key psi_key, uint max_elements,uint offset_to_key, - my_bool max_at_top, queue_compare compare, + bool max_at_top, queue_compare compare, void *first_cmp_arg); int init_queue_ex(QUEUE *queue, PSI_memory_key psi_key, uint max_elements,uint offset_to_key, - my_bool max_at_top, queue_compare compare, + bool max_at_top, queue_compare compare, void *first_cmp_arg, uint auto_extent); int reinit_queue(QUEUE *queue, PSI_memory_key psi_key, uint max_elements,uint offset_to_key, - my_bool max_at_top, queue_compare compare, + bool max_at_top, queue_compare compare, void *first_cmp_arg); void delete_queue(QUEUE *queue); void queue_insert(QUEUE *queue,uchar *element); @@ -84,12 +84,12 @@ static inline void queue_remove_all(QUEUE *queue) queue->elements= 0; } -static inline my_bool queue_is_full(QUEUE *queue) +static inline bool queue_is_full(QUEUE *queue) { return queue->elements == queue->max_elements; } -static inline my_bool is_queue_inited(QUEUE *queue) +static inline bool is_queue_inited(QUEUE *queue) { return queue->root != NULL; } diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index b7229566b516..b833ea721dc9 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -105,7 +105,7 @@ my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs); <> 0 Error */ -int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, +int _create_index_by_sort(MI_SORT_PARAM *info,bool no_messages, ulonglong sortbuff_size) { int error,maxbuffer,skr; diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 9e3d0dbf52b0..348782d97f20 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -804,7 +804,7 @@ int ha_myisammrg::attach_children(void) if (myrg_attach_children(this->file, this->test_if_locked | current_thd->open_options, myisammrg_attach_children_callback, ¶m, - (my_bool *) ¶m.need_compat_check)) + (bool *) ¶m.need_compat_check)) { error= my_errno(); goto err; @@ -1516,7 +1516,7 @@ int ha_myisammrg::create(const char *name, TABLE*, MY_UNPACK_FILENAME|MY_APPEND_EXT), table_names, create_info->merge_insert_method, - (my_bool) 0)); + (bool) 0)); } diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 52728ab3f6d5..d6bce4dcff03 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -76,7 +76,7 @@ class Mrg_child_def: public Sql_alloc class ha_myisammrg: public handler { MYRG_INFO *file; - my_bool is_cloned; /* This instance has been cloned */ + bool is_cloned; /* This instance has been cloned */ public: MEM_ROOT children_mem_root; /* mem root for children list */ diff --git a/storage/myisammrg/myrg_create.c b/storage/myisammrg/myrg_create.c index 77f116229d99..13eee0213e5d 100644 --- a/storage/myisammrg/myrg_create.c +++ b/storage/myisammrg/myrg_create.c @@ -30,7 +30,7 @@ */ int myrg_create(const char *name, const char **table_names, - uint insert_method, my_bool fix_names) + uint insert_method, bool fix_names) { int save_errno; uint errpos; diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index cbff922a9e00..987136a5a0f6 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -50,7 +50,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) MI_INFO *isam=0; uint found_merge_insert_method= 0; size_t name_buff_length; - my_bool bad_children= FALSE; + bool bad_children= FALSE; DBUG_ENTER("myrg_open"); memset(&file, 0, sizeof(file)); @@ -384,7 +384,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, MI_INFO *(*callback)(void*), - void *callback_param, my_bool *need_compat_check) + void *callback_param, bool *need_compat_check) { ulonglong file_offset; MI_INFO *myisam; @@ -394,8 +394,8 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, uint child_nr; uint key_parts= 0; uint min_keys; - my_bool bad_children= FALSE; - my_bool first_child= TRUE; + bool bad_children= FALSE; + bool first_child= TRUE; DBUG_ENTER("myrg_attach_children"); DBUG_PRINT("myrg", ("handle_locking: %d", handle_locking)); diff --git a/storage/ndb/include/portlib/NdbThread.h b/storage/ndb/include/portlib/NdbThread.h index ab263c51e674..858ba26fd4df 100644 --- a/storage/ndb/include/portlib/NdbThread.h +++ b/storage/ndb/include/portlib/NdbThread.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ struct NdbThread; signum set in g_ndb_shm_signum in a portable manner. */ #ifdef NDB_SHM_TRANSPORTER -void NdbThread_set_shm_sigmask(my_bool block); +void NdbThread_set_shm_sigmask(bool block); #endif /** @@ -137,13 +137,13 @@ int NdbThread_GetTid(struct NdbThread*); * Yield to normal time-share prio and back to real-time prio for * real-time threads */ -int NdbThread_yield_rt(struct NdbThread*, my_bool high_prio); +int NdbThread_yield_rt(struct NdbThread*, bool high_prio); /** * Set Scheduler for thread * This sets real-time priority of the thread. */ -int NdbThread_SetScheduler(struct NdbThread*, my_bool rt_prio, my_bool high_prio); +int NdbThread_SetScheduler(struct NdbThread*, bool rt_prio, bool high_prio); /** * Set Thread priority for thread diff --git a/storage/ndb/include/util/ndb_opts.h b/storage/ndb/include/util/ndb_opts.h index 47b40fc58e7d..36bfe7251b3c 100644 --- a/storage/ndb/include/util/ndb_opts.h +++ b/storage/ndb/include/util/ndb_opts.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,9 +35,9 @@ extern "C" { #define NONE OPT_EXTERN(int,opt_ndb_nodeid,NONE); -OPT_EXTERN(my_bool,opt_ndb_endinfo,=0); -OPT_EXTERN(my_bool,opt_core,NONE); -OPT_EXTERN(my_bool,opt_ndb_optimized_node_selection,NONE); +OPT_EXTERN(bool,opt_ndb_endinfo,=0); +OPT_EXTERN(bool,opt_core,NONE); +OPT_EXTERN(bool,opt_ndb_optimized_node_selection,NONE); OPT_EXTERN(const char *,opt_ndb_connectstring,=0); OPT_EXTERN(int, opt_connect_retry_delay,NONE); OPT_EXTERN(int, opt_connect_retries,NONE); @@ -135,7 +135,7 @@ enum ndb_std_options { void ndb_opt_set_usage_funcs(void (*short_usage)(void), void (*usage)(void)); -my_bool +bool ndb_std_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument); @@ -144,7 +144,7 @@ void ndb_usage(void (*usagefunc)(void), const char *load_default_groups[], struct my_option *my_long_options); void ndb_short_usage_sub(const char* extra); -my_bool ndb_is_load_default_arg_separator(const char* arg); +bool ndb_is_load_default_arg_separator(const char* arg); /* Read the given [groups] from and return in argc/argv */ int ndb_load_defaults(const char* conf_file, diff --git a/storage/ndb/src/common/portlib/NdbThread.c b/storage/ndb/src/common/portlib/NdbThread.c index b7e9533c87e4..63408eec0e6a 100644 --- a/storage/ndb/src/common/portlib/NdbThread.c +++ b/storage/ndb/src/common/portlib/NdbThread.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ #if defined(HAVE_LINUX_SCHEDULING) || defined(HAVE_PTHREAD_SET_SCHEDPARAM) static int g_min_prio = 0; static int g_max_prio = 0; -static my_bool get_prio_first = TRUE; +static bool get_prio_first = TRUE; #endif static NdbMutex *ndb_thread_mutex = 0; @@ -87,8 +87,8 @@ struct NdbThread volatile int inited; my_thread_t thread; /* Have we called any lock to CPU function yet for this thread */ - my_bool first_lock_call_exclusive; - my_bool first_lock_call_non_exclusive; + bool first_lock_call_exclusive; + bool first_lock_call_non_exclusive; #ifdef _WIN32 /* Problem in mysys on certain MySQL versions where the thread id is @@ -139,7 +139,7 @@ struct NdbThread }; #ifdef NDB_SHM_TRANSPORTER -void NdbThread_set_shm_sigmask(my_bool block) +void NdbThread_set_shm_sigmask(bool block) { if (ndb_shm_signum) { @@ -577,7 +577,7 @@ get_min_prio(int policy) } static int -get_prio(my_bool high_prio, int policy) +get_prio(bool high_prio, int policy) { int prio; @@ -613,7 +613,7 @@ get_prio(my_bool high_prio, int policy) * time on real-time prio then we can easily crash the system. */ int -NdbThread_yield_rt(struct NdbThread* pThread, my_bool high_prio) +NdbThread_yield_rt(struct NdbThread* pThread, bool high_prio) { int res = NdbThread_SetScheduler(pThread, FALSE, high_prio); int res1 = NdbThread_SetScheduler(pThread, TRUE, high_prio); @@ -636,8 +636,8 @@ NdbThread_SetThreadPrioNormal(struct NdbThread *pThread) #ifndef _WIN32 int NdbThread_SetScheduler(struct NdbThread* pThread, - my_bool rt_prio, - my_bool high_prio) + bool rt_prio, + bool high_prio) { int error_no= 0; #if defined HAVE_LINUX_SCHEDULING @@ -896,8 +896,8 @@ NdbThread_SetThreadPrio(struct NdbThread *pThread, static unsigned int num_processor_groups = 0; static unsigned int *num_processors_per_group = NULL; -static my_bool inited = FALSE; -static my_bool support_cpu_locking_on_windows = FALSE; +static bool inited = FALSE; +static bool support_cpu_locking_on_windows = FALSE; /** * On Windows the processors group have different sizes. @@ -925,7 +925,7 @@ static my_bool support_cpu_locking_on_windows = FALSE; #define GET_PROCESSOR_ID(a) ((a) & 63) #define NOT_ASSIGNED_TO_PROCESSOR_GROUP 0xFFFF0000 -static my_bool +static bool is_cpu_locking_supported_on_windows() { if (inited) @@ -961,7 +961,7 @@ is_cpu_locking_supported_on_windows() } -static my_bool +static bool is_cpu_available(unsigned int cpu_id) { unsigned int processor_group = GET_PROCESSOR_GROUP(cpu_id); @@ -999,8 +999,8 @@ calculate_processor_mask(KAFFINITY *mask, int NdbThread_SetScheduler(struct NdbThread* pThread, - my_bool rt_prio, - my_bool high_prio) + bool rt_prio, + bool high_prio) { int windows_prio; if (rt_prio && high_prio) diff --git a/storage/ndb/src/common/util/ndb_opts.cpp b/storage/ndb/src/common/util/ndb_opts.cpp index dd90f38589e9..e348ac8ec818 100644 --- a/storage/ndb/src/common/util/ndb_opts.cpp +++ b/storage/ndb/src/common/util/ndb_opts.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -83,7 +83,7 @@ void ndb_usage(void (*usagefunc)(void), const char *load_default_groups[], } extern "C" -my_bool +bool ndb_std_get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) @@ -120,7 +120,7 @@ void ndb_std_print_version() } extern "C" -my_bool ndb_is_load_default_arg_separator(const char* arg) +bool ndb_is_load_default_arg_separator(const char* arg) { /* load_default() in 5.5+ returns an extra arg which has to diff --git a/storage/ndb/src/cw/cpcd/main.cpp b/storage/ndb/src/cw/cpcd/main.cpp index 21bdae87b8a0..8593550775f7 100644 --- a/storage/ndb/src/cw/cpcd/main.cpp +++ b/storage/ndb/src/cw/cpcd/main.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ static struct my_option my_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { diff --git a/storage/ndb/src/kernel/ndbd.cpp b/storage/ndb/src/kernel/ndbd.cpp index 8adbb49ceebe..c8071f462a3e 100644 --- a/storage/ndb/src/kernel/ndbd.cpp +++ b/storage/ndb/src/kernel/ndbd.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1045,7 +1045,7 @@ ndbd_run(bool foreground, int report_fd, } -extern "C" my_bool opt_core; +extern "C" bool opt_core; // instantiated and updated in NdbcntrMain.cpp extern Uint32 g_currentStartPhase; diff --git a/storage/ndb/src/kernel/vm/mt_thr_config.cpp b/storage/ndb/src/kernel/vm/mt_thr_config.cpp index 1b0a7a68863e..c7155cd07a19 100644 --- a/storage/ndb/src/kernel/vm/mt_thr_config.cpp +++ b/storage/ndb/src/kernel/vm/mt_thr_config.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1215,7 +1215,7 @@ THRConfigApplier::do_bind(NdbThread* thread, } } require(num_cpu_ids == num_bits_set); - my_bool is_exclusive; + bool is_exclusive; if (thr->m_bind_type == T_Thread::B_CPUSET_EXCLUSIVE_BIND) { /* Bind to a CPU set exclusively */ diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp index 0a8cf8f14698..df8a3bd8efaf 100644 --- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -658,7 +658,7 @@ InitConfigFileParser::Context::reportWarning(const char * fmt, ...){ static int order = 1; static -my_bool +bool parse_mycnf_opt(int, const struct my_option * opt, char * value) { long *app_type= (long*) &opt->app_type; diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index e62103cceaa4..d67fa65ca3a7 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,7 +80,7 @@ int g_errorInsert = 0; }\ } -extern "C" my_bool opt_core; +extern "C" bool opt_core; void * MgmtSrvr::logLevelThread_C(void* m) diff --git a/storage/ndb/test/ndbapi/testFK.cpp b/storage/ndb/test/ndbapi/testFK.cpp index c9d80d4fecff..68bfd9317ac3 100644 --- a/storage/ndb/test/ndbapi/testFK.cpp +++ b/storage/ndb/test/ndbapi/testFK.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ #include #include -extern "C" my_bool opt_core; +extern "C" bool opt_core; #define DBG(x) \ do { g_info << x << " at line " << __LINE__ << endl; } while (0) diff --git a/storage/ndb/test/ndbapi/testIndexStat.cpp b/storage/ndb/test/ndbapi/testIndexStat.cpp index 0b7d44ddd04f..c9e30c0ea142 100644 --- a/storage/ndb/test/ndbapi/testIndexStat.cpp +++ b/storage/ndb/test/ndbapi/testIndexStat.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,8 +41,8 @@ struct Opts { uint rpkvar; uint scanpct; uint eqscans; - my_bool keeptable; - my_bool abort; + bool keeptable; + bool abort; const char* dump; Opts() : loglevel(0), diff --git a/storage/ndb/test/ndbapi/test_event_merge.cpp b/storage/ndb/test/ndbapi/test_event_merge.cpp index 42098b5f945e..915b8f1dbe32 100644 --- a/storage/ndb/test/ndbapi/test_event_merge.cpp +++ b/storage/ndb/test/ndbapi/test_event_merge.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,24 +67,24 @@ */ struct Opts { - my_bool abort_on_error; + bool abort_on_error; int blob_version; int loglevel; uint loop; uint maxops; uint maxpk; - my_bool no_blobs; - my_bool no_implicit_nulls; - my_bool no_missing_update; - my_bool no_multiops; - my_bool no_nulls; - my_bool one_blob; + bool no_blobs; + bool no_implicit_nulls; + bool no_missing_update; + bool no_multiops; + bool no_nulls; + bool one_blob; const char* opstring; uint seed; int maxtab; - my_bool separate_events; + bool separate_events; uint tweak; // whatever's useful - my_bool use_table; + bool use_table; }; static Opts g_opts; diff --git a/storage/ndb/test/run-test/main.cpp b/storage/ndb/test/run-test/main.cpp index f78822875a3e..e5782d78d395 100644 --- a/storage/ndb/test/run-test/main.cpp +++ b/storage/ndb/test/run-test/main.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -598,7 +598,7 @@ main(int argc, char ** argv) } extern "C" -my_bool +bool get_one_option(int arg, const struct my_option * opt, char * value) { if (arg == 1024) diff --git a/storage/ndb/test/src/DbUtil.cpp b/storage/ndb/test/src/DbUtil.cpp index 040f1a6a9c06..f68e8ab02673 100644 --- a/storage/ndb/test/src/DbUtil.cpp +++ b/storage/ndb/test/src/DbUtil.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -415,7 +415,7 @@ DbUtil::runQuery(const char* sql, Update max_length, making it possible to know how big buffers to allocate */ - my_bool one= 1; + bool one= 1; mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &one); if (mysql_stmt_store_result(stmt)) @@ -467,7 +467,7 @@ DbUtil::runQuery(const char* sql, } bind_result[i].buffer_length= buf_len; - bind_result[i].is_null = (my_bool*)malloc(sizeof(my_bool)); + bind_result[i].is_null = (bool*)malloc(sizeof(bool)); if (bind_result[i].is_null == NULL) { free(bind_result[i].buffer); diff --git a/storage/ndb/test/src/SqlClient.cpp b/storage/ndb/test/src/SqlClient.cpp index e0171e29d1a9..08f477f1f261 100644 --- a/storage/ndb/test/src/SqlClient.cpp +++ b/storage/ndb/test/src/SqlClient.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -225,7 +225,7 @@ SqlClient::runQuery(const char* sql, Update max_length, making it possible to know how big buffers to allocate */ - my_bool one= 1; + bool one= 1; mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &one); if (mysql_stmt_store_result(stmt)) diff --git a/storage/ndb/tools/delete_all.cpp b/storage/ndb/tools/delete_all.cpp index 41e3be1ba587..f1ead4644dbc 100644 --- a/storage/ndb/tools/delete_all.cpp +++ b/storage/ndb/tools/delete_all.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,9 +29,9 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, const char *load_default_groups[]= { "mysql_cluster",0 }; static const char* _dbname = "TEST_DB"; -static my_bool _transactional = false; -static my_bool _tupscan = 0; -static my_bool _diskscan = 0; +static bool _transactional = false; +static bool _tupscan = 0; +static bool _diskscan = 0; static struct my_option my_long_options[] = { diff --git a/storage/ndb/tools/ndb_blob_tool.cpp b/storage/ndb/tools/ndb_blob_tool.cpp index 95797f75d504..7a8c7e09bfdc 100644 --- a/storage/ndb/tools/ndb_blob_tool.cpp +++ b/storage/ndb/tools/ndb_blob_tool.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,10 +21,10 @@ #include static const char* opt_dbname = 0; -static my_bool opt_check_orphans = false; -static my_bool opt_delete_orphans = false; +static bool opt_check_orphans = false; +static bool opt_delete_orphans = false; static const char* opt_dump_file = 0; -static my_bool opt_verbose = false; +static bool opt_verbose = false; static FILE* g_dump_file = 0; static FileOutputStream* g_dump_out = 0; diff --git a/storage/ndb/tools/ndb_index_stat.cpp b/storage/ndb/tools/ndb_index_stat.cpp index 08c420d27bd5..d0f1a6f28ddd 100644 --- a/storage/ndb/tools/ndb_index_stat.cpp +++ b/storage/ndb/tools/ndb_index_stat.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,22 +24,22 @@ // stats options static const char* _dbname = 0; -static my_bool _delete = false; -static my_bool _update = false; -static my_bool _dump = false; +static bool _delete = false; +static bool _update = false; +static bool _dump = false; static int _query = 0; static int _stats_any = 0; // sys options -static my_bool _sys_drop = false; -static my_bool _sys_create = false; -static my_bool _sys_create_if_not_exist = false; -static my_bool _sys_create_if_not_valid = false; -static my_bool _sys_check = false; -static my_bool _sys_skip_tables = false; -static my_bool _sys_skip_events = false; +static bool _sys_drop = false; +static bool _sys_create = false; +static bool _sys_create_if_not_exist = false; +static bool _sys_create_if_not_valid = false; +static bool _sys_check = false; +static bool _sys_skip_tables = false; +static bool _sys_skip_events = false; static int _sys_any = 0; // other -static my_bool _verbose = false; +static bool _verbose = false; static int _loops = 1; static Ndb_cluster_connection* g_ncc = 0; diff --git a/storage/ndb/tools/ndb_move_data.cpp b/storage/ndb/tools/ndb_move_data.cpp index e728947c13ed..a9d0cc501d7e 100644 --- a/storage/ndb/tools/ndb_move_data.cpp +++ b/storage/ndb/tools/ndb_move_data.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,14 +23,14 @@ #include static const char* opt_dbname = "TEST_DB"; -static my_bool opt_exclude_missing_columns = false; -static my_bool opt_promote_attributes = false; -static my_bool opt_lossy_conversions = false; +static bool opt_exclude_missing_columns = false; +static bool opt_promote_attributes = false; +static bool opt_lossy_conversions = false; static const char* opt_staging_tries = 0; -static my_bool opt_drop_source = false; -static my_bool opt_verbose = false; -static my_bool opt_error_insert = false; -static my_bool opt_abort_on_error = false; +static bool opt_drop_source = false; +static bool opt_verbose = false; +static bool opt_error_insert = false; +static bool opt_abort_on_error = false; static char g_staging_tries_default[100]; static Ndb_move_data::Opts::Tries g_opts_tries; diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index 56772929f15a..6bd88567192c 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -442,7 +442,7 @@ static void usage() ndb_usage(short_usage_sub, load_default_groups, my_long_options); } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index ac448c722aaf..9cb19b2ca25b 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -248,7 +248,7 @@ class ha_perfschema : public handler return HA_CACHE_TBL_NOCACHE; } - virtual my_bool + virtual bool register_query_cache_table( THD *, char *, size_t, qc_engine_callback *engine_callback, ulonglong *) { diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index da30fb7f707c..2e16ce4c4b34 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -2032,7 +2032,7 @@ pfs_destroy_cond_v1(PSI_cond *cond) @sa PSI_v1::get_table_share. */ PSI_table_share * -pfs_get_table_share_v1(my_bool temporary, TABLE_SHARE *share) +pfs_get_table_share_v1(bool temporary, TABLE_SHARE *share) { /* Ignore temporary tables and views. */ if (temporary || share->is_view) @@ -2072,7 +2072,7 @@ pfs_release_table_share_v1(PSI_table_share *share) @sa PSI_v1::drop_table_share. */ void -pfs_drop_table_share_v1(my_bool temporary, +pfs_drop_table_share_v1(bool temporary, const char *schema_name, int schema_name_length, const char *table_name, @@ -6468,8 +6468,8 @@ pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, const void *xid, const ulonglong *trxid, int isolation_level, - my_bool read_only, - my_bool autocommit) + bool read_only, + bool autocommit) { DBUG_ASSERT(state != NULL); @@ -6729,7 +6729,7 @@ pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker, } void -pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit) +pfs_end_transaction_v1(PSI_transaction_locker *locker, bool commit) { PSI_transaction_locker_state *state = reinterpret_cast(locker); diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h index 8aee040c5885..fecb8df85c6a 100644 --- a/storage/perfschema/pfs_events_transactions.h +++ b/storage/perfschema/pfs_events_transactions.h @@ -89,7 +89,7 @@ struct PFS_events_transactions : public PFS_events /** Global Transaction ID specifier. */ Gtid_specification m_gtid_spec; /** True if XA transaction. */ - my_bool m_xa; + bool m_xa; /** XA transaction ID. */ PSI_xid m_xid; /** XA status */ @@ -97,9 +97,9 @@ struct PFS_events_transactions : public PFS_events /** Transaction isolation level. */ enum_isolation_level m_isolation_level; /** True if read-only transaction, otherwise read-write. */ - my_bool m_read_only; + bool m_read_only; /** True if autocommit transaction. */ - my_bool m_autocommit; + bool m_autocommit; /** Total number of savepoints. */ ulonglong m_savepoint_count; /** Number of rollback_to_savepoint. */ diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index 383fa7b27a99..2cb4c5f59004 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -51,7 +51,7 @@ Indicate if the performance schema is enabled. This flag is set at startup, and never changes. */ -my_bool pfs_enabled = TRUE; +bool pfs_enabled = TRUE; /** PFS_INSTRUMENT option settings array diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h index 833ed6076088..f6a5f7a20521 100644 --- a/storage/perfschema/pfs_instr_class.h +++ b/storage/perfschema/pfs_instr_class.h @@ -64,7 +64,7 @@ class PFS_opaque_container_page; @{ */ -extern my_bool pfs_enabled; +extern bool pfs_enabled; extern enum_timer_name *class_timers[]; /** Key, naming a synch instrument (mutex, rwlock, cond). */ diff --git a/strings/conf_to_src.cc b/strings/conf_to_src.cc index 9f8d6ce5cd2e..6af4e6906e92 100644 --- a/strings/conf_to_src.cc +++ b/strings/conf_to_src.cc @@ -131,7 +131,7 @@ static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) } } -static my_bool simple_cs_is_full(CHARSET_INFO *cs) +static bool simple_cs_is_full(CHARSET_INFO *cs) { return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && cs->to_lower) && diff --git a/strings/ctype-big5.cc b/strings/ctype-big5.cc index 397cd858e4ff..84d77eccc912 100644 --- a/strings/ctype-big5.cc +++ b/strings/ctype-big5.cc @@ -879,7 +879,7 @@ extern "C" { static int my_strnncoll_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *a, size_t a_length, const uchar *b, size_t b_length, - my_bool b_is_prefix) + bool b_is_prefix) { size_t length= MY_MIN(a_length, b_length); int res= my_strnncoll_big5_internal(&a, &b, length); diff --git a/strings/ctype-bin.cc b/strings/ctype-bin.cc index 9273ab32fa50..febe9f8370a4 100644 --- a/strings/ctype-bin.cc +++ b/strings/ctype-bin.cc @@ -74,7 +74,7 @@ static const uchar bin_char_array[] = extern "C" { -static my_bool +static bool my_coll_init_8bit_bin(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused))) { @@ -85,7 +85,7 @@ my_coll_init_8bit_bin(CHARSET_INFO *cs, static int my_strnncoll_binary(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { size_t len= std::min(slen,tlen); const int cmp= len == 0 ? 0 : memcmp(s,t,len); // memcmp(a, b, 0) == 0 @@ -137,7 +137,7 @@ static int my_strnncoll_8bit_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { size_t len=MY_MIN(slen,tlen); int cmp= memcmp(s,t,len); diff --git a/strings/ctype-cp932.cc b/strings/ctype-cp932.cc index 6e9098939d43..d6c52963b164 100644 --- a/strings/ctype-cp932.cc +++ b/strings/ctype-cp932.cc @@ -1750,7 +1750,7 @@ extern "C" { static int my_strnncoll_cp932(const CHARSET_INFO *cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length, - my_bool b_is_prefix) + bool b_is_prefix) { int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length); if (b_is_prefix && a_length > b_length) diff --git a/strings/ctype-czech.cc b/strings/ctype-czech.cc index 36bbb8584de4..6726daad2da3 100644 --- a/strings/ctype-czech.cc +++ b/strings/ctype-czech.cc @@ -232,7 +232,7 @@ extern "C" { static int my_strnncoll_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s1, size_t len1, const uchar *s2, size_t len2, - my_bool s2_is_prefix) + bool s2_is_prefix) { int v1, v2; const uchar *p1, * p2, * store1, * store2; @@ -369,12 +369,12 @@ my_strnxfrm_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), extern "C" { -static my_bool my_like_range_czech(const CHARSET_INFO *cs, - const char *ptr,size_t ptr_length, - char escape, char w_one, char w_many, - size_t res_length, char *min_str, - char *max_str, - size_t *min_length,size_t *max_length) +static bool my_like_range_czech(const CHARSET_INFO *cs, + const char *ptr,size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, char *min_str, + char *max_str, + size_t *min_length,size_t *max_length) { uchar value; const char *end=ptr+ptr_length; diff --git a/strings/ctype-gb18030.cc b/strings/ctype-gb18030.cc index 0ada4a2dc4b0..18b06b1dcc7e 100644 --- a/strings/ctype-gb18030.cc +++ b/strings/ctype-gb18030.cc @@ -21621,7 +21621,7 @@ get_casefolded_code(const CHARSET_INFO *cs, const uchar *src, static size_t my_casefold_gb18030(const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen, const uchar *map, - my_bool is_upper) + bool is_upper) { char *srcend= src + srclen; char *dst0= dst; @@ -22035,7 +22035,7 @@ static int my_strnncoll_gb18030(const CHARSET_INFO *cs, const uchar *s, size_t s_length, const uchar *t, size_t t_length, - my_bool t_is_prefix) + bool t_is_prefix) { int res= my_strnncoll_gb18030_internal(cs, &s, s_length, &t, t_length); @@ -22218,7 +22218,7 @@ my_wildcmp_gb18030_impl(const CHARSET_INFO *cs, { while (1) { - my_bool escaped= 0; + bool escaped= 0; if ((w_len= get_code_and_length(cs, wildstr, wildend, &w_gb)) == 0) return 1; diff --git a/strings/ctype-gbk.cc b/strings/ctype-gbk.cc index d7b5aaab272a..d9095e2cd1f8 100644 --- a/strings/ctype-gbk.cc +++ b/strings/ctype-gbk.cc @@ -3482,7 +3482,7 @@ extern "C" { static int my_strnncoll_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *a, size_t a_length, const uchar *b, size_t b_length, - my_bool b_is_prefix) + bool b_is_prefix) { size_t length= MY_MIN(a_length, b_length); int res= my_strnncoll_gbk_internal(&a, &b, length); diff --git a/strings/ctype-latin1.cc b/strings/ctype-latin1.cc index 3fcf8d311449..95d6bffd0985 100644 --- a/strings/ctype-latin1.cc +++ b/strings/ctype-latin1.cc @@ -558,7 +558,7 @@ static int my_strnncoll_latin1_de(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *a, size_t a_length, const uchar *b, size_t b_length, - my_bool b_is_prefix) + bool b_is_prefix) { const uchar *a_end= a + a_length; const uchar *b_end= b + b_length; diff --git a/strings/ctype-mb.cc b/strings/ctype-mb.cc index 11e69dd12c4f..021a5487442d 100644 --- a/strings/ctype-mb.cc +++ b/strings/ctype-mb.cc @@ -489,7 +489,7 @@ int my_strnncoll_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { size_t len= MY_MIN(slen,tlen); int cmp= memcmp(s,t,len); @@ -782,12 +782,12 @@ static void pad_max_char(const CHARSET_INFO *cs, char *str, char *end) ** optimized ! */ -my_bool my_like_range_mb(const CHARSET_INFO *cs, - const char *ptr,size_t ptr_length, - char escape, char w_one, char w_many, - size_t res_length, - char *min_str,char *max_str, - size_t *min_length,size_t *max_length) +bool my_like_range_mb(const CHARSET_INFO *cs, + const char *ptr,size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) { uint mb_len; const char *end= ptr + ptr_length; @@ -937,7 +937,7 @@ my_bool my_like_range_mb(const CHARSET_INFO *cs, @retval FALSE if LIKE pattern can be optimized @retval TRUE if LIKE can't be optimized. */ -my_bool +bool my_like_range_generic(const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, diff --git a/strings/ctype-simple.cc b/strings/ctype-simple.cc index 3882bab0775f..d2e17f721d9d 100644 --- a/strings/ctype-simple.cc +++ b/strings/ctype-simple.cc @@ -117,7 +117,7 @@ my_strnxfrm_simple(const CHARSET_INFO *cs, int my_strnncoll_simple(const CHARSET_INFO * cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { size_t len = ( slen > tlen ) ? tlen : slen; const uchar *map= cs->sort_order; @@ -963,12 +963,12 @@ int my_wildcmp_8bit(const CHARSET_INFO *cs, ** optimized ! */ -my_bool my_like_range_simple(const CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - char escape, char w_one, char w_many, - size_t res_length, - char *min_str,char *max_str, - size_t *min_length, size_t *max_length) +bool my_like_range_simple(const CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + char escape, char w_one, char w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length, size_t *max_length) { const char *end= ptr + ptr_length; char *min_org=min_str; @@ -1195,7 +1195,7 @@ static int pcmp(const void * f, const void * s) return res; } -static my_bool +static bool create_fromuni(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) { @@ -1290,7 +1290,7 @@ create_fromuni(CHARSET_INFO *cs, } extern "C" { -static my_bool +static bool my_cset_init_8bit(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) { cs->caseup_multiply= 1; @@ -1320,7 +1320,7 @@ static void set_max_sort_char(CHARSET_INFO *cs) } extern "C" { -static my_bool +static bool my_coll_init_simple(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused))) { @@ -1716,17 +1716,17 @@ my_strntoull10rnd_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), -my_bool my_propagate_simple(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), - const uchar *str MY_ATTRIBUTE((unused)), - size_t length MY_ATTRIBUTE((unused))) +bool my_propagate_simple(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), + const uchar *str MY_ATTRIBUTE((unused)), + size_t length MY_ATTRIBUTE((unused))) { return 1; } -my_bool my_propagate_complex(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), - const uchar *str MY_ATTRIBUTE((unused)), - size_t length MY_ATTRIBUTE((unused))) +bool my_propagate_complex(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), + const uchar *str MY_ATTRIBUTE((unused)), + size_t length MY_ATTRIBUTE((unused))) { return 0; } diff --git a/strings/ctype-sjis.cc b/strings/ctype-sjis.cc index ee06f3b43a23..e52bd25fbb3c 100644 --- a/strings/ctype-sjis.cc +++ b/strings/ctype-sjis.cc @@ -1120,7 +1120,7 @@ extern "C" { static int my_strnncoll_sjis(const CHARSET_INFO *cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length, - my_bool b_is_prefix) + bool b_is_prefix) { int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); if (b_is_prefix && a_length > b_length) diff --git a/strings/ctype-tis620.cc b/strings/ctype-tis620.cc index 6f238315b06f..59e7f2006d46 100644 --- a/strings/ctype-tis620.cc +++ b/strings/ctype-tis620.cc @@ -532,7 +532,7 @@ static int my_strnncoll_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s1, size_t len1, const uchar *s2, size_t len2, - my_bool s2_is_prefix) + bool s2_is_prefix) { uchar buf[80] ; uchar *tc1, *tc2; diff --git a/strings/ctype-uca.cc b/strings/ctype-uca.cc index 6c0899280af3..5bc2b472a58f 100644 --- a/strings/ctype-uca.cc +++ b/strings/ctype-uca.cc @@ -874,7 +874,7 @@ my_uca_add_contraction_flag(MY_CONTRACTIONS *list, my_wc_t wc, int flag) static MY_CONTRACTION * my_uca_add_contraction(MY_CONTRACTIONS *list, my_wc_t *wc, size_t len, - my_bool with_context) + bool with_context) { /* Contraction is always at least two code points. @@ -964,7 +964,7 @@ my_charset_get_contractions(const CHARSET_INFO *cs) @retval 1 - there are some contractions */ -static inline my_bool +static inline bool my_uca_have_contractions(const MY_UCA_INFO *uca) { return uca->contractions.has_contractions; @@ -982,7 +982,7 @@ my_uca_have_contractions(const MY_UCA_INFO *uca) @retval 1 - can be contraction head */ -my_bool +bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc) { return c->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_HEAD; @@ -999,7 +999,7 @@ my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc) @retval 1 - can be contraction tail */ -my_bool +bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc) { return c->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_TAIL; @@ -1017,7 +1017,7 @@ my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc) @retval 1 - can be contraction part */ -static inline my_bool +static inline bool my_uca_can_be_contraction_part(const MY_CONTRACTIONS *c, my_wc_t wc, int flag) { return c->flags[wc & MY_UCA_CNT_FLAG_MASK] & flag; @@ -1062,7 +1062,7 @@ my_uca_contraction2_weight(const MY_CONTRACTIONS *list, my_wc_t wc1, my_wc_t wc2 @retval TRUE - can be previous context head */ -static inline my_bool +static inline bool my_uca_can_be_previous_context_head(const MY_CONTRACTIONS *list, my_wc_t wc) { return list->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_PREVIOUS_CONTEXT_HEAD; @@ -1080,7 +1080,7 @@ my_uca_can_be_previous_context_head(const MY_CONTRACTIONS *list, my_wc_t wc) @retval TRUE - can be contraction tail */ -static inline my_bool +static inline bool my_uca_can_be_previous_context_tail(const MY_CONTRACTIONS *list, my_wc_t wc) { return list->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_PREVIOUS_CONTEXT_TAIL; @@ -1884,7 +1884,7 @@ static int my_strnncoll_uca(const CHARSET_INFO *cs, const Mb_wc mb_wc, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { Scanner sscanner(mb_wc, cs, s, slen); Scanner tscanner(mb_wc, cs, t, tlen); @@ -3086,7 +3086,7 @@ typedef struct my_coll_rule_item_st my_wc_t curr[MY_UCA_MAX_CONTRACTION]; /* Current character */ int diff[4]; /* Primary, Secondary, Tertiary, Quaternary difference */ size_t before_level; /* "reset before" indicator */ - my_bool with_context; + bool with_context; } MY_COLL_RULE; @@ -4253,7 +4253,7 @@ my_char_weight_put(MY_UCA_INFO *dst, uint16 *to, @retval FALSE on success @retval TRUE on error */ -static my_bool +static bool my_uca_copy_page(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader, const MY_UCA_INFO *src, @@ -4391,7 +4391,7 @@ apply_shift_900(MY_CHARSET_LOADER *loader, return false; } -static my_bool +static bool apply_shift(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, MY_COLL_RULE *r, int level, uint16 *to, size_t to_stride, size_t nweights) @@ -4449,7 +4449,7 @@ apply_shift(MY_CHARSET_LOADER *loader, } -static my_bool +static bool apply_one_rule(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, MY_COLL_RULE *r, int level, MY_UCA_INFO *dst) @@ -4581,7 +4581,7 @@ copy_ja_han_pages(const CHARSET_INFO *cs, MY_UCA_INFO *dst) } } -static my_bool +static bool init_weight_level(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, MY_UCA_INFO *dst, const MY_UCA_INFO *src, @@ -4663,7 +4663,7 @@ init_weight_level(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader, /* Allocate pages that we'll overwrite and copy default weights */ for (i= 0; i < npages; i++) { - my_bool rc; + bool rc; /* Don't touch pages with lengths[i]==0, they have implicit weights calculated algorithmically. @@ -5161,7 +5161,7 @@ static bool my_prepare_coll_param(CHARSET_INFO *cs, MY_COLL_RULES *rules) default weights. */ -static my_bool +static bool create_tailoring(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) { MY_COLL_RULES rules; @@ -5263,7 +5263,7 @@ create_tailoring(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) */ extern "C" { -static my_bool +static bool my_coll_init_uca(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) { cs->pad_char= ' '; @@ -5276,7 +5276,7 @@ my_coll_init_uca(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) static int my_strnncoll_any_uca(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { if (cs->cset->mb_wc == my_mb_wc_utf8mb4_thunk) { @@ -5332,7 +5332,7 @@ static size_t my_strnxfrm_any_uca(const CHARSET_INFO *cs, static int my_strnncoll_uca_900(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { if (cs->cset->mb_wc == my_mb_wc_utf8mb4_thunk) { @@ -5753,7 +5753,7 @@ extern "C" { static int my_strnncoll_ucs2_uca(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { Mb_wc_through_function_pointer mb_wc(cs); return my_strnncoll_uca>( diff --git a/strings/ctype-ucs2.cc b/strings/ctype-ucs2.cc index 5067a035ad74..c4b4b13b3184 100644 --- a/strings/ctype-ucs2.cc +++ b/strings/ctype-ucs2.cc @@ -1280,7 +1280,7 @@ static int my_strnncoll_utf16(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { int s_res, t_res; my_wc_t s_wc= 0, t_wc= 0; @@ -1504,7 +1504,7 @@ static int my_strnncoll_utf16_bin(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { int s_res,t_res; my_wc_t s_wc= 0, t_wc= 0; @@ -2087,7 +2087,7 @@ static int my_strnncoll_utf32(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { my_wc_t s_wc= 0, t_wc= 0; const uchar *se= s + slen; @@ -2622,7 +2622,7 @@ static int my_strnncoll_utf32_bin(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { my_wc_t s_wc= 0, t_wc= 0; const uchar *se= s + slen; @@ -3072,7 +3072,7 @@ my_fill_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), static int my_strnncoll_ucs2(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { int s_res,t_res; my_wc_t s_wc= 0, t_wc= 0; @@ -3255,7 +3255,7 @@ static int my_strnncoll_ucs2_bin(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { int s_res,t_res; my_wc_t s_wc= 0, t_wc= 0; diff --git a/strings/ctype-utf8.cc b/strings/ctype-utf8.cc index bcf4a301f9b8..e62c8896ebd9 100644 --- a/strings/ctype-utf8.cc +++ b/strings/ctype-utf8.cc @@ -4871,7 +4871,7 @@ my_wildcmp_unicode_impl(const CHARSET_INFO *cs, { while (1) { - my_bool escaped= 0; + bool escaped= 0; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) return 1; @@ -5595,7 +5595,7 @@ static size_t my_casedn_str_utf8(const CHARSET_INFO *cs, char *src) static int my_strnncoll_utf8(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { int s_res,t_res; my_wc_t s_wc= 0, t_wc= 0; @@ -7845,7 +7845,7 @@ static int my_strnncoll_utf8mb4(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - my_bool t_is_prefix) + bool t_is_prefix) { my_wc_t s_wc= 0; my_wc_t t_wc= 0; diff --git a/strings/ctype-win1250ch.cc b/strings/ctype-win1250ch.cc index 7877d86694b9..01f620f07d58 100644 --- a/strings/ctype-win1250ch.cc +++ b/strings/ctype-win1250ch.cc @@ -442,7 +442,7 @@ static int my_strnncoll_win1250ch(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), const uchar *s1, size_t len1, const uchar *s2, size_t len2, - my_bool s2_is_prefix) + bool s2_is_prefix) { int v1, v2; const uchar *p1, * p2; @@ -616,7 +616,7 @@ static const uchar like_range_prefix_max_win1250ch[]= */ extern "C" { -static my_bool +static bool my_like_range_win1250ch(const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, diff --git a/strings/ctype.cc b/strings/ctype.cc index 2c5667000d0c..8042578c92ae 100644 --- a/strings/ctype.cc +++ b/strings/ctype.cc @@ -787,12 +787,12 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) } // extern "C" -my_bool +bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf, size_t len) { MY_XML_PARSER p; struct my_cs_file_info info; - my_bool rc; + bool rc; my_charset_file_init(&info); my_xml_parser_create(&p); @@ -887,7 +887,7 @@ uint my_charset_repertoire(const CHARSET_INFO *cs) This function is Ok for 5.0 and 5.1, because we're not going to introduce new tricky character sets between 5.0 and 5.2. */ -my_bool +bool my_charset_is_ascii_based(const CHARSET_INFO *cs) { return @@ -904,7 +904,7 @@ my_charset_is_ascii_based(const CHARSET_INFO *cs) This functions is shared between "conf_to_src" and dynamic charsets loader in "mysqld". */ -my_bool +bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs) { size_t code; @@ -924,7 +924,7 @@ my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs) Check if a 8bit character set is compatible with ascii on the range 0x00..0x7F. */ -my_bool +bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs) { uint i; diff --git a/strings/decimal.cc b/strings/decimal.cc index 82e0d93fab10..318cf97cef63 100644 --- a/strings/decimal.cc +++ b/strings/decimal.cc @@ -862,7 +862,7 @@ int decimal_shift(decimal_t *dec, int shift) */ int -internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed) +internal_str2dec(const char *from, decimal_t *to, char **end, bool fixed) { const char *s= from, *s1, *endp, *end_of_string= *end; int i, intg, frac, error, intg1, frac1; diff --git a/strings/dtoa.cc b/strings/dtoa.cc index 084007478fde..6b83341d9249 100644 --- a/strings/dtoa.cc +++ b/strings/dtoa.cc @@ -103,7 +103,7 @@ static void dtoa_free(char *, char *, size_t); @return number of written characters (excluding terminating '\0') */ -size_t my_fcvt(double x, int precision, char *to, my_bool *error) +size_t my_fcvt(double x, int precision, char *to, bool *error) { int decpt, sign, len, i; char *res, *src, *end, *dst= to; @@ -227,12 +227,12 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error) */ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, - my_bool *error) + bool *error) { int decpt, sign, len, exp_len; char *res, *src, *end, *dst= to, *dend= dst + width; char buf[DTOA_BUFF_SIZE]; - my_bool have_space, force_e_format; + bool have_space, force_e_format; DBUG_ASSERT(width > 0 && to != NULL); /* We want to remove '-' from equations early */ @@ -1038,7 +1038,7 @@ static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc) Bigint *b1, *p5, *p51=NULL; int i; static int p05[3]= { 5, 25, 125 }; - my_bool overflow= FALSE; + bool overflow= FALSE; if ((i= k & 3)) b= multadd(b, p05[i-1], 0, alloc); diff --git a/strings/uctypedump.cc b/strings/uctypedump.cc index f30fdf6403fe..bf0261eec9d0 100644 --- a/strings/uctypedump.cc +++ b/strings/uctypedump.cc @@ -94,7 +94,7 @@ typedef struct uint decimal_digit_value; /* 0-9 */ uint digit_value; /* 0-9 */ char *numeric_value; /* Examples: 0, 1, 10, 100, 1000, 1/2, 5/2 */ - my_bool mirrored; /* Y or N */ + bool mirrored; /* Y or N */ char *unicode_1_0_name; char *iso10646_comment_field; uint uppercase_mapping; diff --git a/strings/xml.cc b/strings/xml.cc index 0155a6af2702..271118f35209 100644 --- a/strings/xml.cc +++ b/strings/xml.cc @@ -110,7 +110,7 @@ static void my_xml_norm_text(MY_XML_ATTR *a) } -static inline my_bool +static inline bool my_xml_parser_prefix_cmp(MY_XML_PARSER *p, const char *s, size_t slen) { return (p->cur + slen > p->end) || memcmp(p->cur, s, slen); diff --git a/testclients/mysql_client_fw.c b/testclients/mysql_client_fw.c index d1fb03c22d26..f19a995ec657 100644 --- a/testclients/mysql_client_fw.c +++ b/testclients/mysql_client_fw.c @@ -41,17 +41,17 @@ static char *opt_unix_socket= 0; static char *shared_memory_base_name= 0; #endif static unsigned int opt_port; -static my_bool tty_password= 0; +static bool tty_password= 0; static int opt_silent= 0; -static my_bool opt_secure_auth= 1; +static bool opt_secure_auth= 1; static MYSQL *mysql= 0; static char current_db[]= "client_test_db"; static unsigned int test_count= 0; static unsigned int opt_count= 0; static unsigned int opt_count_read= 0; static unsigned int iter_count= 0; -static my_bool have_innodb= FALSE; +static bool have_innodb= FALSE; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static unsigned int opt_drop_db= 1; @@ -209,7 +209,7 @@ static void verify_field_count(MYSQL_RES *result, uint exp_count) MY_ATTRIBUTE((unused)); static void execute_prepare_query(const char *query, ulonglong exp_count) MY_ATTRIBUTE((unused)); -static my_bool thread_query(const char *query) MY_ATTRIBUTE((unused)); +static bool thread_query(const char *query) MY_ATTRIBUTE((unused)); /* A workaround for Sun Forte 5.6 on Solaris x86 */ @@ -289,12 +289,12 @@ Disable direct calls of mysql_init, as it disregards shared memory base. /* Check if the connection has InnoDB tables */ -static my_bool check_have_innodb(MYSQL *conn) +static bool check_have_innodb(MYSQL *conn) { MYSQL_RES *res; MYSQL_ROW row; int rc; - my_bool result= FALSE; + bool result= FALSE; rc= mysql_query(conn, "SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') " @@ -342,7 +342,7 @@ opt_port and opt_unix_socket. @return pointer to initialized and connected MYSQL object */ -static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) +static MYSQL* client_connect(ulong flag, uint protocol, bool auto_reconnect) { MYSQL* mysql; int rc; @@ -601,7 +601,7 @@ static int my_process_stmt_result(MYSQL_STMT *stmt) MYSQL_RES *result; char data[MAX_RES_FIELDS][MAX_FIELD_DATA_SIZE]; ulong length[MAX_RES_FIELDS]; - my_bool is_null[MAX_RES_FIELDS]; + bool is_null[MAX_RES_FIELDS]; int rc, i; if (!(result= mysql_stmt_result_metadata(stmt))) /* No meta info */ @@ -963,7 +963,7 @@ typedef struct st_stmt_fetch const char *query; unsigned stmt_no; MYSQL_STMT *handle; -my_bool is_open; +bool is_open; MYSQL_BIND *bind_array; char **out_data; unsigned long *out_data_length; @@ -1089,7 +1089,7 @@ reading from the rest. enum fetch_type { USE_ROW_BY_ROW_FETCH= 0, USE_STORE_RESULT= 1 }; -my_bool fetch_n(const char **query_list, unsigned query_count, +bool fetch_n(const char **query_list, unsigned query_count, enum fetch_type fetch_type) { unsigned open_statements= query_count; @@ -1157,10 +1157,10 @@ enum fetch_type fetch_type) /* Separate thread query to test some cases */ -static my_bool thread_query(const char *query) +static bool thread_query(const char *query) { MYSQL *l_mysql; - my_bool error; + bool error; error= 0; if (!opt_silent) @@ -1268,7 +1268,7 @@ static struct my_tests_st *get_my_tests(); /* To be defined in main .c file */ static struct my_tests_st *my_testlist= 0; -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument) { diff --git a/testclients/mysql_client_test.c b/testclients/mysql_client_test.c index 163acb23496a..c5c5debfa14a 100644 --- a/testclients/mysql_client_test.c +++ b/testclients/mysql_client_test.c @@ -526,7 +526,7 @@ static void test_wl4435() char dec_data[20][WL4435_STRING_SIZE]; int int_data[20]; ulong str_length= WL4435_STRING_SIZE; - my_bool is_null; + bool is_null; MYSQL_BIND ps_params[WL4435_NUM_PARAMS]; int exec_counter; @@ -1016,7 +1016,7 @@ static void test_wl4435_2() MYSQL_RES *rs_metadata; \ MYSQL_FIELD *fields; \ c_type pspv c_type_ext; \ - my_bool psp_null= FALSE; \ + bool psp_null= FALSE; \ \ memset(&pspv, 0, sizeof (pspv)); \ \ @@ -1354,7 +1354,7 @@ static void test_prepare() float real_data, o_real_data; double double_data, o_double_data; ulong length[7], len; - my_bool is_null[7]; + bool is_null[7]; char llbuf[22]; MYSQL_BIND my_bind[7]; char query[MAX_TEST_QUERY_LENGTH]; @@ -1614,7 +1614,7 @@ static void test_null() int rc; uint nData; MYSQL_BIND my_bind[2]; - my_bool is_null[2]; + bool is_null[2]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_null"); @@ -1717,12 +1717,12 @@ static void test_ps_null_param() int rc; MYSQL_BIND in_bind; - my_bool in_is_null; + bool in_is_null; long int in_long; MYSQL_BIND out_bind; ulong out_length; - my_bool out_is_null; + bool out_is_null; char out_str_data[20]; const char *queries[]= {"select ?", "select ?+1", @@ -1793,7 +1793,7 @@ static void test_fetch_null() int i, nData; MYSQL_BIND my_bind[11]; ulong length[11]; - my_bool is_null[11]; + bool is_null[11]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_fetch_null"); @@ -2622,7 +2622,7 @@ static void test_bug1644() MYSQL_ROW row; MYSQL_BIND my_bind[4]; int num; - my_bool isnull; + bool isnull; int rc, i; char query[MAX_TEST_QUERY_LENGTH]; @@ -2957,7 +2957,7 @@ static void test_long_data_str() ulong length1; MYSQL_RES *result; MYSQL_BIND my_bind[2]; - my_bool is_null[2]; + bool is_null[2]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_long_data_str"); @@ -3047,7 +3047,7 @@ static void test_long_data_str1() char data[255]; long length; ulong max_blob_length, blob_length, length1; - my_bool true_value; + bool true_value; MYSQL_RES *result; MYSQL_BIND my_bind[2]; MYSQL_FIELD *field; @@ -3518,7 +3518,7 @@ static void test_bind_result() ulong length1; char szData[100]; MYSQL_BIND my_bind[2]; - my_bool is_null[2]; + bool is_null[2]; myheader("test_bind_result"); @@ -3612,7 +3612,7 @@ static void test_bind_result_ext() ulong szLength, bLength; MYSQL_BIND my_bind[8]; ulong length[8]; - my_bool is_null[8]; + bool is_null[8]; char llbuf[22]; myheader("test_bind_result_ext"); @@ -3733,7 +3733,7 @@ static void test_bind_result_ext1() double szData; MYSQL_BIND my_bind[8]; ulong length[8]; - my_bool is_null[8]; + bool is_null[8]; myheader("test_bind_result_ext1"); rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); @@ -3866,7 +3866,7 @@ static void bind_fetch(int row_count) char s_data[10]; ulong length[10]; MYSQL_BIND my_bind[7]; - my_bool is_null[7]; + bool is_null[7]; stmt= mysql_simple_prepare(mysql, "INSERT INTO test_bind_fetch VALUES " "(?, ?, ?, ?, ?, ?, ?)"); @@ -4020,7 +4020,7 @@ static void test_fetch_date() ulong d_length, t_length, ts_length, ts4_length, ts6_length, dt_length, y_length; MYSQL_BIND my_bind[8]; - my_bool is_null[8]; + bool is_null[8]; ulong length[8]; myheader("test_fetch_date"); @@ -5024,7 +5024,7 @@ static void test_multi_stmt() char name[50]; MYSQL_BIND my_bind[2]; ulong length[2]; - my_bool is_null[2]; + bool is_null[2]; myheader("test_multi_stmt"); rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_multi_table"); @@ -5157,7 +5157,7 @@ static void test_manual_sample() char str_data[50]; ulonglong affected_rows; MYSQL_BIND my_bind[3]; - my_bool is_null; + bool is_null; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_manual_sample"); @@ -5317,7 +5317,7 @@ static void test_prepare_alter() MYSQL_STMT *stmt; int rc, id; MYSQL_BIND my_bind[1]; - my_bool is_null; + bool is_null; myheader("test_prepare_alter"); @@ -5562,7 +5562,7 @@ static void test_store_result() char szData[100]; MYSQL_BIND my_bind[2]; ulong length, length1; - my_bool is_null[2]; + bool is_null[2]; myheader("test_store_result"); @@ -5948,13 +5948,13 @@ static void test_subselect() conversion using MYSQL_TIME structure */ -static void bind_date_conv(uint row_count, my_bool preserveFractions) +static void bind_date_conv(uint row_count, bool preserveFractions) { MYSQL_STMT *stmt= 0; uint rc, i, count= row_count; ulong length[4]; MYSQL_BIND my_bind[4]; - my_bool is_null[4]= {0}; + bool is_null[4]= {0}; MYSQL_TIME tm[4]; ulong second_part; uint year, month, day, hour, minute, sec; @@ -6248,7 +6248,7 @@ static void test_temporal_param() uint rc; ulong length[N_PARAMS], length2[N_PARAMS]; MYSQL_BIND my_bind[N_PARAMS], my_bind2[N_PARAMS]; - my_bool is_null[N_PARAMS], is_null2[N_PARAMS]; + bool is_null[N_PARAMS], is_null2[N_PARAMS]; MYSQL_TIME tm; longlong bigint= 123; double real= 123; @@ -6483,7 +6483,7 @@ static void test_buffers() MYSQL_BIND my_bind[2]; int rc; ulong length; - my_bool is_null; + bool is_null; char buffer[20]; myheader("test_buffers"); @@ -7286,7 +7286,7 @@ static void test_decimal_bug() MYSQL_BIND my_bind[1]; char data[30]; int rc; - my_bool is_null; + bool is_null; myheader("test_decimal_bug"); @@ -8065,7 +8065,7 @@ static void test_fetch_offset() char data[11]; ulong length; int rc; - my_bool is_null; + bool is_null; myheader("test_fetch_offset"); @@ -9334,7 +9334,7 @@ static void test_bug3117() MYSQL_BIND buffer; longlong lii; ulong length; - my_bool is_null; + bool is_null; int rc; myheader("test_bug3117"); @@ -9805,7 +9805,7 @@ static void test_bind_nagative() MYSQL_BIND my_bind[1]; int32 my_val= 0; ulong my_length= 0L; - my_bool my_null= FALSE; + bool my_null= FALSE; myheader("test_insert_select"); rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); @@ -9849,7 +9849,7 @@ static void test_derived() MYSQL_BIND my_bind[1]; int32 my_val= 0; ulong my_length= 0L; - my_bool my_null= FALSE; + bool my_null= FALSE; const char *query= "select count(1) from (select f.id from t1 f where f.id=?) as x"; @@ -9876,7 +9876,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8"); my_bind[0].buffer_type= MYSQL_TYPE_LONG; my_bind[0].buffer= (void *)&my_val; my_bind[0].length= &my_length; - my_bind[0].is_null= &my_null; + my_bind[0].is_null= (bool*)&my_null; my_val= 1; rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); @@ -10373,7 +10373,7 @@ static void test_union_param() MYSQL_BIND my_bind[2]; char my_val[4]; ulong my_length= 3L; - my_bool my_null= FALSE; + bool my_null= FALSE; myheader("test_union_param"); my_stpcpy(my_val, "abc"); @@ -10914,7 +10914,7 @@ static void test_view() MYSQL_BIND my_bind[1]; char str_data[50]; ulong length = 0L; - my_bool is_null = 0L; + bool is_null = 0L; const char *query= "SELECT COUNT(*) FROM v1 WHERE SERVERNAME=?"; @@ -11177,7 +11177,7 @@ static void test_view_insert() MYSQL_BIND my_bind[1]; int my_val = 0; ulong my_length = 0L; - my_bool my_null = 0L; + bool my_null = 0L; const char *query= "insert into v1 values (?)"; @@ -12022,7 +12022,7 @@ static void test_bug6096() MYSQL_FIELD *query_field_list, *stmt_field_list; ulong query_field_count, stmt_field_count; int rc; - my_bool update_max_length= TRUE; + bool update_max_length= TRUE; uint i; myheader("test_bug6096"); @@ -12394,7 +12394,7 @@ static void test_rewind(void) const char *stmt_text; ulong length= 4; long unsigned int Data= 0; - my_bool isnull=0; + bool isnull=0; myheader("test_rewind"); @@ -12703,8 +12703,8 @@ static void test_truncation_option() const char *stmt_text; int rc; uint8 buf; - my_bool option= 0; - my_bool error; + bool option= 0; + bool error; MYSQL_BIND my_bind; myheader("test_truncation_option"); @@ -14933,7 +14933,7 @@ static void test_bug15510() static void test_opt_reconnect() { MYSQL *lmysql; - my_bool my_true= TRUE; + bool my_true= TRUE; myheader("test_opt_reconnect"); @@ -15053,8 +15053,8 @@ static void test_bug16143() static void test_bug16144() { - const my_bool flag_orig= (my_bool) 0xde; - my_bool flag= flag_orig; + const bool flag_orig= (bool) 0xde; + bool flag= flag_orig; MYSQL_STMT *stmt; myheader("test_bug16144"); @@ -16193,7 +16193,7 @@ static void test_bug28505() static void test_bug28934() { - my_bool error= 0; + bool error= 0; MYSQL_BIND bind[5]; MYSQL_STMT *stmt; int cnt; @@ -16827,17 +16827,17 @@ static void bug20023_change_user(MYSQL *con) opt_db ? opt_db : "test")); } -static my_bool query_str_variable(MYSQL *con, - const char *var_name, - char *str, - size_t len) +static bool query_str_variable(MYSQL *con, + const char *var_name, + char *str, + size_t len) { MYSQL_RES *rs; MYSQL_ROW row; char query_buffer[MAX_TEST_QUERY_LENGTH]; - my_bool is_null; + bool is_null; my_snprintf(query_buffer, sizeof (query_buffer), "SELECT %s", var_name); @@ -16856,12 +16856,12 @@ static my_bool query_str_variable(MYSQL *con, return is_null; } -static my_bool query_int_variable(MYSQL *con, - const char *var_name, - int *var_value) +static bool query_int_variable(MYSQL *con, + const char *var_name, + int *var_value) { char str[32]; - my_bool is_null= query_str_variable(con, var_name, str, sizeof(str)); + bool is_null= query_str_variable(con, var_name, str, sizeof(str)); if (!is_null) *var_value= atoi(str); @@ -17022,7 +17022,7 @@ static void bug31418_impl() { MYSQL con; - my_bool is_null; + bool is_null; int rc= 0; /* Create a new connection. */ @@ -17317,7 +17317,7 @@ static void test_wl4166_1() float real_data; double double_data; ulong length[7]; - my_bool is_null[7]; + bool is_null[7]; MYSQL_BIND my_bind[7]; int rc; int i; @@ -17855,7 +17855,7 @@ static void test_bug40365(void) uint rc, i; MYSQL_STMT *stmt= 0; MYSQL_BIND my_bind[2]; - my_bool is_null[2]= {0}; + bool is_null[2]= {0}; MYSQL_TIME tm[2]; DBUG_ENTER("test_bug40365"); @@ -17950,7 +17950,7 @@ static void test_bug43560(void) uint rc; MYSQL_STMT *stmt= 0; MYSQL_BIND bind; - my_bool is_null= 0; + bool is_null= 0; char buffer[256]; const uint BUFSIZE= sizeof(buffer); const char* values[] = {"eins", "zwei", "drei", "viele", NULL}; @@ -18099,7 +18099,7 @@ static void test_bug41078(void) ulong len; char str[64]; const char param_str[]= "abcdefghijklmn"; - my_bool is_null, error; + bool is_null, error; DBUG_ENTER("test_bug41078"); @@ -18437,8 +18437,8 @@ static void test_bug47485() const char* sql_select = "SELECT 1, 'a'"; int int_data; char str_data[16]; - my_bool is_null[2]; - my_bool error[2]; + bool is_null[2]; + bool error[2]; ulong length[2]; DBUG_ENTER("test_bug47485"); @@ -18613,7 +18613,7 @@ static void test_bug49972() MYSQL_BIND in_param_bind; MYSQL_BIND out_param_bind; int int_data= 0; - my_bool is_null= FALSE; + bool is_null= FALSE; DBUG_ENTER("test_bug49972"); myheader("test_bug49972"); @@ -19210,7 +19210,7 @@ static void test_wl6587() { int rc; MYSQL *l_mysql, *r_mysql; - my_bool can; + bool can; myheader("test_wl6587"); @@ -19517,7 +19517,7 @@ static void test_wl6791() MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_PROTOCOL, MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_SSL_MODE }, - my_bool_opts[] = { + bool_opts[] = { MYSQL_OPT_COMPRESS, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_GUESS_CONNECTION, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, @@ -19562,18 +19562,18 @@ static void test_wl6791() DIE_UNLESS(opt_before == opt_after); } - for (idx= 0; idx < sizeof(my_bool_opts) / sizeof(enum mysql_option); idx++) + for (idx= 0; idx < sizeof(bool_opts) / sizeof(enum mysql_option); idx++) { - my_bool opt_before = TRUE, opt_after = FALSE; + bool opt_before = TRUE, opt_after = FALSE; if (!opt_silent) - fprintf(stdout, "testing my_bool option #%d (%d)\n", idx, - (int)my_bool_opts[idx]); + fprintf(stdout, "testing bool option #%d (%d)\n", idx, + (int)bool_opts[idx]); - rc = mysql_options(l_mysql, my_bool_opts[idx], &opt_before); + rc = mysql_options(l_mysql, bool_opts[idx], &opt_before); DIE_UNLESS(rc == 0); - rc = mysql_get_option(l_mysql, my_bool_opts[idx], &opt_after); + rc = mysql_get_option(l_mysql, bool_opts[idx], &opt_after); DIE_UNLESS(rc == 0); DIE_UNLESS(opt_before == opt_after); @@ -19824,7 +19824,7 @@ struct execute_test_query */ static void execute_and_test(struct execute_test_query *query, char quote, int result, const char* string, - const char* expected, my_bool recursive) + const char* expected, bool recursive) { MYSQL_STMT *stmt; const char *stmt_text; @@ -20041,7 +20041,7 @@ static void test_bug19894382() MYSQL_STMT *stmt1; const char *stmt1_txt= "INSERT INTO client_test_db.bug19894382 VALUES" " ('master', ?, ?, ?, ?, ?, ?);"; - my_bool is_null= 0; + bool is_null= 0; MYSQL_BIND bind_val[6]; MYSQL_TIME tm[6]; MYSQL_TIME tm_common; @@ -20580,8 +20580,8 @@ static void test_bug17883203() MYSQL_STMT *stmt; MYSQL_BIND bind; char str_data[BUG17883203_STRING_SIZE]; - my_bool is_null; - my_bool error; + bool is_null; + bool error; unsigned long length; const char stmt_text[] ="SELECT VERSION()"; int rc; @@ -20807,7 +20807,7 @@ static void test_mysql_binlog() MYSQL *mysql1, *mysql2; MYSQL_RPL rpl1, rpl2; const char *binlog_name= "mysql-binlog.000001"; - my_bool reconnect= TRUE; + bool reconnect= TRUE; myheader("test_mysql_binlog"); diff --git a/unittest/gunit/dynarray-t.cc b/unittest/gunit/dynarray-t.cc index 5d14f32afcfd..db1658149131 100644 --- a/unittest/gunit/dynarray-t.cc +++ b/unittest/gunit/dynarray-t.cc @@ -96,11 +96,11 @@ namespace dynarray_unittest { // We still want to unit-test this, to compare performance. #undef my_init_dynamic_array extern "C" -my_bool my_init_dynamic_array(DYNAMIC_ARRAY *array, - PSI_memory_key key, - uint element_size, - void *init_buffer, uint init_alloc, - uint alloc_increment); +bool my_init_dynamic_array(DYNAMIC_ARRAY *array, + PSI_memory_key key, + uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment); /* Cut'n paste this function from sql_select.cc, to avoid linking in the entire server for this unit test. diff --git a/unittest/gunit/gunit_test_main.cc b/unittest/gunit/gunit_test_main.cc index d5917bd0a7ca..4d613fad8b5f 100644 --- a/unittest/gunit/gunit_test_main.cc +++ b/unittest/gunit/gunit_test_main.cc @@ -30,8 +30,8 @@ CHARSET_INFO *system_charset_info= NULL; namespace { -my_bool opt_use_tap= true; -my_bool opt_unit_help= false; +bool opt_use_tap= true; +bool opt_unit_help= false; struct my_option unittest_options[] = { @@ -51,7 +51,7 @@ struct my_option unittest_options[] = }; -extern "C" my_bool get_one_option(int, const struct my_option *, char *) +extern "C" bool get_one_option(int, const struct my_option *, char *) { return FALSE; } diff --git a/unittest/gunit/gunit_test_main_server.cc b/unittest/gunit/gunit_test_main_server.cc index bfdff199d3a6..425b8b784cba 100644 --- a/unittest/gunit/gunit_test_main_server.cc +++ b/unittest/gunit/gunit_test_main_server.cc @@ -37,8 +37,8 @@ int Fake_TABLE::highest_table_id= 5; namespace { -my_bool opt_use_tap= true; -my_bool opt_unit_help= false; +bool opt_use_tap= true; +bool opt_unit_help= false; struct my_option unittest_options[] = { @@ -58,7 +58,7 @@ struct my_option unittest_options[] = }; -extern "C" my_bool get_one_option(int, const struct my_option *, char *) +extern "C" bool get_one_option(int, const struct my_option *, char *) { return FALSE; } diff --git a/unittest/gunit/keyring/buffered_file_io_10.cc b/unittest/gunit/keyring/buffered_file_io_10.cc index 7caf09ea88a5..a35fd624b926 100644 --- a/unittest/gunit/keyring/buffered_file_io_10.cc +++ b/unittest/gunit/keyring/buffered_file_io_10.cc @@ -22,12 +22,12 @@ namespace keyring { - my_bool Buffered_file_io_10::flush_to_file(PSI_file_key *file_key, - const std::string* filename, - const Digest *digest) + bool Buffered_file_io_10::flush_to_file(PSI_file_key *file_key, + const std::string* filename, + const Digest *digest) { File file; - my_bool was_error= TRUE; + bool was_error= TRUE; file= mysql_file_open(*file_key, filename->c_str(), O_TRUNC | O_WRONLY | O_CREAT, MYF(0)); if (file >= 0 && diff --git a/unittest/gunit/keyring/buffered_file_io_10.h b/unittest/gunit/keyring/buffered_file_io_10.h index 53e1313f08f6..b7ae328ec22e 100644 --- a/unittest/gunit/keyring/buffered_file_io_10.h +++ b/unittest/gunit/keyring/buffered_file_io_10.h @@ -24,8 +24,8 @@ namespace keyring Buffered_file_io_10(ILogger *logger) : Buffered_file_io(logger), file_version("Keyring file version:1.0") {} - my_bool flush_to_file(PSI_file_key *file_key, const std::string* filename, - const Digest *digest); + bool flush_to_file(PSI_file_key *file_key, const std::string* filename, + const Digest *digest); size_t get_memory_needed_for_buffer(); private: std::string file_version; diff --git a/unittest/gunit/keyring/keys_container-t.cc b/unittest/gunit/keyring/keys_container-t.cc index 0ac41d53dc49..f282a17f0ed9 100644 --- a/unittest/gunit/keyring/keys_container-t.cc +++ b/unittest/gunit/keyring/keys_container-t.cc @@ -37,7 +37,7 @@ namespace keyring__keys_container_unittest using ::testing::DoAll; using ::testing::SetArgPointee; - my_bool check_if_file_exists_and_TAG_is_correct(const char* file_name) + bool check_if_file_exists_and_TAG_is_correct(const char* file_name) { char tag[4]; std::fstream file; @@ -420,7 +420,7 @@ namespace keyring__keys_container_unittest Buffered_file_io_dont_remove_backup(ILogger *logger) : Buffered_file_io(logger) {} - my_bool remove_backup(myf myFlags) + bool remove_backup(myf myFlags) { return FALSE; } @@ -799,19 +799,19 @@ namespace keyring__keys_container_unittest class Mock_keyring_io : public IKeyring_io { public: - MOCK_METHOD1(init, my_bool(std::string *keyring_filename)); - MOCK_METHOD1(flush_to_backup, my_bool(ISerialized_object *serialized_object)); - MOCK_METHOD1(flush_to_storage, my_bool(ISerialized_object *serialized_object)); + MOCK_METHOD1(init, bool(std::string *keyring_filename)); + MOCK_METHOD1(flush_to_backup, bool(ISerialized_object *serialized_object)); + MOCK_METHOD1(flush_to_storage, bool(ISerialized_object *serialized_object)); MOCK_METHOD0(get_serializer, ISerializer*()); - MOCK_METHOD1(get_serialized_object, my_bool(ISerialized_object **serialized_object)); - MOCK_METHOD0(has_next_serialized_object, my_bool()); + MOCK_METHOD1(get_serialized_object, bool(ISerialized_object **serialized_object)); + MOCK_METHOD0(has_next_serialized_object, bool()); }; class Mock_serialized_object : public ISerialized_object { public: - MOCK_METHOD1(get_next_key, my_bool(IKey **key)); - MOCK_METHOD0(has_next_key, my_bool()); + MOCK_METHOD1(get_next_key, bool(IKey **key)); + MOCK_METHOD0(has_next_key, bool()); MOCK_METHOD0(get_key_operation, Key_operation()); MOCK_METHOD1(set_key_operation, void(Key_operation)); }; diff --git a/unittest/gunit/rpl_group_set-t.cc b/unittest/gunit/rpl_group_set-t.cc index 912c4c958f99..079fa2d0ebf2 100644 --- a/unittest/gunit/rpl_group_set-t.cc +++ b/unittest/gunit/rpl_group_set-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -594,8 +594,8 @@ TEST_F(GroupTest, Group_containers) Gtid_specification *gtid_next= &thd->variables.gtid_next; thd->set_new_thread_id(); gtid_next->type= Gtid_specification::AUTOMATIC; - my_bool >id_end= thd->variables.gtid_end; - my_bool >id_commit= thd->variables.gtid_commit; + bool >id_end= thd->variables.gtid_end; + bool >id_commit= thd->variables.gtid_commit; thd->server_status= 0; thd->system_thread= NON_SYSTEM_THREAD; thd->variables.gtid_next_list.gtid_set= &stage.set; diff --git a/unittest/gunit/thread_utils.cc b/unittest/gunit/thread_utils.cc index 824784b6bc40..42cf26314c43 100644 --- a/unittest/gunit/thread_utils.cc +++ b/unittest/gunit/thread_utils.cc @@ -77,7 +77,7 @@ void Thread::join() void Thread::run_wrapper(Thread *start_arg) { - const my_bool error= my_thread_init(); + const bool error= my_thread_init(); ASSERT_FALSE(error); start_arg->run(); my_thread_end(); diff --git a/utilities/comp_client_err.cc b/utilities/comp_client_err.cc index 8da6a72b6749..a06e3fa9083a 100644 --- a/utilities/comp_client_err.cc +++ b/utilities/comp_client_err.cc @@ -48,7 +48,7 @@ static void usage(void) " -O, --out_file=name Output file name\n"); } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE ((unused)), char *argument MY_ATTRIBUTE ((unused))) diff --git a/utilities/comp_err.cc b/utilities/comp_err.cc index 367bd9bc320d..7e88916ee1e3 100644 --- a/utilities/comp_err.cc +++ b/utilities/comp_err.cc @@ -81,7 +81,7 @@ const char *empty_string= ""; /* For empty states */ const char *default_language= "eng"; int er_offset= 1000; -my_bool info_flag= 0; +bool info_flag= 0; bool isObsolete(const char* error_name) { @@ -161,15 +161,15 @@ static struct errors *parse_error_string(char *ptr, int er_count); static struct message *parse_message_string(struct message *new_message, char *str); static struct message *find_message(struct errors *err, const char *lang, - my_bool no_default); + bool no_default); static int check_message_format(struct errors *err, const char* mess); static int parse_input_file(const char *file_name, struct errors **top_error, struct languages **top_language); static int get_options(int *argc, char ***argv); static void usage(void); -static my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); +static bool get_one_option(int optid, const struct my_option *opt, + char *argument); static char *parse_text_line(char *pos); static int copy_rows(FILE * to, char *row, int row_nr, long start_pos); static char *parse_default_language(char *str); @@ -724,7 +724,7 @@ static char *parse_default_language(char *str) Returns the message structure if one is found, or NULL if not. */ static struct message *find_message(struct errors *err, const char *lang, - my_bool no_default) + bool no_default) { struct message *tmp, *return_val= 0; DBUG_ENTER("find_message"); @@ -1101,7 +1101,7 @@ static struct languages *parse_charset_string(char *str) /* Read options */ -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE ((unused)), char *argument MY_ATTRIBUTE ((unused))) { diff --git a/utilities/ibd2sdi.cc b/utilities/ibd2sdi.cc index db5f3a2b84e9..da6147f827cf 100644 --- a/utilities/ibd2sdi.cc +++ b/utilities/ibd2sdi.cc @@ -281,7 +281,7 @@ usage() /** Parse the options passed to tool. */ extern "C" -my_bool +bool ibd2sdi_get_one_option( int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), diff --git a/utilities/innochecksum.cc b/utilities/innochecksum.cc index 8d09363663c8..5f661d2b75c0 100644 --- a/utilities/innochecksum.cc +++ b/utilities/innochecksum.cc @@ -250,9 +250,9 @@ get_page_size( @return true if decompress succeeded */ static bool page_decompress( - byte* buf, - byte* scratch, - page_size_t page_size) + byte* buf, + byte* scratch, + page_size_t page_size) { dberr_t err; @@ -1368,7 +1368,7 @@ static void usage(void) my_print_variables(innochecksum_options); } -extern "C" my_bool +extern "C" bool innochecksum_get_one_option( int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), diff --git a/utilities/my_print_defaults.c b/utilities/my_print_defaults.c index d49de31cfe0b..b6d6e7363aee 100644 --- a/utilities/my_print_defaults.c +++ b/utilities/my_print_defaults.c @@ -40,7 +40,7 @@ const char *config_file="my"; /* Default config file */ static char *my_login_path; -static my_bool *show_passwords; +static bool *show_passwords; uint verbose= 0, opt_defaults_file_used= 0; const char *default_dbug_option="d:t:o,/tmp/my_print_defaults.trace"; @@ -109,7 +109,7 @@ static struct my_option my_long_options[] = }; -static void usage(my_bool version) +static void usage(bool version) { print_version(); if (version) @@ -124,7 +124,7 @@ static void usage(my_bool version) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { diff --git a/utilities/perror.cc b/utilities/perror.cc index a62be35e1d2f..633de281ce48 100644 --- a/utilities/perror.cc +++ b/utilities/perror.cc @@ -33,14 +33,14 @@ #include "print_version.h" -static my_bool verbose; +static bool verbose; #include "../include/my_base.h" #include "../mysys/my_handler_errors.h" #include "my_compiler.h" #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -static my_bool ndb_code; +static bool ndb_code; static char ndb_string[1024]; int mgmapi_error_string(int err_no, char *str, int size) { @@ -89,7 +89,7 @@ static void usage(void) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { @@ -187,7 +187,7 @@ int get_ER_error_msg(uint code, const char **name_ptr, const char **msg_ptr) } #if defined(_WIN32) -static my_bool print_win_error_msg(DWORD error, my_bool verbose) +static bool print_win_error_msg(DWORD error, bool verbose) { LPTSTR s; if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | @@ -249,7 +249,7 @@ int main(int argc,char *argv[]) const char *name; char *unknown_error = 0; #if defined(_WIN32) - my_bool skip_win_message= 0; + bool skip_win_message= 0; #endif MY_INIT(argv[0]); diff --git a/utilities/resolve_stack_dump.cc b/utilities/resolve_stack_dump.cc index ce7b11cfb8b8..4d42f2cd751a 100644 --- a/utilities/resolve_stack_dump.cc +++ b/utilities/resolve_stack_dump.cc @@ -102,7 +102,7 @@ static void die(const char* fmt, ...) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { diff --git a/utilities/resolveip.cc b/utilities/resolveip.cc index ac31f5a7f9ed..387c057352bd 100644 --- a/utilities/resolveip.cc +++ b/utilities/resolveip.cc @@ -47,7 +47,7 @@ extern int h_errno; typedef uint32 in_addr_t; -static my_bool silent; +static bool silent; static struct my_option my_long_options[] = { @@ -74,7 +74,7 @@ static void usage(void) } -static my_bool +static bool get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused))) { diff --git a/vio/test-ssl.c b/vio/test-ssl.c index ede4f867c343..f4d90d35a86a 100644 --- a/vio/test-ssl.c +++ b/vio/test-ssl.c @@ -55,7 +55,7 @@ main(int argc, char** argv) char* ca_file = 0, *ca_path = 0; char* cipher=0; int child_pid,sv[2]; - my_bool unused; + bool unused; struct st_VioSSLFd* ssl_acceptor= 0; struct st_VioSSLFd* ssl_connector= 0; Vio* client_vio=0, *server_vio=0; diff --git a/vio/vio.cc b/vio/vio.cc index b635ab99a6d8..43c2b3da4d1a 100644 --- a/vio/vio.cc +++ b/vio/vio.cc @@ -89,7 +89,7 @@ static int no_io_wait(Vio *vio MY_ATTRIBUTE((unused)), #endif extern "C" { -static my_bool has_no_data(Vio *vio MY_ATTRIBUTE((unused))) +static bool has_no_data(Vio *vio MY_ATTRIBUTE((unused))) { return FALSE; } @@ -247,8 +247,8 @@ static bool vio_init(Vio *vio, enum enum_vio_type type, @return Return value is zero on success. */ -my_bool vio_reset(Vio* vio, enum enum_vio_type type, - my_socket sd, void *ssl MY_ATTRIBUTE((unused)), uint flags) +bool vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, void *ssl MY_ATTRIBUTE((unused)), uint flags) { int ret= FALSE; Vio new_vio(flags); @@ -436,7 +436,7 @@ Vio *vio_new_win32shared_memory(HANDLE handle_file_map, HANDLE handle_map, int vio_timeout(Vio *vio, uint which, int timeout_sec) { int timeout_ms; - my_bool old_mode; + bool old_mode; /* Vio timeouts are measured in milliseconds. Check for a possible diff --git a/vio/vio_priv.h b/vio/vio_priv.h index aa7f142a8b44..c944e200b7ca 100644 --- a/vio/vio_priv.h +++ b/vio/vio_priv.h @@ -42,19 +42,19 @@ extern PSI_memory_key key_memory_vio_ssl_fd; #ifdef _WIN32 size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size); size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size); -my_bool vio_is_connected_pipe(Vio *vio); +bool vio_is_connected_pipe(Vio *vio); int vio_shutdown_pipe(Vio * vio); size_t vio_read_shared_memory(Vio *vio, uchar * buf, size_t size); size_t vio_write_shared_memory(Vio *vio, const uchar * buf, size_t size); -my_bool vio_is_connected_shared_memory(Vio *vio); +bool vio_is_connected_shared_memory(Vio *vio); int vio_shutdown_shared_memory(Vio * vio); void vio_delete_shared_memory(Vio *vio); #endif /* _WIN32 */ -my_bool vio_buff_has_data(Vio *vio); +bool vio_buff_has_data(Vio *vio); int vio_socket_io_wait(Vio *vio, enum enum_vio_io_event event); -int vio_socket_timeout(Vio *vio, uint which, my_bool old_mode); +int vio_socket_timeout(Vio *vio, uint which, bool old_mode); #ifdef HAVE_OPENSSL size_t vio_ssl_read(Vio *vio,uchar* buf, size_t size); @@ -63,7 +63,7 @@ size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size); /* When the workday is over... */ int vio_ssl_shutdown(Vio *vio); void vio_ssl_delete(Vio *vio); -my_bool vio_ssl_has_data(Vio *vio); +bool vio_ssl_has_data(Vio *vio); #endif /* HAVE_OPENSSL */ diff --git a/vio/viopipe.cc b/vio/viopipe.cc index 09af4939f6d4..d46194377b77 100644 --- a/vio/viopipe.cc +++ b/vio/viopipe.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -90,7 +90,7 @@ size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count) } -my_bool vio_is_connected_pipe(Vio *vio) +bool vio_is_connected_pipe(Vio *vio) { if (PeekNamedPipe(vio->hPipe, NULL, 0, NULL, NULL, NULL)) return TRUE; diff --git a/vio/vioshm.cc b/vio/vioshm.cc index 1c3578941eb6..cb8524f20df2 100644 --- a/vio/vioshm.cc +++ b/vio/vioshm.cc @@ -147,7 +147,7 @@ size_t vio_write_shared_memory(Vio *vio, const uchar *buf, size_t size) } -my_bool vio_is_connected_shared_memory(Vio *vio) +bool vio_is_connected_shared_memory(Vio *vio) { return (WaitForSingleObject(vio->event_conn_closed, 0) != WAIT_OBJECT_0); } diff --git a/vio/viosocket.cc b/vio/viosocket.cc index 0f463d6baf46..0619ec400acc 100644 --- a/vio/viosocket.cc +++ b/vio/viosocket.cc @@ -203,7 +203,7 @@ size_t vio_read_buff(Vio *vio, uchar* buf, size_t size) } -my_bool vio_buff_has_data(Vio *vio) +bool vio_buff_has_data(Vio *vio) { return (vio->read_pos != vio->read_end); } @@ -240,7 +240,7 @@ size_t vio_write(Vio *vio, const uchar* buf, size_t size) } //WL#4896: Not covered -static int vio_set_blocking(Vio *vio, my_bool status) +static int vio_set_blocking(Vio *vio, bool status) { DBUG_ENTER("vio_set_blocking"); @@ -282,7 +282,7 @@ static int vio_set_blocking(Vio *vio, my_bool status) int vio_socket_timeout(Vio *vio, uint which MY_ATTRIBUTE((unused)), - my_bool old_mode) + bool old_mode) { int ret= 0; DBUG_ENTER("vio_socket_timeout"); @@ -336,7 +336,7 @@ int vio_socket_timeout(Vio *vio, #endif { /* Deduce what should be the new blocking mode of the socket. */ - my_bool new_mode= vio->write_timeout < 0 && vio->read_timeout < 0; + bool new_mode= vio->write_timeout < 0 && vio->read_timeout < 0; /* If necessary, update the blocking mode. */ if (new_mode != old_mode) @@ -382,7 +382,7 @@ int vio_fastsend(Vio * vio) DBUG_RETURN(r); } -int vio_keepalive(Vio* vio, my_bool set_keep_alive) +int vio_keepalive(Vio* vio, bool set_keep_alive) { int r=0; uint opt = 0; @@ -410,7 +410,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) @retval FALSE Indeterminate failure. */ -my_bool +bool vio_should_retry(Vio *vio) { return (vio_errno(vio) == SOCKET_EINTR); @@ -427,7 +427,7 @@ vio_should_retry(Vio *vio) @retval FALSE Not a timeout failure. */ -my_bool +bool vio_was_timeout(Vio *vio) { return (vio_errno(vio) == SOCKET_ETIMEDOUT); @@ -646,10 +646,10 @@ static void vio_get_normalized_ip(const struct sockaddr *src, @retval FALSE on success. */ -my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, - size_t addr_length, - char *ip_string, - size_t ip_string_size) +bool vio_get_normalized_ip_string(const struct sockaddr *addr, + size_t addr_length, + char *ip_string, + size_t ip_string_size) { struct sockaddr_storage norm_addr_storage; struct sockaddr *norm_addr= (struct sockaddr *) &norm_addr_storage; @@ -681,8 +681,8 @@ my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, IPv6 address is returned. */ -my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port, - size_t ip_buffer_size) +bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port, + size_t ip_buffer_size) { DBUG_ENTER("vio_peer_addr"); DBUG_PRINT("enter", ("Client socked fd: %d", @@ -764,7 +764,7 @@ my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port, @retval TRUE Failure. */ // WL#4896: Not covered -static my_bool socket_peek_read(Vio *vio, uint *bytes) +static bool socket_peek_read(Vio *vio, uint *bytes) { my_socket sd= mysql_socket_getfd(vio->mysql_socket); #if defined(_WIN32) @@ -1106,7 +1106,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) @retval TRUE A fatal error. See socket_errno. */ -my_bool +bool vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len, int timeout) { int ret, wait; @@ -1198,7 +1198,7 @@ vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len, int timeout) @retval FALSE EOF condition is signaled. */ -my_bool vio_is_connected(Vio *vio) +bool vio_is_connected(Vio *vio) { uint bytes= 0; DBUG_ENTER("vio_is_connected"); @@ -1285,7 +1285,7 @@ ssize_t vio_pending(Vio *vio) @retval false otherwise. */ -my_bool vio_is_no_name_error(int err_code) +bool vio_is_no_name_error(int err_code) { #ifdef _WIN32 diff --git a/vio/viossl.cc b/vio/viossl.cc index 4c76ac2587d6..0084de07c205 100644 --- a/vio/viossl.cc +++ b/vio/viossl.cc @@ -127,13 +127,13 @@ static void ssl_set_sys_error(int ssl_error) @retval FALSE Indeterminate failure. */ -static my_bool ssl_should_retry(Vio *vio, int ret, - enum enum_vio_io_event *event, - unsigned long *ssl_errno_holder) +static bool ssl_should_retry(Vio *vio, int ret, + enum enum_vio_io_event *event, + unsigned long *ssl_errno_holder) { int ssl_error; SSL *ssl= static_cast(vio->ssl_arg); - my_bool should_retry= TRUE; + bool should_retry= TRUE; /* Retrieve the result for the SSL I/O operation. */ ssl_error= SSL_get_error(ssl, ret); @@ -528,7 +528,7 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout, } -my_bool vio_ssl_has_data(Vio *vio) +bool vio_ssl_has_data(Vio *vio) { return SSL_pending(static_cast(vio->ssl_arg)) > 0 ? TRUE : FALSE; } diff --git a/vio/viosslfactories.cc b/vio/viosslfactories.cc index f0e6c0f119d2..f639bd976f92 100644 --- a/vio/viosslfactories.cc +++ b/vio/viosslfactories.cc @@ -75,7 +75,7 @@ static const char tls_cipher_blocked[]= "!aNULL:!eNULL:!EXPORT:!LOW:!MD5:!DES:!R "!ECDHE-RSA-DES-CBC3-SHA:!ECDHE-ECDSA-DES-CBC3-SHA:"; #endif -static my_bool ssl_initialized = FALSE; +static bool ssl_initialized = FALSE; /* Diffie-Hellman key. @@ -375,7 +375,7 @@ static void init_ssl_locks() #endif } -static void set_lock_callback_functions(my_bool init) +static void set_lock_callback_functions(bool init) { CRYPTO_set_locking_callback(init ? openssl_lock_function : NULL); CRYPTO_set_id_callback(init ? openssl_id_function : NULL); @@ -487,7 +487,7 @@ long process_tls_version(const char *tls_version) static struct st_VioSSLFd * new_VioSSLFd(const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, - const char *cipher, my_bool is_client, + const char *cipher, bool is_client, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, const long ssl_ctx_flags) {