From c4a9c1f0437377ec1c55b01f052ae593ff58865b Mon Sep 17 00:00:00 2001 From: sjaakola Date: Tue, 11 Dec 2018 22:14:22 +0200 Subject: [PATCH 1/6] Fixes according to Svoj's review #2 --- CMakeLists.txt | 7 +- cmake/wsrep.cmake | 2 +- mysql-test/r/mysqld--help-notwin.result | 1472 ----------------- .../r/query_cache_size_functionality.result | 226 --- .../r/query_cache_type_functionality.result | 250 --- sql/handler.cc | 24 +- sql/item_strfunc.h | 3 +- sql/mdl.cc | 2 +- sql/wsrep_applier.h | 1 - sql/wsrep_high_priority_service.cc | 6 +- sql/wsrep_mysqld.cc | 7 +- sql/wsrep_priv.h | 1 - sql/wsrep_schema.h | 1 - sql/wsrep_server_service.cc | 3 - sql/wsrep_thd.cc | 47 +- wsrep/wsrep_api.h | 1278 -------------- wsrep/wsrep_dummy.c | 449 ----- wsrep/wsrep_gtid.c | 74 - wsrep/wsrep_listener.c | 261 --- wsrep/wsrep_loader.c | 230 --- wsrep/wsrep_uuid.c | 94 -- 21 files changed, 23 insertions(+), 4415 deletions(-) delete mode 100644 mysql-test/r/mysqld--help-notwin.result delete mode 100644 mysql-test/r/query_cache_size_functionality.result delete mode 100644 mysql-test/r/query_cache_type_functionality.result delete mode 100644 wsrep/wsrep_api.h delete mode 100644 wsrep/wsrep_dummy.c delete mode 100644 wsrep/wsrep_gtid.c delete mode 100644 wsrep/wsrep_listener.c delete mode 100644 wsrep/wsrep_loader.c delete mode 100644 wsrep/wsrep_uuid.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f62318b2fa83..d33591256f98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,8 +383,10 @@ INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb) # Add storage engines and plugins. CONFIGURE_PLUGINS() -IF(WITH_WSREP) - ADD_SUBDIRECTORY(wsrep-lib) +IF(NOT WITHOUT_SERVER) + IF(WITH_WSREP) + ADD_SUBDIRECTORY(wsrep-lib) + ENDIF() ENDIF() ADD_SUBDIRECTORY(include) @@ -427,7 +429,6 @@ INCLUDE(cmake/tags.cmake) -#INCLUDE(for_clients) ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(support-files) diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index 477f256778f0e..44e00649993a0 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -32,7 +32,7 @@ OPTION(WITH_WSREP_ALL SET(WSREP_PATCH_VERSION "22") # Obtain wsrep API version -FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION +FILE(STRINGS "${CMAKE_SOURCE_DIR}/wsrep-lib/wsrep-API/v26/wsrep_api.h" WSREP_API_VERSION LIMIT_COUNT 1 REGEX "WSREP_INTERFACE_VERSION") STRING(REGEX MATCH "([0-9]+)" WSREP_API_VERSION "${WSREP_API_VERSION}") diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result deleted file mode 100644 index b7db372a70492..0000000000000 --- a/mysql-test/r/mysqld--help-notwin.result +++ /dev/null @@ -1,1472 +0,0 @@ -The following options may be given as the first argument: ---print-defaults Print the program argument list and exit. ---no-defaults Don't read default options from any option file, - except for login file. ---defaults-file=# Only read default options from the given file #. ---defaults-extra-file=# Read this file after the global files are read. ---defaults-group-suffix=# - Also read groups with concat(group, suffix) ---login-path=# Read this path from the login file. - - --abort-slave-event-count=# - Option used by mysql-test for debugging and testing of - replication. - --allow-suspicious-udfs - Allows use of UDFs consisting of only one symbol xxx() - without corresponding xxx_init() or xxx_deinit(). That - also means that one can load any function from any - library, for example exit() from libc.so - -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode - will also set transaction isolation level 'serializable'. - --auto-increment-increment[=#] - Auto-increment columns are incremented by this - --auto-increment-offset[=#] - Offset added to Auto-increment columns. Used when - auto-increment-increment != 1 - --autocommit Set default value for autocommit (0 or 1) - (Defaults to on; use --skip-autocommit to disable.) - --automatic-sp-privileges - Creating and dropping stored procedures alters ACLs - (Defaults to on; use --skip-automatic-sp-privileges to disable.) - --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 COLUMN, ADD INDEX or FORCE - operation. This variable is deprecated and will be - removed in a future release. - --back-log=# The number of outstanding connection requests MySQL can - have. This comes into play when the main MySQL thread - gets very many connection requests in a very short time - -b, --basedir=name Path to installation directory. All paths are usually - resolved relative to this - --big-tables Allow big result sets by saving all temporary sets on - file (Solves most 'table full' errors) - --bind-address=name IP address to bind to. - --binlog-cache-size=# - The size of the transactional cache for updates to - transactional engines for the binary log. If you often - use transactions containing many statements, you can - increase this to get more performance - --binlog-checksum=name - Type of BINLOG_CHECKSUM_ALG. Include checksum for log - events in the binary log. Possible values are NONE and - CRC32; default is CRC32. - --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 that there are no - dependencies between transactional and non-transactional - tables such as in the statement INSERT INTO t_myisam - SELECT * FROM t_innodb; otherwise, slaves may diverge - from the master. - --binlog-do-db=name Tells the master it should log updates for the specified - database, and exclude all others not explicitly - mentioned. - --binlog-error-action=name - When statements cannot be written to the binary log due - to a fatal error, the server can either ignore the error - and let the master continue, or abort. - --binlog-format=name - What form of binary logging the master will use: either - ROW for row-based binary logging, STATEMENT for - statement-based binary logging, or MIXED. MIXED is - statement-based binary logging except for those - statements where only row-based is correct: those which - involve user-defined functions (i.e. UDFs) or the UUID() - function; for those, row-based binary logging is - automatically used. If NDBCLUSTER is enabled and - binlog-format is MIXED, the format switches to row-based - and back implicitly per each query accessing an - NDBCLUSTER table - --binlog-gtid-simple-recovery - If this option is enabled, the server does not open more - than two binary logs when initializing GTID_PURGED and - GTID_EXECUTED, either during server restart or when - binary logs are being purged. Enabling this option is - useful when the server has already generated many binary - logs without GTID events (e.g., having GTID_MODE = OFF). - Note: If this option is enabled, GLOBAL.GTID_EXECUTED and - GLOBAL.GTID_PURGED may be initialized wrongly in two - cases: (1) GTID_MODE was ON for some binary logs but OFF - for the newest binary log. (2) SET GTID_PURGED was issued - after the oldest existing binary log was generated. If a - wrong set is computed in one of case (1) or case (2), it - will remain wrong even if the server is later restarted - with this option disabled. - --binlog-ignore-db=name - Tells the master that updates to the given database - should not be logged to the binary log. - --binlog-max-flush-queue-time=# - The maximum time that the binary log group commit will - keep reading transactions before it flush the - transactions to the binary log (and optionally sync, - depending on the value of sync_binlog). - --binlog-order-commits - Issue internal commit calls in the same order as - transactions are written to the binary log. Default is to - order commits. - (Defaults to on; use --skip-binlog-order-commits to disable.) - --binlog-row-event-max-size=# - The maximum size of a row-based binary log event in - bytes. Rows will be grouped into events smaller than this - size if possible. The value has to be a multiple of 256. - --binlog-row-image=name - Controls whether rows should be logged in 'FULL', - 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all - columns in the before and after image are logged. - 'NOBLOB', means that mysqld avoids logging blob columns - whenever possible (eg, blob column was not changed or is - not part of primary key). 'MINIMAL', means that a PK - equivalent (PK columns or full row if there is no PK in - the table) is logged in the before image, and only - changed columns are logged in the after image. (Default: - FULL). - --binlog-rows-query-log-events - Allow writing of Rows_query_log events into binary log. - --binlog-stmt-cache-size=# - The size of the statement cache for updates to - non-transactional engines for the binary log. If you - often use statements updating a great number of rows, you - can increase this to get more performance - --binlogging-impossible-mode=name - On a fatal error when statements cannot be binlogged the - behaviour can be ignore the error and let the master - continue or abort the server. This variable is deprecated - and will be removed in a future release. Please use - binlog_error_action instead. - --block-encryption-mode=name - mode for AES_ENCRYPT/AES_DECRYPT - --bootstrap Used by mysql installation scripts. - --bulk-insert-buffer-size=# - Size of tree cache used in bulk insert optimisation. Note - that this is a limit per thread! - --character-set-client-handshake - Don't ignore client side character set value sent during - handshake. - (Defaults to on; use --skip-character-set-client-handshake to disable.) - --character-set-filesystem=name - Set the filesystem character set. - -C, --character-set-server=name - Set the default character set. - --character-sets-dir=name - Directory where character sets are - -r, --chroot=name Chroot mysqld daemon during startup. - --collation-server=name - Set the default collation. - --completion-type=name - The transaction completion type, one of NO_CHAIN, CHAIN, - RELEASE - --concurrent-insert[=name] - Use concurrent insert with MyISAM. Possible values are - NEVER, AUTO, ALWAYS - --connect-timeout=# The number of seconds the mysqld server is waiting for a - connect packet before responding with 'Bad handshake' - --console Write error output on screen; don't remove the console - window on windows. - --core-file Write core on errors. - -h, --datadir=name Path to the database root directory - --date-format=name The DATE format (ignored) - --datetime-format=name - The DATETIME format (ignored) - --default-authentication-plugin=name - Defines what password- and authentication algorithm to - use per default - --default-storage-engine=name - The default storage engine for new tables - --default-time-zone=name - Set the default time zone. - --default-tmp-storage-engine=name - The default storage engine for new explict temporary - tables - --default-week-format=# - The default week format used by WEEK() functions - --delay-key-write[=name] - Type of DELAY_KEY_WRITE - --delayed-insert-limit=# - After inserting delayed_insert_limit rows, the INSERT - DELAYED handler will check if there are any SELECT - statements pending. If so, it allows these to execute - before continuing. This variable is deprecated along with - INSERT DELAYED. - --delayed-insert-timeout=# - How long a INSERT DELAYED thread should wait for INSERT - statements before terminating.This variable is deprecated - along with INSERT DELAYED. - --delayed-queue-size=# - What size queue (in rows) should be allocated for - handling INSERT DELAYED. If the queue becomes full, any - client that does INSERT DELAYED will wait until there is - room in the queue again.This variable is deprecated along - with INSERT DELAYED. - --disconnect-on-expired-password - Give clients that don't signal password expiration - support execution time error(s) instead of connection - error - (Defaults to on; use --skip-disconnect-on-expired-password to disable.) - --disconnect-slave-event-count=# - Option used by mysql-test for debugging and testing of - replication. - --div-precision-increment=# - Precision of the result of '/' operator will be increased - on that value - --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) near the closing bracket - --enforce-gtid-consistency - Prevents execution of statements that would be impossible - to log in a transactionally safe manner. Currently, the - disallowed statements include CREATE TEMPORARY TABLE - inside transactions, all updates to non-transactional - tables, and CREATE TABLE ... SELECT. - --eq-range-index-dive-limit=# - The optimizer will use existing index statistics instead - of doing index dives for equality ranges if the number of - equality ranges for the index is larger than or equal to - this number. If set to 0, index dives are always used. - --event-scheduler[=name] - Enable the event scheduler. Possible values are ON, OFF, - and DISABLED (keep the event scheduler completely - deactivated, it cannot be activated run-time) - -T, --exit-info[=#] Used for debugging. Use at your own risk. - --expire-logs-days=# - If non-zero, binary logs will be purged after - expire_logs_days days; possible purges happen at startup - and at binary log rotation - --explicit-defaults-for-timestamp - This option causes CREATE TABLE to create all TIMESTAMP - columns as NULL with DEFAULT NULL attribute, Without this - option, TIMESTAMP columns are NOT NULL and have implicit - DEFAULT clauses. The old behavior is deprecated. - --external-locking Use system (external) locking (disabled by default). - With this option enabled you can run myisamchk to test - (not repair) tables while the MySQL server is running. - Disable with --skip-external-locking. - --flush Flush MyISAM tables to disk between SQL commands - --flush-time=# A dedicated thread is created to flush all tables at the - given interval - --ft-boolean-syntax=name - List of operators for MATCH ... AGAINST ( ... IN BOOLEAN - MODE) - --ft-max-word-len=# The maximum length of the word to be included in a - FULLTEXT index. Note: FULLTEXT indexes must be rebuilt - after changing this variable - --ft-min-word-len=# The minimum length of the word to be included in a - FULLTEXT index. Note: FULLTEXT indexes must be rebuilt - after changing this variable - --ft-query-expansion-limit=# - Number of best matches to use for query expansion - --ft-stopword-file=name - Use stopwords from this file instead of built-in list - --gdb Set up signals usable for debugging. - --general-log Log connections and queries to a table or log file. - Defaults logging to a file hostname.log or a table - mysql.general_logif --log-output=TABLE is used - --general-log-file=name - Log connections and queries to given file - --group-concat-max-len=# - The maximum length of the result of function - GROUP_CONCAT() - --gtid-mode=name Whether Global Transaction Identifiers (GTIDs) are - enabled. Can be ON or OFF. - -?, --help Display this help and exit. - --host-cache-size=# How many host names should be cached to avoid resolving. - --ignore-builtin-innodb - IGNORED. This option will be removed in future releases. - Disable initialization of builtin InnoDB plugin - --ignore-db-dir=name - Specifies a directory to add to the ignore list when - collecting database names from the datadir. Put a blank - argument to reset the list accumulated so far. - --init-connect=name Command(s) that are executed for each new connection - --init-file=name Read SQL commands from this file at startup - --init-slave=name Command(s) that are executed by a slave server each time - the SQL thread starts - --interactive-timeout=# - The number of seconds the server waits for activity on an - interactive connection before closing it - --join-buffer-size=# - The size of the buffer that is used for full joins - --keep-files-on-create - Don't overwrite stale .MYD and .MYI even if no directory - is specified - --key-buffer-size=# The size of the buffer used for index blocks for MyISAM - tables. Increase this to get better index handling (for - all reads and multiple writes) to as much as you can - afford - --key-cache-age-threshold=# - This characterizes the number of hits a hot block has to - be untouched until it is considered aged enough to be - downgraded to a warm block. This specifies the percentage - ratio of that number of hits to the total number of - blocks in key cache - --key-cache-block-size=# - The default size of key cache blocks - --key-cache-division-limit=# - The minimum percentage of warm blocks in key cache - -L, --language=name Client error messages in given language. May be given as - a full path. Deprecated. Use --lc-messages-dir instead. - --large-pages Enable support for large pages - --lc-messages=name Set the language used for the error messages. - --lc-messages-dir=name - Directory where error messages are - --lc-time-names=name - Set the language used for the month names and the days of - the week. - --local-infile Enable LOAD DATA LOCAL INFILE - (Defaults to on; use --skip-local-infile to disable.) - --lock-wait-timeout=# - Timeout in seconds to wait for a lock before returning an - error. - --log-bin[=name] Log update queries in binary format. Optional (but - strongly recommended to avoid replication problems if - server's hostname changes) argument should be the chosen - location for the binary log files. - --log-bin-index=name - File that holds the names for binary log files. - --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 SUPER privilege and only - if this stored function (trigger) may not break binary - logging. Note that if ALL connections to this server - ALWAYS use row-based binary logging, the security issues - do not exist and the binary logging cannot break, so you - can safely set this to TRUE - --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 written. This option is useful - during some upgrades. - --log-error[=name] Error log file - --log-isam[=name] Log all MyISAM changes to file. - --log-output=name Syntax: log-output=value[,value...], where "value" could - be TABLE, FILE or NONE - --log-queries-not-using-indexes - Log queries that are executed without benefit of any - index to the slow log if it is open - --log-raw Log to general log before any rewriting of the query. For - use in debugging, not production as sensitive information - may be logged. - --log-short-format Don't log extra information to update and slow-query - logs. - --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 - --log-slow-admin-statements - Log slow OPTIMIZE, ANALYZE, ALTER and other - administrative statements to the slow log if it is open. - --log-slow-slave-statements - Log slow statements executed by slave thread to the slow - log if it is open. - --log-tc=name Path to transaction coordinator log (used for - transactions that affect more than one storage engine, - when binary log is disabled). - --log-tc-size=# Size of transaction coordinator log. - --log-throttle-queries-not-using-indexes[=#] - Log at most this many 'not using index' warnings per - minute to the slow log. Any further warnings will be - condensed into a single summary line. A value of 0 - disables throttling. Option has no effect unless - --log_queries_not_using_indexes is set. - -W, --log-warnings[=#] - Log some not critical warnings to the log file - --long-query-time=# Log all queries that have taken more than long_query_time - seconds to execute to file. The argument will be treated - as a decimal value with microsecond precision - --low-priority-updates - INSERT/DELETE/UPDATE has lower priority than selects - --lower-case-table-names[=#] - If set to 1 table names are stored in lowercase on disk - and table names will be case-insensitive. Should be set - to 2 if you are using a case insensitive file system - --master-info-file=name - The location and name of the file that remembers the - master and where the I/O replication thread is in the - master's binlogs. - --master-info-repository=name - Defines the type of the repository for the master - information. - --master-retry-count=# - The number of tries the slave will make to connect to the - master before giving up. Deprecated option, use 'CHANGE - MASTER TO master_retry_count = ' instead. - --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. Disabled by default. - --max-allowed-packet=# - Max packet length to send to or receive from the server - --max-binlog-cache-size=# - Sets the total size of the transactional cache - --max-binlog-dump-events=# - Option used by mysql-test for debugging and testing of - replication. - --max-binlog-size=# Binary log will be rotated automatically when the size - exceeds this value. Will also apply to relay logs if - max_relay_log_size is 0 - --max-binlog-stmt-cache-size=# - Sets the total size of the statement cache - --max-connect-errors=# - If there is more than this number of interrupted - connections from a host this host will be blocked from - further connections - --max-connections=# The number of simultaneous clients allowed - --max-delayed-threads=# - Don't start more than this number of threads to handle - INSERT DELAYED statements. If set to zero INSERT DELAYED - will be not used.This variable is deprecated along with - INSERT DELAYED. - --max-digest-length=# - Maximum length considered for digest text. - --max-error-count=# Max number of errors/warnings to store for a statement - --max-heap-table-size=# - Don't allow creation of heap tables bigger than this - --max-join-size=# Joins that are probably going to read more than - max_join_size records return an error - --max-length-for-sort-data=# - Max number of bytes in sorted records - --max-prepared-stmt-count=# - Maximum number of prepared statements in the server - --max-relay-log-size=# - If non-zero: relay log will be rotated automatically when - the size exceeds this value; if zero: when the size - exceeds max_binlog_size - --max-seeks-for-key=# - Limit assumed max number of seeks when looking up rows - based on a key - --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT - values (only the first max_sort_length bytes of each - value are used; the rest are ignored) - --max-sp-recursion-depth[=#] - Maximum stored procedure recursion depth - --max-tmp-tables=# Maximum number of temporary tables a client can keep open - at a time - --max-user-connections=# - The maximum number of active connections for a single - user (0 = no limit) - --max-write-lock-count=# - After this many write locks, allow some read locks to run - in between - --memlock Lock mysqld in memory. - --metadata-locks-cache-size=# - Size of unused metadata locks cache - --metadata-locks-hash-instances=# - Number of metadata locks hash instances - --min-examined-row-limit=# - Don't write queries to slow log that examine fewer rows - than that - --multi-range-count=# - Number of key ranges to request at once. This variable - has no effect, and is deprecated. It will be removed in a - future release. - --myisam-block-size=# - Block size to be used for MyISAM index pages - --myisam-data-pointer-size=# - Default pointer size to be used for MyISAM tables - --myisam-max-sort-file-size=# - Don't use the fast sort index method to created index if - the temporary file would get bigger than this - --myisam-mmap-size=# - Restricts the total memory used for memory mapping of - MySQL tables - --myisam-recover-options[=name] - Syntax: myisam-recover-options[=option[,option...]], - where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF - --myisam-repair-threads=# - If larger than 1, when repairing a MyISAM table all - indexes will be created in parallel, with one thread per - index. The value of 1 disables parallel repair - --myisam-sort-buffer-size=# - The buffer that is allocated when sorting the index when - doing a REPAIR or when creating indexes with CREATE INDEX - or ALTER TABLE - --myisam-stats-method=name - Specifies how MyISAM index statistics collection code - should treat NULLs. Possible values of name are - NULLS_UNEQUAL (default behavior for 4.1 and later), - NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED - --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables - --net-buffer-length=# - Buffer length for TCP/IP and socket communication - --net-read-timeout=# - Number of seconds to wait for more data from a connection - before aborting the read - --net-retry-count=# If a read on a communication port is interrupted, retry - this many times before giving up - --net-write-timeout=# - Number of seconds to wait for a block to be written to a - connection before aborting the write - -n, --new Use very new possible "unsafe" functions - --old Use compatible behavior - --old-alter-table Use old, non-optimized alter table - --old-passwords=# Determine which hash algorithm to use when generating - passwords using the PASSWORD() function - --old-style-user-limits - Enable old-style user limits (before 5.0.3, user - resources were counted per each user+host vs. per - account). - --open-files-limit=# - If this is not 0, then mysqld will use this value to - reserve file descriptors to use with setrlimit(). If this - value is 0 then mysqld will reserve max_connections*5 or - max_connections + table_open_cache*2 (whichever is - larger) number of file descriptors - --optimizer-prune-level=# - Controls the heuristic(s) applied during query - optimization to prune less-promising partial plans from - the optimizer search space. Meaning: 0 - do not apply any - heuristic, thus perform exhaustive search; 1 - prune - plans based on number of retrieved rows - --optimizer-search-depth=# - Maximum depth of search performed by the query optimizer. - Values larger than the number of relations in a query - result in better query plans, but take longer to compile - a query. Values smaller than the number of tables in a - relation result in faster optimization, but may produce - very bad query plans. If set to 0, the system will - automatically pick a reasonable value - --optimizer-switch=name - optimizer_switch=option=val[,option=val...], where option - is one of {index_merge, index_merge_union, - index_merge_sort_union, index_merge_intersection, - engine_condition_pushdown, index_condition_pushdown, mrr, - mrr_cost_based, materialization, semijoin, loosescan, - firstmatch, subquery_materialization_cost_based, - block_nested_loop, batched_key_access, - use_index_extensions} and val is one of {on, off, - default} - --optimizer-trace=name - Controls tracing of the Optimizer: - optimizer_trace=option=val[,option=val...], where option - is one of {enabled, one_line} and val is one of {on, - default} - --optimizer-trace-features=name - Enables/disables tracing of selected features of the - Optimizer: - optimizer_trace_features=option=val[,option=val...], - where option is one of {greedy_search, range_optimizer, - dynamic_range, repeated_subselect} and val is one of {on, - off, default} - --optimizer-trace-limit=# - Maximum number of shown optimizer traces - --optimizer-trace-max-mem-size=# - Maximum allowed cumulated size of stored optimizer traces - --optimizer-trace-offset=# - Offset of first optimizer trace to show; see manual - --performance-schema - Enable the performance schema. - (Defaults to on; use --skip-performance-schema to disable.) - --performance-schema-accounts-size=# - Maximum number of instrumented user@host accounts. Use 0 - to disable, -1 for automated sizing. - --performance-schema-consumer-events-stages-current - Default startup value for the events_stages_current - consumer. - --performance-schema-consumer-events-stages-history - Default startup value for the events_stages_history - consumer. - --performance-schema-consumer-events-stages-history-long - Default startup value for the events_stages_history_long - consumer. - --performance-schema-consumer-events-statements-current - Default startup value for the events_statements_current - consumer. - (Defaults to on; use --skip-performance-schema-consumer-events-statements-current to disable.) - --performance-schema-consumer-events-statements-history - Default startup value for the events_statements_history - consumer. - --performance-schema-consumer-events-statements-history-long - Default startup value for the - events_statements_history_long consumer. - --performance-schema-consumer-events-waits-current - Default startup value for the events_waits_current - consumer. - --performance-schema-consumer-events-waits-history - Default startup value for the events_waits_history - consumer. - --performance-schema-consumer-events-waits-history-long - Default startup value for the events_waits_history_long - consumer. - --performance-schema-consumer-global-instrumentation - Default startup value for the global_instrumentation - consumer. - (Defaults to on; use --skip-performance-schema-consumer-global-instrumentation to disable.) - --performance-schema-consumer-statements-digest - Default startup value for the statements_digest consumer. - (Defaults to on; use --skip-performance-schema-consumer-statements-digest to disable.) - --performance-schema-consumer-thread-instrumentation - Default startup value for the thread_instrumentation - consumer. - (Defaults to on; use --skip-performance-schema-consumer-thread-instrumentation to disable.) - --performance-schema-digests-size=# - Size of the statement digest. Use 0 to disable, -1 for - automated sizing. - --performance-schema-events-stages-history-long-size=# - Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to - disable, -1 for automated sizing. - --performance-schema-events-stages-history-size=# - Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 - to disable, -1 for automated sizing. - --performance-schema-events-statements-history-long-size=# - Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 - to disable, -1 for automated sizing. - --performance-schema-events-statements-history-size=# - Number of rows per thread in EVENTS_STATEMENTS_HISTORY. - Use 0 to disable, -1 for automated sizing. - --performance-schema-events-waits-history-long-size=# - Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to - disable, -1 for automated sizing. - --performance-schema-events-waits-history-size=# - Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 - to disable, -1 for automated sizing. - --performance-schema-hosts-size=# - Maximum number of instrumented hosts. Use 0 to disable, - -1 for automated sizing. - --performance-schema-instrument[=name] - Default startup value for a performance schema - instrument. - --performance-schema-max-cond-classes=# - Maximum number of condition instruments. - --performance-schema-max-cond-instances=# - Maximum number of instrumented condition objects. Use 0 - to disable, -1 for automated sizing. - --performance-schema-max-digest-length=# - Maximum length considered for digest text, when stored in - performance_schema tables. - --performance-schema-max-file-classes=# - Maximum number of file instruments. - --performance-schema-max-file-handles=# - Maximum number of opened instrumented files. - --performance-schema-max-file-instances=# - Maximum number of instrumented files. Use 0 to disable, - -1 for automated sizing. - --performance-schema-max-mutex-classes=# - Maximum number of mutex instruments. - --performance-schema-max-mutex-instances=# - Maximum number of instrumented MUTEX objects. Use 0 to - disable, -1 for automated sizing. - --performance-schema-max-rwlock-classes=# - Maximum number of rwlock instruments. - --performance-schema-max-rwlock-instances=# - Maximum number of instrumented RWLOCK objects. Use 0 to - disable, -1 for automated sizing. - --performance-schema-max-socket-classes=# - Maximum number of socket instruments. - --performance-schema-max-socket-instances=# - Maximum number of opened instrumented sockets. Use 0 to - disable, -1 for automated sizing. - --performance-schema-max-stage-classes=# - Maximum number of stage instruments. - --performance-schema-max-statement-classes=# - Maximum number of statement instruments. - --performance-schema-max-table-handles=# - Maximum number of opened instrumented tables. Use 0 to - disable, -1 for automated sizing. - --performance-schema-max-table-instances=# - Maximum number of instrumented tables. Use 0 to disable, - -1 for automated sizing. - --performance-schema-max-thread-classes=# - Maximum number of thread instruments. - --performance-schema-max-thread-instances=# - Maximum number of instrumented threads. Use 0 to disable, - -1 for automated sizing. - --performance-schema-session-connect-attrs-size=# - Size of session attribute string buffer per thread. Use 0 - to disable, -1 for automated sizing. - --performance-schema-setup-actors-size=# - Maximum number of rows in SETUP_ACTORS. - --performance-schema-setup-objects-size=# - Maximum number of rows in SETUP_OBJECTS. - --performance-schema-users-size=# - Maximum number of instrumented users. Use 0 to disable, - -1 for automated sizing. - --pid-file=name Pid file used by safe_mysqld - --plugin-dir=name Directory for plugins - --plugin-load=name Optional semicolon-separated list of plugins to load, - where each plugin is identified as name=library, where - name is the plugin name and library is the plugin library - in plugin_dir. - --plugin-load-add=name - Optional semicolon-separated list of plugins to load, - where each plugin is identified as name=library, where - name is the plugin name and library is the plugin library - in plugin_dir. This option adds to the list speficied by - --plugin-load in an incremental way. Multiple - --plugin-load-add are supported. - -P, --port=# Port number to use for connection or 0 to default to, - my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default - (3306), whatever comes first - --port-open-timeout=# - Maximum time in seconds to wait for the port to become - free. (Default: No wait). - --preload-buffer-size=# - The size of the buffer that is allocated when preloading - indexes - --profiling-history-size=# - Limit of query profiling memory - --query-alloc-block-size=# - Allocation block size for query parsing and execution - --query-cache-limit=# - Don't cache results that are bigger than this - --query-cache-min-res-unit=# - The minimum size for blocks allocated by the query cache - --query-cache-size=# - The memory allocated to store results from old queries - --query-cache-type=name - OFF = Don't cache or retrieve results. ON = Cache all - results except SELECT SQL_NO_CACHE ... queries. DEMAND = - Cache only SELECT SQL_CACHE ... queries - --query-cache-wlock-invalidate - Invalidate queries in query cache on LOCK for write - --query-prealloc-size=# - Persistent buffer for query parsing and execution - --range-alloc-block-size=# - Allocation block size for storing ranges during - optimization - --read-buffer-size=# - Each thread that does a sequential scan allocates a - buffer of this size for each table it scans. If you do - many sequential scans, you may want to increase this - value - --read-only Make all non-temporary tables read-only, with the - exception for replication (slave) threads and users with - the SUPER privilege - --read-rnd-buffer-size=# - When reading rows in sorted order after a sort, the rows - are read through this buffer to avoid a disk seeks - --relay-log=name The location and name to use for relay logs - --relay-log-index=name - File that holds the names for relay log files. - --relay-log-info-file=name - The location and name of the file that remembers where - the SQL replication thread is in the relay logs - --relay-log-info-repository=name - Defines the type of the repository for the relay log - information and associated workers. - --relay-log-purge if disabled - do not purge relay logs. if enabled - purge - them as soon as they are no more needed - (Defaults to on; use --skip-relay-log-purge to disable.) - --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 - --relay-log-space-limit=# - Maximum space to use for all relay logs - --replicate-do-db=name - Tells the slave thread to restrict replication to the - specified database. To specify more than one database, - use the directive multiple times, once for each database. - Note that this will only work if you do not use - cross-database queries such as UPDATE some_db.some_table - SET foo='bar' while having selected a different or no - database. If you need cross database updates to work, - make sure you have 3.23.28 or later, and use - replicate-wild-do-table=db_name.%. - --replicate-do-table=name - Tells the slave thread to restrict replication to the - specified table. To specify more than one table, use the - directive multiple times, once for each table. This will - work for cross-database updates, in contrast to - replicate-do-db. - --replicate-ignore-db=name - Tells the slave thread to not replicate to the specified - database. To specify more than one database to ignore, - use the directive multiple times, once for each database. - This option will not work if you use cross database - updates. If you need cross database updates to work, make - sure you have 3.23.28 or later, and use - replicate-wild-ignore-table=db_name.%. - --replicate-ignore-table=name - Tells the slave thread to not replicate to the specified - table. To specify more than one table to ignore, use the - directive multiple times, once for each table. This will - work for cross-database updates, in contrast to - replicate-ignore-db. - --replicate-rewrite-db=name - Updates to a database with a different name than the - original. Example: - replicate-rewrite-db=master_db_name->slave_db_name. - --replicate-same-server-id - In replication, if set to 1, do not skip events having - our server id. Default value is 0 (to break infinite - loops in circular replication). Can't be set to 1 if - --log-slave-updates is used. - --replicate-wild-do-table=name - Tells the slave thread to restrict replication to the - tables that match the specified wildcard pattern. To - specify more than one table, use the directive multiple - times, once for each table. This will work for - cross-database updates. Example: - replicate-wild-do-table=foo%.bar% will replicate only - updates to tables in all databases that start with foo - and whose table names start with bar. - --replicate-wild-ignore-table=name - Tells the slave thread to not replicate to the tables - that match the given wildcard pattern. To specify more - than one table to ignore, use the directive multiple - times, once for each table. This will work for - cross-database updates. Example: - replicate-wild-ignore-table=foo%.bar% will not do updates - to tables in databases that start with foo and whose - table names start with bar. - --report-host=name Hostname or IP of the slave to be reported to the master - during slave registration. Will appear in the output of - SHOW SLAVE HOSTS. Leave unset if you do not want the - slave to register itself with the master. Note that it is - not sufficient for the master to simply read the IP of - the slave off the socket once the slave connects. Due to - NAT and other routing issues, that IP may not be valid - for connecting to the slave from the master or other - hosts - --report-password=name - The account password of the slave to be reported to the - master during slave registration - --report-port=# Port for connecting to slave reported to the master - during slave registration. Set it only if the slave is - listening on a non-default port or if you have a special - tunnel from the master or other clients to the slave. If - not sure, leave this option unset - --report-user=name The account user name of the slave to be reported to the - master during slave registration - --rpl-stop-slave-timeout=# - Timeout in seconds to wait for slave to stop before - returning a warning. - --safe-user-create Don't allow new user creation by the user who has no - write privileges to the mysql.user table. - --secure-auth Disallow authentication for accounts that have old - (pre-4.1) passwords - (Defaults to on; use --skip-secure-auth to disable.) - --secure-file-priv=name - Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to - files within specified directory - --server-id=# Uniquely identifies the server instance in the community - of replication partners - --server-id-bits=# Set number of significant bits in server-id - --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' table as a comment in - COLUMN_TYPE field. This variable is deprecated and will - be removed in a future release. - --show-slave-auth-info - Show user and password in SHOW SLAVE HOSTS on this - master. - --simplified-binlog-gtid-recovery - Alias for @@binlog_gtid_simple_recovery. Deprecated - --skip-grant-tables Start without grant tables. This gives all users FULL - ACCESS to all tables. - --skip-host-cache Don't cache host names. - --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or - 'localhost'. - --skip-networking Don't allow connection with TCP/IP - --skip-new Don't use new, possibly wrong routines. - --skip-show-database - Don't allow 'SHOW DATABASE' commands - --skip-slave-start If set, slave is not autostarted. - --skip-stack-trace Don't print a stack trace on failure. - --slave-allow-batching - Allow slave to batch requests - --slave-checkpoint-group=# - Maximum number of processed transactions by - Multi-threaded slave before a checkpoint operation is - called to update progress status. - --slave-checkpoint-period=# - Gather workers' activities to Update progress status of - Multi-threaded slave and flush the relay log info to disk - after every #th milli-seconds. - --slave-compressed-protocol - Use compression on master/slave protocol - --slave-exec-mode=name - Modes for how replication events should be executed. - Legal values are STRICT (default) and IDEMPOTENT. In - IDEMPOTENT mode, replication will not stop for operations - that are idempotent. In STRICT mode, replication will - stop on any unexpected difference between the master and - the slave - --slave-load-tmpdir=name - The location where the slave should put its temporary - files when replicating a LOAD DATA INFILE command - --slave-max-allowed-packet=# - The maximum packet length to sent successfully from the - master to slave. - --slave-net-timeout=# - Number of seconds to wait for more data from a - master/slave connection before aborting the read - --slave-parallel-workers=# - Number of worker threads for executing events in parallel - --slave-pending-jobs-size-max=# - Max size of Slave Worker queues holding yet not applied - events.The least possible value must be not less than the - master side max_allowed_packet. - --slave-rows-search-algorithms=name - Set of searching algorithms that the slave will use while - searching for records from the storage engine to either - updated or deleted them. Possible values are: INDEX_SCAN, - TABLE_SCAN and HASH_SCAN. Any combination is allowed, and - the slave will always pick the most suitable algorithm - for any given scenario. (Default: INDEX_SCAN, - TABLE_SCAN). - --slave-skip-errors=name - Tells the slave thread to continue replication when a - query event returns an error from the provided list - --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 receiving them from the - network before writing them to the relay log. Enabled by - default. - (Defaults to on; use --skip-slave-sql-verify-checksum to disable.) - --slave-transaction-retries=# - Number of times the slave SQL thread will retry a - transaction in case it failed with a deadlock or elapsed - lock wait timeout, before giving up and stopping - --slave-type-conversions=name - Set of slave type conversions that are enabled. Legal - values are: ALL_LOSSY to enable lossy conversions, - ALL_NON_LOSSY to enable non-lossy conversions, - ALL_UNSIGNED to treat all integer column type data to be - unsigned values, and ALL_SIGNED to treat all integer - column type data to be signed values. Default treatment - is ALL_SIGNED. If ALL_SIGNED and ALL_UNSIGNED both are - specifed, ALL_SIGNED will take high priority than - ALL_UNSIGNED. If the variable is assigned the empty set, - no conversions are allowed and it is expected that the - types match exactly. - --slow-launch-time=# - If creating the thread takes longer than this value (in - seconds), the Slow_launch_threads counter will be - incremented - --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 used. Must be enabled to activate - other slow log options - --slow-query-log-file=name - Log slow queries to given log file. Defaults logging to - hostname-slow.log. Must be enabled to activate other slow - log options - --socket=name Socket file to use for connection - --sort-buffer-size=# - Each thread that needs to do a sort allocates a buffer of - this size - --sporadic-binlog-dump-fail - Option used by mysql-test for debugging and testing of - replication. - --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual - for the complete list of valid sql modes - --stored-program-cache=# - The soft upper limit for number of cached stored routines - for one connection. - -s, --symbolic-links - Enable symbolic link support. - --sync-binlog=# Synchronously flush binary log to disk after every #th - write to the file. Use 0 (default) to disable synchronous - flushing - --sync-frm Sync .frm files to disk on creation - (Defaults to on; use --skip-sync-frm to disable.) - --sync-master-info=# - Synchronously flush master info to disk after every #th - event. Use 0 to disable synchronous flushing - --sync-relay-log=# Synchronously flush relay log to disk after every #th - event. Use 0 to disable synchronous flushing - --sync-relay-log-info=# - Synchronously flush relay log info to disk after every - #th transaction. Use 0 to disable synchronous flushing - --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it - safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' - value different for different invocations, even within - the same statement. - --table-definition-cache=# - The number of cached table definitions - --table-open-cache=# - The number of cached open tables (total for all table - cache instances) - --table-open-cache-instances=# - The number of table cache instances - --tc-heuristic-recover=name - Decision to use in heuristic recover process. Possible - values are COMMIT or ROLLBACK. - --thread-cache-size=# - How many threads we should keep in a cache for reuse - --thread-handling=name - Define threads usage for handling queries, one of - one-thread-per-connection, no-threads, loaded-dynamically - --thread-stack=# The stack size for each thread - --time-format=name The TIME format (ignored) - --timed-mutexes Specify whether to time mutexes. Deprecated, has no - effect. - --tmp-table-size=# If an internal in-memory temporary table exceeds this - size, MySQL will automatically convert it to an on-disk - MyISAM table - -t, --tmpdir=name Path for temporary files. Several paths may be specified, - separated by a colon (:), in this case they are used in a - round-robin fashion - --transaction-alloc-block-size=# - Allocation block size for transactions to be stored in - binary log - --transaction-isolation=name - Default transaction isolation level. - --transaction-prealloc-size=# - Persistent buffer for transactions to be stored in binary - log - --transaction-read-only - Default transaction access mode. True if transactions are - read-only. - --updatable-views-with-limit=name - YES = Don't issue an error message (warning only) if a - VIEW without presence of a key of the underlying table is - used in queries with a LIMIT clause for updating. NO = - Prohibit update of a VIEW, which does not contain a key - of the underlying table and the query uses a LIMIT clause - (usually get from GUI tools) - -u, --user=name Run mysqld daemon as user. - --validate-user-plugins - Turns on additional validation of authentication plugins - assigned to user accounts. - (Defaults to on; use --skip-validate-user-plugins to disable.) - -v, --verbose Used with --help option for detailed help. - -V, --version Output version information and exit. - --wait-timeout=# The number of seconds the server waits for activity on a - connection before closing it - --wsrep-OSU-method[=name] - Method for Online Schema Upgrade - --wsrep-SR-store=name - Storage for streaming replication fragments - --wsrep-auto-increment-control - To automatically control the assignment of autoincrement - variables - (Defaults to on; use --skip-wsrep-auto-increment-control to disable.) - --wsrep-causal-reads - (DEPRECATED) setting this variable is equivalent to - setting wsrep_sync_wait READ flag - --wsrep-certify-nonPK - Certify tables with no primary key - (Defaults to on; use --skip-wsrep-certify-nonPK to disable.) - --wsrep-cluster-address=name - Address to initially connect to cluster - --wsrep-cluster-name=name - Name for the cluster - --wsrep-convert-LOCK-to-trx - To convert locking sessions into transactions - --wsrep-data-home-dir=name - home directory for wsrep provider - --wsrep-dbug-option=name - DBUG options to provider library - --wsrep-debug To enable debug level logging - --wsrep-desync To desynchronize the node from the cluster - --wsrep-dirty-reads Allow reads from a node is not in primary component - --wsrep-drupal-282555-workaround - To use a workaround forbad autoincrement value - --wsrep-forced-binlog-format=name - binlog format to take effect over user's choice - --wsrep-ignore-apply-errors=# - Ignore replication errors - --wsrep-load-data-splitting - To commit LOAD DATA transaction after every 10K rows - inserted (deprecating) - (Defaults to on; use --skip-wsrep-load-data-splitting to disable.) - --wsrep-log-conflicts - To log multi-master conflicts - --wsrep-max-ws-rows=# - Max number of rows in write set - --wsrep-max-ws-size=# - Max write set size (bytes) - --wsrep-mysql-replication-bundle=# - mysql replication group commit - --wsrep-node-address=name - Node address - --wsrep-node-incoming-address=name - Client connection address - --wsrep-node-name=name - Node name - --wsrep-notify-cmd=name - --wsrep-on To enable wsrep replication - (Defaults to on; use --skip-wsrep-on to disable.) - --wsrep-preordered To enable preordered write set processing - --wsrep-provider=name - Path to replication provider library - --wsrep-provider-options=name - provider specific options - --wsrep-recover Recover database state after crash and exit - --wsrep-reject-queries[=name] - Variable to set to reject queries - --wsrep-replicate-myisam - To enable myisam replication - --wsrep-restart-slave - Should MySQL slave be restarted automatically, when node - joins back to cluster - --wsrep-retry-autocommit=# - Max number of times to retry a failed autocommit - statement - --wsrep-slave-FK-checks - Should slave thread do foreign key constraint checks - (Defaults to on; use --skip-wsrep-slave-FK-checks to disable.) - --wsrep-slave-UK-checks - Should slave thread do secondary index uniqueness checks - --wsrep-slave-threads=# - Number of slave appliers to launch - --wsrep-sst-auth=name - Authentication for SST connection - --wsrep-sst-donor=name - preferred donor node for the SST - --wsrep-sst-donor-rejects-queries - Reject client queries when donating state snapshot - transfer - --wsrep-sst-method=name - State snapshot transfer method - --wsrep-sst-receive-address=name - Address where node is waiting for SST contact - --wsrep-start-position=name - global transaction position to start from - --wsrep-sync-wait[=#] - Ensure "synchronous" read view before executing an - operation of the type specified by bitmask: 1 - - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); - 2 - UPDATE and DELETE; 4 - INSERT and REPLACE - --wsrep-trx-fragment-size=# - Size of transaction fragments for streaming replication - (measured in units of 'wsrep_trx_fragment_unit') - --wsrep-trx-fragment-unit=name - Unit for streaming replication transaction fragments' - size: bytes, events, rows, statements - -Variables (--variable-name=value) -abort-slave-event-count 0 -allow-suspicious-udfs FALSE -auto-increment-increment 1 -auto-increment-offset 1 -autocommit TRUE -automatic-sp-privileges TRUE -avoid-temporal-upgrade FALSE -back-log 80 -big-tables FALSE -bind-address * -binlog-cache-size 32768 -binlog-checksum CRC32 -binlog-direct-non-transactional-updates FALSE -binlog-error-action IGNORE_ERROR -binlog-format STATEMENT -binlog-gtid-simple-recovery FALSE -binlog-max-flush-queue-time 0 -binlog-order-commits TRUE -binlog-row-event-max-size 8192 -binlog-row-image FULL -binlog-rows-query-log-events FALSE -binlog-stmt-cache-size 32768 -binlogging-impossible-mode IGNORE_ERROR -block-encryption-mode aes-128-ecb -bulk-insert-buffer-size 8388608 -character-set-client-handshake TRUE -character-set-filesystem binary -character-set-server latin1 -character-sets-dir MYSQL_CHARSETSDIR/ -chroot (No default value) -collation-server latin1_swedish_ci -completion-type NO_CHAIN -concurrent-insert AUTO -connect-timeout 10 -console FALSE -date-format %Y-%m-%d -datetime-format %Y-%m-%d %H:%i:%s -default-storage-engine InnoDB -default-time-zone (No default value) -default-tmp-storage-engine InnoDB -default-week-format 0 -delay-key-write ON -delayed-insert-limit 100 -delayed-insert-timeout 300 -delayed-queue-size 1000 -disconnect-on-expired-password TRUE -disconnect-slave-event-count 0 -div-precision-increment 4 -end-markers-in-json FALSE -enforce-gtid-consistency FALSE -eq-range-index-dive-limit 10 -event-scheduler OFF -expire-logs-days 0 -explicit-defaults-for-timestamp FALSE -external-locking FALSE -flush FALSE -flush-time 0 -ft-boolean-syntax + -><()~*:""&| -ft-max-word-len 84 -ft-min-word-len 4 -ft-query-expansion-limit 20 -ft-stopword-file (No default value) -gdb FALSE -general-log FALSE -group-concat-max-len 1024 -gtid-mode OFF -help TRUE -host-cache-size 279 -ignore-builtin-innodb FALSE -init-connect -init-file (No default value) -init-slave -interactive-timeout 28800 -join-buffer-size 262144 -keep-files-on-create FALSE -key-buffer-size 8388608 -key-cache-age-threshold 300 -key-cache-block-size 1024 -key-cache-division-limit 100 -language MYSQL_SHAREDIR/ -large-pages FALSE -lc-messages en_US -lc-messages-dir MYSQL_SHAREDIR/ -lc-time-names en_US -local-infile TRUE -lock-wait-timeout 31536000 -log-bin (No default value) -log-bin-index (No default value) -log-bin-trust-function-creators FALSE -log-bin-use-v1-row-events FALSE -log-error -log-isam myisam.log -log-output FILE -log-queries-not-using-indexes FALSE -log-raw FALSE -log-short-format FALSE -log-slave-updates FALSE -log-slow-admin-statements FALSE -log-slow-slave-statements FALSE -log-tc tc.log -log-tc-size 24576 -log-throttle-queries-not-using-indexes 0 -log-warnings 1 -long-query-time 10 -low-priority-updates FALSE -lower-case-table-names 1 -master-info-file master.info -master-info-repository FILE -master-retry-count 86400 -master-verify-checksum FALSE -max-allowed-packet 4194304 -max-binlog-cache-size 18446744073709547520 -max-binlog-dump-events 0 -max-binlog-size 1073741824 -max-binlog-stmt-cache-size 18446744073709547520 -max-connect-errors 100 -max-connections 151 -max-delayed-threads 20 -max-digest-length 1024 -max-error-count 64 -max-heap-table-size 16777216 -max-join-size 18446744073709551615 -max-length-for-sort-data 1024 -max-prepared-stmt-count 16382 -max-relay-log-size 0 -max-seeks-for-key 18446744073709551615 -max-sort-length 1024 -max-sp-recursion-depth 0 -max-tmp-tables 32 -max-user-connections 0 -max-write-lock-count 18446744073709551615 -memlock FALSE -metadata-locks-cache-size 1024 -metadata-locks-hash-instances 8 -min-examined-row-limit 0 -multi-range-count 256 -myisam-block-size 1024 -myisam-data-pointer-size 6 -myisam-max-sort-file-size 9223372036853727232 -myisam-mmap-size 18446744073709551615 -myisam-recover-options OFF -myisam-repair-threads 1 -myisam-sort-buffer-size 8388608 -myisam-stats-method nulls_unequal -myisam-use-mmap FALSE -net-buffer-length 16384 -net-read-timeout 30 -net-retry-count 10 -net-write-timeout 60 -new FALSE -old FALSE -old-alter-table FALSE -old-passwords 0 -old-style-user-limits FALSE -optimizer-prune-level 1 -optimizer-search-depth 62 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on -optimizer-trace -optimizer-trace-features greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on -optimizer-trace-limit 1 -optimizer-trace-max-mem-size 16384 -optimizer-trace-offset -1 -performance-schema TRUE -performance-schema-accounts-size -1 -performance-schema-consumer-events-stages-current FALSE -performance-schema-consumer-events-stages-history FALSE -performance-schema-consumer-events-stages-history-long FALSE -performance-schema-consumer-events-statements-current TRUE -performance-schema-consumer-events-statements-history FALSE -performance-schema-consumer-events-statements-history-long FALSE -performance-schema-consumer-events-waits-current FALSE -performance-schema-consumer-events-waits-history FALSE -performance-schema-consumer-events-waits-history-long FALSE -performance-schema-consumer-global-instrumentation TRUE -performance-schema-consumer-statements-digest TRUE -performance-schema-consumer-thread-instrumentation TRUE -performance-schema-digests-size -1 -performance-schema-events-stages-history-long-size -1 -performance-schema-events-stages-history-size -1 -performance-schema-events-statements-history-long-size -1 -performance-schema-events-statements-history-size -1 -performance-schema-events-waits-history-long-size -1 -performance-schema-events-waits-history-size -1 -performance-schema-hosts-size -1 -performance-schema-instrument -performance-schema-max-cond-classes 80 -performance-schema-max-cond-instances -1 -performance-schema-max-digest-length 1024 -performance-schema-max-file-classes 50 -performance-schema-max-file-handles 32768 -performance-schema-max-file-instances -1 -performance-schema-max-mutex-classes 200 -performance-schema-max-mutex-instances -1 -performance-schema-max-rwlock-classes 40 -performance-schema-max-rwlock-instances -1 -performance-schema-max-socket-classes 10 -performance-schema-max-socket-instances -1 -performance-schema-max-stage-classes 150 -performance-schema-max-statement-classes 168 -performance-schema-max-table-handles -1 -performance-schema-max-table-instances -1 -performance-schema-max-thread-classes 50 -performance-schema-max-thread-instances -1 -performance-schema-session-connect-attrs-size -1 -performance-schema-setup-actors-size 100 -performance-schema-setup-objects-size 100 -performance-schema-users-size -1 -port #### -port-open-timeout 0 -preload-buffer-size 32768 -profiling-history-size 15 -query-alloc-block-size 8192 -query-cache-limit 1048576 -query-cache-min-res-unit 4096 -query-cache-size 1048576 -query-cache-type OFF -query-cache-wlock-invalidate FALSE -query-prealloc-size 8192 -range-alloc-block-size 4096 -read-buffer-size 131072 -read-only FALSE -read-rnd-buffer-size 262144 -relay-log (No default value) -relay-log-index (No default value) -relay-log-info-file relay-log.info -relay-log-info-repository FILE -relay-log-purge TRUE -relay-log-recovery FALSE -relay-log-space-limit 0 -replicate-same-server-id FALSE -report-host (No default value) -report-password (No default value) -report-port 0 -report-user (No default value) -rpl-stop-slave-timeout 31536000 -safe-user-create FALSE -secure-auth TRUE -server-id 0 -server-id-bits 32 -show-old-temporals FALSE -show-slave-auth-info FALSE -simplified-binlog-gtid-recovery FALSE -skip-grant-tables TRUE -skip-name-resolve FALSE -skip-networking FALSE -skip-show-database FALSE -skip-slave-start FALSE -slave-allow-batching FALSE -slave-checkpoint-group 512 -slave-checkpoint-period 300 -slave-compressed-protocol FALSE -slave-exec-mode STRICT -slave-max-allowed-packet 1073741824 -slave-net-timeout 3600 -slave-parallel-workers 0 -slave-pending-jobs-size-max 16777216 -slave-rows-search-algorithms TABLE_SCAN,INDEX_SCAN -slave-skip-errors (No default value) -slave-sql-verify-checksum TRUE -slave-transaction-retries 10 -slave-type-conversions -slow-launch-time 2 -slow-query-log FALSE -sort-buffer-size 262144 -sporadic-binlog-dump-fail FALSE -sql-mode NO_ENGINE_SUBSTITUTION -stored-program-cache 256 -symbolic-links FALSE -sync-binlog 0 -sync-frm TRUE -sync-master-info 10000 -sync-relay-log 10000 -sync-relay-log-info 10000 -sysdate-is-now FALSE -table-open-cache-instances 1 -tc-heuristic-recover COMMIT -thread-cache-size 9 -thread-handling one-thread-per-connection -thread-stack 262144 -time-format %H:%i:%s -timed-mutexes FALSE -tmp-table-size 16777216 -transaction-alloc-block-size 8192 -transaction-isolation REPEATABLE-READ -transaction-prealloc-size 4096 -transaction-read-only FALSE -updatable-views-with-limit YES -validate-user-plugins TRUE -verbose TRUE -wait-timeout 28800 -wsrep-OSU-method TOI -wsrep-SR-store table -wsrep-auto-increment-control TRUE -wsrep-causal-reads FALSE -wsrep-certify-nonPK TRUE -wsrep-cluster-address -wsrep-cluster-name my_wsrep_cluster -wsrep-convert-LOCK-to-trx FALSE -wsrep-data-home-dir -wsrep-dbug-option -wsrep-debug FALSE -wsrep-desync FALSE -wsrep-dirty-reads FALSE -wsrep-drupal-282555-workaround FALSE -wsrep-forced-binlog-format NONE -wsrep-ignore-apply-errors 7 -wsrep-load-data-splitting TRUE -wsrep-log-conflicts FALSE -wsrep-max-ws-rows 0 -wsrep-max-ws-size 2147483647 -wsrep-mysql-replication-bundle 0 -wsrep-node-address -wsrep-node-incoming-address AUTO -wsrep-notify-cmd -wsrep-on FALSE -wsrep-preordered FALSE -wsrep-provider none -wsrep-provider-options -wsrep-recover FALSE -wsrep-reject-queries NONE -wsrep-replicate-myisam FALSE -wsrep-restart-slave FALSE -wsrep-retry-autocommit 1 -wsrep-slave-FK-checks TRUE -wsrep-slave-UK-checks FALSE -wsrep-slave-threads 1 -wsrep-sst-auth (No default value) -wsrep-sst-donor -wsrep-sst-donor-rejects-queries FALSE -wsrep-sst-method rsync -wsrep-sst-receive-address AUTO -wsrep-start-position 00000000-0000-0000-0000-000000000000:-1 -wsrep-sync-wait 0 -wsrep-trx-fragment-size 0 -wsrep-trx-fragment-unit bytes - -To see what values a running MySQL server is using, type -'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-test/r/query_cache_size_functionality.result b/mysql-test/r/query_cache_size_functionality.result deleted file mode 100644 index 7563b3e61eb8b..0000000000000 --- a/mysql-test/r/query_cache_size_functionality.result +++ /dev/null @@ -1,226 +0,0 @@ -'#________________________VAR_02_query_cache_size__________________#' -echo '##' ---echo '#---------------------WL6372_VAR_2_01----------------------#' -#################################################################### -# Checking default value # -#################################################################### -SELECT COUNT(@@GLOBAL.query_cache_size) -1 Expected -SELECT @@GLOBAL.query_cache_size; -@@GLOBAL.query_cache_size -1048576 -1048576 Expected -'#---------------------WL6372_VAR_2_02----------------------#' -# Restart server with query_cache_size 51200; -SELECT @@GLOBAL.query_cache_size; -@@GLOBAL.query_cache_size -51200 -51200 Expected -SET @@GLOBAL.query_cache_size=DEFAULT; -SELECT @@GLOBAL.query_cache_size; -@@GLOBAL.query_cache_size -1048576 -1048576 Expected -'#---------------------WL6372_VAR_2_03----------------------#' -SET @@local.query_cache_size=1; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -Expected error 'Global variable' -SET @@session.query_cache_size=1; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -Expected error 'Global variable' -SET @@GLOBAL.query_cache_size=1; -SET @@GLOBAL.query_cache_size=DEFAULT; -SELECT @@GLOBAL.query_cache_size; -@@GLOBAL.query_cache_size -1048576 -1048576 Expected -'#---------------------WL6372_VAR_2_04----------------------#' -SELECT @@GLOBAL.query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -@@GLOBAL.query_cache_size = VARIABLE_VALUE -1 -1 Expected -SELECT COUNT(@@GLOBAL.query_cache_size); -COUNT(@@GLOBAL.query_cache_size) -1 -1 Expected -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -COUNT(VARIABLE_VALUE) -1 -1 Expected -'#---------------------WL6372_VAR_2_05----------------------#' -SELECT @@query_cache_size = @@GLOBAL.query_cache_size; -@@query_cache_size = @@GLOBAL.query_cache_size -1 -1 Expected -SELECT COUNT(@@local.query_cache_size); -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable -Expected error 'Variable is a GLOBAL variable' -SELECT COUNT(@@SESSION.query_cache_size); -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable -Expected error 'Variable is a GLOBAL variable' -SELECT COUNT(@@GLOBAL.query_cache_size); -COUNT(@@GLOBAL.query_cache_size) -1 -1 Expected -SELECT query_cache_size = @@SESSION.query_cache_size; -ERROR 42S22: Unknown column 'query_cache_size' in 'field list' -Expected error 'Unknown column query_cache_size in field list' -'#---------------------WL6372_VAR_2_06----------------------#' -Check the size of the vardir -The output size is in unit blocks -TRUE -TRUE Expected -'#---------------------WL6372_VAR_2_07----------------------#' -# create 1 table and insert 3 rows each -DROP TABLE IF EXISTS tab1; -=============== -create table & Index -=============== -CREATE TABLE tab1 (col_1 text(10)) -ENGINE=INNODB ; -=============== -Load the data -=============== -SET @col_1 = repeat('a', 10); -INSERT INTO tab1 -VALUES (@col_1); -INSERT INTO tab1 -VALUES (@col_1); -INSERT INTO tab1 -VALUES (@col_1); -commit; -set @@GLOBAL.query_cache_size=DEFAULT; -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -19 -17 Expected -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -24 -22 Expected -select 1 from tab1 limit 2; -1 -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -29 -27 Expected -# Restart server with query_cache_type ON -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -10 -8 Expected -select 1 from tab1 limit 2; -1 -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -14 -12 Expected -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -18 -16 Expected -# opening another client session -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -19 -17 Expected -#cleanup -DROP TABLE IF EXISTS tab1; diff --git a/mysql-test/r/query_cache_type_functionality.result b/mysql-test/r/query_cache_type_functionality.result deleted file mode 100644 index 134d8c3a066a6..0000000000000 --- a/mysql-test/r/query_cache_type_functionality.result +++ /dev/null @@ -1,250 +0,0 @@ -'#________________________VAR_03_query_cache_type__________________#' -echo '##' ---echo '#---------------------WL6372_VAR_3_01----------------------#' -#################################################################### -# Checking default value # -#################################################################### -SELECT COUNT(@@GLOBAL.query_cache_type) -1 Expected -SELECT @@GLOBAL.query_cache_type; -@@GLOBAL.query_cache_type -OFF -OFF Expected -'#---------------------WL6372_VAR_3_02----------------------#' -# Restart server with query_cache_type 1; -SELECT @@GLOBAL.query_cache_type; -@@GLOBAL.query_cache_type -ON -ON Expected -SET @@GLOBAL.query_cache_type=DEFAULT; -SELECT @@GLOBAL.query_cache_type; -@@GLOBAL.query_cache_type -OFF -OFF Expected -'#---------------------WL6372_VAR_3_03----------------------#' -SET @@local.query_cache_type=1; -SELECT @@Local.query_cache_type; -@@Local.query_cache_type -ON -ON Expected -SET @@session.query_cache_type=1; -SELECT @@Session.query_cache_type; -@@Session.query_cache_type -ON -ON Expected -SET @@GLOBAL.query_cache_type=1; -SELECT @@GLOBAL.query_cache_type; -@@GLOBAL.query_cache_type -ON -ON Expected -SET @@GLOBAL.query_cache_type=DEFAULT; -SELECT @@GLOBAL.query_cache_type; -@@GLOBAL.query_cache_type -OFF -OFF Expected -SET @@Session.query_cache_type=DEFAULT; -SELECT @@Session.query_cache_type; -@@Session.query_cache_type -OFF -OFF Expected -SET @@Local.query_cache_type=DEFAULT; -SELECT @@Local.query_cache_type; -@@Local.query_cache_type -OFF -OFF Expected -'#---------------------WL6372_VAR_3_04----------------------#' -SELECT @@GLOBAL.query_cache_type = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_type'; -@@GLOBAL.query_cache_type = VARIABLE_VALUE -1 -1 Expected -SELECT COUNT(@@GLOBAL.query_cache_type); -COUNT(@@GLOBAL.query_cache_type) -1 -1 Expected -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_type'; -COUNT(VARIABLE_VALUE) -1 -1 Expected -'#---------------------WL6372_VAR_3_05----------------------#' -SELECT @@query_cache_type = @@GLOBAL.query_cache_type; -@@query_cache_type = @@GLOBAL.query_cache_type -1 -1 Expected -SELECT @@query_cache_type = @@Session.query_cache_type; -@@query_cache_type = @@Session.query_cache_type -1 -1 Expected -SELECT COUNT(@@local.query_cache_type); -COUNT(@@local.query_cache_type) -1 -1 Expected -SELECT COUNT(@@SESSION.query_cache_type); -COUNT(@@SESSION.query_cache_type) -1 -1 Expected -SELECT COUNT(@@GLOBAL.query_cache_type); -COUNT(@@GLOBAL.query_cache_type) -1 -1 Expected -SELECT query_cache_type = @@SESSION.query_cache_type; -ERROR 42S22: Unknown column 'query_cache_type' in 'field list' -Expected error 'Unknown column query_cache_type in field list' -'#---------------------WL6372_VAR_3_06----------------------#' -Check the size of the vardir -The output size is in unit blocks -TRUE -TRUE Expected -'#---------------------WL6372_VAR_3_07----------------------#' -# create 1 table and insert 3 rows each -DROP TABLE IF EXISTS tab1; -=============== -create table & Index -=============== -CREATE TABLE tab1 (col_1 text(10)) -ENGINE=INNODB ; -=============== -Load the data -=============== -SET @col_1 = repeat('a', 10); -INSERT INTO tab1 -VALUES (@col_1); -INSERT INTO tab1 -VALUES (@col_1); -INSERT INTO tab1 -VALUES (@col_1); -commit; -set @@GLOBAL.query_cache_type=DEFAULT; -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -27 -25 Expected -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -32 -30 Expected -select 1 from tab1 limit 2; -1 -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -37 -35 Expected -# Restart server with query_cache_type ON -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -10 -8 Expected -select 1 from tab1 limit 2; -1 -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -0 -0 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -14 -12 Expected -select 1 from tab1 limit 1; -1 -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; -variable_value -1 -1 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; -variable_value -2 -2 Expected -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -18 -16 Expected -# opening another client session -select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; -variable_value -19 -17 Expected -#cleanup -DROP TABLE IF EXISTS tab1; diff --git a/sql/handler.cc b/sql/handler.cc index 1641ce6216db7..7519a0fa8e316 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1628,7 +1628,7 @@ int ha_commit_trans(THD *thd, bool all) goto end; } - done: +done: DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE();); mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); @@ -1643,7 +1643,7 @@ int ha_commit_trans(THD *thd, bool all) /* Come here if error and we need to rollback. */ #ifdef WITH_WSREP - wsrep_err: +wsrep_err: mysql_mutex_lock(&thd->LOCK_thd_data); if (thd->wsrep_trx().state() == wsrep::transaction::s_must_abort) { @@ -1669,7 +1669,7 @@ int ha_commit_trans(THD *thd, bool all) WSREP_DEBUG("rollback skipped %p %d",thd->rgi_slave, thd->rgi_slave->is_parallel_exec); } -end: + end: if (rw_trans && mdl_request.ticket) { /* @@ -6249,16 +6249,6 @@ static int binlog_log_row_internal(TABLE* table, bool error= 0; THD *const thd= table->in_use; -#ifdef WITH_WSREP - /* only InnoDB tables will be replicated through binlog emulation */ - if (WSREP_EMULATE_BINLOG(thd) && - table->file->ht->db_type != DB_TYPE_INNODB && - !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && - (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB))) - { - return 0; - } -#endif /* WITH_WSREP */ /* If there are no table maps written to the binary log, this is the first row handled in this statement. In that case, we need @@ -6289,9 +6279,11 @@ int binlog_log_row(TABLE* table, const uchar *before_record, THD *const thd= table->in_use; /* only InnoDB tables will be replicated through binlog emulation */ - if ((WSREP_EMULATE_BINLOG(thd) && - table->file->partition_ht()->db_type != DB_TYPE_INNODB) || - (thd->wsrep_ignore_table == true)) + if (WSREP_EMULATE_BINLOG(thd) && + table->file->ht->db_type != DB_TYPE_INNODB && + !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && + (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB)) || + (thd->wsrep_ignore_table == true)) return 0; #endif diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index f35ccb2081ed6..6fcb8f87b57da 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1806,7 +1806,8 @@ class Item_temptable_rowid :public Item_str_func }; #ifdef WITH_WSREP -#include "../wsrep/wsrep_api.h" +//#include "../wsrep/wsrep_api.h" +#include "wsrep_api.h" class Item_func_wsrep_last_written_gtid: public Item_str_ascii_func { diff --git a/sql/mdl.cc b/sql/mdl.cc index 73dbb007f3a54..7488af9871387 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -1133,7 +1133,7 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout, thd_wait_begin(NULL, THD_WAIT_META_DATA_LOCK); while (!m_wait_status && !owner->is_killed() && wait_result != ETIMEDOUT && wait_result != ETIME) - { + { #ifdef WITH_WSREP // Allow tests to block the applier thread using the DBUG facilities DBUG_EXECUTE_IF("sync.wsrep_before_mdl_wait", diff --git a/sql/wsrep_applier.h b/sql/wsrep_applier.h index 875c025785b90..a8da2acbb9a3a 100644 --- a/sql/wsrep_applier.h +++ b/sql/wsrep_applier.h @@ -17,7 +17,6 @@ #define WSREP_APPLIER_H #include -#include "../wsrep/wsrep_api.h" #include "sql_class.h" // THD class diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index 89c1a4bfbfc12..07f4ab60dffd6 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -62,7 +62,7 @@ class Wsrep_non_trans_mode }; } -static rpl_group_info* wsrep_relay_group_init(const char* log_fname) +static rpl_group_info* wsrep_relay_group_init(THD* thd, const char* log_fname) { Relay_log_info* rli= new Relay_log_info(false); @@ -94,7 +94,7 @@ static rpl_group_info* wsrep_relay_group_init(const char* log_fname) rli->mi= new Master_info(&connection_name, false); struct rpl_group_info *rgi= new rpl_group_info(rli); - rgi->thd= rli->sql_driver_thd= current_thd; + rgi->thd= rli->sql_driver_thd= thd; if ((rgi->deferred_events_collecting= rli->mi->rpl_filter->is_on())) { @@ -161,7 +161,7 @@ Wsrep_high_priority_service::Wsrep_high_priority_service(THD* thd) /* Make THD wsrep_applier so that it cannot be killed */ thd->wsrep_applier= true; - if (!thd->wsrep_rgi) thd->wsrep_rgi= wsrep_relay_group_init("wsrep_relay"); + if (!thd->wsrep_rgi) thd->wsrep_rgi= wsrep_relay_group_init(thd, "wsrep_relay"); m_rgi= thd->wsrep_rgi; m_rgi->thd= thd; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index b2c419260dcf9..5e59bf89d8551 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -947,11 +947,8 @@ void wsrep_shutdown_replication() wsrep_wait_appliers_close(NULL); node_uuid= WSREP_UUID_UNDEFINED; - if (current_thd) - { - /* Undocking the thread specific data. */ - my_pthread_setspecific_ptr(THR_THD, NULL); - } + /* Undocking the thread specific data. */ + my_pthread_setspecific_ptr(THR_THD, NULL); } bool wsrep_start_replication() diff --git a/sql/wsrep_priv.h b/sql/wsrep_priv.h index b20e6e41640b1..68773d279481d 100644 --- a/sql/wsrep_priv.h +++ b/sql/wsrep_priv.h @@ -22,7 +22,6 @@ #include #include "wsrep_mysqld.h" #include "wsrep_schema.h" -#include "../wsrep/wsrep_api.h" #include #include diff --git a/sql/wsrep_schema.h b/sql/wsrep_schema.h index 45bdd71436433..feaceec0e7997 100644 --- a/sql/wsrep_schema.h +++ b/sql/wsrep_schema.h @@ -23,7 +23,6 @@ #include "mysqld.h" #include "thr_lock.h" /* enum thr_lock_type */ -#include "../wsrep/wsrep_api.h" #include "wsrep_mysqld.h" #include diff --git a/sql/wsrep_server_service.cc b/sql/wsrep_server_service.cc index dfa7071d0d12f..982e2a1401c74 100644 --- a/sql/wsrep_server_service.cc +++ b/sql/wsrep_server_service.cc @@ -14,7 +14,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "my_global.h" -//#include "mysql/service_wsrep.h" #include "wsrep_server_service.h" #include "wsrep_server_state.h" #include "wsrep_client_state.h" @@ -30,14 +29,12 @@ #include "log.h" /* sql_print_xxx() */ #include "sql_class.h" /* system variables */ -//#include "global_threads.h" /* LOCK_thread_count */ #include "transaction.h" /* trans_xxx */ #include "sql_base.h" /* close_thread_tables */ static void init_service_thd(THD* thd, char* thread_stack) { thd->thread_stack= thread_stack; - //thd->thread_id= 0; thd->real_id= pthread_self(); thd->prior_thr_create_utime= thd->start_utime= microsecond_interval_timer(); thd->set_command(COM_SLEEP); diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index c399fe6a23d4d..04623982459a2 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -53,60 +53,17 @@ int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff, return 0; } -static rpl_group_info* wsrep_relay_group_init(const char* log_fname) -{ - Relay_log_info* rli= new Relay_log_info(false); - - if (!rli->relay_log.description_event_for_exec) - { - rli->relay_log.description_event_for_exec= - new Format_description_log_event(4); - } - - static LEX_CSTRING connection_name= { STRING_WITH_LEN("wsrep") }; - - /* - Master_info's constructor initializes rpl_filter by either an already - constructed Rpl_filter object from global 'rpl_filters' list if the - specified connection name is same, or it constructs a new Rpl_filter - object and adds it to rpl_filters. This object is later destructed by - Mater_info's destructor by looking it up based on connection name in - rpl_filters list. - - However, since all Master_info objects created here would share same - connection name ("wsrep"), destruction of any of the existing Master_info - objects (in wsrep_return_from_bf_mode()) would free rpl_filter referenced - by any/all existing Master_info objects. - - In order to avoid that, we have added a check in Master_info's destructor - to not free the "wsrep" rpl_filter. It will eventually be freed by - free_all_rpl_filters() when server terminates. - */ - rli->mi= new Master_info(&connection_name, false); - - struct rpl_group_info *rgi= new rpl_group_info(rli); - rgi->thd= rli->sql_driver_thd= current_thd; - - if ((rgi->deferred_events_collecting= rli->mi->rpl_filter->is_on())) - { - rgi->deferred_events= new Deferred_log_events(rli); - } - - return rgi; -} - static void wsrep_replication_process(THD *thd, void* arg __attribute__((unused))) { DBUG_ENTER("wsrep_replication_process"); - if (!thd->wsrep_rgi) thd->wsrep_rgi= wsrep_relay_group_init("wsrep_relay"); + + Wsrep_applier_service applier_service(thd); /* thd->system_thread_info.rpl_sql_info isn't initialized. */ thd->system_thread_info.rpl_sql_info= new rpl_sql_thread_info(thd->wsrep_rgi->rli->mi->rpl_filter); - Wsrep_applier_service applier_service(thd); - WSREP_INFO("Starting applier thread %llu", thd->thread_id); enum wsrep::provider::status ret= Wsrep_server_state::get_provider().run_applier(&applier_service); diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h deleted file mode 100644 index ecbf08fbc3441..0000000000000 --- a/wsrep/wsrep_api.h +++ /dev/null @@ -1,1278 +0,0 @@ -/* Copyright (C) 2009-2013 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/*! - @file wsrep API declaration. - - HOW TO READ THIS FILE. - - Due to C language rules this header layout doesn't lend itself to intuitive - reading. So here's the scoop: in the end this header declares two main types: - - * struct wsrep_init_args - - and - - * struct wsrep - - wsrep_init_args contains initialization parameters for wsrep provider like - names, addresses, etc. and pointers to callbacks. The callbacks will be called - by provider when it needs to do something application-specific, like log a - message or apply a writeset. It should be passed to init() call from - wsrep API. It is an application part of wsrep API contract. - - struct wsrep is the interface to wsrep provider. It contains all wsrep API - calls. It is a provider part of wsrep API contract. - - Finally, wsrep_load() method loads (dlopens) wsrep provider library. It is - defined in wsrep_loader.c unit and is part of libwsrep.a (which is not a - wsrep provider, but a convenience library). - - wsrep_unload() does the reverse. - -*/ -#ifndef WSREP_H -#define WSREP_H - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************** - * * - * wsrep replication API * - * * - **************************************************************************/ - -#define WSREP_INTERFACE_VERSION "26" - -/*! Empty backend spec */ -#define WSREP_NONE "none" - - -/*! - * @brief log severity levels, passed as first argument to log handler - */ -typedef enum wsrep_log_level -{ - WSREP_LOG_FATAL, //!< Unrecoverable error, application must quit. - WSREP_LOG_ERROR, //!< Operation failed, must be repeated. - WSREP_LOG_WARN, //!< Unexpected condition, but no operational failure. - WSREP_LOG_INFO, //!< Informational message. - WSREP_LOG_DEBUG //!< Debug message. Shows only of compiled with debug. -} wsrep_log_level_t; - -/*! - * @brief error log handler - * - * All messages from wsrep provider are directed to this - * handler, if present. - * - * @param level log level - * @param message log message - */ -typedef void (*wsrep_log_cb_t)(wsrep_log_level_t, const char *); - - -/*! - * Certain provider capabilities application may want to know about - */ -#define WSREP_CAP_MULTI_MASTER ( 1ULL << 0 ) -#define WSREP_CAP_CERTIFICATION ( 1ULL << 1 ) -#define WSREP_CAP_PARALLEL_APPLYING ( 1ULL << 2 ) -#define WSREP_CAP_TRX_REPLAY ( 1ULL << 3 ) -#define WSREP_CAP_ISOLATION ( 1ULL << 4 ) -#define WSREP_CAP_PAUSE ( 1ULL << 5 ) -#define WSREP_CAP_CAUSAL_READS ( 1ULL << 6 ) -#define WSREP_CAP_CAUSAL_TRX ( 1ULL << 7 ) -#define WSREP_CAP_INCREMENTAL_WRITESET ( 1ULL << 8 ) -#define WSREP_CAP_SESSION_LOCKS ( 1ULL << 9 ) -#define WSREP_CAP_DISTRIBUTED_LOCKS ( 1ULL << 10 ) -#define WSREP_CAP_CONSISTENCY_CHECK ( 1ULL << 11 ) -#define WSREP_CAP_UNORDERED ( 1ULL << 12 ) -#define WSREP_CAP_ANNOTATION ( 1ULL << 13 ) -#define WSREP_CAP_PREORDERED ( 1ULL << 14 ) -#define WSREP_CAP_STREAMING ( 1ULL << 15 ) -#define WSREP_CAP_SNAPSHOT ( 1ULL << 16 ) -#define WSREP_CAP_NBO ( 1ULL << 17 ) - -typedef uint32_t wsrep_cap_t; //!< capabilities bitmask - -/*! - * Writeset flags - * - * TRX_END the writeset and all preceding writesets must be committed - * ROLLBACK all preceding writesets in a transaction must be rolled back - * ISOLATION the writeset must be applied AND committed in isolation - * PA_UNSAFE the writeset cannot be applied in parallel - * COMMUTATIVE the order in which the writeset is applied does not matter - * NATIVE the writeset contains another writeset in this provider format - * - * TRX_START shall be set on the first trx fragment by provider - * TRX_PREPARE shall be set on the fragment which prepares the transaction - * - * Note that some of the flags are mutually exclusive (e.g. TRX_END and - * ROLLBACK). - */ -#define WSREP_FLAG_TRX_END ( 1ULL << 0 ) -#define WSREP_FLAG_ROLLBACK ( 1ULL << 1 ) -#define WSREP_FLAG_ISOLATION ( 1ULL << 2 ) -#define WSREP_FLAG_PA_UNSAFE ( 1ULL << 3 ) -#define WSREP_FLAG_COMMUTATIVE ( 1ULL << 4 ) -#define WSREP_FLAG_NATIVE ( 1ULL << 5 ) -#define WSREP_FLAG_TRX_START ( 1ULL << 6 ) -#define WSREP_FLAG_TRX_PREPARE ( 1ULL << 7 ) -#define WSREP_FLAG_SNAPSHOT ( 1ULL << 8 ) - -#define WSREP_FLAGS_LAST WSREP_FLAG_SNAPSHOT -#define WSREP_FLAGS_MASK ((WSREP_FLAGS_LAST << 1) - 1) - - -typedef uint64_t wsrep_trx_id_t; //!< application transaction ID -typedef uint64_t wsrep_conn_id_t; //!< application connection ID -typedef int64_t wsrep_seqno_t; //!< sequence number of a writeset, etc. -#ifdef __cplusplus -typedef bool wsrep_bool_t; -#else -typedef _Bool wsrep_bool_t; //!< should be the same as standard (C99) bool -#endif /* __cplusplus */ - -/*! undefined seqno */ -#define WSREP_SEQNO_UNDEFINED (-1) - - -/*! wsrep provider status codes */ -typedef enum wsrep_status -{ - WSREP_OK = 0, //!< success - WSREP_WARNING, //!< minor warning, error logged - WSREP_TRX_MISSING, //!< transaction is not known by wsrep - WSREP_TRX_FAIL, //!< transaction aborted, server can continue - WSREP_BF_ABORT, //!< trx was victim of brute force abort - WSREP_SIZE_EXCEEDED, //!< data exceeded maximum supported size - WSREP_CONN_FAIL, //!< error in client connection, must abort - WSREP_NODE_FAIL, //!< error in node state, wsrep must reinit - WSREP_FATAL, //!< fatal error, server must abort - WSREP_NOT_IMPLEMENTED, //!< feature not implemented - WSREP_NOT_ALLOWED //!< operation not allowed -} wsrep_status_t; - - -/*! wsrep callbacks status codes */ -typedef enum wsrep_cb_status -{ - WSREP_CB_SUCCESS = 0, //!< success (as in "not critical failure") - WSREP_CB_FAILURE //!< critical failure (consistency violation) - /* Technically, wsrep provider has no use for specific failure codes since - * there is nothing it can do about it but abort execution. Therefore any - * positive number shall indicate a critical failure. Optionally that value - * may be used by provider to come to a consensus about state consistency - * in a group of nodes. */ -} wsrep_cb_status_t; - - -/*! - * UUID type - for all unique IDs - */ -typedef union wsrep_uuid { - uint8_t data[16]; - size_t alignment; -} wsrep_uuid_t; - -/*! Undefined UUID */ -static const wsrep_uuid_t WSREP_UUID_UNDEFINED = {{0,}}; - -/*! UUID string representation length, terminating '\0' not included */ -#define WSREP_UUID_STR_LEN 36 - -/*! - * Scan UUID from string - * @return length of UUID string representation or negative error code - */ -extern int -wsrep_uuid_scan (const char* str, size_t str_len, wsrep_uuid_t* uuid); - -/*! - * Print UUID to string - * @return length of UUID string representation or negative error code - */ -extern int -wsrep_uuid_print (const wsrep_uuid_t* uuid, char* str, size_t str_len); - -/*! - * @brief Compare two UUIDs - * - * Performs a byte by byte comparison of lhs and rhs. - * Returns 0 if lhs and rhs match, otherwise -1 or 1 according to the - * difference of the first byte that differs in lsh and rhs. - * - * @return -1, 0, 1 if lhs is respectively smaller, equal, or greater than rhs - */ -extern int -wsrep_uuid_compare (const wsrep_uuid_t* lhs, const wsrep_uuid_t* rhs); - -#define WSREP_MEMBER_NAME_LEN 32 //!< maximum logical member name length -#define WSREP_INCOMING_LEN 256 //!< max Domain Name length + 0x00 - - -/*! - * Global transaction identifier - */ -typedef struct wsrep_gtid -{ - wsrep_uuid_t uuid; /*!< History UUID */ - wsrep_seqno_t seqno; /*!< Sequence number */ -} wsrep_gtid_t; - -/*! Undefined GTID */ -static const wsrep_gtid_t WSREP_GTID_UNDEFINED = {{{0, }}, -1}; - -/*! Minimum number of bytes guaranteed to store GTID string representation, - * terminating '\0' not included (36 + 1 + 20) */ -#define WSREP_GTID_STR_LEN 57 - - -/*! - * Scan GTID from string - * @return length of GTID string representation or negative error code - */ -extern int -wsrep_gtid_scan(const char* str, size_t str_len, wsrep_gtid_t* gtid); - -/*! - * Print GTID to string - * @return length of GTID string representation or negative error code - */ -extern int -wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len); - -/*! - * Source/server transaction ID (trx ID assigned at originating node) - */ -typedef struct wsrep_stid { - wsrep_uuid_t node; //!< source node ID - wsrep_trx_id_t trx; //!< local trx ID at source - wsrep_conn_id_t conn; //!< local connection ID at source -} wsrep_stid_t; - -/*! - * Transaction meta data - */ -typedef struct wsrep_trx_meta -{ - wsrep_gtid_t gtid; /*!< Global transaction identifier */ - wsrep_stid_t stid; /*!< Source transaction identifier */ - wsrep_seqno_t depends_on; /*!< Sequence number of the last transaction - this transaction may depend on */ -} wsrep_trx_meta_t; - -/*! Abstract data buffer structure */ -typedef struct wsrep_buf -{ - const void* ptr; /*!< Pointer to data buffer */ - size_t len; /*!< Length of buffer */ -} wsrep_buf_t; - -/*! Transaction handle struct passed for wsrep transaction handling calls */ -typedef struct wsrep_ws_handle -{ - wsrep_trx_id_t trx_id; //!< transaction ID - void* opaque; //!< opaque provider transaction context data -} wsrep_ws_handle_t; - -/*! - * member status - */ -typedef enum wsrep_member_status { - WSREP_MEMBER_UNDEFINED, //!< undefined state - WSREP_MEMBER_JOINER, //!< incomplete state, requested state transfer - WSREP_MEMBER_DONOR, //!< complete state, donates state transfer - WSREP_MEMBER_JOINED, //!< complete state - WSREP_MEMBER_SYNCED, //!< complete state, synchronized with group - WSREP_MEMBER_ERROR, //!< this and above is provider-specific error code - WSREP_MEMBER_MAX -} wsrep_member_status_t; - -/*! - * static information about a group member (some fields are tentative yet) - */ -typedef struct wsrep_member_info { - wsrep_uuid_t id; //!< group-wide unique member ID - char name[WSREP_MEMBER_NAME_LEN]; //!< human-readable name - char incoming[WSREP_INCOMING_LEN]; //!< address for client requests -} wsrep_member_info_t; - -/*! - * group status - */ -typedef enum wsrep_view_status { - WSREP_VIEW_PRIMARY, //!< primary group configuration (quorum present) - WSREP_VIEW_NON_PRIMARY, //!< non-primary group configuration (quorum lost) - WSREP_VIEW_DISCONNECTED, //!< not connected to group, retrying. - WSREP_VIEW_MAX -} wsrep_view_status_t; - -/*! - * view of the group - */ -typedef struct wsrep_view_info { - wsrep_gtid_t state_id; //!< global state ID - wsrep_seqno_t view; //!< global view number - wsrep_view_status_t status; //!< view status - wsrep_cap_t capabilities;//!< capabilities available in the view - int my_idx; //!< index of this member in the view - int memb_num; //!< number of members in the view - int proto_ver; //!< application protocol agreed on the view - wsrep_member_info_t members[1];//!< array of member information -} wsrep_view_info_t; - - -/*! - * @brief connected to group - * - * This handler is called once the first primary view is seen. - * The purpose of this call is to provide basic information only, - * like node UUID and group UUID. - */ -typedef enum wsrep_cb_status (*wsrep_connected_cb_t) ( - void* app_ctx, - const wsrep_view_info_t* view -); - - -/*! - * @brief group view handler - * - * This handler is called in *total order* corresponding to the group - * configuration change. It is to provide a vital information about - * new group view. - * - * @param app_ctx application context - * @param recv_ctx receiver context - * @param view new view on the group - * @param state current state - * @param state_len length of current state - */ -typedef enum wsrep_cb_status (*wsrep_view_cb_t) ( - void* app_ctx, - void* recv_ctx, - const wsrep_view_info_t* view, - const char* state, - size_t state_len -); - - -/*! - * Magic string to tell provider to engage into trivial (empty) state transfer. - * No data will be passed, but the node shall be considered JOINED. - * Should be passed in sst_req parameter of wsrep_sst_cb_t. - */ -#define WSREP_STATE_TRANSFER_TRIVIAL "trivial" - -/*! - * Magic string to tell provider not to engage in state transfer at all. - * The member will stay in WSREP_MEMBER_UNDEFINED state but will keep on - * receiving all writesets. - * Should be passed in sst_req parameter of wsrep_sst_cb_t. - */ -#define WSREP_STATE_TRANSFER_NONE "none" - - -/*! - * @brief Creates and returns State Snapshot Transfer request for provider. - * - * This handler is called whenever the node is found to miss some of events - * from the cluster history (e.g. fresh node joining the cluster). - * SST will be used if it is impossible (or impractically long) to replay - * missing events, which may be not known in advance, so the node must always - * be ready to accept full SST or abort in case event replay is impossible. - * - * Normally SST request is an opaque buffer that is passed to the - * chosen SST donor node and must contain information sufficient for - * donor to deliver SST (typically SST method and delivery address). - * See above macros WSREP_STATE_TRANSFER_TRIVIAL and WSREP_STATE_TRANSFER_NONE - * to modify the standard provider behavior. - * - * @note Currently it is assumed that sst_req is allocated using - * malloc()/calloc()/realloc() and it will be freed by - * wsrep provider. - * - * @param app_ctx application context - * @param sst_req location to store SST request - * @param sst_req_len location to store SST request length or error code, - * value of 0 means no SST. - */ -typedef enum wsrep_cb_status (*wsrep_sst_request_cb_t) ( - void* app_ctx, - void** sst_req, - size_t* sst_req_len -); - - -/*! - * @brief apply callback - * - * This handler is called from wsrep library to apply replicated writeset - * Must support brute force applying for multi-master operation - * - * @param recv_ctx receiver context pointer provided by the application - * @param ws_handle internal provider writeset handle - * @param flags WSREP_FLAG_... flags - * @param data data buffer containing the writeset - * @param meta transaction meta data of the writeset to be applied - * @param exit_loop set to true to exit receive loop - * - * @return error code: - * @retval 0 - success - * @retval non-0 - application-specific error code - */ -typedef enum wsrep_cb_status (*wsrep_apply_cb_t) ( - void* recv_ctx, - const wsrep_ws_handle_t* ws_handle, - uint32_t flags, - const wsrep_buf_t* data, - const wsrep_trx_meta_t* meta, - wsrep_bool_t* exit_loop -); - - -/*! - * @brief unordered callback - * - * This handler is called to execute unordered actions (actions that need not - * to be executed in any particular order) attached to writeset. - * - * @param recv_ctx receiver context pointer provided by the application - * @param data data buffer containing the writeset - */ -typedef enum wsrep_cb_status (*wsrep_unordered_cb_t) ( - void* recv_ctx, - const wsrep_buf_t* data -); - - -/*! - * @brief a callback to donate state snapshot - * - * This handler is called from wsrep library when it needs this node - * to deliver state to a new cluster member. - * No state changes will be committed for the duration of this call. - * Wsrep implementation may provide internal state to be transmitted - * to new cluster member for initial state. - * - * @param app_ctx application context - * @param recv_ctx receiver context - * @param str_msg state transfer request message - * @param gtid current state ID on this node - * @param state current wsrep internal state buffer - * @param bypass bypass snapshot transfer, only transfer uuid:seqno pair - */ -typedef enum wsrep_cb_status (*wsrep_sst_donate_cb_t) ( - void* app_ctx, - void* recv_ctx, - const wsrep_buf_t* str_msg, - const wsrep_gtid_t* state_id, - const wsrep_buf_t* state, - wsrep_bool_t bypass -); - - -/*! - * @brief a callback to signal application that wsrep state is synced - * with cluster - * - * This callback is called after wsrep library has got in sync with - * rest of the cluster. - * - * @param app_ctx application context - * - * @return wsrep_cb_status enum - */ -typedef enum wsrep_cb_status (*wsrep_synced_cb_t) (void* app_ctx); - - -/*! - * Initialization parameters for wsrep provider. - */ -struct wsrep_init_args -{ - void* app_ctx; //!< Application context for callbacks - - /* Configuration parameters */ - const char* node_name; //!< Symbolic name of this node (e.g. hostname) - const char* node_address; //!< Address to be used by wsrep provider - const char* node_incoming; //!< Address for incoming client connections - const char* data_dir; //!< Directory where wsrep files are kept if any - const char* options; //!< Provider-specific configuration string - int proto_ver; //!< Max supported application protocol version - - /* Application initial state information. */ - const wsrep_gtid_t* state_id; //!< Application state GTID - const wsrep_buf_t* state; //!< Initial state for wsrep provider - - /* Application callbacks */ - wsrep_log_cb_t logger_cb; //!< logging handler - wsrep_connected_cb_t connected_cb; //!< connected to group - wsrep_view_cb_t view_cb; //!< group view change handler - wsrep_sst_request_cb_t sst_request_cb; //!< SST request creator - - /* Applier callbacks */ - wsrep_apply_cb_t apply_cb; //!< apply callback - wsrep_unordered_cb_t unordered_cb; //!< callback for unordered actions - - /* State Snapshot Transfer callbacks */ - wsrep_sst_donate_cb_t sst_donate_cb; //!< donate SST - wsrep_synced_cb_t synced_cb; //!< synced with group -}; - - -/*! Type of the stats variable value in struct wsrep_status_var */ -typedef enum wsrep_var_type -{ - WSREP_VAR_STRING, //!< pointer to null-terminated string - WSREP_VAR_INT64, //!< int64_t - WSREP_VAR_DOUBLE //!< double -} -wsrep_var_type_t; - -/*! Generalized stats variable representation */ -struct wsrep_stats_var -{ - const char* name; //!< variable name - wsrep_var_type_t type; //!< variable value type - union { - int64_t _int64; - double _double; - const char* _string; - } value; //!< variable value -}; - - -/*! Key struct used to pass certification keys for transaction handling calls. - * A key consists of zero or more key parts. */ -typedef struct wsrep_key -{ - const wsrep_buf_t* key_parts; /*!< Array of key parts */ - size_t key_parts_num; /*!< Number of key parts */ -} wsrep_key_t; - -/*! Key type: - * EXCLUSIVE conflicts with any key type - * SEMI reserved. If not supported, should be interpreted as EXCLUSIVE - * SHARED conflicts only with EXCLUSIVE keys */ -typedef enum wsrep_key_type -{ - WSREP_KEY_SHARED = 0, - WSREP_KEY_SEMI, - WSREP_KEY_EXCLUSIVE -} wsrep_key_type_t; - -/*! Data type: - * ORDERED state modification event that should be applied and committed - * in order. - * UNORDERED some action that does not modify state and execution of which is - * optional and does not need to happen in order. - * ANNOTATION (human readable) writeset annotation. */ -typedef enum wsrep_data_type -{ - WSREP_DATA_ORDERED = 0, - WSREP_DATA_UNORDERED, - WSREP_DATA_ANNOTATION -} wsrep_data_type_t; - - -/*! - * @brief Helper method to reset trx writeset handle state when trx id changes - * - * Instead of passing wsrep_ws_handle_t directly to wsrep calls, - * wrapping handle with this call offloads bookkeeping from - * application. - */ -static inline wsrep_ws_handle_t* wsrep_ws_handle_for_trx( - wsrep_ws_handle_t* ws_handle, - wsrep_trx_id_t trx_id) -{ - if (ws_handle->trx_id != trx_id) - { - ws_handle->trx_id = trx_id; - ws_handle->opaque = NULL; - } - return ws_handle; -} - - -/*! - * A handle for processing preordered actions. - * Must be initialized to WSREP_PO_INITIALIZER before use. - */ -typedef struct wsrep_po_handle { void* opaque; } wsrep_po_handle_t; - -static const wsrep_po_handle_t WSREP_PO_INITIALIZER = { NULL }; - - -typedef struct wsrep_st wsrep_t; -/*! - * wsrep interface for dynamically loadable libraries - */ -struct wsrep_st { - - const char *version; //!< interface version string - - /*! - * @brief Initializes wsrep provider - * - * @param wsrep provider handle - * @param args wsrep initialization parameters - */ - wsrep_status_t (*init) (wsrep_t* wsrep, - const struct wsrep_init_args* args); - - /*! - * @brief Returns provider capabilities bitmap - * - * Note that these are potential provider capabilities. Provider will - * offer only capabilities supported by all members in the view - * (see wsrep_view_info). - * - * @param wsrep provider handle - */ - wsrep_cap_t (*capabilities) (wsrep_t* wsrep); - - /*! - * @brief Passes provider-specific configuration string to provider. - * - * @param wsrep provider handle - * @param conf configuration string - * - * @retval WSREP_OK configuration string was parsed successfully - * @retval WSREP_WARNING could not parse configuration string, no action taken - */ - wsrep_status_t (*options_set) (wsrep_t* wsrep, const char* conf); - - /*! - * @brief Returns provider-specific string with current configuration values. - * - * @param wsrep provider handle - * - * @return a dynamically allocated string with current configuration - * parameter values - */ - char* (*options_get) (wsrep_t* wsrep); - - /*! - * @brief Opens connection to cluster - * - * Returns when either node is ready to operate as a part of the cluster - * or fails to reach operating status. - * - * @param wsrep provider handle - * @param cluster_name unique symbolic cluster name - * @param cluster_url URL-like cluster address (backend://address) - * @param state_donor name of the node to be asked for state transfer. - * @param bootstrap a flag to request initialization of a new wsrep - * service rather then a connection to the existing one. - * cluster_url may still carry important initialization - * parameters, like backend spec and/or listen address. - */ - wsrep_status_t (*connect) (wsrep_t* wsrep, - const char* cluster_name, - const char* cluster_url, - const char* state_donor, - wsrep_bool_t bootstrap); - - /*! - * @brief Closes connection to cluster. - * - * If state_uuid and/or state_seqno is not NULL, will store final state - * in there. - * - * @param wsrep this wsrep handler - */ - wsrep_status_t (*disconnect)(wsrep_t* wsrep); - - /*! - * @brief start receiving replication events - * - * This function never returns - * - * @param wsrep provider handle - * @param recv_ctx receiver context - */ - wsrep_status_t (*recv)(wsrep_t* wsrep, void* recv_ctx); - - /*! - * @brief Tells provider that a given writeset has a read view associated - * with it. - * - * @param wsrep provider handle - * @param handle writeset handle - * @param rv read view GTID established by the caller or if NULL, - * provider will infer it internally. - */ - wsrep_status_t (*assign_read_view)(wsrep_t* wsrep, - wsrep_ws_handle_t* handle, - const wsrep_gtid_t* rv); - - /*! - * @brief Certifies transaction with provider. - * - * Must be called before transaction commit. Returns success code, which - * caller must check. - * - * In case of WSREP_OK, transaction can proceed to commit. - * Otherwise transaction must rollback. - * - * In case of a failure there are two conceptually different situations: - * - the writeset was not ordered. In that case meta struct shall contain - * undefined GTID: WSREP_UUID_UNDEFINED:WSREP_SEQNO_UNDEFINED. - * - the writeset was successfully ordered, but failed certification. - * In this case meta struct shall contain a valid GTID. - * - * Regardless of the return code, if meta struct contains a valid GTID - * the commit order critical section must be entered with that GTID. - * - * @param wsrep provider handle - * @param conn_id connection ID - * @param ws_handle writeset of committing transaction - * @param flags fine tuning the replication WSREP_FLAG_* - * @param meta transaction meta data - * - * @retval WSREP_OK writeset successfully certified, can commit - * @retval WSREP_TRX_FAIL must rollback transaction - * @retval WSREP_CONN_FAIL must close client connection - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*certify)(wsrep_t* wsrep, - wsrep_conn_id_t conn_id, - wsrep_ws_handle_t* ws_handle, - uint32_t flags, - wsrep_trx_meta_t* meta); - - /*! - * @brief Enters commit order critical section. - * - * Anything executed between this call and commit_order_leave() will be - * executed in provider enforced order. - * - * @param wsrep provider handle - * @param ws_handle internal provider writeset handle - * @param meta transaction meta data - * - * @retval WSREP_OK commit order entered successfully - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*commit_order_enter)(wsrep_t* wsrep, - const wsrep_ws_handle_t* ws_handle, - const wsrep_trx_meta_t* meta); - - /*! - * @brief Leaves commit order critical section - * - * Anything executed between commit_order_enter() and this call will be - * executed in provider enforced order. - * - * @param wsrep provider handle - * @param ws_handle internal provider writeset handle - * @param meta transaction meta data - * @param error buffer containing error info (null/empty for no error) - * - * @retval WSREP_OK commit order left successfully - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*commit_order_leave)(wsrep_t* wsrep, - const wsrep_ws_handle_t* ws_handle, - const wsrep_trx_meta_t* meta, - const wsrep_buf_t* error); - - /*! - * @brief Releases resources after transaction commit/rollback. - * - * Ends total order critical section. - * - * @param wsrep provider handle - * @param ws_handle writeset of committing transaction - * @retval WSREP_OK release succeeded - */ - wsrep_status_t (*release) (wsrep_t* wsrep, - wsrep_ws_handle_t* ws_handle); - - /*! - * @brief Replay trx as a slave writeset - * - * If local trx has been aborted by brute force, and it has already - * replicated before this abort, we must try if we can apply it as - * slave trx. Note that slave nodes see only trx writesets and certification - * test based on write set content can be different to DBMS lock conflicts. - * - * @param wsrep provider handle - * @param ws_handle writeset of committing transaction - * @param trx_ctx transaction context - * - * @retval WSREP_OK cluster commit succeeded - * @retval WSREP_TRX_FAIL must rollback transaction - * @retval WSREP_BF_ABORT brute force abort happened after trx replicated - * must rollback transaction and try to replay - * @retval WSREP_CONN_FAIL must close client connection - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*replay_trx)(wsrep_t* wsrep, - const wsrep_ws_handle_t* ws_handle, - void* trx_ctx); - - /*! - * @brief Abort certify() call of another thread. - * - * It is possible, that some high-priority transaction needs to abort - * another transaction which is in certify() call waiting for resources. - * - * The kill routine checks that abort is not attempted against a transaction - * which is front of the caller (in total order). - * - * If the abort was successful, the victim sequence number is stored - * into location pointed by the victim_seqno. - * - * @param wsrep provider handle - * @param bf_seqno seqno of brute force trx, running this cancel - * @param victim_trx transaction to be aborted, and which is committing - * @param victim_seqno seqno of the victim transaction if assigned - * - * @retval WSREP_OK abort succeeded - * @retval WSREP_NOT_ALLOWED the provider declined the abort request - * @retval WSREP_TRX_MISSING the victim_trx was missing - * @retval WSREP_WARNING abort failed - */ - wsrep_status_t (*abort_certification)(wsrep_t* wsrep, - wsrep_seqno_t bf_seqno, - wsrep_trx_id_t victim_trx, - wsrep_seqno_t* victim_seqno); - - /*! - * @brief Send a rollback fragment on behalf of trx - * - * @param wsrep provider handle - * @param trx transaction to be rolled back - * @param data data to append to the fragment - * - * @retval WSREP_OK rollback fragment sent successfully - */ - wsrep_status_t (*rollback)(wsrep_t* wsrep, - wsrep_trx_id_t trx, - const wsrep_buf_t* data); - - /*! - * @brief Appends a row reference to transaction writeset - * - * Both copy flag and key_type can be ignored by provider (key type - * interpreted as WSREP_KEY_EXCLUSIVE). - * - * @param wsrep provider handle - * @param ws_handle writeset handle - * @param keys array of keys - * @param count length of the array of keys - * @param type type of the key - * @param copy can be set to FALSE if keys persist through commit. - */ - wsrep_status_t (*append_key)(wsrep_t* wsrep, - wsrep_ws_handle_t* ws_handle, - const wsrep_key_t* keys, - size_t count, - enum wsrep_key_type type, - wsrep_bool_t copy); - - /*! - * @brief Appends data to transaction writeset - * - * This method can be called any time before commit and it - * appends a number of data buffers to transaction writeset. - * - * Both copy and unordered flags can be ignored by provider. - * - * @param wsrep provider handle - * @param ws_handle writeset handle - * @param data array of data buffers - * @param count buffer count - * @param type type of data - * @param copy can be set to FALSE if data persists through commit. - */ - wsrep_status_t (*append_data)(wsrep_t* wsrep, - wsrep_ws_handle_t* ws_handle, - const wsrep_buf_t* data, - size_t count, - enum wsrep_data_type type, - wsrep_bool_t copy); - - /*! - * @brief Blocks until the given GTID is committed - * - * This call will block the caller until the given GTID - * is guaranteed to be committed, or until a timeout occurs. - * The timeout value is given in parameter tout, if tout is -1, - * then the global causal read timeout applies. - * - * If no pointer upto is provided the call will block until - * causal ordering with all possible preceding writes in the - * cluster is guaranteed. - * - * If pointer to gtid is non-null, the call stores the global - * transaction ID of the last transaction which is guaranteed - * to be committed when the call returns. - * - * @param wsrep provider handle - * @param upto gtid to wait upto - * @param tout timeout in seconds - * -1 wait for global causal read timeout - * @param gtid location to store GTID - */ - wsrep_status_t (*sync_wait)(wsrep_t* wsrep, - wsrep_gtid_t* upto, - int tout, - wsrep_gtid_t* gtid); - - /*! - * @brief Returns the last committed gtid - * - * @param gtid location to store GTID - */ - wsrep_status_t (*last_committed_id)(wsrep_t* wsrep, - wsrep_gtid_t* gtid); - - /*! - * @brief Clears allocated connection context. - * - * Whenever a new connection ID is passed to wsrep provider through - * any of the API calls, a connection context is allocated for this - * connection. This call is to explicitly notify provider of connection - * closing. - * - * @param wsrep provider handle - * @param conn_id connection ID - * @param query the 'set database' query - * @param query_len length of query (does not end with 0) - */ - wsrep_status_t (*free_connection)(wsrep_t* wsrep, - wsrep_conn_id_t conn_id); - - /*! - * @brief Replicates a query and starts "total order isolation" section. - * - * Regular mode: - * - * Replicates the action spec and returns success code, which caller must - * check. Total order isolation continues until to_execute_end() is called. - * Regular "total order isolation" is achieved by calling to_execute_start() - * with WSREP_FLAG_TRX_START and WSREP_FLAG_TRX_END set. - * - * Two-phase mode: - * - * In this mode a query execution is split in two phases. The first phase is - * acquiring total order isolation to access critical section and the - * second phase is to release acquired resources in total order. - * - * To start the first phase the call is made with WSREP_FLAG_TRX_START set. - * The action is replicated and success code is returned. The total order - * isolation continues until to_execute_end() is called. However, the provider - * will keep the reference to the operation for conflict resolution purposes. - * - * The second phase is started with WSREP_FLAG_TRX_END set. Provider - * returns once it has achieved total ordering isolation for second phase. - * Total order isolation continues until to_execute_end() is called. - * All references to the operation are cleared by provider before - * call to to_execute_end() returns. - * - * @param wsrep provider handle - * @param conn_id connection ID - * @param keys array of keys - * @param keys_num length of the array of keys - * @param action action buffer array to be executed - * @param count action buffer count - * @param flags flags - * @param meta transaction meta data - * - * @retval WSREP_OK cluster commit succeeded - * @retval WSREP_CONN_FAIL must close client connection - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*to_execute_start)(wsrep_t* wsrep, - wsrep_conn_id_t conn_id, - const wsrep_key_t* keys, - size_t keys_num, - const wsrep_buf_t* action, - size_t count, - uint32_t flags, - wsrep_trx_meta_t* meta); - - /*! - * @brief Ends the total order isolation section. - * - * Marks the end of total order isolation. TO locks are freed - * and other transactions are free to commit from this point on. - * - * @param wsrep provider handle - * @param conn_id connection ID - * @param error error information about TOI operation (empty for no error) - * - * @retval WSREP_OK cluster commit succeeded - * @retval WSREP_CONN_FAIL must close client connection - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*to_execute_end)(wsrep_t* wsrep, - wsrep_conn_id_t conn_id, - const wsrep_buf_t* error); - - - /*! - * @brief Collects preordered replication events into a writeset. - * - * @param wsrep wsrep provider handle - * @param handle a handle associated with a given writeset - * @param data an array of data buffers. - * @param count length of data buffer array. - * @param copy whether provider needs to make a copy of events. - * - * @retval WSREP_OK cluster-wide commit succeeded - * @retval WSREP_TRX_FAIL operation failed (e.g. trx size exceeded limit) - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*preordered_collect) (wsrep_t* wsrep, - wsrep_po_handle_t* handle, - const wsrep_buf_t* data, - size_t count, - wsrep_bool_t copy); - - /*! - * @brief "Commits" preordered writeset to cluster. - * - * The contract is that the writeset will be committed in the same (partial) - * order this method was called. Frees resources associated with the writeset - * handle and reinitializes the handle. - * - * @param wsrep wsrep provider handle - * @param po_handle a handle associated with a given writeset - * @param source_id ID of the event producer, also serves as the partial order - * or stream ID - events with different source_ids won't be - * ordered with respect to each other. - * @param flags WSREP_FLAG_... flags - * @param pa_range the number of preceding events this event can be processed - * in parallel with. A value of 0 means strict serial - * processing. Note: commits always happen in wsrep order. - * @param commit 'true' to commit writeset to cluster (replicate) or - * 'false' to rollback (cancel) the writeset. - * - * @retval WSREP_OK cluster-wide commit succeeded - * @retval WSREP_TRX_FAIL operation failed (e.g. NON-PRIMARY component) - * @retval WSREP_NODE_FAIL must close all connections and reinit - */ - wsrep_status_t (*preordered_commit) (wsrep_t* wsrep, - wsrep_po_handle_t* handle, - const wsrep_uuid_t* source_id, - uint32_t flags, - int pa_range, - wsrep_bool_t commit); - - /*! - * @brief Signals to wsrep provider that state snapshot has been sent to - * joiner. - * - * @param wsrep provider handle - * @param state_id state ID - * @param rcode 0 or negative error code of the operation. - */ - wsrep_status_t (*sst_sent)(wsrep_t* wsrep, - const wsrep_gtid_t* state_id, - int rcode); - - /*! - * @brief Signals to wsrep provider that new state snapshot has been received. - * May deadlock if called from sst_prepare_cb. - * - * @param wsrep provider handle - * @param state_id state ID - * @param state initial state provided by SST donor - * @param rcode 0 or negative error code of the operation. - */ - wsrep_status_t (*sst_received)(wsrep_t* wsrep, - const wsrep_gtid_t* state_id, - const wsrep_buf_t* state, - int rcode); - - - /*! - * @brief Generate request for consistent snapshot. - * - * If successful, this call will generate internally SST request - * which in turn triggers calling SST donate callback on the nodes - * specified in donor_spec. If donor_spec is null, callback is - * called only locally. This call will block until sst_sent is called - * from callback. - * - * @param wsrep provider handle - * @param msg context message for SST donate callback - * @param msg_len length of context message - * @param donor_spec list of snapshot donors - */ - wsrep_status_t (*snapshot)(wsrep_t* wsrep, - const wsrep_buf_t* msg, - const char* donor_spec); - - /*! - * @brief Returns an array of status variables. - * Array is terminated by Null variable name. - * - * @param wsrep provider handle - * @return array of struct wsrep_status_var. - */ - struct wsrep_stats_var* (*stats_get) (wsrep_t* wsrep); - - /*! - * @brief Release resources that might be associated with the array. - * - * @param wsrep provider handle. - * @param var_array array returned by stats_get(). - */ - void (*stats_free) (wsrep_t* wsrep, struct wsrep_stats_var* var_array); - - /*! - * @brief Reset some stats variables to inital value, provider-dependent. - * - * @param wsrep provider handle. - */ - void (*stats_reset) (wsrep_t* wsrep); - - /*! - * @brief Pauses writeset applying/committing. - * - * @return global sequence number of the paused state or negative error code. - */ - wsrep_seqno_t (*pause) (wsrep_t* wsrep); - - /*! - * @brief Resumes writeset applying/committing. - */ - wsrep_status_t (*resume) (wsrep_t* wsrep); - - /*! - * @brief Desynchronize from cluster - * - * Effectively turns off flow control for this node, allowing it - * to fall behind the cluster. - */ - wsrep_status_t (*desync) (wsrep_t* wsrep); - - /*! - * @brief Request to resynchronize with cluster. - * - * Effectively turns on flow control. Asynchronous - actual synchronization - * event to be delivered via sync_cb. - */ - wsrep_status_t (*resync) (wsrep_t* wsrep); - - /*! - * @brief Acquire global named lock - * - * @param wsrep wsrep provider handle - * @param name lock name - * @param shared shared or exclusive lock - * @param owner 64-bit owner ID - * @param tout timeout in nanoseconds. - * 0 - return immediately, -1 wait forever. - * @return wsrep status or negative error code - * @retval -EDEADLK lock was already acquired by this thread - * @retval -EBUSY lock was busy - */ - wsrep_status_t (*lock) (wsrep_t* wsrep, - const char* name, wsrep_bool_t shared, - uint64_t owner, int64_t tout); - - /*! - * @brief Release global named lock - * - * @param wsrep wsrep provider handle - * @param name lock name - * @param owner 64-bit owner ID - * @return wsrep status or negative error code - * @retval -EPERM lock does not belong to this owner - */ - wsrep_status_t (*unlock) (wsrep_t* wsrep, const char* name, uint64_t owner); - - /*! - * @brief Check if global named lock is locked - * - * @param wsrep wsrep provider handle - * @param name lock name - * @param owner if not NULL will contain 64-bit owner ID - * @param node if not NULL will contain owner's node UUID - * @return true if lock is locked - */ - wsrep_bool_t (*is_locked) (wsrep_t* wsrep, const char* name, uint64_t* conn, - wsrep_uuid_t* node); - - /*! - * wsrep provider name - */ - const char* provider_name; - - /*! - * wsrep provider version - */ - const char* provider_version; - - /*! - * wsrep provider vendor name - */ - const char* provider_vendor; - - /*! - * @brief Frees allocated resources before unloading the library. - * @param wsrep provider handle - */ - void (*free)(wsrep_t* wsrep); - - void *dlh; //!< reserved for future use - void *ctx; //!< reserved for implementation private context -}; - - -/*! - * - * @brief Loads wsrep library - * - * @param spec path to wsrep library. If NULL or WSREP_NONE initializes dummy - * pass-through implementation. - * @param hptr wsrep handle - * @param log_cb callback to handle loader messages. Otherwise writes to stderr. - * - * @return zero on success, errno on failure - */ -int wsrep_load(const char* spec, wsrep_t** hptr, wsrep_log_cb_t log_cb); - -/*! - * @brief Unloads wsrep library and frees associated resources - * - * @param hptr wsrep handler pointer - */ -void wsrep_unload(wsrep_t* hptr); - -#ifdef __cplusplus -} -#endif - -#endif /* WSREP_H */ diff --git a/wsrep/wsrep_dummy.c b/wsrep/wsrep_dummy.c deleted file mode 100644 index 8c39ca5ace09b..0000000000000 --- a/wsrep/wsrep_dummy.c +++ /dev/null @@ -1,449 +0,0 @@ -/* Copyright (C) 2009-2010 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -/*! @file Dummy wsrep API implementation. */ - -#include "wsrep_api.h" - -#include -#include -#include - -/*! Dummy backend context. */ -typedef struct wsrep_dummy -{ - wsrep_log_cb_t log_fn; - char* options; -} wsrep_dummy_t; - -/* Get pointer to wsrep_dummy context from wsrep_t pointer */ -#define WSREP_DUMMY(_p) ((wsrep_dummy_t *) (_p)->ctx) - -/* Trace function usage a-la DBUG */ -#define WSREP_DBUG_ENTER(_w) do { \ - if (WSREP_DUMMY(_w)) { \ - if (WSREP_DUMMY(_w)->log_fn) \ - WSREP_DUMMY(_w)->log_fn(WSREP_LOG_DEBUG, __FUNCTION__); \ - } \ - } while (0) - - -static void dummy_free(wsrep_t *w) -{ - WSREP_DBUG_ENTER(w); - if (WSREP_DUMMY(w)->options) { - free(WSREP_DUMMY(w)->options); - WSREP_DUMMY(w)->options = NULL; - } - free(w->ctx); - w->ctx = NULL; -} - -static wsrep_status_t dummy_init (wsrep_t* w, - const struct wsrep_init_args* args) -{ - WSREP_DUMMY(w)->log_fn = args->logger_cb; - WSREP_DBUG_ENTER(w); - if (args->options) { - WSREP_DUMMY(w)->options = strdup(args->options); - } - return WSREP_OK; -} - -static wsrep_cap_t dummy_capabilities (wsrep_t* w __attribute__((unused))) -{ - return 0; -} - -static wsrep_status_t dummy_options_set( - wsrep_t* w, - const char* conf) -{ - WSREP_DBUG_ENTER(w); - if (WSREP_DUMMY(w)->options) { - free(WSREP_DUMMY(w)->options); - WSREP_DUMMY(w)->options = NULL; - } - if (conf) { - WSREP_DUMMY(w)->options = strdup(conf); - } - return WSREP_OK; -} - -static char* dummy_options_get (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return strdup(WSREP_DUMMY(w)->options); -} - -static wsrep_status_t dummy_connect( - wsrep_t* w, - const char* name __attribute__((unused)), - const char* url __attribute__((unused)), - const char* donor __attribute__((unused)), - wsrep_bool_t bootstrap __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_disconnect(wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_recv(wsrep_t* w, - void* recv_ctx __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_assign_read_view( - wsrep_t* w, - wsrep_ws_handle_t* ws_handle __attribute__((unused)), - const wsrep_gtid_t* rv __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_certify( - wsrep_t* w, - const wsrep_conn_id_t conn_id __attribute__((unused)), - wsrep_ws_handle_t* ws_handle __attribute__((unused)), - uint32_t flags __attribute__((unused)), - wsrep_trx_meta_t* meta __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_commit_order_enter( - wsrep_t* w, - const wsrep_ws_handle_t* ws_handle __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_commit_order_leave( - wsrep_t* w, - const wsrep_ws_handle_t* ws_handle __attribute__((unused)), - const wsrep_buf_t* error __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_release( - wsrep_t* w, - wsrep_ws_handle_t* ws_handle __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_replay_trx( - wsrep_t* w, - wsrep_ws_handle_t* ws_handle __attribute__((unused)), - void* trx_ctx __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_abort_certification( - wsrep_t* w, - const wsrep_seqno_t bf_seqno __attribute__((unused)), - const wsrep_trx_id_t trx_id __attribute__((unused)), - wsrep_seqno_t *victim_seqno __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_rollback( - wsrep_t* w, - const wsrep_trx_id_t trx __attribute__((unused)), - const wsrep_buf_t* data __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_append_key( - wsrep_t* w, - wsrep_ws_handle_t* ws_handle __attribute__((unused)), - const wsrep_key_t* key __attribute__((unused)), - const size_t key_num __attribute__((unused)), - const wsrep_key_type_t key_type __attribute__((unused)), - const bool copy __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_append_data( - wsrep_t* w, - wsrep_ws_handle_t* ws_handle __attribute__((unused)), - const struct wsrep_buf* data __attribute__((unused)), - const size_t count __attribute__((unused)), - const wsrep_data_type_t type __attribute__((unused)), - const bool copy __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_sync_wait( - wsrep_t* w, - wsrep_gtid_t* upto __attribute__((unused)), - int tout __attribute__((unused)), - wsrep_gtid_t* gtid __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_last_committed_id( - wsrep_t* w, - wsrep_gtid_t* gtid __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_free_connection( - wsrep_t* w, - const wsrep_conn_id_t conn_id __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_to_execute_start( - wsrep_t* w, - const wsrep_conn_id_t conn_id __attribute__((unused)), - const wsrep_key_t* key __attribute__((unused)), - const size_t key_num __attribute__((unused)), - const struct wsrep_buf* data __attribute__((unused)), - const size_t count __attribute__((unused)), - const uint32_t flags __attribute__((unused)), - wsrep_trx_meta_t* meta __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_to_execute_end( - wsrep_t* w, - const wsrep_conn_id_t conn_id __attribute__((unused)), - const wsrep_buf_t* err __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_preordered_collect( - wsrep_t* w, - wsrep_po_handle_t* handle __attribute__((unused)), - const struct wsrep_buf* data __attribute__((unused)), - size_t count __attribute__((unused)), - wsrep_bool_t copy __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_preordered_commit( - wsrep_t* w, - wsrep_po_handle_t* handle __attribute__((unused)), - const wsrep_uuid_t* source_id __attribute__((unused)), - uint32_t flags __attribute__((unused)), - int pa_range __attribute__((unused)), - wsrep_bool_t commit __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_sst_sent( - wsrep_t* w, - const wsrep_gtid_t* state_id __attribute__((unused)), - const int rcode __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_sst_received( - wsrep_t* w, - const wsrep_gtid_t* state_id __attribute__((unused)), - const wsrep_buf_t* state __attribute__((unused)), - const int rcode __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_snapshot( - wsrep_t* w, - const wsrep_buf_t* msg __attribute__((unused)), - const char* donor_spec __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static struct wsrep_stats_var dummy_stats[] = { - { NULL, WSREP_VAR_STRING, { 0 } } -}; - -static struct wsrep_stats_var* dummy_stats_get (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return dummy_stats; -} - -static void dummy_stats_free ( - wsrep_t* w, - struct wsrep_stats_var* stats __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); -} - -static void dummy_stats_reset (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); -} - -static wsrep_seqno_t dummy_pause (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return -ENOSYS; -} - -static wsrep_status_t dummy_resume (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_desync (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return WSREP_NOT_IMPLEMENTED; -} - -static wsrep_status_t dummy_resync (wsrep_t* w) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static wsrep_status_t dummy_lock (wsrep_t* w, - const char* s __attribute__((unused)), - bool r __attribute__((unused)), - uint64_t o __attribute__((unused)), - int64_t t __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_NOT_IMPLEMENTED; -} - -static wsrep_status_t dummy_unlock (wsrep_t* w, - const char* s __attribute__((unused)), - uint64_t o __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return WSREP_OK; -} - -static bool dummy_is_locked (wsrep_t* w, - const char* s __attribute__((unused)), - uint64_t* o __attribute__((unused)), - wsrep_uuid_t* t __attribute__((unused))) -{ - WSREP_DBUG_ENTER(w); - return false; -} - -static wsrep_t dummy_iface = { - WSREP_INTERFACE_VERSION, - &dummy_init, - &dummy_capabilities, - &dummy_options_set, - &dummy_options_get, - &dummy_connect, - &dummy_disconnect, - &dummy_recv, - &dummy_assign_read_view, - &dummy_certify, - &dummy_commit_order_enter, - &dummy_commit_order_leave, - &dummy_release, - &dummy_replay_trx, - &dummy_abort_certification, - &dummy_rollback, - &dummy_append_key, - &dummy_append_data, - &dummy_sync_wait, - &dummy_last_committed_id, - &dummy_free_connection, - &dummy_to_execute_start, - &dummy_to_execute_end, - &dummy_preordered_collect, - &dummy_preordered_commit, - &dummy_sst_sent, - &dummy_sst_received, - &dummy_snapshot, - &dummy_stats_get, - &dummy_stats_free, - &dummy_stats_reset, - &dummy_pause, - &dummy_resume, - &dummy_desync, - &dummy_resync, - &dummy_lock, - &dummy_unlock, - &dummy_is_locked, - WSREP_NONE, - WSREP_INTERFACE_VERSION, - "Codership Oy ", - &dummy_free, - NULL, - NULL -}; - -int wsrep_dummy_loader(wsrep_t* w) -{ - if (!w) - return EINVAL; - - *w = dummy_iface; - - // allocate private context - if (!(w->ctx = malloc(sizeof(wsrep_dummy_t)))) - return ENOMEM; - - // initialize private context - WSREP_DUMMY(w)->log_fn = NULL; - WSREP_DUMMY(w)->options = NULL; - - return 0; -} diff --git a/wsrep/wsrep_gtid.c b/wsrep/wsrep_gtid.c deleted file mode 100644 index a02543ab523d1..0000000000000 --- a/wsrep/wsrep_gtid.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 2013 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -/*! @file Helper functions to deal with GTID string representations */ - -#include -#include -#include -#include - -#include "wsrep_api.h" - -/*! - * Read GTID from string - * @return length of GTID string representation or -EINVAL in case of error - */ -int -wsrep_gtid_scan(const char* str, size_t str_len, wsrep_gtid_t* gtid) -{ - unsigned int offset; - char* endptr; - - if ((offset = wsrep_uuid_scan(str, str_len, >id->uuid)) > 0 && - offset < str_len && str[offset] == ':') { - ++offset; - if (offset < str_len) - { - errno = 0; - gtid->seqno = strtoll(str + offset, &endptr, 0); - - if (errno == 0) { - offset = endptr - str; - return offset; - } - } - } - *gtid = WSREP_GTID_UNDEFINED; - return -EINVAL; -} - -/*! - * Write GTID to string - * @return length of GTID string representation or -EMSGSIZE if string is too - * short - */ -int -wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len) -{ - unsigned int offset, ret; - if ((offset = wsrep_uuid_print(>id->uuid, str, str_len)) > 0) - { - ret = snprintf(str + offset, str_len - offset, - ":%" PRId64, gtid->seqno); - if (ret <= str_len - offset) { - return (offset + ret); - } - - } - - return -EMSGSIZE; -} diff --git a/wsrep/wsrep_listener.c b/wsrep/wsrep_listener.c deleted file mode 100644 index 7d1558c301477..0000000000000 --- a/wsrep/wsrep_listener.c +++ /dev/null @@ -1,261 +0,0 @@ -/* Copyright (C) 2012 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/*! @file Example of wsrep event listener. Outputs description of received - * events to stdout. To get a general picture you should start with - * main() function. */ - -#include - -#include -#include -#include -#include -#include -#include - -/*! This is global application context, it will be used by wsrep callbacks */ -struct application_context -{}; - -static struct application_context global_ctx; - -/*! This is receiving thread context, it will be used by wsrep callbacks */ -struct receiver_context -{ - char msg[4096]; -}; - -/* wsrep provider handle (global for simplicty) */ -static wsrep_t* wsrep = NULL; - -/*! This is a logger callback which library will be using to log events. */ -static void -logger_cb (wsrep_log_level_t level __attribute__((unused)), const char* msg) -{ - fprintf (stderr, "WSREP: %s\n", msg); -} - -/*! This will be called on cluster view change (nodes joining, leaving, etc.). - * Each view change is the point where application may be pronounced out of - * sync with the current cluster view and need state transfer. - * It is guaranteed that no other callbacks are called concurrently with it. */ -static wsrep_cb_status_t -view_cb (void* app_ctx __attribute__((unused)), - void* recv_ctx __attribute__((unused)), - const wsrep_view_info_t* view, - const char* state __attribute__((unused)), - size_t state_len __attribute__((unused))) -{ - printf ("New cluster membership view: %d nodes, my index is %d, " - "global seqno: %lld\n", - view->memb_num, view->my_idx, (long long)view->state_id.seqno); - - return WSREP_CB_SUCCESS; -} - -/*! This will be called on cluster view change (nodes joining, leaving, etc.). - * Each view change is the point where application may be pronounced out of - * sync with the current cluster view and need state transfer. - * It is guaranteed that no other callbacks are called concurrently with it. */ -static wsrep_cb_status_t -sst_request_cb (void** sst_req, - size_t* sst_req_len) -{ - /* For simplicity we're skipping state transfer by using magic string - * as a state transfer request. - * This node will not be considered JOINED (having full state) - * by other cluster members. */ - *sst_req = strdup(WSREP_STATE_TRANSFER_NONE); - - if (*sst_req) - *sst_req_len = strlen(*sst_req) + 1; - else - *sst_req_len = -ENOMEM; - - return WSREP_CB_SUCCESS; -} - -/*! This is called to "apply" writeset. - * If writesets don't conflict on keys, it may be called concurrently to - * utilize several CPU cores. */ -static wsrep_cb_status_t -apply_cb (void* recv_ctx, - const wsrep_ws_handle_t* ws_handle __attribute__((unused)), - uint32_t flags __attribute__((unused)), - const wsrep_buf_t* ws __attribute__((unused)), - const wsrep_trx_meta_t* meta, - wsrep_bool_t* exit_loop __attribute__((unused))) -{ - struct receiver_context* ctx = (struct receiver_context*)recv_ctx; - - snprintf (ctx->msg, sizeof(ctx->msg), - "Got writeset %lld, size %zu", (long long)meta->gtid.seqno, - ws->len); - - bool const commit = flags & (WSREP_FLAG_TRX_END | WSREP_FLAG_ROLLBACK); - - wsrep->commit_order_enter(wsrep, ws_handle); - if (commit) puts(ctx->msg); - wsrep->commit_order_leave(wsrep, ws_handle, NULL); - - return WSREP_CB_SUCCESS; -} - -/* The following callbacks are stubs and not used in this example. */ -static wsrep_cb_status_t -unordered_cb(void* recv_ctx __attribute__((unused)), - const wsrep_buf_t* data __attribute__((unused))) -{ - return WSREP_CB_SUCCESS; -} - -static wsrep_cb_status_t -sst_donate_cb (void* app_ctx __attribute__((unused)), - void* recv_ctx __attribute__((unused)), - const wsrep_buf_t* msg __attribute__((unused)), - const wsrep_gtid_t* state_id __attribute__((unused)), - const wsrep_buf_t* state __attribute__((unused)), - wsrep_bool_t bypass __attribute__((unused))) -{ - return WSREP_CB_SUCCESS; -} - -static wsrep_cb_status_t synced_cb (void* app_ctx __attribute__((unused))) -{ - return WSREP_CB_SUCCESS; -} - -/* This is the listening thread. It blocks in wsrep::recv() call until - * disconnect from cluster. It will apply and commit writesets through the - * callbacks defined avbove. */ -static void* -recv_thread (void* arg) -{ - struct receiver_context* ctx = (struct receiver_context*)arg; - - wsrep_status_t rc = wsrep->recv(wsrep, ctx); - - fprintf (stderr, "Receiver exited with code %d", rc); - - return NULL; -} - -/* This is a signal handler to demonstrate graceful cluster leave. */ -static void -graceful_leave (int signum) -{ - printf ("Got signal %d, exiting...\n", signum); - wsrep->disconnect(wsrep); -} - -int main (int argc, char* argv[]) -{ - if (argc != 4) - { - fprintf (stderr, "Usage: %s " - "\n", argv[0]); - exit (EXIT_FAILURE); - } - - const char* const wsrep_provider = argv[1]; - const char* const wsrep_uri = argv[2]; - const char* const cluster_name = argv[3]; - - /* Now let's load and initialize provider */ - wsrep_status_t rc = wsrep_load (wsrep_provider, &wsrep, logger_cb); - if (WSREP_OK != rc) - { - fprintf (stderr, "Failed to load wsrep provider '%s'\n",wsrep_provider); - exit (EXIT_FAILURE); - } - - wsrep_gtid_t state_id = { WSREP_UUID_UNDEFINED, WSREP_SEQNO_UNDEFINED }; - - /* wsrep provider initialization arguments */ - struct wsrep_init_args wsrep_args = - { - .app_ctx = &global_ctx, - - .node_name = "example listener", - .node_address = "", - .node_incoming = "", - .data_dir = ".", // working directory - .options = "", - .proto_ver = 127, // maximum supported application event protocol - - .state_id = &state_id, - .state = NULL, - - .logger_cb = logger_cb, - .view_cb = view_cb, - .sst_request_cb = sst_request_cb, - .apply_cb = apply_cb, - .unordered_cb = unordered_cb, - .sst_donate_cb = sst_donate_cb, - .synced_cb = synced_cb - }; - - rc = wsrep->init(wsrep, &wsrep_args); - if (WSREP_OK != rc) - { - fprintf (stderr, "wsrep::init() failed: %d\n", rc); - exit (EXIT_FAILURE); - } - - /* Connect to cluster */ - rc = wsrep->connect (wsrep, cluster_name, wsrep_uri, "", 0); - if (0 != rc) - { - fprintf (stderr, - "wsrep::connect() failed: %d (%s)\n", rc, strerror(-rc)); - exit (EXIT_FAILURE); - } - - /* Now let's start several listening threads*/ - int const num_threads = 4; - struct receiver_context thread_ctx[num_threads]; - pthread_t threads[num_threads]; - - int i; - for (i = 0; i < num_threads; i++) - { - int err = pthread_create ( - &threads[i], NULL, recv_thread, &thread_ctx[i]); - - if (err) - { - fprintf (stderr, "Failed to start thread %d: %d (%s)", - i, err, strerror(err)); - exit (EXIT_FAILURE); - } - } - - signal (SIGTERM, graceful_leave); - signal (SIGINT, graceful_leave); - - /* Listening threads are now running and receiving writesets. Wait for them - * to join. Threads will join after signal handler closes wsrep connection*/ - for (i = 0; i < num_threads; i++) - { - pthread_join (threads[i], NULL); - } - - /* Unload provider after nobody uses it any more. */ - wsrep_unload (wsrep); - - return 0; -} diff --git a/wsrep/wsrep_loader.c b/wsrep/wsrep_loader.c deleted file mode 100644 index 31618de420e72..0000000000000 --- a/wsrep/wsrep_loader.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright (C) 2009-2011 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -/*! @file wsrep implementation loader */ - -#include -#include -#include -#include - -#include "wsrep_api.h" - -// Logging stuff for the loader -static const char* log_levels[] = {"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}; - -static void default_logger (wsrep_log_level_t lvl, const char* msg) -{ - fprintf (stderr, "wsrep loader: [%s] %s\n", log_levels[lvl], msg); -} - -static wsrep_log_cb_t logger = default_logger; - -/************************************************************************** - * Library loader - **************************************************************************/ - -static int wsrep_check_iface_version(const char* found, const char* iface_ver) -{ - const size_t msg_len = 128; - char msg[128]; - - if (strcmp(found, iface_ver)) { - snprintf (msg, msg_len, - "provider interface version mismatch: need '%s', found '%s'", - iface_ver, found); - logger (WSREP_LOG_ERROR, msg); - return EINVAL; - } - - return 0; -} - -static int verify(const wsrep_t *wh, const char *iface_ver) -{ - char msg[128]; - const size_t msg_len = sizeof(msg); - -#define VERIFY(_p) if (!(_p)) { \ - snprintf(msg, msg_len, "wsrep_load(): verify(): %s\n", # _p); \ - logger (WSREP_LOG_ERROR, msg); \ - return EINVAL; \ - } - - VERIFY(wh); - VERIFY(wh->version); - - if (wsrep_check_iface_version(wh->version, iface_ver)) - return EINVAL; - - VERIFY(wh->init); - VERIFY(wh->options_set); - VERIFY(wh->options_get); - VERIFY(wh->connect); - VERIFY(wh->disconnect); - VERIFY(wh->recv); - VERIFY(wh->assign_read_view); - VERIFY(wh->certify); - VERIFY(wh->commit_order_enter); - VERIFY(wh->commit_order_leave); - VERIFY(wh->release); - VERIFY(wh->replay_trx); - VERIFY(wh->abort_certification); - VERIFY(wh->append_key); - VERIFY(wh->append_data); - VERIFY(wh->free_connection); - VERIFY(wh->to_execute_start); - VERIFY(wh->to_execute_end); - VERIFY(wh->preordered_collect); - VERIFY(wh->preordered_commit); - VERIFY(wh->sst_sent); - VERIFY(wh->sst_received); - VERIFY(wh->stats_get); - VERIFY(wh->stats_free); - VERIFY(wh->stats_reset); - VERIFY(wh->pause); - VERIFY(wh->resume); - VERIFY(wh->desync); - VERIFY(wh->resync); - VERIFY(wh->lock); - VERIFY(wh->unlock); - VERIFY(wh->is_locked); - VERIFY(wh->provider_name); - VERIFY(wh->provider_version); - VERIFY(wh->provider_vendor); - VERIFY(wh->free); - return 0; -} - -typedef int (*wsrep_loader_fun)(wsrep_t*); - -static wsrep_loader_fun wsrep_dlf(void *dlh, const char *sym) -{ - union { - wsrep_loader_fun dlfun; - void *obj; - } alias; - alias.obj = dlsym(dlh, sym); - return alias.dlfun; -} - -static int wsrep_check_version_symbol(void *dlh) -{ - char** dlversion = NULL; - dlversion = (char**) dlsym(dlh, "wsrep_interface_version"); - if (dlversion == NULL) - return 0; - return wsrep_check_iface_version(*dlversion, WSREP_INTERFACE_VERSION); -} - -extern int wsrep_dummy_loader(wsrep_t *w); - -int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) -{ - int ret = 0; - void *dlh = NULL; - wsrep_loader_fun dlfun; - char msg[1024]; - const size_t msg_len = sizeof(msg) - 1; - msg[msg_len] = 0; - - if (NULL != log_cb) - logger = log_cb; - - if (!(spec && hptr)) - return EINVAL; - - snprintf (msg, msg_len, - "wsrep_load(): loading provider library '%s'", spec); - logger (WSREP_LOG_INFO, msg); - - if (!(*hptr = malloc(sizeof(wsrep_t)))) { - logger (WSREP_LOG_FATAL, "wsrep_load(): out of memory"); - return ENOMEM; - } - - if (!spec || strcmp(spec, WSREP_NONE) == 0) { - if ((ret = wsrep_dummy_loader(*hptr)) != 0) { - free (*hptr); - *hptr = NULL; - } - return ret; - } - - if (!(dlh = dlopen(spec, RTLD_NOW | RTLD_LOCAL))) { - snprintf(msg, msg_len, "wsrep_load(): dlopen(): %s", dlerror()); - logger (WSREP_LOG_ERROR, msg); - ret = EINVAL; - goto out; - } - - if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader"))) { - ret = EINVAL; - goto out; - } - - if (wsrep_check_version_symbol(dlh) != 0) { - ret = EINVAL; - goto out; - } - - if ((ret = (*dlfun)(*hptr)) != 0) { - snprintf(msg, msg_len, "wsrep_load(): loader failed: %s", - strerror(ret)); - logger (WSREP_LOG_ERROR, msg); - goto out; - } - - if ((ret = verify(*hptr, WSREP_INTERFACE_VERSION)) != 0) { - snprintf (msg, msg_len, - "wsrep_load(): interface version mismatch: my version %s, " - "provider version %s", WSREP_INTERFACE_VERSION, - (*hptr)->version); - logger (WSREP_LOG_ERROR, msg); - goto out; - } - - (*hptr)->dlh = dlh; - -out: - if (ret != 0) { - if (dlh) dlclose(dlh); - free(*hptr); - *hptr = NULL; - } else { - snprintf (msg, msg_len, - "wsrep_load(): %s %s by %s loaded successfully.", - (*hptr)->provider_name, (*hptr)->provider_version, - (*hptr)->provider_vendor); - logger (WSREP_LOG_INFO, msg); - } - - return ret; -} - -void wsrep_unload(wsrep_t *hptr) -{ - if (!hptr) { - logger (WSREP_LOG_WARN, "wsrep_unload(): null pointer."); - } else { - if (hptr->free) - hptr->free(hptr); - if (hptr->dlh) - dlclose(hptr->dlh); - free(hptr); - } -} - diff --git a/wsrep/wsrep_uuid.c b/wsrep/wsrep_uuid.c deleted file mode 100644 index 419594db1275e..0000000000000 --- a/wsrep/wsrep_uuid.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2009 Codership Oy - - 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 Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -/*! @file Helper functions to deal with history UUID string representations */ - -#include -#include -#include -#include - -#include "wsrep_api.h" - -/*! - * Read UUID from string - * @return length of UUID string representation or -EINVAL in case of error - */ -int -wsrep_uuid_scan (const char* str, size_t str_len, wsrep_uuid_t* uuid) -{ - unsigned int uuid_len = 0; - unsigned int uuid_offt = 0; - - while (uuid_len + 1 < str_len) { - /* We are skipping potential '-' after uuid_offt == 4, 6, 8, 10 - * which means - * (uuid_offt >> 1) == 2, 3, 4, 5, - * which in turn means - * (uuid_offt >> 1) - 2 <= 3 - * since it is always >= 0, because uuid_offt is unsigned */ - if (((uuid_offt >> 1) - 2) <= 3 && str[uuid_len] == '-') { - // skip dashes after 4th, 6th, 8th and 10th positions - uuid_len += 1; - continue; - } - - if (isxdigit(str[uuid_len]) && isxdigit(str[uuid_len + 1])) { - // got hex digit, scan another byte to uuid, increment uuid_offt - sscanf (str + uuid_len, "%2hhx", uuid->data + uuid_offt); - uuid_len += 2; - uuid_offt += 1; - if (sizeof (uuid->data) == uuid_offt) - return uuid_len; - } - else { - break; - } - } - - *uuid = WSREP_UUID_UNDEFINED; - return -EINVAL; -} - -/*! - * Write UUID to string - * @return length of UUID string representation or -EMSGSIZE if string is too - * short - */ -int -wsrep_uuid_print (const wsrep_uuid_t* uuid, char* str, size_t str_len) -{ - if (str_len > 36) { - const unsigned char* u = uuid->data; - return snprintf(str, str_len, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" - "%02x%02x-%02x%02x%02x%02x%02x%02x", - u[ 0], u[ 1], u[ 2], u[ 3], u[ 4], u[ 5], u[ 6], u[ 7], - u[ 8], u[ 9], u[10], u[11], u[12], u[13], u[14], u[15]); - } - else { - return -EMSGSIZE; - } -} - -/*! - * Compare two UUIDs - * @return -1, 0, 1 if lhs is respectively smaller, equal, or greater than rhs - */ -int -wsrep_uuid_compare (const wsrep_uuid_t* lhs, const wsrep_uuid_t* rhs) -{ - return memcmp(lhs, rhs, sizeof(wsrep_uuid_t)); -} From 8536a9ca3ee949360bce3451b7c33d0265860237 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Thu, 27 Dec 2018 13:33:55 +0200 Subject: [PATCH 2/6] Fixes acording to Svoj review #2 * removed obsolete packaging directory * removed current_thd usage, except from item_strfunc.cc, where refacoring for skipping current_thd is not straight forward * removed the commented out include file from item_strfunc.h --- packaging/deb-in/CMakeLists.txt | 357 -------------------------- sql/handler.cc | 9 +- sql/item_create.cc | 6 +- sql/item_strfunc.h | 1 - storage/innobase/handler/ha_innodb.cc | 2 +- 5 files changed, 7 insertions(+), 368 deletions(-) delete mode 100644 packaging/deb-in/CMakeLists.txt diff --git a/packaging/deb-in/CMakeLists.txt b/packaging/deb-in/CMakeLists.txt deleted file mode 100644 index aa14eb424251c..0000000000000 --- a/packaging/deb-in/CMakeLists.txt +++ /dev/null @@ -1,357 +0,0 @@ -# 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 -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") - RETURN() -ENDIF() -IF (NOT DEFINED DEB_CODENAME) - execute_process( - COMMAND lsb_release -cs - OUTPUT_VARIABLE DEB_CODENAME - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - SET (DEB_CODENAME ${DEB_CODENAME} CACHE STRING "") -ENDIF() -IF (DEFINED WITH_NDBCLUSTER_STORAGE_ENGINE) - SET (DEB_BASE_PRODUCT "cluster-") - SET (DEB_BASE_PRODUCTC "Cluster ") - SET (DEB_BASE_VERSION ${NDBVERSION}) - SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-community-server, mysql-commercial-server") - SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-community-client, mysql-commercial-client") -ELSE() - SET (DEB_BASE_PRODUCT "") - SET (DEB_BASE_PRODUCTC "") - SET (DEB_BASE_VERSION ${VERSION}) - SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-cluster-community-server, mysql-cluster-commercial-server") - SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-cluster-community-client, mysql-cluster-commercial-client") -ENDIF() - -SET (DEB_BASE_VERSION "${DEB_BASE_VERSION}-${WSREP_VERSION}") - -# Commercial or community -IF (DEB_PRODUCT STREQUAL "commercial") - message (FATAL_ERROR "mysql-wsrep is GPL only, no commercial builds") - SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Commercial Server ${MYSQL_BASE_VERSION}") - SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}commercial") - SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Commercial") - SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}community") - SET (DEB_LICENSENAME "Advanced") - SET (DEB_INSTALL_LICENSEFILE "LICENSE.mysql") - SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+commercial.1") - SET (DEB_PLUGIN_SETPERMISSION "") - SET (DEB_MAN_SETPERMISSION "") - # List of plugins that are only in commercial packages - # Plugins that are in both community and commercial should NOT be added here - SET (DEB_INCLUDE_BINARIES_EXTRA -" -debian/extra/audit_log-plugin -debian/extra/authentication_pam-plugin -debian/extra/firewall-plugin -debian/extra/openssl_udf-plugin -debian/extra/thread_pool-plugin -") - SET (DEB_INSTALL_SERVER_PLUGINS -" -usr/lib/mysql/plugin/audit_log.so -usr/lib/mysql/plugin/authentication_pam.so -usr/lib/mysql/plugin/openssl_udf.so -usr/lib/mysql/plugin/thread_pool.so -usr/lib/mysql/plugin/firewall.so -usr/lib/mysql/plugin/debug/audit_log.so -usr/lib/mysql/plugin/debug/authentication_pam.so -usr/lib/mysql/plugin/debug/keyring_okv.so -usr/lib/mysql/plugin/debug/openssl_udf.so -usr/lib/mysql/plugin/debug/thread_pool.so -usr/lib/mysql/plugin/debug/firewall.so -") - SET (DEB_REMOVEPATTERN "gpl.in") -ELSE() - SET (DEB_PRODUCT "${DEB_BASE_PRODUCT}community") - SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Server ${MYSQL_BASE_VERSION}") - SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}community") - SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Community") - SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}commercial") - SET (DEB_LICENSENAME "GPL") - SET (DEB_INSTALL_LICENSEFILE "COPYING") - SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+1") - SET (DEB_REMOVEPATTERN "com.in") - SET (DEB_PLUGIN_SETPERMISSION "usr/bin/mysql_setpermission") - SET (DEB_MAN_SETPERMISSION "usr/share/man/man1/mysql_setpermission.1") -ENDIF() - -# mysql-wsrep ! -SET (DEB_PRODUCTNAME "wsrep") -SET (DEB_PRODUCTNAMEC "Wsrep") -SET (DEB_PRODUCTSERIES "-5.6") -SET (DEB_WSREP_README "README-wsrep") - - -SET (FILES_STARTUP_SYSV -" -etc/init.d/mysql -usr/bin/mysqld_safe -") -SET (FILES_STARTUP_UPSTART -" -Not Yet Implememted: Upstart File List -") - -# Platform specifics. The differences are generally only distro version -# and whether or not Systemd and/or apparmor are available -IF (DEB_CODENAME STREQUAL "wheezy") - SET (DEB_PLATFORMRELEASE "debian7") - # Following the Oracle example, we package for Debian 7 - # using only SysV init and no Apparmor. - SET (DEB_CONTROL_BDEPS "") - SET (DEB_INSTALL_SOURCE_XZ "") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR "") - SET (DEB_RULES_APPARMOR_LOAD "") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_SERVICE_SERVER_EXECPOST "") - SET (DEB_INIT_APPARMOR "") - SET (DEB_STARTUP "SYSV") -ELSEIF(DEB_CODENAME STREQUAL "jessie") - SET (DEB_PLATFORMRELEASE "debian8") - # Improving on Oracle, we would prefer to package for Debian 8 - # using both SysV init and Systemd, but still no Apparmor. - SET (DEB_CONTROL_BDEPS "") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR "") - SET (DEB_RULES_APPARMOR_LOAD "") - SET (DEB_SYSTEMD_SERVICE_NAME "") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_SERVICE_SERVER_EXECPOST "") - SET (DEB_INIT_APPARMOR "") - # Debian 8 comes with both SysV init and Systemd, - # but "scripts/CMakeLists.txt" enforces an either-or. - SET (DEB_STARTUP "SYSV") - # For now, we go with Systemd only. -ELSEIF(DEB_CODENAME STREQUAL "stretch") - SET (DEB_PLATFORMRELEASE "debian9") - SET (DEB_CONTROL_BDEPS "") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR "") - SET (DEB_RULES_APPARMOR_LOAD "") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_INIT_APPARMOR "") - SET (DEB_STARTUP "SYSV") -ELSEIF(DEB_CODENAME STREQUAL "precise") - SET (DEB_PLATFORMRELEASE "ubuntu12.04") - SET (DEB_CONTROL_BDEPS "dh-apparmor") - SET (DEB_INSTALL_SOURCE_XZ "") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_SERVICE_SERVER_EXECPOST "") - SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") - SET (DEB_STARTUP "SYSV") -ELSEIF(DEB_CODENAME STREQUAL "trusty") - SET (DEB_PLATFORMRELEASE "ubuntu14.04") - SET (DEB_CONTROL_BDEPS "dh-apparmor") - SET (DEB_INSTALL_SOURCE_XZ "") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_SERVICE_SERVER_EXECPOST "") - SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") - SET (DEB_STARTUP "SYSV") -ELSEIF(DEB_CODENAME STREQUAL "wily") - SET (DEB_PLATFORMRELEASE "ubuntu15.10") - SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD - "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld") - SET (DEB_SYSTEMD_SERVICE_NAME "mysql") - SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql") - SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") - SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE - "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") - SET (DEB_SERVICE_SERVER_EXECPOST - "ExecStartPost=/usr/share/mysql/mysql-systemd-start post") - SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") - SET (DEB_STARTUP "SYSTEMD") -ELSEIF(DEB_CODENAME STREQUAL "xenial") - SET (DEB_PLATFORMRELEASE "ubuntu16.04") - SET (DEB_CONTROL_BDEPS "dh-apparmor") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD "") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") - SET (DEB_SYSTEMD_SERVICE_NAME "") - SET (DEB_RULES_SYSTEMD_ENABLE "") - SET (DEB_RULES_SYSTEMD_START "") - SET (DEB_INSTALL_SERVER_SYSTEMD "") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE "") - SET (DEB_SERVICE_SERVER_EXECPOST "") - SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") - SET (DEB_STARTUP "SYSV") -ELSEIF(DEB_CODENAME STREQUAL "yakkety") - SET (DEB_PLATFORMRELEASE "ubuntu16.10") - SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD - "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") - SET (DEB_SYSTEMD_SERVICE_NAME "mysql") - SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql") - SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") - SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE - "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") - SET (DEB_SERVICE_SERVER_EXECPOST - "ExecStartPost=/usr/share/mysql/mysql-systemd-start post") - SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") - SET (DEB_STARTUP "SYSTEMD") -ELSEIF(DEB_CODENAME STREQUAL "zesty") - SET (DEB_PLATFORMRELEASE "ubuntu17.04") - SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") - SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") - SET (DEB_RULES_INSTALL_SYSTEMD - "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") - SET (DEB_RULES_INSTALL_APPARMOR - "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_RULES_APPARMOR_LOAD - "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") - SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql") - SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") - SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") - SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") - SET (DEB_SERVICE_SERVER_EXECPRE - "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") - SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") -ELSE() - MESSAGE(STATUS - "Skipping deb packaging on unsupported platform ${DEB_CODENAME}.") - RETURN() -ENDIF() - -# All files are configured and copied to the debian/ directory, which is used -# by debuild to make the packages -# 5.7.11 builds out-of-source. Hack: have duplicate debian/ -SET (DEB_ROOT ${CMAKE_SOURCE_DIR}/packaging/deb-in) -FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian) -FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/debian) -FILE(GLOB_RECURSE SOURCEFILES RELATIVE "${DEB_ROOT}" "${DEB_ROOT}/*") -# Skip the copyright file from the "other" product type -LIST(REMOVE_ITEM SOURCEFILES "copyright.${DEB_REMOVEPATTERN}") -LIST(REMOVE_ITEM SOURCEFILES "CMakeLists.txt") -# Combine the list of all startup files to be included, -# skip Debian magical init files unless needed -IF(DEB_PRODUCTNAME STREQUAL "wsrep") - SET(COMMON_WSREP_CONFLICTS "mysql-common (>= 5.7)") - LIST(REMOVE_ITEM SOURCEFILES "mysql-common.install.in") - LIST(REMOVE_ITEM SOURCEFILES "mysql-common.dirs.in") - LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postinst.in") - LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postrm.in") -ENDIF() -IF(DEB_STARTUP MATCHES ".*SYSV.*") - SET (DEB_FILES_STARTUP ${FILES_STARTUP_SYSV}) -ELSE() - LIST(REMOVE_ITEM SOURCEFILES - "mysql-packagesource-server-SERIES.mysql.init.in") -ENDIF() -IF(DEB_STARTUP MATCHES ".*SYSTEMD.*") - SET (DEB_FILES_STARTUP - ${DEB_FILES_STARTUP} - ${FILES_STARTUP_SYSTEMD}) -ELSE() - LIST(REMOVE_ITEM SOURCEFILES - "mysql-packagesource-server-SERIES.mysql.service.in") -ENDIF() -# Don't install systemd file on systems without systemd -IF(DEB_INSTALL_SERVER_SYSTEMD STREQUAL "") - LIST(REMOVE_ITEM SOURCEFILES "mysql-packagesource-server.mysql.service.in") -ENDIF() - -FOREACH (SOURCEFILE ${SOURCEFILES}) - STRING(REGEX REPLACE "-packagesource-" "-${DEB_PRODUCTNAME}-" - TMPFILE ${SOURCEFILE}) - STRING(REGEX REPLACE "-SERIES" "${DEB_PRODUCTSERIES}" TMPFILE ${TMPFILE}) - # Strip away the input file endings from the destination filenames - STRING(REGEX REPLACE ".in$" "" TMPFILE ${TMPFILE}) - STRING(REGEX REPLACE ".gpl$" "" TMPFILE ${TMPFILE}) - STRING(REGEX REPLACE ".com$" "" DESTFILE ${TMPFILE}) - CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}" - "${CMAKE_BINARY_DIR}/debian/${DESTFILE}" @ONLY) - CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}" - "${CMAKE_SOURCE_DIR}/debian/${DESTFILE}" @ONLY) -ENDFOREACH() -EXECUTE_PROCESS( - COMMAND chmod +x ${CMAKE_BINARY_DIR}/debian/rules -) -IF(DEB_PRODUCTNAME STREQUAL "wsrep") -FILE(APPEND "${CMAKE_BINARY_DIR}/debian/control" " -Package: mysql-common -Architecture: any -Pre-depends: debconf (>= 0.2.17), - \${misc:Pre-Depends} -Multi-Arch: foreign -Depends: \${misc:Depends}, - \${shlibs:Depends}, - mysql-wsrep-common -Description: MySQL Common - The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, - and robust SQL (Structured Query Language) database server. MySQL Server - is intended for mission-critical, heavy-load production systems as well - as for embedding into mass-deployed software. MySQL is a trademark of - Oracle. This package contains common files needed by MySQL client - library and the MySQL database server. - This package is a dummy replacement for the case when using mysql WSREP - implementation to satisfy dependencies of other packages - like libmysqlclient18. It depends on any mysql-wsrep-common -") -ENDIF() diff --git a/sql/handler.cc b/sql/handler.cc index 7519a0fa8e316..718e44f308140 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6440,9 +6440,8 @@ int handler::ha_write_row(uchar *buf) rows_changed++; error= binlog_log_row(table, 0, buf, log_func); #ifdef WITH_WSREP - THD *thd= current_thd; if (table_share->tmp_table == NO_TMP_TABLE && - WSREP(thd) && (error= wsrep_after_row(thd))) + WSREP(ha_thd()) && (error= wsrep_after_row(ha_thd()))) { DBUG_RETURN(error); } @@ -6481,9 +6480,8 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data) rows_changed++; error= binlog_log_row(table, old_data, new_data, log_func); #ifdef WITH_WSREP - THD *thd= current_thd; if (table_share->tmp_table == NO_TMP_TABLE && - WSREP(thd) && (error= wsrep_after_row(thd))) + WSREP(ha_thd()) && (error= wsrep_after_row(ha_thd()))) { return error; } @@ -6544,9 +6542,8 @@ int handler::ha_delete_row(const uchar *buf) rows_changed++; error= binlog_log_row(table, buf, 0, log_func); #ifdef WITH_WSREP - THD *thd= current_thd; if (table_share->tmp_table == NO_TMP_TABLE && - WSREP(thd) && (error= wsrep_after_row(thd))) + WSREP(ha_thd()) && (error= wsrep_after_row(ha_thd()))) { return error; } diff --git a/sql/item_create.cc b/sql/item_create.cc index a4c3de5f8fbae..ba7a704e29b71 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -6951,7 +6951,7 @@ Create_func_wsrep_last_written_gtid::s_singleton; Item* Create_func_wsrep_last_written_gtid::create_builder(THD *thd) { - current_thd->lex->safe_to_cache_query= 0; + thd->lex->safe_to_cache_query= 0; return new (thd->mem_root) Item_func_wsrep_last_written_gtid(thd); } @@ -6962,7 +6962,7 @@ Create_func_wsrep_last_seen_gtid::s_singleton; Item* Create_func_wsrep_last_seen_gtid::create_builder(THD *thd) { - current_thd->lex->safe_to_cache_query= 0; + thd->lex->safe_to_cache_query= 0; return new (thd->mem_root) Item_func_wsrep_last_seen_gtid(thd); } @@ -6997,7 +6997,7 @@ Create_func_wsrep_sync_wait_upto::create_native(THD *thd, my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str); break; } - current_thd->lex->safe_to_cache_query= 0; + thd->lex->safe_to_cache_query= 0; return func; } #endif /* WITH_WSREP */ diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 6fcb8f87b57da..2ead0f44e4960 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1806,7 +1806,6 @@ class Item_temptable_rowid :public Item_str_func }; #ifdef WITH_WSREP -//#include "../wsrep/wsrep_api.h" #include "wsrep_api.h" class Item_func_wsrep_last_written_gtid: public Item_str_ascii_func diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4f3e710a118b7..fc2827a7f4f36 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8127,7 +8127,7 @@ ha_innobase::write_row( wsrep_thd_query(m_user_thd) : (char *)"void"); error= DB_SUCCESS; - wsrep_thd_self_abort(current_thd); + wsrep_thd_self_abort(m_user_thd); innobase_srv_conc_exit_innodb( m_prebuilt); /* jump straight to func exit over From 8e99d84f6b9aef5ae39bc10ec643112b80acc788 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Thu, 27 Dec 2018 14:24:51 +0200 Subject: [PATCH 3/6] Fixes according to Svoj review #2 * brought back the "INCLUDE(for_clients)" in CMakeLists.txt, it is now same as in upstream 10.4, the line was removed by merging mistake * removed obsolete have_ipv6.inc, tests have refactored before to use check_ipv6.inc --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d33591256f98b..cdeae04dc3bb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,7 +428,7 @@ INCLUDE(cmake/tags.cmake) - +INCLUDE(for_clients) ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(support-files) From d5edc41ad18a399afb3df23600e5bf985b7722ec Mon Sep 17 00:00:00 2001 From: sjaakola Date: Sun, 30 Dec 2018 19:30:37 +0200 Subject: [PATCH 4/6] Fixes according to svoj review #2 --- sql/handler.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 718e44f308140..4c69d9f3a5eb9 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1655,7 +1655,7 @@ int ha_commit_trans(THD *thd, bool all) mysql_mutex_unlock(&thd->LOCK_thd_data); #endif /* WITH_WSREP */ - err: +err: error= 1; /* Transaction was rolled back */ /* In parallel replication, rollback is delayed, as there is extra replication @@ -1669,7 +1669,7 @@ int ha_commit_trans(THD *thd, bool all) WSREP_DEBUG("rollback skipped %p %d",thd->rgi_slave, thd->rgi_slave->is_parallel_exec); } - end: +end: if (rw_trans && mdl_request.ticket) { /* @@ -6279,10 +6279,9 @@ int binlog_log_row(TABLE* table, const uchar *before_record, THD *const thd= table->in_use; /* only InnoDB tables will be replicated through binlog emulation */ - if (WSREP_EMULATE_BINLOG(thd) && - table->file->ht->db_type != DB_TYPE_INNODB && - !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && - (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB)) || + if ((WSREP_EMULATE_BINLOG(thd) && + table->file->ht->db_type != DB_TYPE_INNODB && + table->file->partition_ht()->db_type != DB_TYPE_INNODB) || (thd->wsrep_ignore_table == true)) return 0; #endif From e29943d0c15a2d40901ac64da18dd646385e029f Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 9 Jan 2019 15:37:09 +0200 Subject: [PATCH 5/6] Fixes according to svoj review #2 Removed the obsolete reference to wsrep-lib --- extra/mariabackup/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt index 08745ea1e6193..f371b8b7a16db 100644 --- a/extra/mariabackup/CMakeLists.txt +++ b/extra/mariabackup/CMakeLists.txt @@ -40,9 +40,6 @@ IF(NOT HAVE_SYSTEM_REGEX) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pcre) ENDIF() -IF(WITH_WSREP) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep-lib) -ENDIF() ADD_DEFINITIONS(-UMYSQL_SERVER) ######################################################################## From 850a478f3adc1da6fe714bce64a1629479721e0b Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 9 Jan 2019 23:15:02 +0200 Subject: [PATCH 6/6] Fixes according to svoj review #2 --- CMakeLists.txt | 11 +++---- mysql-test/include/mtr_warnings.sql | 47 ----------------------------- sql/wsrep_mysqld.cc | 2 -- 3 files changed, 5 insertions(+), 55 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdeae04dc3bb3..9cad6482475eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,12 +383,6 @@ INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb) # Add storage engines and plugins. CONFIGURE_PLUGINS() -IF(NOT WITHOUT_SERVER) - IF(WITH_WSREP) - ADD_SUBDIRECTORY(wsrep-lib) - ENDIF() -ENDIF() - ADD_SUBDIRECTORY(include) ADD_SUBDIRECTORY(dbug) ADD_SUBDIRECTORY(strings) @@ -410,6 +404,10 @@ IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(unittest/embedded) ENDIF(WITH_EMBEDDED_SERVER) + IF(WITH_WSREP) + ADD_SUBDIRECTORY(wsrep-lib) + ENDIF() + ADD_SUBDIRECTORY(mysql-test) ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(sql-bench) @@ -428,6 +426,7 @@ INCLUDE(cmake/tags.cmake) + INCLUDE(for_clients) ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(support-files) diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 481f924088d50..4cdc9868c221b 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -229,53 +229,6 @@ INSERT INTO global_suppressions VALUES MDEV-12501 -- set --maturity-level by default */ ("Plugin .* is of maturity level .* while the server is .*"), - ("WSREP:*down context*"), - ("WSREP: Failed to send state UUID:*"), - ("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"), - ("WSREP: option --wsrep-causal-reads is deprecated"), - ("WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0"), - ("WSREP: Could not open saved state file for reading: "), - ("WSREP: Could not open state file for reading: "), - ("WSREP: access file\\(.*gvwstate\\.dat\\) failed\\(No such file or directory\\)"), - ("WSREP: Gap in state sequence\\. Need state transfer\\."), - ("WSREP: Failed to prepare for incremental state transfer: Local state UUID \\(00000000-0000-0000-0000-000000000000\\) does not match group state UUID"), - ("WSREP: No existing UUID has been found, so we assume that this is the first time that this server has been started\\. Generating a new UUID: "), - ("WSREP: last inactive check more than"), - ("WSREP: binlog cache not empty \\(0 bytes\\) at connection close"), - ("WSREP: SQL statement was ineffective"), - ("WSREP: Refusing exit for the last slave thread"), - ("WSREP: Quorum: No node with complete state"), - ("WSREP: Failed to report last committed"), - ("Slave SQL: Error 'Duplicate entry"), - ("Query apply warning:"), - ("WSREP: Ignoring error"), - ("WSREP: Initial position was provided by configuration or SST, avoiding override"), - ("Warning: Using a password on the command line interface can be insecure"), - ("InnoDB: Error: Table \"mysql\"\\.\"innodb_table_stats\" not found"), - ("but it is impossible to select State Transfer donor: Resource temporarily unavailable"), - ("WSREP: Could not find peer"), - ("WSREP: discarding established \\(time wait\\)"), - ("sending install message failed: Resource temporarily unavailable"), - ("WSREP: Ignoring possible split-brain \\(allowed by configuration\\) from view"), - ("WSREP: no nodes coming from prim view, prim not possible"), - ("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"), - ("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"), - ("WSREP: gcs_caused\\(\\) returned -57 \\(Socket is not connected\\)"), - ("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"), - ("Action message in non-primary configuration from member"), - ("SYNC message from member"), - ("InnoDB: Resizing redo log from"), - ("InnoDB: Starting to delete and rewrite log files"), - ("InnoDB: New log files created, LSN="), --- WSREP: Send action {0x7f86280147f0, 73, STATE_REQUEST} returned -107 (Transport endpoint is not connected) - ("Transport endpoint is not connected"), - ("Socket is not connected"), --- "WSREP: Protocol violation. JOIN message sender 1.0 (host-91-221-67-96) is not in state transfer (SYNCED). Message ignored. - ("is not in state transfer"), - ("JOIN message from member .* in non-primary configuration"), - ("install timer expired"), - ("Last Applied Action message in non-primary configuration from member"), - ("THE_LAST_SUPPRESSION")|| diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 5e59bf89d8551..e0e0f403d0f3a 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2959,7 +2959,6 @@ void* start_wsrep_THD(void *arg) thd->proc_info= 0; thd->set_command(COM_SLEEP); thd->init_for_queries(); - DBUG_ASSERT(current_thd); mysql_mutex_lock(&LOCK_thread_count); wsrep_running_threads++; mysql_cond_broadcast(&COND_thread_count); @@ -2985,7 +2984,6 @@ void* start_wsrep_THD(void *arg) WSREP_DEBUG("wsrep running threads now: %lu", wsrep_running_threads); mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); - DBUG_ASSERT(current_thd); /* Note: We can't call THD destructor without crashing if plugins have not been initialized. However, in most of the