Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
This commit is contained in:
commit
ec8c38a82e
@ -14,6 +14,7 @@ cache:
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- GCC_VERSION=4.8
|
||||
- GCC_VERSION=5
|
||||
- GCC_VERSION=6
|
||||
addons:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, MariaDB
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -199,12 +199,12 @@ const char *compatible_mode_names[]=
|
||||
};
|
||||
#define MASK_ANSI_QUOTES \
|
||||
(\
|
||||
(1<<2) | /* POSTGRESQL */\
|
||||
(1<<3) | /* ORACLE */\
|
||||
(1<<4) | /* MSSQL */\
|
||||
(1<<5) | /* DB2 */\
|
||||
(1<<6) | /* MAXDB */\
|
||||
(1<<10) /* ANSI */\
|
||||
(1U<<2) | /* POSTGRESQL */\
|
||||
(1U<<3) | /* ORACLE */\
|
||||
(1U<<4) | /* MSSQL */\
|
||||
(1U<<5) | /* DB2 */\
|
||||
(1U<<6) | /* MAXDB */\
|
||||
(1U<<10) /* ANSI */\
|
||||
)
|
||||
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
|
||||
"", compatible_mode_names, NULL};
|
||||
@ -5476,7 +5476,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
|
||||
*err_len= var_len;
|
||||
}
|
||||
else
|
||||
found|= ((longlong) 1 << (find - 1));
|
||||
found|= 1UL << (find - 1);
|
||||
if (pos == end)
|
||||
break;
|
||||
start= pos + 1;
|
||||
|
24
dbug/dbug.c
24
dbug/dbug.c
@ -115,18 +115,18 @@
|
||||
* (until we add flags to _db_stack_frame_, increasing it by 4 bytes)
|
||||
*/
|
||||
|
||||
#define DEBUG_ON (1 << 1) /* Debug enabled */
|
||||
#define FILE_ON (1 << 2) /* File name print enabled */
|
||||
#define LINE_ON (1 << 3) /* Line number print enabled */
|
||||
#define DEPTH_ON (1 << 4) /* Function nest level print enabled */
|
||||
#define PROCESS_ON (1 << 5) /* Process name print enabled */
|
||||
#define NUMBER_ON (1 << 6) /* Number each line of output */
|
||||
#define PID_ON (1 << 8) /* Identify each line with process id */
|
||||
#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */
|
||||
#define FLUSH_ON_WRITE (1 << 10) /* Flush on every write */
|
||||
#define OPEN_APPEND (1 << 11) /* Open for append */
|
||||
#define SANITY_CHECK_ON (1 << 12) /* Check memory on every DBUG_ENTER/RETURN */
|
||||
#define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/
|
||||
#define DEBUG_ON (1U << 1) /* Debug enabled */
|
||||
#define FILE_ON (1U << 2) /* File name print enabled */
|
||||
#define LINE_ON (1U << 3) /* Line number print enabled */
|
||||
#define DEPTH_ON (1U << 4) /* Function nest level print enabled */
|
||||
#define PROCESS_ON (1U << 5) /* Process name print enabled */
|
||||
#define NUMBER_ON (1U << 6) /* Number each line of output */
|
||||
#define PID_ON (1U << 8) /* Identify each line with process id */
|
||||
#define TIMESTAMP_ON (1U << 9) /* timestamp every line of output */
|
||||
#define FLUSH_ON_WRITE (1U << 10) /* Flush on every write */
|
||||
#define OPEN_APPEND (1U << 11) /* Open for append */
|
||||
#define SANITY_CHECK_ON (1U << 12) /* Check memory on every DBUG_ENTER/RETURN */
|
||||
#define TRACE_ON (1U << 31) /* Trace enabled. MUST be the highest bit!*/
|
||||
|
||||
#define sf_sanity() (0)
|
||||
#define TRACING (cs->stack->flags & TRACE_ON)
|
||||
|
4
debian/rules
vendored
4
debian/rules
vendored
@ -84,6 +84,10 @@ endif
|
||||
-DCOMPILATION_COMMENT="mariadb.org binary distribution" \
|
||||
-DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
|
||||
-DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \
|
||||
$${MYSQL_BUILD_CXX:+-DCMAKE_CXX_COMPILER=$${MYSQL_BUILD_CXX}} \
|
||||
$${MYSQL_BUILD_CC:+-DCMAKE_C_COMPILER=$${MYSQL_BUILD_CC}} \
|
||||
$${MYSQL_COMPILER_LAUNCHER:+-DCMAKE_CXX_COMPILER_LAUNCHER=${MYSQL_COMPILER_LAUNCHER}} \
|
||||
$${MYSQL_COMPILER_LAUNCHER:+-DCMAKE_C_COMPILER_LAUNCHER=${MYSQL_COMPILER_LAUNCHER}} \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_BUILD_ARCH) \
|
||||
-DBUILD_CONFIG=mysql_release \
|
||||
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -599,8 +600,8 @@ inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block,
|
||||
word16*)
|
||||
{
|
||||
return (order == BigEndianOrder)
|
||||
? block[1] | (block[0] << 8)
|
||||
: block[0] | (block[1] << 8);
|
||||
? word16(block[1] | (word16(block[0]) << 8))
|
||||
: word16(block[0] | (word16(block[1]) << 8));
|
||||
}
|
||||
|
||||
inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block,
|
||||
@ -625,7 +626,7 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, byte value,
|
||||
block[0] = xorBlock ? (value ^ xorBlock[0]) : value;
|
||||
}
|
||||
|
||||
#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y)))
|
||||
#define GETBYTE(x, y) byte((x)>>(8*(y)))
|
||||
|
||||
inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value,
|
||||
const byte *xorBlock = 0)
|
||||
@ -827,7 +828,7 @@ word ShiftWordsLeftByBits(word* r, unsigned int n, unsigned int shiftBits)
|
||||
|
||||
|
||||
inline
|
||||
word ShiftWordsRightByBits(word* r, unsigned int n, unsigned int shiftBits)
|
||||
word ShiftWordsRightByBits(word* r, int n, unsigned int shiftBits)
|
||||
{
|
||||
word u, carry=0;
|
||||
if (shiftBits)
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -57,7 +58,7 @@ class Mode_BASE : public virtual_base {
|
||||
public:
|
||||
enum { MaxBlockSz = 16 };
|
||||
|
||||
explicit Mode_BASE(int sz, CipherDir dir, Mode mode)
|
||||
explicit Mode_BASE(unsigned sz, CipherDir dir, Mode mode)
|
||||
: blockSz_(sz), reg_(reinterpret_cast<byte*>(r_)),
|
||||
tmp_(reinterpret_cast<byte*>(t_)), dir_(dir), mode_(mode)
|
||||
{}
|
||||
@ -67,7 +68,7 @@ public:
|
||||
|
||||
void SetIV(const byte* iv) { memcpy(reg_, iv, blockSz_); }
|
||||
protected:
|
||||
int blockSz_;
|
||||
unsigned blockSz_;
|
||||
byte* reg_;
|
||||
byte* tmp_;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 1995, 2012 Monty Program Ab
|
||||
Copyright (c) 1995, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -34,25 +34,25 @@
|
||||
|
||||
/* The following is bits in the flag parameter to ha_open() */
|
||||
|
||||
#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */
|
||||
#define HA_OPEN_WAIT_IF_LOCKED 1
|
||||
#define HA_OPEN_IGNORE_IF_LOCKED 2
|
||||
#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */
|
||||
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
|
||||
#define HA_OPEN_ABORT_IF_CRASHED 16
|
||||
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
|
||||
#define HA_OPEN_FROM_SQL_LAYER 64
|
||||
#define HA_OPEN_MMAP 128 /* open memory mapped */
|
||||
#define HA_OPEN_COPY 256 /* Open copy (for repair) */
|
||||
#define HA_OPEN_ABORT_IF_LOCKED 0U /* default */
|
||||
#define HA_OPEN_WAIT_IF_LOCKED 1U
|
||||
#define HA_OPEN_IGNORE_IF_LOCKED 2U
|
||||
#define HA_OPEN_TMP_TABLE 4U /* Table is a temp table */
|
||||
#define HA_OPEN_DELAY_KEY_WRITE 8U /* Don't update index */
|
||||
#define HA_OPEN_ABORT_IF_CRASHED 16U
|
||||
#define HA_OPEN_FOR_REPAIR 32U /* open even if crashed */
|
||||
#define HA_OPEN_FROM_SQL_LAYER 64U
|
||||
#define HA_OPEN_MMAP 128U /* open memory mapped */
|
||||
#define HA_OPEN_COPY 256U /* Open copy (for repair) */
|
||||
/* Internal temp table, used for temporary results */
|
||||
#define HA_OPEN_INTERNAL_TABLE 512
|
||||
#define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */
|
||||
#define HA_OPEN_MERGE_TABLE 2048
|
||||
#define HA_OPEN_INTERNAL_TABLE 512U
|
||||
#define HA_OPEN_NO_PSI_CALL 1024U /* Don't call/connect PSI */
|
||||
#define HA_OPEN_MERGE_TABLE 2048U
|
||||
/*
|
||||
Allow opening even if table is incompatible as this is for ALTER TABLE which
|
||||
will fix the table structure.
|
||||
*/
|
||||
#define HA_OPEN_FOR_ALTER 4096
|
||||
#define HA_OPEN_FOR_ALTER 4096U
|
||||
|
||||
/* The following is parameter to ha_rkey() how to use key */
|
||||
|
||||
@ -248,15 +248,15 @@ enum ha_base_keytype {
|
||||
Note that these can only be up to 16 bits!
|
||||
*/
|
||||
|
||||
#define HA_NOSAME 1 /* Set if not dupplicated records */
|
||||
#define HA_PACK_KEY 2 /* Pack string key to previous key */
|
||||
#define HA_AUTO_KEY 16
|
||||
#define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */
|
||||
#define HA_FULLTEXT 128 /* For full-text search */
|
||||
#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */
|
||||
#define HA_SPATIAL 1024 /* For spatial search */
|
||||
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
|
||||
#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
|
||||
#define HA_NOSAME 1U /* Set if not dupplicated records */
|
||||
#define HA_PACK_KEY 2U /* Pack string key to previous key */
|
||||
#define HA_AUTO_KEY 16U
|
||||
#define HA_BINARY_PACK_KEY 32U /* Packing of all keys to prev key */
|
||||
#define HA_FULLTEXT 128U /* For full-text search */
|
||||
#define HA_UNIQUE_CHECK 256U /* Check the key for uniqueness */
|
||||
#define HA_SPATIAL 1024U /* For spatial search */
|
||||
#define HA_NULL_ARE_EQUAL 2048U /* NULL in key are cmp as equal */
|
||||
#define HA_GENERATED_KEY 8192U /* Automaticly generated key */
|
||||
|
||||
/* The combination of the above can be used for key type comparison. */
|
||||
#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \
|
||||
@ -303,25 +303,25 @@ enum ha_base_keytype {
|
||||
#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
|
||||
|
||||
/* optionbits for database */
|
||||
#define HA_OPTION_PACK_RECORD 1
|
||||
#define HA_OPTION_PACK_KEYS 2
|
||||
#define HA_OPTION_COMPRESS_RECORD 4
|
||||
#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */
|
||||
#define HA_OPTION_TMP_TABLE 16
|
||||
#define HA_OPTION_CHECKSUM 32
|
||||
#define HA_OPTION_DELAY_KEY_WRITE 64
|
||||
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
|
||||
#define HA_OPTION_PACK_RECORD 1U
|
||||
#define HA_OPTION_PACK_KEYS 2U
|
||||
#define HA_OPTION_COMPRESS_RECORD 4U
|
||||
#define HA_OPTION_LONG_BLOB_PTR 8U /* new ISAM format */
|
||||
#define HA_OPTION_TMP_TABLE 16U
|
||||
#define HA_OPTION_CHECKSUM 32U
|
||||
#define HA_OPTION_DELAY_KEY_WRITE 64U
|
||||
#define HA_OPTION_NO_PACK_KEYS 128U /* Reserved for MySQL */
|
||||
/* unused 256 */
|
||||
#define HA_OPTION_RELIES_ON_SQL_LAYER 512
|
||||
#define HA_OPTION_NULL_FIELDS 1024
|
||||
#define HA_OPTION_PAGE_CHECKSUM 2048
|
||||
#define HA_OPTION_RELIES_ON_SQL_LAYER 512U
|
||||
#define HA_OPTION_NULL_FIELDS 1024U
|
||||
#define HA_OPTION_PAGE_CHECKSUM 2048U
|
||||
/*
|
||||
STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE
|
||||
or ALTER TABLE). Table and index statistics that are collected by the
|
||||
storage engine and used by the optimizer for query optimization will be
|
||||
stored on disk and will not change after a server restart.
|
||||
*/
|
||||
#define HA_OPTION_STATS_PERSISTENT 4096
|
||||
#define HA_OPTION_STATS_PERSISTENT 4096U
|
||||
/*
|
||||
STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE. Statistics
|
||||
for the table will be wiped away on server shutdown and new ones recalculated
|
||||
@ -330,31 +330,31 @@ enum ha_base_keytype {
|
||||
explicitly set at table level and the corresponding table will use whatever
|
||||
is the global server default.
|
||||
*/
|
||||
#define HA_OPTION_NO_STATS_PERSISTENT 8192
|
||||
#define HA_OPTION_NO_STATS_PERSISTENT 8192U
|
||||
|
||||
/* .frm has extra create options in linked-list format */
|
||||
#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1L << 14) /* 5.2 to 5.5, unused since 10.0 */
|
||||
#define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */
|
||||
#define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */
|
||||
#define HA_OPTION_NO_CHECKSUM (1L << 17)
|
||||
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
|
||||
#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1U << 14) /* 5.2 to 5.5, unused since 10.0 */
|
||||
#define HA_OPTION_TEMP_COMPRESS_RECORD (1U << 15) /* set by isamchk */
|
||||
#define HA_OPTION_READ_ONLY_DATA (1U << 16) /* Set by isamchk */
|
||||
#define HA_OPTION_NO_CHECKSUM (1U << 17)
|
||||
#define HA_OPTION_NO_DELAY_KEY_WRITE (1U << 18)
|
||||
|
||||
/* Bits in flag to create() */
|
||||
|
||||
#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */
|
||||
#define HA_PACK_RECORD 2 /* Request packed record format */
|
||||
#define HA_CREATE_TMP_TABLE 4
|
||||
#define HA_CREATE_CHECKSUM 8
|
||||
#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
|
||||
#define HA_CREATE_PAGE_CHECKSUM 32
|
||||
#define HA_CREATE_DELAY_KEY_WRITE 64
|
||||
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
|
||||
#define HA_CREATE_INTERNAL_TABLE 256
|
||||
#define HA_PRESERVE_INSERT_ORDER 512
|
||||
#define HA_DONT_TOUCH_DATA 1U /* Don't empty datafile (isamchk) */
|
||||
#define HA_PACK_RECORD 2U /* Request packed record format */
|
||||
#define HA_CREATE_TMP_TABLE 4U
|
||||
#define HA_CREATE_CHECKSUM 8U
|
||||
#define HA_CREATE_KEEP_FILES 16U /* don't overwrite .MYD and MYI */
|
||||
#define HA_CREATE_PAGE_CHECKSUM 32U
|
||||
#define HA_CREATE_DELAY_KEY_WRITE 64U
|
||||
#define HA_CREATE_RELIES_ON_SQL_LAYER 128U
|
||||
#define HA_CREATE_INTERNAL_TABLE 256U
|
||||
#define HA_PRESERVE_INSERT_ORDER 512U
|
||||
|
||||
/* Flags used by start_bulk_insert */
|
||||
|
||||
#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1
|
||||
#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1U
|
||||
|
||||
|
||||
/*
|
||||
@ -366,44 +366,44 @@ enum ha_base_keytype {
|
||||
*/
|
||||
|
||||
/* this one is not used */
|
||||
#define HA_STATUS_POS 1
|
||||
#define HA_STATUS_POS 1U
|
||||
/*
|
||||
assuming the table keeps shared actual copy of the 'info' and
|
||||
local, possibly outdated copy, the following flag means that
|
||||
it should not try to get the actual data (locking the shared structure)
|
||||
slightly outdated version will suffice
|
||||
*/
|
||||
#define HA_STATUS_NO_LOCK 2
|
||||
#define HA_STATUS_NO_LOCK 2U
|
||||
/* update the time of the last modification (in handler::update_time) */
|
||||
#define HA_STATUS_TIME 4
|
||||
#define HA_STATUS_TIME 4U
|
||||
/*
|
||||
update the 'constant' part of the info:
|
||||
handler::max_data_file_length, max_index_file_length, create_time
|
||||
sortkey, ref_length, block_size, data_file_name, index_file_name.
|
||||
handler::table->s->keys_in_use, keys_for_keyread, rec_per_key
|
||||
*/
|
||||
#define HA_STATUS_CONST 8
|
||||
#define HA_STATUS_CONST 8U
|
||||
/*
|
||||
update the 'variable' part of the info:
|
||||
handler::records, deleted, data_file_length, index_file_length,
|
||||
check_time, mean_rec_length
|
||||
*/
|
||||
#define HA_STATUS_VARIABLE 16
|
||||
#define HA_STATUS_VARIABLE 16U
|
||||
/*
|
||||
get the information about the key that caused last duplicate value error
|
||||
update handler::errkey and handler::dupp_ref
|
||||
see handler::get_dup_key()
|
||||
*/
|
||||
#define HA_STATUS_ERRKEY 32
|
||||
#define HA_STATUS_ERRKEY 32U
|
||||
/*
|
||||
update handler::auto_increment_value
|
||||
*/
|
||||
#define HA_STATUS_AUTO 64
|
||||
#define HA_STATUS_AUTO 64U
|
||||
/*
|
||||
Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also
|
||||
when only HA_STATUS_VARIABLE but it won't be used.
|
||||
*/
|
||||
#define HA_STATUS_VARIABLE_EXTRA 128
|
||||
#define HA_STATUS_VARIABLE_EXTRA 128U
|
||||
|
||||
/*
|
||||
Errorcodes given by handler functions
|
||||
@ -521,23 +521,23 @@ typedef ulong key_part_map;
|
||||
/* Intern constants in databases */
|
||||
|
||||
/* bits in _search */
|
||||
#define SEARCH_FIND 1
|
||||
#define SEARCH_NO_FIND 2
|
||||
#define SEARCH_SAME 4
|
||||
#define SEARCH_BIGGER 8
|
||||
#define SEARCH_SMALLER 16
|
||||
#define SEARCH_SAVE_BUFF 32
|
||||
#define SEARCH_UPDATE 64
|
||||
#define SEARCH_PREFIX 128
|
||||
#define SEARCH_LAST 256
|
||||
#define MBR_CONTAIN 512
|
||||
#define MBR_INTERSECT 1024
|
||||
#define MBR_WITHIN 2048
|
||||
#define MBR_DISJOINT 4096
|
||||
#define MBR_EQUAL 8192
|
||||
#define MBR_DATA 16384
|
||||
#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
|
||||
#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
|
||||
#define SEARCH_FIND 1U
|
||||
#define SEARCH_NO_FIND 2U
|
||||
#define SEARCH_SAME 4U
|
||||
#define SEARCH_BIGGER 8U
|
||||
#define SEARCH_SMALLER 16U
|
||||
#define SEARCH_SAVE_BUFF 32U
|
||||
#define SEARCH_UPDATE 64U
|
||||
#define SEARCH_PREFIX 128U
|
||||
#define SEARCH_LAST 256U
|
||||
#define MBR_CONTAIN 512U
|
||||
#define MBR_INTERSECT 1024U
|
||||
#define MBR_WITHIN 2048U
|
||||
#define MBR_DISJOINT 4096U
|
||||
#define MBR_EQUAL 8192U
|
||||
#define MBR_DATA 16384U
|
||||
#define SEARCH_NULL_ARE_EQUAL 32768U /* NULL in keys are equal */
|
||||
#define SEARCH_NULL_ARE_NOT_EQUAL 65536U/* NULL in keys are not equal */
|
||||
/* Use this when inserting a key in position order */
|
||||
#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2)
|
||||
/* Only part of the key is specified while reading */
|
||||
@ -548,27 +548,27 @@ typedef ulong key_part_map;
|
||||
#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2)
|
||||
|
||||
/* bits in opt_flag */
|
||||
#define QUICK_USED 1
|
||||
#define READ_CACHE_USED 2
|
||||
#define READ_CHECK_USED 4
|
||||
#define KEY_READ_USED 8
|
||||
#define WRITE_CACHE_USED 16
|
||||
#define OPT_NO_ROWS 32
|
||||
#define QUICK_USED 1U
|
||||
#define READ_CACHE_USED 2U
|
||||
#define READ_CHECK_USED 4U
|
||||
#define KEY_READ_USED 8U
|
||||
#define WRITE_CACHE_USED 16U
|
||||
#define OPT_NO_ROWS 32U
|
||||
|
||||
/* bits in update */
|
||||
#define HA_STATE_CHANGED 1 /* Database has changed */
|
||||
#define HA_STATE_AKTIV 2 /* Has a current record */
|
||||
#define HA_STATE_WRITTEN 4 /* Record is written */
|
||||
#define HA_STATE_DELETED 8
|
||||
#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */
|
||||
#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */
|
||||
#define HA_STATE_NO_KEY 64 /* Last read didn't find record */
|
||||
#define HA_STATE_KEY_CHANGED 128
|
||||
#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */
|
||||
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
|
||||
#define HA_STATE_ROW_CHANGED 1024 /* To invalidate ROW cache */
|
||||
#define HA_STATE_EXTEND_BLOCK 2048
|
||||
#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */
|
||||
#define HA_STATE_CHANGED 1U /* Database has changed */
|
||||
#define HA_STATE_AKTIV 2U /* Has a current record */
|
||||
#define HA_STATE_WRITTEN 4U /* Record is written */
|
||||
#define HA_STATE_DELETED 8U
|
||||
#define HA_STATE_NEXT_FOUND 16U /* Next found record (record before) */
|
||||
#define HA_STATE_PREV_FOUND 32U /* Prev found record (record after) */
|
||||
#define HA_STATE_NO_KEY 64U /* Last read didn't find record */
|
||||
#define HA_STATE_KEY_CHANGED 128U
|
||||
#define HA_STATE_WRITE_AT_END 256U /* set in _ps_find_writepos */
|
||||
#define HA_STATE_BUFF_SAVED 512U /* If current keybuff is info->buff */
|
||||
#define HA_STATE_ROW_CHANGED 1024U /* To invalidate ROW cache */
|
||||
#define HA_STATE_EXTEND_BLOCK 2048U
|
||||
#define HA_STATE_RNEXT_SAME 4096U /* rnext_same occupied lastkey2 */
|
||||
|
||||
/* myisampack expects no more than 32 field types. */
|
||||
enum en_fieldtype {
|
||||
@ -584,15 +584,15 @@ enum data_file_type {
|
||||
|
||||
/* For key ranges */
|
||||
|
||||
#define NO_MIN_RANGE 1
|
||||
#define NO_MAX_RANGE 2
|
||||
#define NEAR_MIN 4
|
||||
#define NEAR_MAX 8
|
||||
#define UNIQUE_RANGE 16
|
||||
#define EQ_RANGE 32
|
||||
#define NULL_RANGE 64
|
||||
#define GEOM_FLAG 128
|
||||
#define SKIP_RANGE 256
|
||||
#define NO_MIN_RANGE 1U
|
||||
#define NO_MAX_RANGE 2U
|
||||
#define NEAR_MIN 4U
|
||||
#define NEAR_MAX 8U
|
||||
#define UNIQUE_RANGE 16U
|
||||
#define EQ_RANGE 32U
|
||||
#define NULL_RANGE 64U
|
||||
#define GEOM_FLAG 128U
|
||||
#define SKIP_RANGE 256U
|
||||
|
||||
typedef struct st_key_range
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011, Monty Program Ab
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -114,7 +114,7 @@ static inline uint32 my_clear_highest_bit(uint32 v)
|
||||
|
||||
static inline uint32 my_reverse_bits(uint32 key)
|
||||
{
|
||||
return
|
||||
return (uint32)
|
||||
(_my_bits_reverse_table[ key & 255] << 24) |
|
||||
(_my_bits_reverse_table[(key>> 8) & 255] << 16) |
|
||||
(_my_bits_reverse_table[(key>>16) & 255] << 8) |
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2013, Monty Program Ab.
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -677,7 +677,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||
smaller what the disk page size. This influences the speed of the
|
||||
isam btree library. eg to big to slow.
|
||||
*/
|
||||
#define IO_SIZE 4096
|
||||
#define IO_SIZE 4096U
|
||||
/*
|
||||
How much overhead does malloc have. The code often allocates
|
||||
something like 1024-MALLOC_OVERHEAD bytes
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2014, MariaDB
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -651,7 +651,7 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
|
||||
#define ESRCH 1
|
||||
#endif
|
||||
|
||||
typedef int64 my_thread_id;
|
||||
typedef uint64 my_thread_id;
|
||||
|
||||
extern void my_threadattr_global_init(void);
|
||||
extern my_bool my_thread_global_init(void);
|
||||
|
138
include/my_sys.h
138
include/my_sys.h
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, Monty Program Ab.
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -60,75 +60,75 @@ typedef struct my_aio_result {
|
||||
#define MY_FILE_ERROR ((size_t) -1)
|
||||
|
||||
/* General bitmaps for my_func's */
|
||||
#define MY_FFNF 1 /* Fatal if file not found */
|
||||
#define MY_FNABP 2 /* Fatal if not all bytes read/writen */
|
||||
#define MY_NABP 4 /* Error if not all bytes read/writen */
|
||||
#define MY_FAE 8 /* Fatal if any error */
|
||||
#define MY_WME 16 /* Write message on error */
|
||||
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
|
||||
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
|
||||
#define MY_ENCRYPT 64 /* Encrypt IO_CACHE temporary files */
|
||||
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
|
||||
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
|
||||
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
|
||||
#define MY_COPYTIME 64 /* my_redel() copys time */
|
||||
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
|
||||
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
|
||||
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
|
||||
#define MY_REDEL_MAKE_BACKUP 256
|
||||
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
|
||||
#define MY_SHORT_WAIT 64 /* my_lock() don't wait if can't lock */
|
||||
#define MY_FORCE_LOCK 128 /* use my_lock() even if disable_locking */
|
||||
#define MY_NO_WAIT 256 /* my_lock() don't wait at all */
|
||||
#define MY_FFNF 1U /* Fatal if file not found */
|
||||
#define MY_FNABP 2U /* Fatal if not all bytes read/writen */
|
||||
#define MY_NABP 4U /* Error if not all bytes read/writen */
|
||||
#define MY_FAE 8U /* Fatal if any error */
|
||||
#define MY_WME 16U /* Write message on error */
|
||||
#define MY_WAIT_IF_FULL 32U /* Wait and try again if disk full error */
|
||||
#define MY_IGNORE_BADFD 32U /* my_sync: ignore 'bad descriptor' errors */
|
||||
#define MY_ENCRYPT 64U /* Encrypt IO_CACHE temporary files */
|
||||
#define MY_FULL_IO 512U /* For my_read - loop intil I/O is complete */
|
||||
#define MY_DONT_CHECK_FILESIZE 128U /* Option to init_io_cache() */
|
||||
#define MY_LINK_WARNING 32U /* my_redel() gives warning if links */
|
||||
#define MY_COPYTIME 64U /* my_redel() copys time */
|
||||
#define MY_DELETE_OLD 256U /* my_create_with_symlink() */
|
||||
#define MY_RESOLVE_LINK 128U /* my_realpath(); Only resolve links */
|
||||
#define MY_HOLD_ORIGINAL_MODES 128U /* my_copy() holds to file modes */
|
||||
#define MY_REDEL_MAKE_BACKUP 256U
|
||||
#define MY_SEEK_NOT_DONE 32U /* my_lock may have to do a seek */
|
||||
#define MY_SHORT_WAIT 64U /* my_lock() don't wait if can't lock */
|
||||
#define MY_FORCE_LOCK 128U /* use my_lock() even if disable_locking */
|
||||
#define MY_NO_WAIT 256U /* my_lock() don't wait at all */
|
||||
/*
|
||||
init_dynamic_array() has init buffer; Internal flag, not to be used by
|
||||
caller.
|
||||
*/
|
||||
#define MY_INIT_BUFFER_USED 256
|
||||
#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
|
||||
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
|
||||
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
|
||||
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
|
||||
#define MY_DONT_OVERWRITE_FILE 2048 /* my_copy: Don't overwrite file */
|
||||
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
|
||||
#define MY_SYNC 4096 /* my_copy(): sync dst file */
|
||||
#define MY_SYNC_DIR 32768 /* my_create/delete/rename: sync directory */
|
||||
#define MY_SYNC_FILESIZE 65536 /* my_sync(): safe sync when file is extended */
|
||||
#define MY_THREAD_SPECIFIC 0x10000 /* my_malloc(): thread specific */
|
||||
#define MY_THREAD_MOVE 0x20000 /* realloc(); Memory can move */
|
||||
/* Tree that should delete things automaticly */
|
||||
#define MY_TREE_WITH_DELETE 0x40000
|
||||
#define MY_INIT_BUFFER_USED 256U
|
||||
#define MY_ZEROFILL 32U /* my_malloc(), fill array with zero */
|
||||
#define MY_ALLOW_ZERO_PTR 64U /* my_realloc() ; zero ptr -> malloc */
|
||||
#define MY_FREE_ON_ERROR 128U /* my_realloc() ; Free old ptr on error */
|
||||
#define MY_HOLD_ON_ERROR 256U /* my_realloc() ; Return old ptr on error */
|
||||
#define MY_DONT_OVERWRITE_FILE 2048U /* my_copy: Don't overwrite file */
|
||||
#define MY_THREADSAFE 2048U /* my_seek(): lock fd mutex */
|
||||
#define MY_SYNC 4096U /* my_copy(): sync dst file */
|
||||
#define MY_SYNC_DIR 32768U /* my_create/delete/rename: sync directory */
|
||||
#define MY_SYNC_FILESIZE 65536U /* my_sync(): safe sync when file is extended */
|
||||
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
|
||||
#define MY_THREAD_MOVE 0x20000U /* realloc(); Memory can move */
|
||||
/* Tree that should delete things automaticly */
|
||||
#define MY_TREE_WITH_DELETE 0x40000U
|
||||
|
||||
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
|
||||
#define MY_GIVE_INFO 2 /* Give time info about process*/
|
||||
#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
|
||||
#define MY_CHECK_ERROR 1U /* Params to my_end; Check open-close */
|
||||
#define MY_GIVE_INFO 2U /* Give time info about process*/
|
||||
#define MY_DONT_FREE_DBUG 4U /* Do not call DBUG_END() in my_end() */
|
||||
|
||||
#define ME_HIGHBYTE 8 /* Shift for colours */
|
||||
#define ME_NOCUR 1 /* Don't use curses message */
|
||||
#define ME_OLDWIN 2 /* Use old window */
|
||||
#define ME_BELL 4 /* Ring bell then printing message */
|
||||
#define ME_HOLDTANG 8 /* Don't delete last keys */
|
||||
#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */
|
||||
#define ME_WAITTANG 32 /* Wait for a user action */
|
||||
#define ME_NOREFRESH 64 /* Write the error message to error log */
|
||||
#define ME_NOINPUT 128 /* Dont use the input libary */
|
||||
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
|
||||
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
|
||||
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
|
||||
#define ME_JUST_INFO 1024 /**< not error but just info */
|
||||
#define ME_JUST_WARNING 2048 /**< not error but just warning */
|
||||
#define ME_FATALERROR 4096 /* Fatal statement error */
|
||||
#define ME_HIGHBYTE 8U /* Shift for colours */
|
||||
#define ME_NOCUR 1U /* Don't use curses message */
|
||||
#define ME_OLDWIN 2U /* Use old window */
|
||||
#define ME_BELL 4U /* Ring bell then printing message */
|
||||
#define ME_HOLDTANG 8U /* Don't delete last keys */
|
||||
#define ME_WAITTOT 16U /* Wait for errtime secs of for a action */
|
||||
#define ME_WAITTANG 32U /* Wait for a user action */
|
||||
#define ME_NOREFRESH 64U /* Write the error message to error log */
|
||||
#define ME_NOINPUT 128U /* Dont use the input libary */
|
||||
#define ME_COLOUR1 ((1U << ME_HIGHBYTE)) /* Possibly error-colours */
|
||||
#define ME_COLOUR2 ((2U << ME_HIGHBYTE))
|
||||
#define ME_COLOUR3 ((3U << ME_HIGHBYTE))
|
||||
#define ME_JUST_INFO 1024U /**< not error but just info */
|
||||
#define ME_JUST_WARNING 2048U /**< not error but just warning */
|
||||
#define ME_FATALERROR 4096U /* Fatal statement error */
|
||||
|
||||
/* Bits in last argument to fn_format */
|
||||
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
|
||||
#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */
|
||||
#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */
|
||||
#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */
|
||||
#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */
|
||||
#define MY_RETURN_REAL_PATH 32 /* return full path for file */
|
||||
#define MY_SAFE_PATH 64 /* Return NULL if too long path */
|
||||
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
|
||||
#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/
|
||||
#define MY_REPLACE_DIR 1U /* replace dir in name with 'dir' */
|
||||
#define MY_REPLACE_EXT 2U /* replace extension with 'ext' */
|
||||
#define MY_UNPACK_FILENAME 4U /* Unpack name (~ -> home) */
|
||||
#define MY_PACK_FILENAME 8U /* Pack name (home -> ~) */
|
||||
#define MY_RESOLVE_SYMLINKS 16U /* Resolve all symbolic links */
|
||||
#define MY_RETURN_REAL_PATH 32U /* return full path for file */
|
||||
#define MY_SAFE_PATH 64U /* Return NULL if too long path */
|
||||
#define MY_RELATIVE_PATH 128U /* name is relative to 'dir' */
|
||||
#define MY_APPEND_EXT 256U /* add 'ext' as additional extension*/
|
||||
|
||||
|
||||
/* My seek flags */
|
||||
@ -143,19 +143,19 @@ typedef struct my_aio_result {
|
||||
#define DFLT_INIT_HITS 3
|
||||
|
||||
/* root_alloc flags */
|
||||
#define MY_KEEP_PREALLOC 1
|
||||
#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */
|
||||
#define MY_KEEP_PREALLOC 1U
|
||||
#define MY_MARK_BLOCKS_FREE 2U /* move used to free list and reuse them */
|
||||
|
||||
/* Internal error numbers (for assembler functions) */
|
||||
#define MY_ERRNO_EDOM 33
|
||||
#define MY_ERRNO_ERANGE 34
|
||||
|
||||
/* Bits for get_date timeflag */
|
||||
#define GETDATE_DATE_TIME 1
|
||||
#define GETDATE_SHORT_DATE 2
|
||||
#define GETDATE_HHMMSSTIME 4
|
||||
#define GETDATE_GMT 8
|
||||
#define GETDATE_FIXEDLENGTH 16
|
||||
#define GETDATE_DATE_TIME 1U
|
||||
#define GETDATE_SHORT_DATE 2U
|
||||
#define GETDATE_HHMMSSTIME 4U
|
||||
#define GETDATE_GMT 8U
|
||||
#define GETDATE_FIXEDLENGTH 16U
|
||||
|
||||
/* Extra length needed for filename if one calls my_create_backup_name */
|
||||
#define MY_BACKUP_NAME_EXTRA_LENGTH 17
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2004, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2017, Monty Program Ab.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -61,16 +62,16 @@ extern uchar days_in_month[];
|
||||
TIME_FUZZY_DATES is used for the result will only be used for comparison
|
||||
purposes. Conversion is as relaxed as possible.
|
||||
*/
|
||||
#define TIME_FUZZY_DATES 1
|
||||
#define TIME_DATETIME_ONLY 2
|
||||
#define TIME_TIME_ONLY 4
|
||||
#define TIME_FUZZY_DATES 1U
|
||||
#define TIME_DATETIME_ONLY 2U
|
||||
#define TIME_TIME_ONLY 4U
|
||||
#define TIME_NO_ZERO_IN_DATE (1UL << 23) /* == MODE_NO_ZERO_IN_DATE */
|
||||
#define TIME_NO_ZERO_DATE (1UL << 24) /* == MODE_NO_ZERO_DATE */
|
||||
#define TIME_INVALID_DATES (1UL << 25) /* == MODE_INVALID_DATES */
|
||||
|
||||
#define MYSQL_TIME_WARN_TRUNCATED 1
|
||||
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2
|
||||
#define MYSQL_TIME_NOTE_TRUNCATED 16
|
||||
#define MYSQL_TIME_WARN_TRUNCATED 1U
|
||||
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2U
|
||||
#define MYSQL_TIME_NOTE_TRUNCATED 16U
|
||||
|
||||
#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|MYSQL_TIME_WARN_OUT_OF_RANGE)
|
||||
#define MYSQL_TIME_WARN_NOTES (MYSQL_TIME_NOTE_TRUNCATED)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2010 Monty Program Ab
|
||||
/* Copyright (C) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -38,7 +38,7 @@
|
||||
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute__((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
|
||||
#endif
|
||||
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
|
||||
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
|
||||
#define TRASH_FREE(A,B) TRASH_FILL(A,(size_t) (B),0x8F)
|
||||
#define TRASH(A,B) TRASH_FREE(A,B)
|
||||
|
||||
# define DBUG_ASSERT_DEFINED(x) \
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2006 MySQL AB
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -24,13 +25,13 @@
|
||||
to xxxcheck.c follows:
|
||||
*/
|
||||
|
||||
#define TT_USEFRM 1
|
||||
#define TT_FOR_UPGRADE 2
|
||||
#define TT_FROM_MYSQL 4
|
||||
#define TT_USEFRM 1U
|
||||
#define TT_FOR_UPGRADE 2U
|
||||
#define TT_FROM_MYSQL 4U
|
||||
|
||||
/* Bits set in out_flag */
|
||||
#define O_NEW_DATA 2
|
||||
#define O_DATA_LOST 4
|
||||
#define O_NEW_DATA 2U
|
||||
#define O_DATA_LOST 4U
|
||||
|
||||
typedef struct st_sort_key_blocks /* Used when sorting */
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -67,7 +68,7 @@
|
||||
*/
|
||||
static inline struct PSI_idle_locker *
|
||||
inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
|
||||
const char *src_file, int src_line)
|
||||
const char *src_file, uint src_line)
|
||||
{
|
||||
struct PSI_idle_locker *locker;
|
||||
locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line);
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
@ -241,7 +242,7 @@ inline_mysql_start_socket_wait(PSI_socket_locker_state *state,
|
||||
MYSQL_SOCKET mysql_socket,
|
||||
enum PSI_socket_operation op,
|
||||
size_t byte_count,
|
||||
const char *src_file, int src_line)
|
||||
const char *src_file, uint src_line)
|
||||
{
|
||||
struct PSI_socket_locker *locker;
|
||||
if (mysql_socket.m_psi != NULL)
|
||||
@ -744,8 +745,7 @@ inline_mysql_socket_send
|
||||
/* Instrumentation end */
|
||||
if (locker != NULL)
|
||||
{
|
||||
size_t bytes_written;
|
||||
bytes_written= (result > -1) ? result : 0;
|
||||
size_t bytes_written= (result > 0) ? (size_t) result : 0;
|
||||
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
|
||||
}
|
||||
|
||||
@ -786,8 +786,7 @@ inline_mysql_socket_recv
|
||||
/* Instrumentation end */
|
||||
if (locker != NULL)
|
||||
{
|
||||
size_t bytes_read;
|
||||
bytes_read= (result > -1) ? result : 0;
|
||||
size_t bytes_read= (result > 0) ? (size_t) result : 0;
|
||||
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
|
||||
}
|
||||
|
||||
@ -828,8 +827,7 @@ inline_mysql_socket_sendto
|
||||
/* Instrumentation end */
|
||||
if (locker != NULL)
|
||||
{
|
||||
size_t bytes_written;
|
||||
bytes_written = (result > -1) ? result : 0;
|
||||
size_t bytes_written = (result > 0) ? (size_t) result : 0;
|
||||
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
|
||||
}
|
||||
|
||||
@ -871,8 +869,7 @@ inline_mysql_socket_recvfrom
|
||||
/* Instrumentation end */
|
||||
if (locker != NULL)
|
||||
{
|
||||
size_t bytes_read;
|
||||
bytes_read = (result > -1) ? result : 0;
|
||||
size_t bytes_read= (result > 0) ? (size_t) result : 0;
|
||||
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -146,7 +147,7 @@ inline_mysql_start_statement(PSI_statement_locker_state *state,
|
||||
PSI_statement_key key,
|
||||
const char *db, uint db_len,
|
||||
const CHARSET_INFO *charset,
|
||||
const char *src_file, int src_line)
|
||||
const char *src_file, uint src_line)
|
||||
{
|
||||
PSI_statement_locker *locker;
|
||||
locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset);
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -183,7 +184,7 @@ static inline struct PSI_table_locker *
|
||||
inline_mysql_start_table_lock_wait(PSI_table_locker_state *state,
|
||||
struct PSI_table *psi,
|
||||
enum PSI_table_lock_operation op,
|
||||
ulong flags, const char *src_file, int src_line)
|
||||
ulong flags, const char *src_file, uint src_line)
|
||||
{
|
||||
if (psi != NULL)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2013, Monty Program Ab
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
#define HOSTNAME_LENGTH 60
|
||||
#define SYSTEM_CHARSET_MBMAXLEN 3
|
||||
#define NAME_CHAR_LEN 64 /* Field/table name length */
|
||||
#define USERNAME_CHAR_LENGTH 128
|
||||
#define NAME_CHAR_LEN 64U /* Field/table name length */
|
||||
#define USERNAME_CHAR_LENGTH 128U
|
||||
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
|
||||
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
|
||||
#define DEFINER_CHAR_LENGTH (USERNAME_CHAR_LENGTH + HOSTNAME_LENGTH + 1)
|
||||
@ -149,40 +149,40 @@ enum enum_indicator_type
|
||||
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
|
||||
|
||||
|
||||
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
|
||||
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
|
||||
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
|
||||
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
|
||||
#define BLOB_FLAG 16 /* Field is a blob */
|
||||
#define UNSIGNED_FLAG 32 /* Field is unsigned */
|
||||
#define ZEROFILL_FLAG 64 /* Field is zerofill */
|
||||
#define BINARY_FLAG 128 /* Field is binary */
|
||||
#define NOT_NULL_FLAG 1U /* Field can't be NULL */
|
||||
#define PRI_KEY_FLAG 2U /* Field is part of a primary key */
|
||||
#define UNIQUE_KEY_FLAG 4U /* Field is part of a unique key */
|
||||
#define MULTIPLE_KEY_FLAG 8U /* Field is part of a key */
|
||||
#define BLOB_FLAG 16U /* Field is a blob */
|
||||
#define UNSIGNED_FLAG 32U /* Field is unsigned */
|
||||
#define ZEROFILL_FLAG 64U /* Field is zerofill */
|
||||
#define BINARY_FLAG 128U /* Field is binary */
|
||||
|
||||
/* The following are only sent to new clients */
|
||||
#define ENUM_FLAG 256 /* field is an enum */
|
||||
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
|
||||
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
|
||||
#define SET_FLAG 2048 /* field is a set */
|
||||
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
|
||||
#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */
|
||||
#define NUM_FLAG 32768 /* Field is num (for clients) */
|
||||
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
|
||||
#define GROUP_FLAG 32768 /* Intern: Group field */
|
||||
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
|
||||
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
|
||||
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
|
||||
#define ENUM_FLAG 256U /* field is an enum */
|
||||
#define AUTO_INCREMENT_FLAG 512U /* field is a autoincrement field */
|
||||
#define TIMESTAMP_FLAG 1024U /* Field is a timestamp */
|
||||
#define SET_FLAG 2048U /* field is a set */
|
||||
#define NO_DEFAULT_VALUE_FLAG 4096U /* Field doesn't have default value */
|
||||
#define ON_UPDATE_NOW_FLAG 8192U /* Field is set to NOW on UPDATE */
|
||||
#define NUM_FLAG 32768U /* Field is num (for clients) */
|
||||
#define PART_KEY_FLAG 16384U /* Intern; Part of some key */
|
||||
#define GROUP_FLAG 32768U /* Intern: Group field */
|
||||
#define BINCMP_FLAG 131072U /* Intern: Used by sql_yacc */
|
||||
#define GET_FIXED_FIELDS_FLAG (1U << 18) /* Used to get fields in item tree */
|
||||
#define FIELD_IN_PART_FUNC_FLAG (1U << 19)/* Field part of partition func */
|
||||
|
||||
/**
|
||||
Intern: Field in TABLE object for new version of altered table,
|
||||
which participates in a newly added index.
|
||||
*/
|
||||
#define FIELD_IN_ADD_INDEX (1 << 20)
|
||||
#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */
|
||||
#define FIELD_IN_ADD_INDEX (1U << 20)
|
||||
#define FIELD_IS_RENAMED (1U << 21) /* Intern: Field is being renamed */
|
||||
#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23 */
|
||||
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA)
|
||||
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3U << FIELD_FLAGS_STORAGE_MEDIA)
|
||||
#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */
|
||||
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT)
|
||||
#define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */
|
||||
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3U << FIELD_FLAGS_COLUMN_FORMAT)
|
||||
#define FIELD_IS_DROPPED (1U << 26) /* Intern: Field is being dropped */
|
||||
|
||||
#define REFRESH_GRANT (1ULL << 0) /* Refresh grant tables */
|
||||
#define REFRESH_LOG (1ULL << 1) /* Start on new log file */
|
||||
@ -335,36 +335,36 @@ enum enum_indicator_type
|
||||
implicitly, by the first transactional
|
||||
statement, when autocommit=off.
|
||||
*/
|
||||
#define SERVER_STATUS_IN_TRANS 1
|
||||
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
|
||||
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
|
||||
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
|
||||
#define SERVER_QUERY_NO_INDEX_USED 32
|
||||
#define SERVER_STATUS_IN_TRANS 1U
|
||||
#define SERVER_STATUS_AUTOCOMMIT 2U /* Server in auto_commit mode */
|
||||
#define SERVER_MORE_RESULTS_EXISTS 8U /* Multi query - next query exists */
|
||||
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16U
|
||||
#define SERVER_QUERY_NO_INDEX_USED 32U
|
||||
/**
|
||||
The server was able to fulfill the clients request and opened a
|
||||
read-only non-scrollable cursor for a query. This flag comes
|
||||
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
|
||||
*/
|
||||
#define SERVER_STATUS_CURSOR_EXISTS 64
|
||||
#define SERVER_STATUS_CURSOR_EXISTS 64U
|
||||
/**
|
||||
This flag is sent when a read-only cursor is exhausted, in reply to
|
||||
COM_STMT_FETCH command.
|
||||
*/
|
||||
#define SERVER_STATUS_LAST_ROW_SENT 128
|
||||
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
|
||||
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
|
||||
#define SERVER_STATUS_LAST_ROW_SENT 128U
|
||||
#define SERVER_STATUS_DB_DROPPED 256U /* A database was dropped */
|
||||
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512U
|
||||
/**
|
||||
Sent to the client if after a prepared statement reprepare
|
||||
we discovered that the new statement returns a different
|
||||
number of result set columns.
|
||||
*/
|
||||
#define SERVER_STATUS_METADATA_CHANGED 1024
|
||||
#define SERVER_QUERY_WAS_SLOW 2048
|
||||
#define SERVER_STATUS_METADATA_CHANGED 1024U
|
||||
#define SERVER_QUERY_WAS_SLOW 2048U
|
||||
|
||||
/**
|
||||
To mark ResultSet containing output parameter values.
|
||||
*/
|
||||
#define SERVER_PS_OUT_PARAMS 4096
|
||||
#define SERVER_PS_OUT_PARAMS 4096U
|
||||
|
||||
/**
|
||||
Set at the same time as SERVER_STATUS_IN_TRANS if the started
|
||||
@ -373,7 +373,7 @@ enum enum_indicator_type
|
||||
to clients in OK and EOF packets, the flag indicates the
|
||||
transaction status at the end of command execution.
|
||||
*/
|
||||
#define SERVER_STATUS_IN_TRANS_READONLY 8192
|
||||
#define SERVER_STATUS_IN_TRANS_READONLY 8192U
|
||||
|
||||
/**
|
||||
This status flag, when on, implies that one of the state information has
|
||||
@ -455,7 +455,7 @@ typedef struct st_net {
|
||||
} NET;
|
||||
|
||||
|
||||
#define packet_error (~(unsigned long) 0)
|
||||
#define packet_error ~0UL
|
||||
|
||||
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
|
||||
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
|
||||
@ -706,9 +706,9 @@ void my_thread_end(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
|
||||
#define MYSQL_STMT_HEADER 4
|
||||
#define MYSQL_LONG_DATA_HEADER 6
|
||||
#define NULL_LENGTH ~0UL /* For net_store_length */
|
||||
#define MYSQL_STMT_HEADER 4U
|
||||
#define MYSQL_LONG_DATA_HEADER 6U
|
||||
|
||||
/*
|
||||
If a float or double field have more than this number of decimals,
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -76,10 +77,10 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
|
||||
|
||||
|
||||
/* Priority for locks */
|
||||
#define THR_LOCK_LATE_PRIV 1 /* For locks to be merged with org lock */
|
||||
#define THR_LOCK_MERGE_PRIV 2 /* For merge tables */
|
||||
#define THR_LOCK_LATE_PRIV 1U /* For locks to be merged with org lock */
|
||||
#define THR_LOCK_MERGE_PRIV 2U /* For merge tables */
|
||||
|
||||
#define THR_UNLOCK_UPDATE_STATUS 1
|
||||
#define THR_UNLOCK_UPDATE_STATUS 1U
|
||||
|
||||
extern ulong max_write_lock_count;
|
||||
extern my_bool thr_lock_inited;
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -33,13 +34,13 @@ extern int find_type_or_exit(const char *x, TYPELIB *typelib,
|
||||
const char *option);
|
||||
#define FIND_TYPE_BASIC 0
|
||||
/** makes @c find_type() require the whole name, no prefix */
|
||||
#define FIND_TYPE_NO_PREFIX (1 << 0)
|
||||
#define FIND_TYPE_NO_PREFIX (1U << 0)
|
||||
/** always implicitely on, so unused, but old code may pass it */
|
||||
#define FIND_TYPE_NO_OVERWRITE 0
|
||||
/** makes @c find_type() accept a number. Not used either */
|
||||
#define FIND_TYPE_ALLOW_NUMBER 0
|
||||
/** makes @c find_type() treat ',' and '=' as terminators */
|
||||
#define FIND_TYPE_COMMA_TERM (1 << 3)
|
||||
#define FIND_TYPE_COMMA_TERM (1U << 3)
|
||||
|
||||
extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
|
||||
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2012 Monty Program Ab
|
||||
Copyright (c) 2012, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -51,9 +51,9 @@ enum enum_vio_io_event
|
||||
VIO_IO_EVENT_CONNECT
|
||||
};
|
||||
|
||||
#define VIO_LOCALHOST 1 /* a localhost connection */
|
||||
#define VIO_BUFFERED_READ 2 /* use buffered read */
|
||||
#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
|
||||
#define VIO_LOCALHOST 1U /* a localhost connection */
|
||||
#define VIO_BUFFERED_READ 2U /* use buffered read */
|
||||
#define VIO_READ_BUFFER_SIZE 16384U /* size of read buffer */
|
||||
#define VIO_DESCRIPTION_SIZE 30 /* size of description */
|
||||
|
||||
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
|
||||
|
@ -53,7 +53,7 @@ SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
FLUSH LOGS;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/
|
||||
--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/ /(^#|created )[0-9]{6} [ 1][0-9]:[0-9]{2}:[0-9]{2}/\1YYMMDD HH:MM:SS/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $MYSQLD_DATADIR/master-bin.000003
|
||||
|
||||
SET TIMESTAMP=DEFAULT;
|
||||
|
@ -939,3 +939,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1003 with cte as (select `test`.`t1`.`i` AS `i`,`test`.`t1`.`c` AS `c` from `test`.`t1`)select 1 AS `i` from dual
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-12185: view defintion contains WITH clause with
|
||||
# several specifications of CTE
|
||||
#
|
||||
with
|
||||
alias1 as (select 1 as one),
|
||||
alias2 as (select 2 as two)
|
||||
select one, two from alias1, alias2;
|
||||
one two
|
||||
1 2
|
||||
create view v1 as
|
||||
with
|
||||
alias1 as (select 1 as one),
|
||||
alias2 as (select 2 as two)
|
||||
select one, two from alias1, alias2;
|
||||
select * from v1;
|
||||
one two
|
||||
1 2
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with alias1 as (select 1 AS `one`), alias2 as (select 2 AS `two`)select `alias1`.`one` AS `one`,`alias2`.`two` AS `two` from (`alias1` join `alias2`) latin1 latin1_swedish_ci
|
||||
drop view v1;
|
||||
|
@ -699,7 +699,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL NULL
|
||||
2 UNCACHEABLE SUBQUERY <derived3> ALL NULL NULL NULL NULL 12 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 with recursive ancestor_couple_ids as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null)coupled_ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`), select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
|
||||
Note 1003 with recursive ancestor_couple_ids as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null), coupled_ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`)select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
|
||||
# simple mutual recursion
|
||||
with recursive
|
||||
ancestor_couple_ids(h_id, w_id)
|
||||
|
@ -6333,5 +6333,18 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-10704: Assertion `field->field->table == table_arg'
|
||||
# failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,
|
||||
# bool, bool)
|
||||
#
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE TABLE t2 (j INT);
|
||||
CREATE TABLE t3 (k INT);
|
||||
CREATE ALGORITHM = MERGE VIEW v AS SELECT j AS f1, k AS f2 FROM ( SELECT j FROM t1, t2 ) sq, t3;
|
||||
REPLACE INTO v (f1,f2) VALUES (1,1);
|
||||
ERROR HY000: Can not modify more than one base table through a join view 'test.v'
|
||||
drop view v;
|
||||
drop table t1,t2,t3;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
@ -72,21 +72,21 @@ FLUSH LOGS;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 700101 6:46:40
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created YYMMDD HH:MM:SS
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Gtid list [#-#-#]
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Gtid list [#-#-#]
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
|
||||
/*!100001 SET @@session.gtid_domain_id=#*//*!*/;
|
||||
/*!100001 SET @@session.server_id=#*//*!*/;
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
use `test`/*!*/;
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
SET @@session.pseudo_thread_id=#/*!*/;
|
||||
@ -100,135 +100,135 @@ SET @@session.collation_database=DEFAULT/*!*/;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(i1)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(i1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(i2)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(i2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(i3)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(i3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(p1)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(p1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(p2)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(p2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Annotate_rows:
|
||||
#Q> INSERT INTO t1 VALUES ('ä(p3)')
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1='ä(p3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
DROP TABLE `t1` /* generated by server */
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -76,21 +76,21 @@ FLUSH LOGS;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 700101 6:46:40
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created YYMMDD HH:MM:SS
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Gtid list [#-#-#]
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Gtid list [#-#-#]
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
|
||||
/*!100001 SET @@session.gtid_domain_id=#*//*!*/;
|
||||
/*!100001 SET @@session.server_id=#*//*!*/;
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
use `test`/*!*/;
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
SET @@session.pseudo_thread_id=#/*!*/;
|
||||
@ -104,105 +104,105 @@ SET @@session.collation_database=DEFAULT/*!*/;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(i1)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(i2)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(i3)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(p1)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(p2)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
INSERT INTO t1 VALUES ('ä(p3)')
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-# ddl
|
||||
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
|
||||
SET TIMESTAMP=XXX/*!*/;
|
||||
DROP TABLE `t1` /* generated by server */
|
||||
/*!*/;
|
||||
# at #
|
||||
#700101 6:46:40 server id # end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
|
||||
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -66,7 +66,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND /InnoDB: Log scan progressed past the checkpoint lsn 1213964/ in mysqld.1.err
|
||||
FOUND /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
|
||||
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
|
||||
FOUND /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
|
||||
FOUND /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
|
||||
FOUND /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
|
||||
@ -83,7 +84,14 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
|
||||
FOUND /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
|
||||
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
NOT FOUND /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42$/ in mysqld.1.err
|
||||
# Minimal MariaDB 10.1.21 encrypted redo log
|
||||
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
|
@ -30,12 +30,6 @@ galera_gcs_fragment : Incorrect arguments to SET
|
||||
galera_flush_local : Fails sporadically
|
||||
galera_binlog_stmt_autoinc : TODO: investigate
|
||||
galera_concurrent_ctas : Test times out, investigate
|
||||
MW-258 : MDEV-11229
|
||||
galera_as_master : MDEV-11229
|
||||
MW-44 : MDEV-11229
|
||||
galera_gcs_fc_limit : MDEV-11229
|
||||
galera_roles : MDEV-11229
|
||||
galera_lock_table : MDEV-11229
|
||||
MW-286 : TODO: investigate
|
||||
galera_sst_xtrabackup-v2-options : TODO: Fix test case
|
||||
galera_sst_xtrabackup-v2 : MDEV-11208
|
||||
|
@ -34,6 +34,7 @@ UNLOCK TABLES;
|
||||
|
||||
--connection node_1
|
||||
--echo value after RSU:
|
||||
--sleep 2
|
||||
SHOW STATUS LIKE 'wsrep_desync_count';
|
||||
SHOW VARIABLES LIKE 'wsrep_desync';
|
||||
SET GLOBAL wsrep_desync=0;
|
||||
|
@ -8,9 +8,11 @@
|
||||
--connection node_1
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
|
||||
--sleep 1
|
||||
--connection node_2
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
|
||||
--sleep 1
|
||||
--connection node_1
|
||||
SET SESSION wsrep_osu_method=TOI;
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
@ -27,6 +27,7 @@ CREATE TABLE test.t3 AS SELECT * from t1;
|
||||
SET SQL_LOG_BIN=ON;
|
||||
INSERT INTO t1 VALUES(3);
|
||||
CREATE TABLE test.t4 AS SELECT * from t1;
|
||||
--save_master_pos
|
||||
|
||||
--connection node_2
|
||||
SELECT * FROM t1;
|
||||
@ -35,28 +36,21 @@ SELECT * FROM t3;
|
||||
SELECT * FROM t4;
|
||||
|
||||
--connection node_3
|
||||
--sync_with_master
|
||||
SHOW TABLES;
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 3 FROM t4;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo # Cleanup
|
||||
--connection node_1
|
||||
DROP TABLE t1, t4;
|
||||
--save_master_pos
|
||||
SET SQL_LOG_BIN=OFF;
|
||||
DROP TABLE t2, t3;
|
||||
|
||||
--connection node_3
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't4';
|
||||
--source include/wait_condition.inc
|
||||
--sync_with_master
|
||||
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
|
@ -19,10 +19,13 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
--connection node_1
|
||||
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (2);
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (3);
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (4);
|
||||
--sleep 1
|
||||
|
||||
# This query will hang because flow control will kick in
|
||||
--send
|
||||
|
@ -11,6 +11,8 @@
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--sleep 1
|
||||
|
||||
--connection node_2
|
||||
LOCK TABLE t1 READ;
|
||||
|
||||
|
@ -36,6 +36,7 @@ GRANT SELECT (a) ON test1.t2 TO role1;
|
||||
--connect(foo_node_1,127.0.0.1,foo,,test,$port_1,)
|
||||
|
||||
--let $port_2= \$NODE_MYPORT_2
|
||||
--sleep 1
|
||||
--connect(foo_node_2,127.0.0.1,foo,,test,$port_2,)
|
||||
|
||||
--echo
|
||||
@ -107,7 +108,7 @@ CALL test1.pr1();
|
||||
--echo
|
||||
--echo # Connect with foo_node_2
|
||||
--connection foo_node_2
|
||||
|
||||
--sleep 1
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
CALL test1.pr1();
|
||||
|
||||
|
@ -43,7 +43,6 @@ trx_unique_checks int(1) NO 0
|
||||
trx_foreign_key_checks int(1) NO 0
|
||||
trx_last_foreign_key_error varchar(256) YES NULL
|
||||
trx_adaptive_hash_latched int(1) NO 0
|
||||
trx_adaptive_hash_timeout bigint(21) unsigned NO 0
|
||||
trx_is_read_only int(1) NO 0
|
||||
trx_autocommit_non_locking int(1) NO 0
|
||||
trx_state trx_weight trx_tables_in_use trx_tables_locked trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks
|
||||
|
@ -1,619 +0,0 @@
|
||||
set global innodb_monitor_disable = All;
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
name status
|
||||
metadata_table_handles_opened disabled
|
||||
metadata_table_handles_closed disabled
|
||||
metadata_table_reference_count disabled
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
buffer_pool_size disabled
|
||||
buffer_pool_reads disabled
|
||||
buffer_pool_read_requests disabled
|
||||
buffer_pool_write_requests disabled
|
||||
buffer_pool_wait_free disabled
|
||||
buffer_pool_read_ahead disabled
|
||||
buffer_pool_read_ahead_evicted disabled
|
||||
buffer_pool_pages_total disabled
|
||||
buffer_pool_pages_misc disabled
|
||||
buffer_pool_pages_data disabled
|
||||
buffer_pool_bytes_data disabled
|
||||
buffer_pool_pages_dirty disabled
|
||||
buffer_pool_bytes_dirty disabled
|
||||
buffer_pool_pages_free disabled
|
||||
buffer_pages_created disabled
|
||||
buffer_pages_written disabled
|
||||
buffer_index_pages_written disabled
|
||||
buffer_non_index_pages_written disabled
|
||||
buffer_pages_read disabled
|
||||
buffer_pages0_read disabled
|
||||
buffer_index_sec_rec_cluster_reads disabled
|
||||
buffer_index_sec_rec_cluster_reads_avoided disabled
|
||||
buffer_data_reads disabled
|
||||
buffer_data_written disabled
|
||||
buffer_flush_batch_scanned disabled
|
||||
buffer_flush_batch_num_scan disabled
|
||||
buffer_flush_batch_scanned_per_call disabled
|
||||
buffer_flush_batch_total_pages disabled
|
||||
buffer_flush_batches disabled
|
||||
buffer_flush_batch_pages disabled
|
||||
buffer_flush_neighbor_total_pages disabled
|
||||
buffer_flush_neighbor disabled
|
||||
buffer_flush_neighbor_pages disabled
|
||||
buffer_flush_n_to_flush_requested disabled
|
||||
buffer_flush_n_to_flush_by_age disabled
|
||||
buffer_flush_adaptive_avg_time_slot disabled
|
||||
buffer_LRU_batch_flush_avg_time_slot disabled
|
||||
buffer_flush_adaptive_avg_time_thread disabled
|
||||
buffer_LRU_batch_flush_avg_time_thread disabled
|
||||
buffer_flush_adaptive_avg_time_est disabled
|
||||
buffer_LRU_batch_flush_avg_time_est disabled
|
||||
buffer_flush_avg_time disabled
|
||||
buffer_flush_adaptive_avg_pass disabled
|
||||
buffer_LRU_batch_flush_avg_pass disabled
|
||||
buffer_flush_avg_pass disabled
|
||||
buffer_LRU_get_free_loops disabled
|
||||
buffer_LRU_get_free_waits disabled
|
||||
buffer_flush_avg_page_rate disabled
|
||||
buffer_flush_lsn_avg_rate disabled
|
||||
buffer_flush_pct_for_dirty disabled
|
||||
buffer_flush_pct_for_lsn disabled
|
||||
buffer_flush_sync_waits disabled
|
||||
buffer_flush_adaptive_total_pages disabled
|
||||
buffer_flush_adaptive disabled
|
||||
buffer_flush_adaptive_pages disabled
|
||||
buffer_flush_sync_total_pages disabled
|
||||
buffer_flush_sync disabled
|
||||
buffer_flush_sync_pages disabled
|
||||
buffer_flush_background_total_pages disabled
|
||||
buffer_flush_background disabled
|
||||
buffer_flush_background_pages disabled
|
||||
buffer_LRU_batch_scanned disabled
|
||||
buffer_LRU_batch_num_scan disabled
|
||||
buffer_LRU_batch_scanned_per_call disabled
|
||||
buffer_LRU_batch_flush_total_pages disabled
|
||||
buffer_LRU_batches_flush disabled
|
||||
buffer_LRU_batch_flush_pages disabled
|
||||
buffer_LRU_batch_evict_total_pages disabled
|
||||
buffer_LRU_batches_evict disabled
|
||||
buffer_LRU_batch_evict_pages disabled
|
||||
buffer_LRU_single_flush_scanned disabled
|
||||
buffer_LRU_single_flush_num_scan disabled
|
||||
buffer_LRU_single_flush_scanned_per_call disabled
|
||||
buffer_LRU_single_flush_failure_count disabled
|
||||
buffer_LRU_get_free_search disabled
|
||||
buffer_LRU_search_scanned disabled
|
||||
buffer_LRU_search_num_scan disabled
|
||||
buffer_LRU_search_scanned_per_call disabled
|
||||
buffer_LRU_unzip_search_scanned disabled
|
||||
buffer_LRU_unzip_search_num_scan disabled
|
||||
buffer_LRU_unzip_search_scanned_per_call disabled
|
||||
buffer_page_read_index_leaf disabled
|
||||
buffer_page_read_index_non_leaf disabled
|
||||
buffer_page_read_index_ibuf_leaf disabled
|
||||
buffer_page_read_index_ibuf_non_leaf disabled
|
||||
buffer_page_read_undo_log disabled
|
||||
buffer_page_read_index_inode disabled
|
||||
buffer_page_read_ibuf_free_list disabled
|
||||
buffer_page_read_ibuf_bitmap disabled
|
||||
buffer_page_read_system_page disabled
|
||||
buffer_page_read_trx_system disabled
|
||||
buffer_page_read_fsp_hdr disabled
|
||||
buffer_page_read_xdes disabled
|
||||
buffer_page_read_blob disabled
|
||||
buffer_page_read_zblob disabled
|
||||
buffer_page_read_zblob2 disabled
|
||||
buffer_page_read_other disabled
|
||||
buffer_page_written_index_leaf disabled
|
||||
buffer_page_written_index_non_leaf disabled
|
||||
buffer_page_written_index_ibuf_leaf disabled
|
||||
buffer_page_written_index_ibuf_non_leaf disabled
|
||||
buffer_page_written_undo_log disabled
|
||||
buffer_page_written_index_inode disabled
|
||||
buffer_page_written_ibuf_free_list disabled
|
||||
buffer_page_written_ibuf_bitmap disabled
|
||||
buffer_page_written_system_page disabled
|
||||
buffer_page_written_trx_system disabled
|
||||
buffer_page_written_fsp_hdr disabled
|
||||
buffer_page_written_xdes disabled
|
||||
buffer_page_written_blob disabled
|
||||
buffer_page_written_zblob disabled
|
||||
buffer_page_written_zblob2 disabled
|
||||
buffer_page_written_other disabled
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs disabled
|
||||
os_pending_reads disabled
|
||||
os_pending_writes disabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs disabled
|
||||
os_log_pending_writes disabled
|
||||
trx_rw_commits disabled
|
||||
trx_ro_commits disabled
|
||||
trx_nl_ro_commits disabled
|
||||
trx_commits_insert_update disabled
|
||||
trx_rollbacks disabled
|
||||
trx_rollbacks_savepoint disabled
|
||||
trx_rollback_active disabled
|
||||
trx_active_transactions disabled
|
||||
trx_rseg_history_len disabled
|
||||
trx_undo_slots_used disabled
|
||||
trx_undo_slots_cached disabled
|
||||
trx_rseg_current_size disabled
|
||||
purge_del_mark_records disabled
|
||||
purge_upd_exist_or_extern_records disabled
|
||||
purge_invoked disabled
|
||||
purge_undo_log_pages disabled
|
||||
purge_dml_delay_usec disabled
|
||||
purge_stop_count disabled
|
||||
purge_resume_count disabled
|
||||
log_checkpoints disabled
|
||||
log_lsn_last_flush disabled
|
||||
log_lsn_last_checkpoint disabled
|
||||
log_lsn_current disabled
|
||||
log_lsn_checkpoint_age disabled
|
||||
log_lsn_buf_pool_oldest disabled
|
||||
log_max_modified_age_async disabled
|
||||
log_max_modified_age_sync disabled
|
||||
log_pending_log_flushes disabled
|
||||
log_pending_checkpoint_writes disabled
|
||||
log_num_log_io disabled
|
||||
log_waits disabled
|
||||
log_write_requests disabled
|
||||
log_writes disabled
|
||||
log_padded disabled
|
||||
compress_pages_compressed disabled
|
||||
compress_pages_decompressed disabled
|
||||
compression_pad_increments disabled
|
||||
compression_pad_decrements disabled
|
||||
compress_saved disabled
|
||||
compress_pages_page_compressed disabled
|
||||
compress_page_compressed_trim_op disabled
|
||||
compress_pages_page_decompressed disabled
|
||||
compress_pages_page_compression_error disabled
|
||||
compress_pages_encrypted disabled
|
||||
compress_pages_decrypted disabled
|
||||
index_page_splits disabled
|
||||
index_page_merge_attempts disabled
|
||||
index_page_merge_successful disabled
|
||||
index_page_reorg_attempts disabled
|
||||
index_page_reorg_successful disabled
|
||||
index_page_discards disabled
|
||||
adaptive_hash_searches disabled
|
||||
adaptive_hash_searches_btree disabled
|
||||
adaptive_hash_pages_added disabled
|
||||
adaptive_hash_pages_removed disabled
|
||||
adaptive_hash_rows_added disabled
|
||||
adaptive_hash_rows_removed disabled
|
||||
adaptive_hash_rows_deleted_no_hash_entry disabled
|
||||
adaptive_hash_rows_updated disabled
|
||||
file_num_open_files disabled
|
||||
ibuf_merges_insert disabled
|
||||
ibuf_merges_delete_mark disabled
|
||||
ibuf_merges_delete disabled
|
||||
ibuf_merges_discard_insert disabled
|
||||
ibuf_merges_discard_delete_mark disabled
|
||||
ibuf_merges_discard_delete disabled
|
||||
ibuf_merges disabled
|
||||
ibuf_size disabled
|
||||
innodb_master_thread_sleeps disabled
|
||||
innodb_activity_count disabled
|
||||
innodb_master_active_loops disabled
|
||||
innodb_master_idle_loops disabled
|
||||
innodb_background_drop_table_usec disabled
|
||||
innodb_ibuf_merge_usec disabled
|
||||
innodb_log_flush_usec disabled
|
||||
innodb_mem_validate_usec disabled
|
||||
innodb_master_purge_usec disabled
|
||||
innodb_dict_lru_usec disabled
|
||||
innodb_dict_lru_count_active disabled
|
||||
innodb_dict_lru_count_idle disabled
|
||||
innodb_checkpoint_usec disabled
|
||||
innodb_dblwr_writes disabled
|
||||
innodb_dblwr_pages_written disabled
|
||||
innodb_page_size disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
dml_reads disabled
|
||||
dml_inserts disabled
|
||||
dml_deletes disabled
|
||||
dml_updates disabled
|
||||
dml_system_reads disabled
|
||||
dml_system_inserts disabled
|
||||
dml_system_deletes disabled
|
||||
dml_system_updates disabled
|
||||
ddl_background_drop_indexes disabled
|
||||
ddl_background_drop_tables disabled
|
||||
ddl_online_create_index disabled
|
||||
ddl_pending_alter_table disabled
|
||||
ddl_sort_file_alter_table disabled
|
||||
ddl_log_file_alter_table disabled
|
||||
icp_attempts disabled
|
||||
icp_no_match disabled
|
||||
icp_out_of_range disabled
|
||||
icp_match disabled
|
||||
set global innodb_monitor_enable = all;
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_enable = aaa;
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
|
||||
set global innodb_monitor_disable = All;
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
name
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
name status
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%_%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
name status
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs enabled
|
||||
os_pending_reads enabled
|
||||
os_pending_writes enabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs enabled
|
||||
os_log_pending_writes enabled
|
||||
set global innodb_monitor_enable="";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
|
||||
set global innodb_monitor_enable="_";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
create index idx on monitor_test(col);
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled
|
||||
trx_active_transactions 1 0 0 1 0 0 enabled
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
insert into monitor_test values(9);
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 4 NULL 4 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 6 NULL 6 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 2 NULL 2 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 0 NULL 0 enabled
|
||||
dml_inserts 1 NULL 1 0 NULL 0 enabled
|
||||
dml_deletes 2 NULL 2 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 disabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 disabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 disabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 disabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts 2 NULL 2 2 NULL 2 enabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
file_num_open_files # # # # # # enabled
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
select a from monitor_test where b < 1 for update;
|
||||
a
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 1
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 0
|
||||
select a from monitor_test where b < 3 for update;
|
||||
a
|
||||
13
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 2
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 1
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = all;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select 1 from `information_schema`.`INNODB_METRICS`
|
||||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
|
||||
1
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
@ -1,5 +1,5 @@
|
||||
select * from information_schema.innodb_trx;
|
||||
trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeout trx_is_read_only trx_autocommit_non_locking
|
||||
trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_is_read_only trx_autocommit_non_locking
|
||||
Warnings:
|
||||
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_trx but the InnoDB storage engine is not installed
|
||||
select * from information_schema.innodb_locks;
|
||||
|
@ -66,7 +66,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND /InnoDB: Log scan progressed past the checkpoint lsn 1213964/ in mysqld.1.err
|
||||
FOUND /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
|
||||
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
|
||||
FOUND /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
|
||||
FOUND /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
|
||||
FOUND /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
|
||||
@ -83,7 +84,14 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
|
||||
FOUND /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
|
||||
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
NOT FOUND /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42$/ in mysqld.1.err
|
||||
# Minimal MariaDB 10.1.21 encrypted redo log
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
|
@ -610,7 +610,59 @@ icp_match 1
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select 1 from `information_schema`.`INNODB_METRICS`
|
||||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
|
||||
1
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
#
|
||||
# Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
|
||||
# MONITORS
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf 0
|
||||
SET GLOBAL innodb_monitor_enable='module_buffer_page';
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4);
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf NNNN
|
||||
SET GLOBAL innodb_monitor_disable='module_buffer_page';
|
||||
SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf 0
|
||||
SET GLOBAL innodb_monitor_enable='%';
|
||||
INSERT INTO t1 VALUES (5), (6), (7), (8);
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf NNNN
|
||||
SET GLOBAL innodb_monitor_disable='%';
|
||||
SET GLOBAL innodb_monitor_reset_all='%';
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf 0
|
||||
SET GLOBAL innodb_monitor_enable='ALL';
|
||||
INSERT INTO t1 VALUES (9), (10), (11), (12);
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
NAME COUNT
|
||||
buffer_page_written_index_leaf NNNN
|
||||
SET GLOBAL innodb_monitor_enable=default;
|
||||
SET GLOBAL innodb_monitor_disable=default;
|
||||
SET GLOBAL innodb_monitor_reset_all=default;
|
||||
DROP TABLE t1;
|
@ -1,387 +0,0 @@
|
||||
# This is the test for Metrics Monitor Table feature.
|
||||
# Test the metrics monitor system's control system
|
||||
# and counter accuracy.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
set global innodb_monitor_disable = All;
|
||||
|
||||
# Test turn on/off the monitor counter with "all" option
|
||||
# By default, they will be off
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
|
||||
# Turn on all monitor counters
|
||||
set global innodb_monitor_enable = all;
|
||||
|
||||
# status should all change to "enabled"
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Test wrong argument to the global configure option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = aaa;
|
||||
|
||||
# We require a valid monitor counter/module name. There is no default
|
||||
# counter name or module. A warning will be printed asking user to
|
||||
# specify a valid counter name.
|
||||
#--disable_warnings
|
||||
#set global innodb_monitor_enable = default;
|
||||
#--enable_warnings
|
||||
|
||||
# Turn off all monitor counters, option name should be case
|
||||
# insensitive
|
||||
set global innodb_monitor_disable = All;
|
||||
|
||||
# status should all change to "disabled"
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# count should all change to 0
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
|
||||
# Test wildcard match, turn on all counters contain string "lock"
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
|
||||
# All lock related counter should be enabled
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
|
||||
# Disable them
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
|
||||
# All lock related counter should be disabled
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
|
||||
# No match for "%lock*"
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
|
||||
# All counters will be turned on with wildcard match string with all "%"
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all counters
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# One more round testing. All counters will be turned on with
|
||||
# single wildcard character "%"
|
||||
set global innodb_monitor_enable="%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all the counters with "%_%"
|
||||
set global innodb_monitor_disable="%_%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Turn on all counters start with "log"
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
|
||||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
|
||||
# is single character wildcard match word
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
|
||||
# Turn on counters whose name contains "os" and "pending" with
|
||||
# wildcard match "os%pending%"
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
|
||||
# Empty string is an invalid option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="";
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="_";
|
||||
|
||||
# Reset counters only in "module_metadata" module
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
# Only turn on "table_open" counter
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# This will open the monitor_test table
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment by 1
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset the counter value while counter is still on (started)
|
||||
# This will reset value "count_reset" but not
|
||||
# "count"
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again to increment "metadata_table_handles_opened" again
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Cannot reset all monitor value while the counter is on
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn off the counter "metadata_table_handles_opened"
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
|
||||
# Reset the counter value while counter is off (disabled)
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
|
||||
# should not be incremented
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select * from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset all the counters, include those counter *_since_start
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn on "table_open" counter again
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Test metadata_table_handles_opened again to see if it is working correctly
|
||||
# after above round of turning on/off/reset
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Test counter "metadata_table_handles_closed",
|
||||
# create index will close the old handle
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
|
||||
create index idx on monitor_test(col);
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Reset counters only in "module_metadata" module
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Test Transaction Module
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
|
||||
# Test DML Module
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# test reset counter while the counter is on
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# insert/delete some rows after the reset
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# We do not allow reset_all while the counter is on, nothing
|
||||
# should be reset here
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Turn off the counter
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Open individual counter "dml_inserts"
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
# Only counter "dml_inserts" should be updated
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
|
||||
# Counters are unpredictable when innodb-file-per-table is on
|
||||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
|
||||
# Test ICP module counters
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
|
||||
select a from monitor_test where b < 1 for update;
|
||||
|
||||
# should have icp_attempts = 1 and icp_out_of_range = 1
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
# should have icp_attempts = 2 and icp_match = 1
|
||||
select a from monitor_test where b < 3 for update;
|
||||
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_disable = all;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# Test for bug #13966091
|
||||
select 1 from `information_schema`.`INNODB_METRICS`
|
||||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
|
||||
|
||||
-- disable_warnings
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
-- enable_warnings
|
@ -1,3 +1,2 @@
|
||||
--innodb-fatal-semaphore-wait-threshold=1
|
||||
--innodb-sys-semaphore-waits=1
|
||||
--innodb-instrument-semaphores=1
|
||||
|
@ -13,6 +13,7 @@ call mtr.add_suppression("InnoDB: Missing MLOG_CHECKPOINT");
|
||||
call mtr.add_suppression("InnoDB: MLOG_FILE_NAME incorrect");
|
||||
call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND");
|
||||
call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
|
||||
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
|
||||
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
|
||||
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
|
||||
--enable_query_log
|
||||
@ -261,7 +262,9 @@ EOF
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
let SEARCH_PATTERN=InnoDB: Log scan progressed past the checkpoint lsn 1213964;
|
||||
let SEARCH_PATTERN=InnoDB: Starting crash recovery from checkpoint LSN=1213964;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN=InnoDB: MLOG_FILE_NAME incorrect:bogus;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN=InnoDB: ############### CORRUPT LOG RECORD FOUND ##################;
|
||||
--source include/search_pattern_in_file.inc
|
||||
@ -313,9 +316,42 @@ EOF
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
let SEARCH_PATTERN=InnoDB: MLOG_FILE_NAME incorrect:bigot;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--let SEARCH_PATTERN= len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
# header block
|
||||
print OUT pack("Nx[5]nx[5]", 1, 0x1286);
|
||||
print OUT "ibbackup was here!!!1!";
|
||||
print OUT pack("x[470]N", 0x52b54540);
|
||||
# invalid (all-zero) checkpoint page 1 and an empty log page
|
||||
print OUT chr(0) x 1024;
|
||||
# valid checkpoint block 2
|
||||
print OUT pack("x[12]NNNx[264]", 0x12860c, 0, 0x80c);
|
||||
# pointer to the MLOG_CHECKPOINT record, and checkpoint page checksum
|
||||
print OUT pack("H*x[204]NNN", "590DBAACFE922582", 0x128612, 0, 0x101741b);
|
||||
# log page
|
||||
print OUT pack("H*", "800009440022000c00000001");
|
||||
# MLOG_1BYTE record for missing tablespace 42 page 123
|
||||
print OUT pack("CCCnC", 128 | 1, 42, 123, 4567, 89);
|
||||
# MLOG_CHECKPOINT record
|
||||
print OUT pack("CNN", 56, 0, 0x12860c);
|
||||
# padding (MLOG_DUMMY_RECORD) and block checksum
|
||||
print OUT " " x 481, pack("N", 0x644e6db8);
|
||||
close OUT or die;
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\$
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # Minimal MariaDB 10.1.21 encrypted redo log
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
|
@ -73,15 +73,13 @@ let SEARCH_PATTERN= syntax error in innodb_log_group_home_dir;
|
||||
--source include/restart_mysqld.inc
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
|
||||
let SEARCH_PATTERN= InnoDB: Starting crash recovery from checkpoint LSN=;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--let $restart_parameters= --debug=d,innodb_log_abort_3
|
||||
--source include/restart_mysqld.inc
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--let $restart_parameters= --innodb-read-only
|
||||
--source include/restart_mysqld.inc
|
||||
@ -95,8 +93,6 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
|
||||
--source include/restart_mysqld.inc
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
@ -104,8 +100,6 @@ let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
|
||||
--source include/restart_mysqld.inc
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
@ -121,8 +115,6 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
|
@ -1,11 +1,13 @@
|
||||
# This is the test for Metrics Monitor Table feature.
|
||||
# Test the metrics monitor system's control system
|
||||
# and counter accuracy.
|
||||
# This test used to be duplicated in the following:
|
||||
# sys_vars.innodb_monitor_reset_basic
|
||||
# sys_vars.innodb_monitor_reset_all_basic
|
||||
# sys_vars.innodb_monitor_disable_basic
|
||||
# sys_vars.innodb_monitor_enable_basic
|
||||
|
||||
--source include/have_innodb.inc
|
||||
set global innodb_monitor_disable = All;
|
||||
# Test turn on/off the monitor counter with "all" option
|
||||
# By default, they will be off
|
||||
# By default, they will be off.
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
|
||||
# Turn on all monitor counters
|
||||
@ -370,9 +372,66 @@ drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# Test for bug #13966091
|
||||
select 1 from `information_schema`.`INNODB_METRICS`
|
||||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
|
||||
|
||||
-- disable_warnings
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
-- enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
|
||||
--echo # MONITORS
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
let $innodb_monitor_enable = `SELECT @@innodb_monitor_enable`;
|
||||
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
SET GLOBAL innodb_monitor_enable='module_buffer_page';
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4); FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
SET GLOBAL innodb_monitor_disable='module_buffer_page';
|
||||
SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
SET GLOBAL innodb_monitor_enable='%';
|
||||
INSERT INTO t1 VALUES (5), (6), (7), (8); FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
SET GLOBAL innodb_monitor_disable='%';
|
||||
SET GLOBAL innodb_monitor_reset_all='%';
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
SET GLOBAL innodb_monitor_enable='ALL';
|
||||
INSERT INTO t1 VALUES (9), (10), (11), (12); FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
--replace_regex /[1-9]/NNNN/
|
||||
SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
LIKE 'buffer_page_written_index_leaf';
|
||||
|
||||
--disable_warnings
|
||||
SET GLOBAL innodb_monitor_enable=default;
|
||||
SET GLOBAL innodb_monitor_disable=default;
|
||||
SET GLOBAL innodb_monitor_reset_all=default;
|
||||
--enable_warnings
|
||||
|
||||
DROP TABLE t1;
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# innodb_instrument_semaphores
|
||||
#
|
||||
# save the initial value
|
||||
SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
|
||||
# default
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
|
||||
# scope
|
||||
SELECT @@session.innodb_instrument_semaphores;
|
||||
ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable
|
||||
SET @@global.innodb_instrument_semaphores=OFF;
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
SET @@global.innodb_instrument_semaphores=ON;
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
1
|
||||
|
||||
# valid values
|
||||
SET @@global.innodb_instrument_semaphores='OFF';
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
SET @@global.innodb_instrument_semaphores=ON;
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
1
|
||||
SET @@global.innodb_instrument_semaphores=default;
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
|
||||
# invalid values
|
||||
SET @@global.innodb_instrument_semaphores=NULL;
|
||||
ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'NULL'
|
||||
SET @@global.innodb_instrument_semaphores='junk';
|
||||
ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'junk'
|
||||
|
||||
# restore the initial value
|
||||
SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
|
||||
# End of test
|
@ -12,24 +12,34 @@ SELECT @@global.innodb_instrument_semaphores;
|
||||
SELECT @@session.innodb_instrument_semaphores;
|
||||
ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable
|
||||
SET @@global.innodb_instrument_semaphores=OFF;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
SET @@global.innodb_instrument_semaphores=ON;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
1
|
||||
|
||||
# valid values
|
||||
SET @@global.innodb_instrument_semaphores='OFF';
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
SET @@global.innodb_instrument_semaphores=ON;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
1
|
||||
SET @@global.innodb_instrument_semaphores=default;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_instrument_semaphores;
|
||||
@@global.innodb_instrument_semaphores
|
||||
0
|
||||
@ -42,4 +52,6 @@ ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value o
|
||||
|
||||
# restore the initial value
|
||||
SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
# End of test
|
||||
|
@ -1,616 +0,0 @@
|
||||
set global innodb_monitor_disable = All;
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
name status
|
||||
metadata_table_handles_opened disabled
|
||||
metadata_table_handles_closed disabled
|
||||
metadata_table_reference_count disabled
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
buffer_pool_size disabled
|
||||
buffer_pool_reads disabled
|
||||
buffer_pool_read_requests disabled
|
||||
buffer_pool_write_requests disabled
|
||||
buffer_pool_wait_free disabled
|
||||
buffer_pool_read_ahead disabled
|
||||
buffer_pool_read_ahead_evicted disabled
|
||||
buffer_pool_pages_total disabled
|
||||
buffer_pool_pages_misc disabled
|
||||
buffer_pool_pages_data disabled
|
||||
buffer_pool_bytes_data disabled
|
||||
buffer_pool_pages_dirty disabled
|
||||
buffer_pool_bytes_dirty disabled
|
||||
buffer_pool_pages_free disabled
|
||||
buffer_pages_created disabled
|
||||
buffer_pages_written disabled
|
||||
buffer_index_pages_written disabled
|
||||
buffer_non_index_pages_written disabled
|
||||
buffer_pages_read disabled
|
||||
buffer_pages0_read disabled
|
||||
buffer_index_sec_rec_cluster_reads disabled
|
||||
buffer_index_sec_rec_cluster_reads_avoided disabled
|
||||
buffer_data_reads disabled
|
||||
buffer_data_written disabled
|
||||
buffer_flush_batch_scanned disabled
|
||||
buffer_flush_batch_num_scan disabled
|
||||
buffer_flush_batch_scanned_per_call disabled
|
||||
buffer_flush_batch_total_pages disabled
|
||||
buffer_flush_batches disabled
|
||||
buffer_flush_batch_pages disabled
|
||||
buffer_flush_neighbor_total_pages disabled
|
||||
buffer_flush_neighbor disabled
|
||||
buffer_flush_neighbor_pages disabled
|
||||
buffer_flush_n_to_flush_requested disabled
|
||||
buffer_flush_n_to_flush_by_age disabled
|
||||
buffer_flush_adaptive_avg_time_slot disabled
|
||||
buffer_LRU_batch_flush_avg_time_slot disabled
|
||||
buffer_flush_adaptive_avg_time_thread disabled
|
||||
buffer_LRU_batch_flush_avg_time_thread disabled
|
||||
buffer_flush_adaptive_avg_time_est disabled
|
||||
buffer_LRU_batch_flush_avg_time_est disabled
|
||||
buffer_flush_avg_time disabled
|
||||
buffer_flush_adaptive_avg_pass disabled
|
||||
buffer_LRU_batch_flush_avg_pass disabled
|
||||
buffer_flush_avg_pass disabled
|
||||
buffer_LRU_get_free_loops disabled
|
||||
buffer_LRU_get_free_waits disabled
|
||||
buffer_flush_avg_page_rate disabled
|
||||
buffer_flush_lsn_avg_rate disabled
|
||||
buffer_flush_pct_for_dirty disabled
|
||||
buffer_flush_pct_for_lsn disabled
|
||||
buffer_flush_sync_waits disabled
|
||||
buffer_flush_adaptive_total_pages disabled
|
||||
buffer_flush_adaptive disabled
|
||||
buffer_flush_adaptive_pages disabled
|
||||
buffer_flush_sync_total_pages disabled
|
||||
buffer_flush_sync disabled
|
||||
buffer_flush_sync_pages disabled
|
||||
buffer_flush_background_total_pages disabled
|
||||
buffer_flush_background disabled
|
||||
buffer_flush_background_pages disabled
|
||||
buffer_LRU_batch_scanned disabled
|
||||
buffer_LRU_batch_num_scan disabled
|
||||
buffer_LRU_batch_scanned_per_call disabled
|
||||
buffer_LRU_batch_flush_total_pages disabled
|
||||
buffer_LRU_batches_flush disabled
|
||||
buffer_LRU_batch_flush_pages disabled
|
||||
buffer_LRU_batch_evict_total_pages disabled
|
||||
buffer_LRU_batches_evict disabled
|
||||
buffer_LRU_batch_evict_pages disabled
|
||||
buffer_LRU_single_flush_scanned disabled
|
||||
buffer_LRU_single_flush_num_scan disabled
|
||||
buffer_LRU_single_flush_scanned_per_call disabled
|
||||
buffer_LRU_single_flush_failure_count disabled
|
||||
buffer_LRU_get_free_search disabled
|
||||
buffer_LRU_search_scanned disabled
|
||||
buffer_LRU_search_num_scan disabled
|
||||
buffer_LRU_search_scanned_per_call disabled
|
||||
buffer_LRU_unzip_search_scanned disabled
|
||||
buffer_LRU_unzip_search_num_scan disabled
|
||||
buffer_LRU_unzip_search_scanned_per_call disabled
|
||||
buffer_page_read_index_leaf disabled
|
||||
buffer_page_read_index_non_leaf disabled
|
||||
buffer_page_read_index_ibuf_leaf disabled
|
||||
buffer_page_read_index_ibuf_non_leaf disabled
|
||||
buffer_page_read_undo_log disabled
|
||||
buffer_page_read_index_inode disabled
|
||||
buffer_page_read_ibuf_free_list disabled
|
||||
buffer_page_read_ibuf_bitmap disabled
|
||||
buffer_page_read_system_page disabled
|
||||
buffer_page_read_trx_system disabled
|
||||
buffer_page_read_fsp_hdr disabled
|
||||
buffer_page_read_xdes disabled
|
||||
buffer_page_read_blob disabled
|
||||
buffer_page_read_zblob disabled
|
||||
buffer_page_read_zblob2 disabled
|
||||
buffer_page_read_other disabled
|
||||
buffer_page_written_index_leaf disabled
|
||||
buffer_page_written_index_non_leaf disabled
|
||||
buffer_page_written_index_ibuf_leaf disabled
|
||||
buffer_page_written_index_ibuf_non_leaf disabled
|
||||
buffer_page_written_undo_log disabled
|
||||
buffer_page_written_index_inode disabled
|
||||
buffer_page_written_ibuf_free_list disabled
|
||||
buffer_page_written_ibuf_bitmap disabled
|
||||
buffer_page_written_system_page disabled
|
||||
buffer_page_written_trx_system disabled
|
||||
buffer_page_written_fsp_hdr disabled
|
||||
buffer_page_written_xdes disabled
|
||||
buffer_page_written_blob disabled
|
||||
buffer_page_written_zblob disabled
|
||||
buffer_page_written_zblob2 disabled
|
||||
buffer_page_written_other disabled
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs disabled
|
||||
os_pending_reads disabled
|
||||
os_pending_writes disabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs disabled
|
||||
os_log_pending_writes disabled
|
||||
trx_rw_commits disabled
|
||||
trx_ro_commits disabled
|
||||
trx_nl_ro_commits disabled
|
||||
trx_commits_insert_update disabled
|
||||
trx_rollbacks disabled
|
||||
trx_rollbacks_savepoint disabled
|
||||
trx_rollback_active disabled
|
||||
trx_active_transactions disabled
|
||||
trx_rseg_history_len disabled
|
||||
trx_undo_slots_used disabled
|
||||
trx_undo_slots_cached disabled
|
||||
trx_rseg_current_size disabled
|
||||
purge_del_mark_records disabled
|
||||
purge_upd_exist_or_extern_records disabled
|
||||
purge_invoked disabled
|
||||
purge_undo_log_pages disabled
|
||||
purge_dml_delay_usec disabled
|
||||
purge_stop_count disabled
|
||||
purge_resume_count disabled
|
||||
log_checkpoints disabled
|
||||
log_lsn_last_flush disabled
|
||||
log_lsn_last_checkpoint disabled
|
||||
log_lsn_current disabled
|
||||
log_lsn_checkpoint_age disabled
|
||||
log_lsn_buf_pool_oldest disabled
|
||||
log_max_modified_age_async disabled
|
||||
log_max_modified_age_sync disabled
|
||||
log_pending_log_flushes disabled
|
||||
log_pending_checkpoint_writes disabled
|
||||
log_num_log_io disabled
|
||||
log_waits disabled
|
||||
log_write_requests disabled
|
||||
log_writes disabled
|
||||
log_padded disabled
|
||||
compress_pages_compressed disabled
|
||||
compress_pages_decompressed disabled
|
||||
compression_pad_increments disabled
|
||||
compression_pad_decrements disabled
|
||||
compress_saved disabled
|
||||
compress_pages_page_compressed disabled
|
||||
compress_page_compressed_trim_op disabled
|
||||
compress_pages_page_decompressed disabled
|
||||
compress_pages_page_compression_error disabled
|
||||
compress_pages_encrypted disabled
|
||||
compress_pages_decrypted disabled
|
||||
index_page_splits disabled
|
||||
index_page_merge_attempts disabled
|
||||
index_page_merge_successful disabled
|
||||
index_page_reorg_attempts disabled
|
||||
index_page_reorg_successful disabled
|
||||
index_page_discards disabled
|
||||
adaptive_hash_searches disabled
|
||||
adaptive_hash_searches_btree disabled
|
||||
adaptive_hash_pages_added disabled
|
||||
adaptive_hash_pages_removed disabled
|
||||
adaptive_hash_rows_added disabled
|
||||
adaptive_hash_rows_removed disabled
|
||||
adaptive_hash_rows_deleted_no_hash_entry disabled
|
||||
adaptive_hash_rows_updated disabled
|
||||
file_num_open_files disabled
|
||||
ibuf_merges_insert disabled
|
||||
ibuf_merges_delete_mark disabled
|
||||
ibuf_merges_delete disabled
|
||||
ibuf_merges_discard_insert disabled
|
||||
ibuf_merges_discard_delete_mark disabled
|
||||
ibuf_merges_discard_delete disabled
|
||||
ibuf_merges disabled
|
||||
ibuf_size disabled
|
||||
innodb_master_thread_sleeps disabled
|
||||
innodb_activity_count disabled
|
||||
innodb_master_active_loops disabled
|
||||
innodb_master_idle_loops disabled
|
||||
innodb_background_drop_table_usec disabled
|
||||
innodb_ibuf_merge_usec disabled
|
||||
innodb_log_flush_usec disabled
|
||||
innodb_mem_validate_usec disabled
|
||||
innodb_master_purge_usec disabled
|
||||
innodb_dict_lru_usec disabled
|
||||
innodb_dict_lru_count_active disabled
|
||||
innodb_dict_lru_count_idle disabled
|
||||
innodb_checkpoint_usec disabled
|
||||
innodb_dblwr_writes disabled
|
||||
innodb_dblwr_pages_written disabled
|
||||
innodb_page_size disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
dml_reads disabled
|
||||
dml_inserts disabled
|
||||
dml_deletes disabled
|
||||
dml_updates disabled
|
||||
dml_system_reads disabled
|
||||
dml_system_inserts disabled
|
||||
dml_system_deletes disabled
|
||||
dml_system_updates disabled
|
||||
ddl_background_drop_indexes disabled
|
||||
ddl_background_drop_tables disabled
|
||||
ddl_online_create_index disabled
|
||||
ddl_pending_alter_table disabled
|
||||
ddl_sort_file_alter_table disabled
|
||||
ddl_log_file_alter_table disabled
|
||||
icp_attempts disabled
|
||||
icp_no_match disabled
|
||||
icp_out_of_range disabled
|
||||
icp_match disabled
|
||||
set global innodb_monitor_enable = all;
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_enable = aaa;
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
|
||||
set global innodb_monitor_disable = All;
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
name
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
name status
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%_%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
name status
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs enabled
|
||||
os_pending_reads enabled
|
||||
os_pending_writes enabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs enabled
|
||||
os_log_pending_writes enabled
|
||||
set global innodb_monitor_enable="";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
|
||||
set global innodb_monitor_enable="_";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
create index idx on monitor_test(col);
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled
|
||||
trx_active_transactions 1 0 0 1 0 0 enabled
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
insert into monitor_test values(9);
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 4 NULL 4 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 6 NULL 6 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 2 NULL 2 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 0 NULL 0 enabled
|
||||
dml_inserts 1 NULL 1 0 NULL 0 enabled
|
||||
dml_deletes 2 NULL 2 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 disabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 disabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 disabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 disabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts 2 NULL 2 2 NULL 2 enabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
file_num_open_files # # # # # # enabled
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
select a from monitor_test where b < 1 for update;
|
||||
a
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 1
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 0
|
||||
select a from monitor_test where b < 3 for update;
|
||||
a
|
||||
13
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 2
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 1
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
@ -1,616 +0,0 @@
|
||||
set global innodb_monitor_disable = All;
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
name status
|
||||
metadata_table_handles_opened disabled
|
||||
metadata_table_handles_closed disabled
|
||||
metadata_table_reference_count disabled
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
buffer_pool_size disabled
|
||||
buffer_pool_reads disabled
|
||||
buffer_pool_read_requests disabled
|
||||
buffer_pool_write_requests disabled
|
||||
buffer_pool_wait_free disabled
|
||||
buffer_pool_read_ahead disabled
|
||||
buffer_pool_read_ahead_evicted disabled
|
||||
buffer_pool_pages_total disabled
|
||||
buffer_pool_pages_misc disabled
|
||||
buffer_pool_pages_data disabled
|
||||
buffer_pool_bytes_data disabled
|
||||
buffer_pool_pages_dirty disabled
|
||||
buffer_pool_bytes_dirty disabled
|
||||
buffer_pool_pages_free disabled
|
||||
buffer_pages_created disabled
|
||||
buffer_pages_written disabled
|
||||
buffer_index_pages_written disabled
|
||||
buffer_non_index_pages_written disabled
|
||||
buffer_pages_read disabled
|
||||
buffer_pages0_read disabled
|
||||
buffer_index_sec_rec_cluster_reads disabled
|
||||
buffer_index_sec_rec_cluster_reads_avoided disabled
|
||||
buffer_data_reads disabled
|
||||
buffer_data_written disabled
|
||||
buffer_flush_batch_scanned disabled
|
||||
buffer_flush_batch_num_scan disabled
|
||||
buffer_flush_batch_scanned_per_call disabled
|
||||
buffer_flush_batch_total_pages disabled
|
||||
buffer_flush_batches disabled
|
||||
buffer_flush_batch_pages disabled
|
||||
buffer_flush_neighbor_total_pages disabled
|
||||
buffer_flush_neighbor disabled
|
||||
buffer_flush_neighbor_pages disabled
|
||||
buffer_flush_n_to_flush_requested disabled
|
||||
buffer_flush_n_to_flush_by_age disabled
|
||||
buffer_flush_adaptive_avg_time_slot disabled
|
||||
buffer_LRU_batch_flush_avg_time_slot disabled
|
||||
buffer_flush_adaptive_avg_time_thread disabled
|
||||
buffer_LRU_batch_flush_avg_time_thread disabled
|
||||
buffer_flush_adaptive_avg_time_est disabled
|
||||
buffer_LRU_batch_flush_avg_time_est disabled
|
||||
buffer_flush_avg_time disabled
|
||||
buffer_flush_adaptive_avg_pass disabled
|
||||
buffer_LRU_batch_flush_avg_pass disabled
|
||||
buffer_flush_avg_pass disabled
|
||||
buffer_LRU_get_free_loops disabled
|
||||
buffer_LRU_get_free_waits disabled
|
||||
buffer_flush_avg_page_rate disabled
|
||||
buffer_flush_lsn_avg_rate disabled
|
||||
buffer_flush_pct_for_dirty disabled
|
||||
buffer_flush_pct_for_lsn disabled
|
||||
buffer_flush_sync_waits disabled
|
||||
buffer_flush_adaptive_total_pages disabled
|
||||
buffer_flush_adaptive disabled
|
||||
buffer_flush_adaptive_pages disabled
|
||||
buffer_flush_sync_total_pages disabled
|
||||
buffer_flush_sync disabled
|
||||
buffer_flush_sync_pages disabled
|
||||
buffer_flush_background_total_pages disabled
|
||||
buffer_flush_background disabled
|
||||
buffer_flush_background_pages disabled
|
||||
buffer_LRU_batch_scanned disabled
|
||||
buffer_LRU_batch_num_scan disabled
|
||||
buffer_LRU_batch_scanned_per_call disabled
|
||||
buffer_LRU_batch_flush_total_pages disabled
|
||||
buffer_LRU_batches_flush disabled
|
||||
buffer_LRU_batch_flush_pages disabled
|
||||
buffer_LRU_batch_evict_total_pages disabled
|
||||
buffer_LRU_batches_evict disabled
|
||||
buffer_LRU_batch_evict_pages disabled
|
||||
buffer_LRU_single_flush_scanned disabled
|
||||
buffer_LRU_single_flush_num_scan disabled
|
||||
buffer_LRU_single_flush_scanned_per_call disabled
|
||||
buffer_LRU_single_flush_failure_count disabled
|
||||
buffer_LRU_get_free_search disabled
|
||||
buffer_LRU_search_scanned disabled
|
||||
buffer_LRU_search_num_scan disabled
|
||||
buffer_LRU_search_scanned_per_call disabled
|
||||
buffer_LRU_unzip_search_scanned disabled
|
||||
buffer_LRU_unzip_search_num_scan disabled
|
||||
buffer_LRU_unzip_search_scanned_per_call disabled
|
||||
buffer_page_read_index_leaf disabled
|
||||
buffer_page_read_index_non_leaf disabled
|
||||
buffer_page_read_index_ibuf_leaf disabled
|
||||
buffer_page_read_index_ibuf_non_leaf disabled
|
||||
buffer_page_read_undo_log disabled
|
||||
buffer_page_read_index_inode disabled
|
||||
buffer_page_read_ibuf_free_list disabled
|
||||
buffer_page_read_ibuf_bitmap disabled
|
||||
buffer_page_read_system_page disabled
|
||||
buffer_page_read_trx_system disabled
|
||||
buffer_page_read_fsp_hdr disabled
|
||||
buffer_page_read_xdes disabled
|
||||
buffer_page_read_blob disabled
|
||||
buffer_page_read_zblob disabled
|
||||
buffer_page_read_zblob2 disabled
|
||||
buffer_page_read_other disabled
|
||||
buffer_page_written_index_leaf disabled
|
||||
buffer_page_written_index_non_leaf disabled
|
||||
buffer_page_written_index_ibuf_leaf disabled
|
||||
buffer_page_written_index_ibuf_non_leaf disabled
|
||||
buffer_page_written_undo_log disabled
|
||||
buffer_page_written_index_inode disabled
|
||||
buffer_page_written_ibuf_free_list disabled
|
||||
buffer_page_written_ibuf_bitmap disabled
|
||||
buffer_page_written_system_page disabled
|
||||
buffer_page_written_trx_system disabled
|
||||
buffer_page_written_fsp_hdr disabled
|
||||
buffer_page_written_xdes disabled
|
||||
buffer_page_written_blob disabled
|
||||
buffer_page_written_zblob disabled
|
||||
buffer_page_written_zblob2 disabled
|
||||
buffer_page_written_other disabled
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs disabled
|
||||
os_pending_reads disabled
|
||||
os_pending_writes disabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs disabled
|
||||
os_log_pending_writes disabled
|
||||
trx_rw_commits disabled
|
||||
trx_ro_commits disabled
|
||||
trx_nl_ro_commits disabled
|
||||
trx_commits_insert_update disabled
|
||||
trx_rollbacks disabled
|
||||
trx_rollbacks_savepoint disabled
|
||||
trx_rollback_active disabled
|
||||
trx_active_transactions disabled
|
||||
trx_rseg_history_len disabled
|
||||
trx_undo_slots_used disabled
|
||||
trx_undo_slots_cached disabled
|
||||
trx_rseg_current_size disabled
|
||||
purge_del_mark_records disabled
|
||||
purge_upd_exist_or_extern_records disabled
|
||||
purge_invoked disabled
|
||||
purge_undo_log_pages disabled
|
||||
purge_dml_delay_usec disabled
|
||||
purge_stop_count disabled
|
||||
purge_resume_count disabled
|
||||
log_checkpoints disabled
|
||||
log_lsn_last_flush disabled
|
||||
log_lsn_last_checkpoint disabled
|
||||
log_lsn_current disabled
|
||||
log_lsn_checkpoint_age disabled
|
||||
log_lsn_buf_pool_oldest disabled
|
||||
log_max_modified_age_async disabled
|
||||
log_max_modified_age_sync disabled
|
||||
log_pending_log_flushes disabled
|
||||
log_pending_checkpoint_writes disabled
|
||||
log_num_log_io disabled
|
||||
log_waits disabled
|
||||
log_write_requests disabled
|
||||
log_writes disabled
|
||||
log_padded disabled
|
||||
compress_pages_compressed disabled
|
||||
compress_pages_decompressed disabled
|
||||
compression_pad_increments disabled
|
||||
compression_pad_decrements disabled
|
||||
compress_saved disabled
|
||||
compress_pages_page_compressed disabled
|
||||
compress_page_compressed_trim_op disabled
|
||||
compress_pages_page_decompressed disabled
|
||||
compress_pages_page_compression_error disabled
|
||||
compress_pages_encrypted disabled
|
||||
compress_pages_decrypted disabled
|
||||
index_page_splits disabled
|
||||
index_page_merge_attempts disabled
|
||||
index_page_merge_successful disabled
|
||||
index_page_reorg_attempts disabled
|
||||
index_page_reorg_successful disabled
|
||||
index_page_discards disabled
|
||||
adaptive_hash_searches disabled
|
||||
adaptive_hash_searches_btree disabled
|
||||
adaptive_hash_pages_added disabled
|
||||
adaptive_hash_pages_removed disabled
|
||||
adaptive_hash_rows_added disabled
|
||||
adaptive_hash_rows_removed disabled
|
||||
adaptive_hash_rows_deleted_no_hash_entry disabled
|
||||
adaptive_hash_rows_updated disabled
|
||||
file_num_open_files disabled
|
||||
ibuf_merges_insert disabled
|
||||
ibuf_merges_delete_mark disabled
|
||||
ibuf_merges_delete disabled
|
||||
ibuf_merges_discard_insert disabled
|
||||
ibuf_merges_discard_delete_mark disabled
|
||||
ibuf_merges_discard_delete disabled
|
||||
ibuf_merges disabled
|
||||
ibuf_size disabled
|
||||
innodb_master_thread_sleeps disabled
|
||||
innodb_activity_count disabled
|
||||
innodb_master_active_loops disabled
|
||||
innodb_master_idle_loops disabled
|
||||
innodb_background_drop_table_usec disabled
|
||||
innodb_ibuf_merge_usec disabled
|
||||
innodb_log_flush_usec disabled
|
||||
innodb_mem_validate_usec disabled
|
||||
innodb_master_purge_usec disabled
|
||||
innodb_dict_lru_usec disabled
|
||||
innodb_dict_lru_count_active disabled
|
||||
innodb_dict_lru_count_idle disabled
|
||||
innodb_checkpoint_usec disabled
|
||||
innodb_dblwr_writes disabled
|
||||
innodb_dblwr_pages_written disabled
|
||||
innodb_page_size disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
dml_reads disabled
|
||||
dml_inserts disabled
|
||||
dml_deletes disabled
|
||||
dml_updates disabled
|
||||
dml_system_reads disabled
|
||||
dml_system_inserts disabled
|
||||
dml_system_deletes disabled
|
||||
dml_system_updates disabled
|
||||
ddl_background_drop_indexes disabled
|
||||
ddl_background_drop_tables disabled
|
||||
ddl_online_create_index disabled
|
||||
ddl_pending_alter_table disabled
|
||||
ddl_sort_file_alter_table disabled
|
||||
ddl_log_file_alter_table disabled
|
||||
icp_attempts disabled
|
||||
icp_no_match disabled
|
||||
icp_out_of_range disabled
|
||||
icp_match disabled
|
||||
set global innodb_monitor_enable = all;
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_enable = aaa;
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
|
||||
set global innodb_monitor_disable = All;
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
name
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
name status
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%_%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
name status
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs enabled
|
||||
os_pending_reads enabled
|
||||
os_pending_writes enabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs enabled
|
||||
os_log_pending_writes enabled
|
||||
set global innodb_monitor_enable="";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
|
||||
set global innodb_monitor_enable="_";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
create index idx on monitor_test(col);
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled
|
||||
trx_active_transactions 1 0 0 1 0 0 enabled
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
insert into monitor_test values(9);
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 4 NULL 4 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 6 NULL 6 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 2 NULL 2 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 0 NULL 0 enabled
|
||||
dml_inserts 1 NULL 1 0 NULL 0 enabled
|
||||
dml_deletes 2 NULL 2 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 disabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 disabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 disabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 disabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts 2 NULL 2 2 NULL 2 enabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
file_num_open_files # # # # # # enabled
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
select a from monitor_test where b < 1 for update;
|
||||
a
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 1
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 0
|
||||
select a from monitor_test where b < 3 for update;
|
||||
a
|
||||
13
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 2
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 1
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
@ -1,616 +0,0 @@
|
||||
set global innodb_monitor_disable = All;
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
name status
|
||||
metadata_table_handles_opened disabled
|
||||
metadata_table_handles_closed disabled
|
||||
metadata_table_reference_count disabled
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
buffer_pool_size disabled
|
||||
buffer_pool_reads disabled
|
||||
buffer_pool_read_requests disabled
|
||||
buffer_pool_write_requests disabled
|
||||
buffer_pool_wait_free disabled
|
||||
buffer_pool_read_ahead disabled
|
||||
buffer_pool_read_ahead_evicted disabled
|
||||
buffer_pool_pages_total disabled
|
||||
buffer_pool_pages_misc disabled
|
||||
buffer_pool_pages_data disabled
|
||||
buffer_pool_bytes_data disabled
|
||||
buffer_pool_pages_dirty disabled
|
||||
buffer_pool_bytes_dirty disabled
|
||||
buffer_pool_pages_free disabled
|
||||
buffer_pages_created disabled
|
||||
buffer_pages_written disabled
|
||||
buffer_index_pages_written disabled
|
||||
buffer_non_index_pages_written disabled
|
||||
buffer_pages_read disabled
|
||||
buffer_pages0_read disabled
|
||||
buffer_index_sec_rec_cluster_reads disabled
|
||||
buffer_index_sec_rec_cluster_reads_avoided disabled
|
||||
buffer_data_reads disabled
|
||||
buffer_data_written disabled
|
||||
buffer_flush_batch_scanned disabled
|
||||
buffer_flush_batch_num_scan disabled
|
||||
buffer_flush_batch_scanned_per_call disabled
|
||||
buffer_flush_batch_total_pages disabled
|
||||
buffer_flush_batches disabled
|
||||
buffer_flush_batch_pages disabled
|
||||
buffer_flush_neighbor_total_pages disabled
|
||||
buffer_flush_neighbor disabled
|
||||
buffer_flush_neighbor_pages disabled
|
||||
buffer_flush_n_to_flush_requested disabled
|
||||
buffer_flush_n_to_flush_by_age disabled
|
||||
buffer_flush_adaptive_avg_time_slot disabled
|
||||
buffer_LRU_batch_flush_avg_time_slot disabled
|
||||
buffer_flush_adaptive_avg_time_thread disabled
|
||||
buffer_LRU_batch_flush_avg_time_thread disabled
|
||||
buffer_flush_adaptive_avg_time_est disabled
|
||||
buffer_LRU_batch_flush_avg_time_est disabled
|
||||
buffer_flush_avg_time disabled
|
||||
buffer_flush_adaptive_avg_pass disabled
|
||||
buffer_LRU_batch_flush_avg_pass disabled
|
||||
buffer_flush_avg_pass disabled
|
||||
buffer_LRU_get_free_loops disabled
|
||||
buffer_LRU_get_free_waits disabled
|
||||
buffer_flush_avg_page_rate disabled
|
||||
buffer_flush_lsn_avg_rate disabled
|
||||
buffer_flush_pct_for_dirty disabled
|
||||
buffer_flush_pct_for_lsn disabled
|
||||
buffer_flush_sync_waits disabled
|
||||
buffer_flush_adaptive_total_pages disabled
|
||||
buffer_flush_adaptive disabled
|
||||
buffer_flush_adaptive_pages disabled
|
||||
buffer_flush_sync_total_pages disabled
|
||||
buffer_flush_sync disabled
|
||||
buffer_flush_sync_pages disabled
|
||||
buffer_flush_background_total_pages disabled
|
||||
buffer_flush_background disabled
|
||||
buffer_flush_background_pages disabled
|
||||
buffer_LRU_batch_scanned disabled
|
||||
buffer_LRU_batch_num_scan disabled
|
||||
buffer_LRU_batch_scanned_per_call disabled
|
||||
buffer_LRU_batch_flush_total_pages disabled
|
||||
buffer_LRU_batches_flush disabled
|
||||
buffer_LRU_batch_flush_pages disabled
|
||||
buffer_LRU_batch_evict_total_pages disabled
|
||||
buffer_LRU_batches_evict disabled
|
||||
buffer_LRU_batch_evict_pages disabled
|
||||
buffer_LRU_single_flush_scanned disabled
|
||||
buffer_LRU_single_flush_num_scan disabled
|
||||
buffer_LRU_single_flush_scanned_per_call disabled
|
||||
buffer_LRU_single_flush_failure_count disabled
|
||||
buffer_LRU_get_free_search disabled
|
||||
buffer_LRU_search_scanned disabled
|
||||
buffer_LRU_search_num_scan disabled
|
||||
buffer_LRU_search_scanned_per_call disabled
|
||||
buffer_LRU_unzip_search_scanned disabled
|
||||
buffer_LRU_unzip_search_num_scan disabled
|
||||
buffer_LRU_unzip_search_scanned_per_call disabled
|
||||
buffer_page_read_index_leaf disabled
|
||||
buffer_page_read_index_non_leaf disabled
|
||||
buffer_page_read_index_ibuf_leaf disabled
|
||||
buffer_page_read_index_ibuf_non_leaf disabled
|
||||
buffer_page_read_undo_log disabled
|
||||
buffer_page_read_index_inode disabled
|
||||
buffer_page_read_ibuf_free_list disabled
|
||||
buffer_page_read_ibuf_bitmap disabled
|
||||
buffer_page_read_system_page disabled
|
||||
buffer_page_read_trx_system disabled
|
||||
buffer_page_read_fsp_hdr disabled
|
||||
buffer_page_read_xdes disabled
|
||||
buffer_page_read_blob disabled
|
||||
buffer_page_read_zblob disabled
|
||||
buffer_page_read_zblob2 disabled
|
||||
buffer_page_read_other disabled
|
||||
buffer_page_written_index_leaf disabled
|
||||
buffer_page_written_index_non_leaf disabled
|
||||
buffer_page_written_index_ibuf_leaf disabled
|
||||
buffer_page_written_index_ibuf_non_leaf disabled
|
||||
buffer_page_written_undo_log disabled
|
||||
buffer_page_written_index_inode disabled
|
||||
buffer_page_written_ibuf_free_list disabled
|
||||
buffer_page_written_ibuf_bitmap disabled
|
||||
buffer_page_written_system_page disabled
|
||||
buffer_page_written_trx_system disabled
|
||||
buffer_page_written_fsp_hdr disabled
|
||||
buffer_page_written_xdes disabled
|
||||
buffer_page_written_blob disabled
|
||||
buffer_page_written_zblob disabled
|
||||
buffer_page_written_zblob2 disabled
|
||||
buffer_page_written_other disabled
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs disabled
|
||||
os_pending_reads disabled
|
||||
os_pending_writes disabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs disabled
|
||||
os_log_pending_writes disabled
|
||||
trx_rw_commits disabled
|
||||
trx_ro_commits disabled
|
||||
trx_nl_ro_commits disabled
|
||||
trx_commits_insert_update disabled
|
||||
trx_rollbacks disabled
|
||||
trx_rollbacks_savepoint disabled
|
||||
trx_rollback_active disabled
|
||||
trx_active_transactions disabled
|
||||
trx_rseg_history_len disabled
|
||||
trx_undo_slots_used disabled
|
||||
trx_undo_slots_cached disabled
|
||||
trx_rseg_current_size disabled
|
||||
purge_del_mark_records disabled
|
||||
purge_upd_exist_or_extern_records disabled
|
||||
purge_invoked disabled
|
||||
purge_undo_log_pages disabled
|
||||
purge_dml_delay_usec disabled
|
||||
purge_stop_count disabled
|
||||
purge_resume_count disabled
|
||||
log_checkpoints disabled
|
||||
log_lsn_last_flush disabled
|
||||
log_lsn_last_checkpoint disabled
|
||||
log_lsn_current disabled
|
||||
log_lsn_checkpoint_age disabled
|
||||
log_lsn_buf_pool_oldest disabled
|
||||
log_max_modified_age_async disabled
|
||||
log_max_modified_age_sync disabled
|
||||
log_pending_log_flushes disabled
|
||||
log_pending_checkpoint_writes disabled
|
||||
log_num_log_io disabled
|
||||
log_waits disabled
|
||||
log_write_requests disabled
|
||||
log_writes disabled
|
||||
log_padded disabled
|
||||
compress_pages_compressed disabled
|
||||
compress_pages_decompressed disabled
|
||||
compression_pad_increments disabled
|
||||
compression_pad_decrements disabled
|
||||
compress_saved disabled
|
||||
compress_pages_page_compressed disabled
|
||||
compress_page_compressed_trim_op disabled
|
||||
compress_pages_page_decompressed disabled
|
||||
compress_pages_page_compression_error disabled
|
||||
compress_pages_encrypted disabled
|
||||
compress_pages_decrypted disabled
|
||||
index_page_splits disabled
|
||||
index_page_merge_attempts disabled
|
||||
index_page_merge_successful disabled
|
||||
index_page_reorg_attempts disabled
|
||||
index_page_reorg_successful disabled
|
||||
index_page_discards disabled
|
||||
adaptive_hash_searches disabled
|
||||
adaptive_hash_searches_btree disabled
|
||||
adaptive_hash_pages_added disabled
|
||||
adaptive_hash_pages_removed disabled
|
||||
adaptive_hash_rows_added disabled
|
||||
adaptive_hash_rows_removed disabled
|
||||
adaptive_hash_rows_deleted_no_hash_entry disabled
|
||||
adaptive_hash_rows_updated disabled
|
||||
file_num_open_files disabled
|
||||
ibuf_merges_insert disabled
|
||||
ibuf_merges_delete_mark disabled
|
||||
ibuf_merges_delete disabled
|
||||
ibuf_merges_discard_insert disabled
|
||||
ibuf_merges_discard_delete_mark disabled
|
||||
ibuf_merges_discard_delete disabled
|
||||
ibuf_merges disabled
|
||||
ibuf_size disabled
|
||||
innodb_master_thread_sleeps disabled
|
||||
innodb_activity_count disabled
|
||||
innodb_master_active_loops disabled
|
||||
innodb_master_idle_loops disabled
|
||||
innodb_background_drop_table_usec disabled
|
||||
innodb_ibuf_merge_usec disabled
|
||||
innodb_log_flush_usec disabled
|
||||
innodb_mem_validate_usec disabled
|
||||
innodb_master_purge_usec disabled
|
||||
innodb_dict_lru_usec disabled
|
||||
innodb_dict_lru_count_active disabled
|
||||
innodb_dict_lru_count_idle disabled
|
||||
innodb_checkpoint_usec disabled
|
||||
innodb_dblwr_writes disabled
|
||||
innodb_dblwr_pages_written disabled
|
||||
innodb_page_size disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
dml_reads disabled
|
||||
dml_inserts disabled
|
||||
dml_deletes disabled
|
||||
dml_updates disabled
|
||||
dml_system_reads disabled
|
||||
dml_system_inserts disabled
|
||||
dml_system_deletes disabled
|
||||
dml_system_updates disabled
|
||||
ddl_background_drop_indexes disabled
|
||||
ddl_background_drop_tables disabled
|
||||
ddl_online_create_index disabled
|
||||
ddl_pending_alter_table disabled
|
||||
ddl_sort_file_alter_table disabled
|
||||
ddl_log_file_alter_table disabled
|
||||
icp_attempts disabled
|
||||
icp_no_match disabled
|
||||
icp_out_of_range disabled
|
||||
icp_match disabled
|
||||
set global innodb_monitor_enable = all;
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_enable = aaa;
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
|
||||
set global innodb_monitor_disable = All;
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_reset_all = all;
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
name
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
name status
|
||||
lock_deadlocks disabled
|
||||
lock_timeouts disabled
|
||||
lock_rec_lock_waits disabled
|
||||
lock_table_lock_waits disabled
|
||||
lock_rec_lock_requests disabled
|
||||
lock_rec_lock_created disabled
|
||||
lock_rec_lock_removed disabled
|
||||
lock_rec_locks disabled
|
||||
lock_table_lock_created disabled
|
||||
lock_table_lock_removed disabled
|
||||
lock_table_locks disabled
|
||||
lock_row_lock_current_waits disabled
|
||||
lock_row_lock_time disabled
|
||||
lock_row_lock_time_max disabled
|
||||
lock_row_lock_waits disabled
|
||||
lock_row_lock_time_avg disabled
|
||||
innodb_rwlock_s_spin_waits disabled
|
||||
innodb_rwlock_x_spin_waits disabled
|
||||
innodb_rwlock_sx_spin_waits disabled
|
||||
innodb_rwlock_s_spin_rounds disabled
|
||||
innodb_rwlock_x_spin_rounds disabled
|
||||
innodb_rwlock_sx_spin_rounds disabled
|
||||
innodb_rwlock_s_os_waits disabled
|
||||
innodb_rwlock_x_os_waits disabled
|
||||
innodb_rwlock_sx_os_waits disabled
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="%";
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
name
|
||||
set global innodb_monitor_disable="%_%";
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
name
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
name
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
name status
|
||||
os_data_reads disabled
|
||||
os_data_writes disabled
|
||||
os_data_fsyncs enabled
|
||||
os_pending_reads enabled
|
||||
os_pending_writes enabled
|
||||
os_log_bytes_written disabled
|
||||
os_log_fsyncs disabled
|
||||
os_log_pending_fsyncs enabled
|
||||
os_log_pending_writes enabled
|
||||
set global innodb_monitor_enable="";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
|
||||
set global innodb_monitor_enable="_";
|
||||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
drop table monitor_test;
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
select * from monitor_test;
|
||||
col
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
create index idx on monitor_test(col);
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
|
||||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
|
||||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled
|
||||
trx_active_transactions 1 0 0 1 0 0 enabled
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
insert into monitor_test values(9);
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 4 NULL 4 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 6 NULL 6 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 2 NULL 2 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 0 NULL 0 enabled
|
||||
dml_inserts 1 NULL 1 0 NULL 0 enabled
|
||||
dml_deletes 2 NULL 2 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 8 NULL 8 2 NULL 2 disabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 disabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 disabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 disabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts 2 NULL 2 2 NULL 2 enabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
file_num_open_files # # # # # # enabled
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
select a from monitor_test where b < 1 for update;
|
||||
a
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 1
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 0
|
||||
select a from monitor_test where b < 3 for update;
|
||||
a
|
||||
13
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
name count
|
||||
icp_attempts 2
|
||||
icp_no_match 0
|
||||
icp_out_of_range 1
|
||||
icp_match 1
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
@ -8,7 +8,7 @@ COUNT(@@GLOBAL.innodb_use_trim)
|
||||
1 Expected
|
||||
SET @@GLOBAL.innodb_use_trim=1;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_use_trim is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT COUNT(@@GLOBAL.innodb_use_trim);
|
||||
COUNT(@@GLOBAL.innodb_use_trim)
|
||||
1
|
||||
@ -31,7 +31,7 @@ COUNT(VARIABLE_VALUE)
|
||||
1 Expected
|
||||
SET @@global.innodb_use_trim = @start_use_trim;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_use_trim is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
Warning 131 Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
|
||||
SELECT @@global.innodb_use_trim;
|
||||
@@global.innodb_use_trim
|
||||
1
|
||||
|
@ -6,7 +6,7 @@
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
-VARIABLE_TYPE BIGINT UNSIGNED
|
||||
+VARIABLE_TYPE INT UNSIGNED
|
||||
VARIABLE_COMMENT Number of InnoDB Adapative Hash Index Partitions. (default = 8).
|
||||
VARIABLE_COMMENT Number of InnoDB Adaptive Hash Index Partitions (default 8)
|
||||
NUMERIC_MIN_VALUE 1
|
||||
NUMERIC_MAX_VALUE 512
|
||||
@@ -68,7 +68,7 @@
|
||||
|
@ -55,7 +55,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||
DEFAULT_VALUE 8
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT Number of InnoDB Adapative Hash Index Partitions. (default = 8).
|
||||
VARIABLE_COMMENT Number of InnoDB Adaptive Hash Index Partitions (default 8)
|
||||
NUMERIC_MIN_VALUE 1
|
||||
NUMERIC_MAX_VALUE 512
|
||||
NUMERIC_BLOCK_SIZE 0
|
||||
@ -1301,7 +1301,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||
DEFAULT_VALUE OFF
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BOOLEAN
|
||||
VARIABLE_COMMENT Enable semaphore request instrumentation. This could have some effect on performance but allows better information on long semaphore wait problems. (Default: not enabled)
|
||||
VARIABLE_COMMENT DEPRECATED. This setting has no effect.
|
||||
NUMERIC_MIN_VALUE NULL
|
||||
NUMERIC_MAX_VALUE NULL
|
||||
NUMERIC_BLOCK_SIZE NULL
|
||||
|
@ -1,378 +0,0 @@
|
||||
# This is the test for Metrics Monitor Table feature.
|
||||
# Test the metrics monitor system's control system
|
||||
# and counter accuracy.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
set global innodb_monitor_disable = All;
|
||||
# Test turn on/off the monitor counter with "all" option
|
||||
# By default, they will be off
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
|
||||
# Turn on all monitor counters
|
||||
set global innodb_monitor_enable = all;
|
||||
|
||||
# status should all change to "enabled"
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Test wrong argument to the global configure option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = aaa;
|
||||
|
||||
# We require a valid monitor counter/module name. There is no default
|
||||
# counter name or module. A warning will be printed asking user to
|
||||
# specify a valid counter name.
|
||||
#--disable_warnings
|
||||
#set global innodb_monitor_enable = default;
|
||||
#--enable_warnings
|
||||
|
||||
# Turn off all monitor counters, option name should be case
|
||||
# insensitive
|
||||
set global innodb_monitor_disable = All;
|
||||
|
||||
# status should all change to "disabled"
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# count should all change to 0
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
|
||||
# Test wildcard match, turn on all counters contain string "lock"
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
|
||||
# All lock related counter should be enabled
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
|
||||
# Disable them
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
|
||||
# All lock related counter should be disabled
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
|
||||
# No match for "%lock*"
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
|
||||
# All counters will be turned on with wildcard match string with all "%"
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all counters
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# One more round testing. All counters will be turned on with
|
||||
# single wildcard character "%"
|
||||
set global innodb_monitor_enable="%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all the counters with "%_%"
|
||||
set global innodb_monitor_disable="%_%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Turn on all counters start with "log"
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
|
||||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
|
||||
# is single character wildcard match word
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
|
||||
# Turn on counters whose name contains "os" and "pending" with
|
||||
# wildcard match "os%pending%"
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
|
||||
# Empty string is an invalid option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="";
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="_";
|
||||
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
# Only turn on "table_open" counter
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# This will open the monitor_test table
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment by 1
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset the counter value while counter is still on (started)
|
||||
# This will reset value "count_reset" but not
|
||||
# "count"
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again to increment "metadata_table_handles_opened" again
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Cannot reset all monitor value while the counter is on
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn off the counter "metadata_table_handles_opened"
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
|
||||
# Reset the counter value while counter is off (disabled)
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
|
||||
# should not be incremented
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select * from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset all the counters, include those counter *_since_start
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn on "table_open" counter again
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Test metadata_table_handles_opened again to see if it is working correctly
|
||||
# after above round of turning on/off/reset
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Test counter "metadata_table_handles_closed",
|
||||
# create index will close the old handle
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
|
||||
create index idx on monitor_test(col);
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Reset counters only in "module_metadata" module
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Test Transaction Module
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
|
||||
# Test DML Module
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# test reset counter while the counter is on
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# insert/delete some rows after the reset
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# We do not allow reset_all while the counter is on, nothing
|
||||
# should be reset here
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Turn off the counter
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Open individual counter "dml_inserts"
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
# Only counter "dml_inserts" should be updated
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
|
||||
# Counters are unpredictable when innodb-file-per-table is on
|
||||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
|
||||
# Test ICP module counters
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
|
||||
select a from monitor_test where b < 1 for update;
|
||||
|
||||
# should have icp_attempts = 1 and icp_out_of_range = 1
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
# should have icp_attempts = 2 and icp_match = 1
|
||||
select a from monitor_test where b < 3 for update;
|
||||
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
-- disable_warnings
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
-- enable_warnings
|
@ -1,378 +0,0 @@
|
||||
# This is the test for Metrics Monitor Table feature.
|
||||
# Test the metrics monitor system's control system
|
||||
# and counter accuracy.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
set global innodb_monitor_disable = All;
|
||||
# Test turn on/off the monitor counter with "all" option
|
||||
# By default, they will be off
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
|
||||
# Turn on all monitor counters
|
||||
set global innodb_monitor_enable = all;
|
||||
|
||||
# status should all change to "enabled"
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Test wrong argument to the global configure option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = aaa;
|
||||
|
||||
# We require a valid monitor counter/module name. There is no default
|
||||
# counter name or module. A warning will be printed asking user to
|
||||
# specify a valid counter name.
|
||||
#--disable_warnings
|
||||
#set global innodb_monitor_enable = default;
|
||||
#--enable_warnings
|
||||
|
||||
# Turn off all monitor counters, option name should be case
|
||||
# insensitive
|
||||
set global innodb_monitor_disable = All;
|
||||
|
||||
# status should all change to "disabled"
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# count should all change to 0
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
|
||||
# Test wildcard match, turn on all counters contain string "lock"
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
|
||||
# All lock related counter should be enabled
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
|
||||
# Disable them
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
|
||||
# All lock related counter should be disabled
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
|
||||
# No match for "%lock*"
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
|
||||
# All counters will be turned on with wildcard match string with all "%"
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all counters
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# One more round testing. All counters will be turned on with
|
||||
# single wildcard character "%"
|
||||
set global innodb_monitor_enable="%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all the counters with "%_%"
|
||||
set global innodb_monitor_disable="%_%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Turn on all counters start with "log"
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
|
||||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
|
||||
# is single character wildcard match word
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
|
||||
# Turn on counters whose name contains "os" and "pending" with
|
||||
# wildcard match "os%pending%"
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
|
||||
# Empty string is an invalid option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="";
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="_";
|
||||
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
# Only turn on "table_open" counter
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# This will open the monitor_test table
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment by 1
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset the counter value while counter is still on (started)
|
||||
# This will reset value "count_reset" but not
|
||||
# "count"
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again to increment "metadata_table_handles_opened" again
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Cannot reset all monitor value while the counter is on
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn off the counter "metadata_table_handles_opened"
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
|
||||
# Reset the counter value while counter is off (disabled)
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
|
||||
# should not be incremented
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select * from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset all the counters, include those counter *_since_start
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn on "table_open" counter again
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Test metadata_table_handles_opened again to see if it is working correctly
|
||||
# after above round of turning on/off/reset
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Test counter "metadata_table_handles_closed",
|
||||
# create index will close the old handle
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
|
||||
create index idx on monitor_test(col);
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Reset counters only in "module_metadata" module
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Test Transaction Module
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
|
||||
# Test DML Module
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# test reset counter while the counter is on
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# insert/delete some rows after the reset
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# We do not allow reset_all while the counter is on, nothing
|
||||
# should be reset here
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Turn off the counter
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Open individual counter "dml_inserts"
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
# Only counter "dml_inserts" should be updated
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
|
||||
# Counters are unpredictable when innodb-file-per-table is on
|
||||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
|
||||
# Test ICP module counters
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
|
||||
select a from monitor_test where b < 1 for update;
|
||||
|
||||
# should have icp_attempts = 1 and icp_out_of_range = 1
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
# should have icp_attempts = 2 and icp_match = 1
|
||||
select a from monitor_test where b < 3 for update;
|
||||
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
-- disable_warnings
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
-- enable_warnings
|
@ -1,378 +0,0 @@
|
||||
# This is the test for Metrics Monitor Table feature.
|
||||
# Test the metrics monitor system's control system
|
||||
# and counter accuracy.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
set global innodb_monitor_disable = All;
|
||||
# Test turn on/off the monitor counter with "all" option
|
||||
# By default, they will be off
|
||||
select name, status from information_schema.innodb_metrics;
|
||||
|
||||
# Turn on all monitor counters
|
||||
set global innodb_monitor_enable = all;
|
||||
|
||||
# status should all change to "enabled"
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Test wrong argument to the global configure option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = aaa;
|
||||
|
||||
# We require a valid monitor counter/module name. There is no default
|
||||
# counter name or module. A warning will be printed asking user to
|
||||
# specify a valid counter name.
|
||||
#--disable_warnings
|
||||
#set global innodb_monitor_enable = default;
|
||||
#--enable_warnings
|
||||
|
||||
# Turn off all monitor counters, option name should be case
|
||||
# insensitive
|
||||
set global innodb_monitor_disable = All;
|
||||
|
||||
# status should all change to "disabled"
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
# count should all change to 0
|
||||
select name from information_schema.innodb_metrics where count!=0;
|
||||
|
||||
# Test wildcard match, turn on all counters contain string "lock"
|
||||
set global innodb_monitor_enable = "%lock%";
|
||||
|
||||
# All lock related counter should be enabled
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "%lock%", 'enabled', 'disabled');
|
||||
|
||||
# Disable them
|
||||
set global innodb_monitor_disable = "%lock%";
|
||||
|
||||
# All lock related counter should be disabled
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "%lock%";
|
||||
|
||||
# No match for "%lock*"
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable = "%lock*";
|
||||
|
||||
# All counters will be turned on with wildcard match string with all "%"
|
||||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all counters
|
||||
set global innodb_monitor_disable="%%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# One more round testing. All counters will be turned on with
|
||||
# single wildcard character "%"
|
||||
set global innodb_monitor_enable="%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='enabled';
|
||||
|
||||
# Turn off all the counters with "%_%"
|
||||
set global innodb_monitor_disable="%_%";
|
||||
|
||||
select name from information_schema.innodb_metrics where status!='disabled';
|
||||
|
||||
# Turn on all counters start with "log"
|
||||
set global innodb_monitor_enable="log%%%%";
|
||||
|
||||
select name from information_schema.innodb_metrics
|
||||
where status != IF(name like "log%", 'enabled', 'disabled');
|
||||
|
||||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
|
||||
# is single character wildcard match word
|
||||
set global innodb_monitor_enable="os_%a_fs_ncs";
|
||||
|
||||
# Turn on counters whose name contains "os" and "pending" with
|
||||
# wildcard match "os%pending%"
|
||||
set global innodb_monitor_enable="os%pending%";
|
||||
|
||||
select name, status from information_schema.innodb_metrics
|
||||
where name like "os%";
|
||||
|
||||
# Empty string is an invalid option
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="";
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_monitor_enable="_";
|
||||
|
||||
SET global innodb_monitor_disable = module_metadata;
|
||||
SET global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
# Only turn on "table_open" counter
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# This will open the monitor_test table
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment by 1
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset the counter value while counter is still on (started)
|
||||
# This will reset value "count_reset" but not
|
||||
# "count"
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again to increment "metadata_table_handles_opened" again
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Cannot reset all monitor value while the counter is on
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn off the counter "metadata_table_handles_opened"
|
||||
set global innodb_monitor_disable = metadata_table_handles_opened;
|
||||
|
||||
# Reset the counter value while counter is off (disabled)
|
||||
set global innodb_monitor_reset = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
|
||||
# should not be incremented
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select * from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Reset all the counters, include those counter *_since_start
|
||||
set global innodb_monitor_reset_all = metadata_table_handles_opened;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Turn on "table_open" counter again
|
||||
set global innodb_monitor_enable = metadata_table_handles_opened;
|
||||
|
||||
# Test metadata_table_handles_opened again to see if it is working correctly
|
||||
# after above round of turning on/off/reset
|
||||
drop table monitor_test;
|
||||
|
||||
# Create a new table to test "metadata_table_handles_opened" counter
|
||||
create table monitor_test(col int) engine = innodb stats_persistent=0;
|
||||
|
||||
select * from monitor_test;
|
||||
|
||||
# "metadata_table_handles_opened" should increment
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_opened";
|
||||
|
||||
# Test counter "metadata_table_handles_closed",
|
||||
# create index will close the old handle
|
||||
set global innodb_monitor_enable = metadata_table_handles_closed;
|
||||
|
||||
create index idx on monitor_test(col);
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name = "metadata_table_handles_closed";
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Reset counters only in "module_metadata" module
|
||||
set global innodb_monitor_disable = module_metadata;
|
||||
|
||||
set global innodb_monitor_reset = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
set global innodb_monitor_reset_all = module_metadata;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "metadata%";
|
||||
|
||||
# Test Transaction Module
|
||||
set global innodb_monitor_enable = module_trx;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into monitor_test values(9);
|
||||
rollback;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "trx_rollbacks" or name like "trx_active_transactions";
|
||||
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
|
||||
# Test DML Module
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# test reset counter while the counter is on
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# insert/delete some rows after the reset
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# We do not allow reset_all while the counter is on, nothing
|
||||
# should be reset here
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Turn off the counter
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Open individual counter "dml_inserts"
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
# Only counter "dml_inserts" should be updated
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
|
||||
# Counters are unpredictable when innodb-file-per-table is on
|
||||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset, status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "file_num_open_files";
|
||||
|
||||
set global innodb_monitor_disable = file_num_open_files;
|
||||
|
||||
# Test ICP module counters
|
||||
set global innodb_monitor_enable = "icp%";
|
||||
|
||||
create table monitor_test(a char(3), b int, c char(2),
|
||||
primary key (a(1), c(1)), key(b)) engine = innodb;
|
||||
|
||||
insert into monitor_test values("13", 2, "aa");
|
||||
|
||||
select a from monitor_test where b < 1 for update;
|
||||
|
||||
# should have icp_attempts = 1 and icp_out_of_range = 1
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
# should have icp_attempts = 2 and icp_match = 1
|
||||
select a from monitor_test where b < 3 for update;
|
||||
|
||||
select name, count from information_schema.innodb_metrics
|
||||
where name like "icp%";
|
||||
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_disable = All;
|
||||
set global innodb_monitor_reset_all = all;
|
||||
|
||||
-- disable_warnings
|
||||
set global innodb_monitor_enable = default;
|
||||
set global innodb_monitor_disable = default;
|
||||
set global innodb_monitor_reset = default;
|
||||
set global innodb_monitor_reset_all = default;
|
||||
-- enable_warnings
|
@ -621,3 +621,24 @@ EXPLAIN EXTENDED
|
||||
WITH cte AS ( SELECT * FROM t1 ) SELECT i FROM cte;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-12185: view defintion contains WITH clause with
|
||||
--echo # several specifications of CTE
|
||||
--echo #
|
||||
|
||||
with
|
||||
alias1 as (select 1 as one),
|
||||
alias2 as (select 2 as two)
|
||||
select one, two from alias1, alias2;
|
||||
|
||||
create view v1 as
|
||||
with
|
||||
alias1 as (select 1 as one),
|
||||
alias2 as (select 2 as two)
|
||||
select one, two from alias1, alias2;
|
||||
|
||||
select * from v1;
|
||||
show create view v1;
|
||||
|
||||
drop view v1;
|
||||
|
@ -6070,6 +6070,23 @@ show create view v1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10704: Assertion `field->field->table == table_arg'
|
||||
--echo # failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,
|
||||
--echo # bool, bool)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE TABLE t2 (j INT);
|
||||
CREATE TABLE t3 (k INT);
|
||||
|
||||
CREATE ALGORITHM = MERGE VIEW v AS SELECT j AS f1, k AS f2 FROM ( SELECT j FROM t1, t2 ) sq, t3;
|
||||
--error ER_VIEW_MULTIUPDATE
|
||||
REPLACE INTO v (f1,f2) VALUES (1,1);
|
||||
|
||||
drop view v;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011, 2013, Monty Program Ab
|
||||
/* Copyright (c) 2011, 2017, MariaDB Corporation.
|
||||
Copyright (c) 2011, 2012, Oleksandr Byelkin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -74,15 +74,15 @@ uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
2 bits which determinate size of offset in the header -1
|
||||
*/
|
||||
/* mask to get above bits */
|
||||
#define DYNCOL_FLG_OFFSET (1|2)
|
||||
#define DYNCOL_FLG_NAMES 4
|
||||
#define DYNCOL_FLG_NMOFFSET (8|16)
|
||||
#define DYNCOL_FLG_OFFSET (1U|2U)
|
||||
#define DYNCOL_FLG_NAMES 4U
|
||||
#define DYNCOL_FLG_NMOFFSET (8U|16U)
|
||||
/**
|
||||
All known flags mask that could be set.
|
||||
|
||||
@note DYNCOL_FLG_NMOFFSET should be 0 for now.
|
||||
*/
|
||||
#define DYNCOL_FLG_KNOWN (1|2|4)
|
||||
#define DYNCOL_FLG_KNOWN (1U|2U|4U)
|
||||
|
||||
/* formats */
|
||||
enum enum_dyncol_format
|
||||
@ -294,7 +294,7 @@ static void set_fixed_header_named(DYNAMIC_COLUMN *str, DYN_HEADER *hdr)
|
||||
DBUG_ASSERT(hdr->offset_size <= MAX_OFFSET_LENGTH_NM);
|
||||
/* size of data offset, named format flag, size of names offset (0 means 2) */
|
||||
str->str[0]=
|
||||
(char) ((str->str[0] & ~(DYNCOL_FLG_OFFSET | DYNCOL_FLG_NMOFFSET)) |
|
||||
(char) (((uchar)str->str[0] & ~(DYNCOL_FLG_OFFSET | DYNCOL_FLG_NMOFFSET)) |
|
||||
(hdr->offset_size - 2) | DYNCOL_FLG_NAMES);
|
||||
int2store(str->str + 1, hdr->column_count); /* columns number */
|
||||
int2store(str->str + 3, hdr->nmpool_size);
|
||||
@ -319,7 +319,7 @@ static my_bool type_and_offset_store_num(uchar *place, size_t offset_size,
|
||||
{
|
||||
ulong val = (((ulong) offset) << 3) | (type - 1);
|
||||
DBUG_ASSERT(type != DYN_COL_NULL);
|
||||
DBUG_ASSERT(((type - 1) & (~7)) == 0); /* fit in 3 bits */
|
||||
DBUG_ASSERT(((type - 1) & (~7U)) == 0); /* fit in 3 bits */
|
||||
DBUG_ASSERT(offset_size >= 1 && offset_size <= 4);
|
||||
|
||||
/* Index entry starts with column number; jump over it */
|
||||
@ -359,7 +359,7 @@ static my_bool type_and_offset_store_named(uchar *place, size_t offset_size,
|
||||
{
|
||||
ulonglong val = (((ulong) offset) << 4) | (type - 1);
|
||||
DBUG_ASSERT(type != DYN_COL_NULL);
|
||||
DBUG_ASSERT(((type - 1) & (~0xf)) == 0); /* fit in 4 bits */
|
||||
DBUG_ASSERT(((type - 1) & (~0xfU)) == 0); /* fit in 4 bits */
|
||||
DBUG_ASSERT(offset_size >= 2 && offset_size <= 5);
|
||||
|
||||
/* Index entry starts with name offset; jump over it */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -274,16 +275,16 @@ struct st_hash_link
|
||||
};
|
||||
|
||||
/* simple states of a block */
|
||||
#define BLOCK_ERROR 1 /* an error occurred when performing file i/o */
|
||||
#define BLOCK_READ 2 /* file block is in the block buffer */
|
||||
#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
|
||||
#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */
|
||||
#define BLOCK_IN_FLUSH 16 /* block is selected for flush */
|
||||
#define BLOCK_CHANGED 32 /* block buffer contains a dirty page */
|
||||
#define BLOCK_IN_USE 64 /* block is not free */
|
||||
#define BLOCK_IN_EVICTION 128 /* block is selected for eviction */
|
||||
#define BLOCK_IN_FLUSHWRITE 256 /* block is in write to file */
|
||||
#define BLOCK_FOR_UPDATE 512 /* block is selected for buffer modification */
|
||||
#define BLOCK_ERROR 1U/* an error occurred when performing file i/o */
|
||||
#define BLOCK_READ 2U/* file block is in the block buffer */
|
||||
#define BLOCK_IN_SWITCH 4U/* block is preparing to read new page */
|
||||
#define BLOCK_REASSIGNED 8U/* blk does not accept requests for old page */
|
||||
#define BLOCK_IN_FLUSH 16U/* block is selected for flush */
|
||||
#define BLOCK_CHANGED 32U/* block buffer contains a dirty page */
|
||||
#define BLOCK_IN_USE 64U/* block is not free */
|
||||
#define BLOCK_IN_EVICTION 128U/* block is selected for eviction */
|
||||
#define BLOCK_IN_FLUSHWRITE 256U/* block is in write to file */
|
||||
#define BLOCK_FOR_UPDATE 512U/* block is selected for buffer modification */
|
||||
|
||||
/* page status, returned by find_key_block */
|
||||
#define PAGE_READ 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2015 MariaDB Corporation
|
||||
Copyright (c) 2015, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -27,9 +27,9 @@
|
||||
|
||||
using yaSSL::yaERR_remove_state;
|
||||
|
||||
#define EVP_CIPH_ECB_MODE 0x1
|
||||
#define EVP_CIPH_CBC_MODE 0x2
|
||||
#define EVP_CIPH_NO_PADDING 0x100
|
||||
#define EVP_CIPH_ECB_MODE 0x1U
|
||||
#define EVP_CIPH_CBC_MODE 0x2U
|
||||
#define EVP_CIPH_NO_PADDING 0x100U
|
||||
|
||||
/*
|
||||
note that TaoCrypt::AES object is not explicitly put into EVP_CIPHER_CTX.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2004, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2013, Monty Program Ab.
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1444,11 +1444,11 @@ MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time)
|
||||
if ((my_time->neg= packed < 0))
|
||||
packed= -packed;
|
||||
get_one(my_time->second_part, 1000000ULL);
|
||||
get_one(my_time->second, 60ULL);
|
||||
get_one(my_time->minute, 60ULL);
|
||||
get_one(my_time->hour, 24ULL);
|
||||
get_one(my_time->day, 32ULL);
|
||||
get_one(my_time->month, 13ULL);
|
||||
get_one(my_time->second, 60U);
|
||||
get_one(my_time->minute, 60U);
|
||||
get_one(my_time->hour, 24U);
|
||||
get_one(my_time->day, 32U);
|
||||
get_one(my_time->month, 13U);
|
||||
my_time->year= (uint)packed;
|
||||
my_time->time_type= MYSQL_TIMESTAMP_DATETIME;
|
||||
return my_time;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2010 Monty Program Ab
|
||||
/* Copyright (C) 2010, 2017, MariaDB Corporation Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -23,7 +23,7 @@
|
||||
#include <my_getopt.h>
|
||||
#include "set_var.h"
|
||||
|
||||
#define FRM_QUOTED_VALUE 0x8000
|
||||
#define FRM_QUOTED_VALUE 0x8000U
|
||||
|
||||
/**
|
||||
Links this item to the given list end
|
||||
|
54
sql/field.h
54
sql/field.h
@ -1,7 +1,7 @@
|
||||
#ifndef FIELD_INCLUDED
|
||||
#define FIELD_INCLUDED
|
||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2015, MariaDB
|
||||
Copyright (c) 2008, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1019,7 +1019,7 @@ public:
|
||||
virtual int cmp_max(const uchar *a, const uchar *b, uint max_len)
|
||||
{ return cmp(a, b); }
|
||||
virtual int cmp(const uchar *,const uchar *)=0;
|
||||
virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L)
|
||||
virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U)
|
||||
{ return memcmp(a,b,pack_length()); }
|
||||
virtual int cmp_offset(uint row_offset)
|
||||
{ return cmp(ptr,ptr+row_offset); }
|
||||
@ -1370,7 +1370,8 @@ public:
|
||||
void set_storage_type(ha_storage_media storage_type_arg)
|
||||
{
|
||||
DBUG_ASSERT(field_storage_type() == HA_SM_DEFAULT);
|
||||
flags |= (storage_type_arg << FIELD_FLAGS_STORAGE_MEDIA);
|
||||
flags |= static_cast<uint32>(storage_type_arg) <<
|
||||
FIELD_FLAGS_STORAGE_MEDIA;
|
||||
}
|
||||
|
||||
column_format_type column_format() const
|
||||
@ -1382,7 +1383,8 @@ public:
|
||||
void set_column_format(column_format_type column_format_arg)
|
||||
{
|
||||
DBUG_ASSERT(column_format() == COLUMN_FORMAT_TYPE_DEFAULT);
|
||||
flags |= (column_format_arg << FIELD_FLAGS_COLUMN_FORMAT);
|
||||
flags |= static_cast<uint32>(column_format_arg) <<
|
||||
FIELD_FLAGS_COLUMN_FORMAT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3131,7 +3133,7 @@ public:
|
||||
int cmp_max(const uchar *, const uchar *, uint max_length);
|
||||
int cmp(const uchar *a,const uchar *b)
|
||||
{
|
||||
return cmp_max(a, b, ~0L);
|
||||
return cmp_max(a, b, ~0U);
|
||||
}
|
||||
void sort_string(uchar *buff,uint length);
|
||||
uint get_key_image(uchar *buff,uint length, imagetype type);
|
||||
@ -3140,7 +3142,7 @@ public:
|
||||
virtual uchar *pack(uchar *to, const uchar *from, uint max_length);
|
||||
virtual const uchar *unpack(uchar* to, const uchar *from,
|
||||
const uchar *from_end, uint param_data);
|
||||
int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
|
||||
int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U);
|
||||
int key_cmp(const uchar *,const uchar*);
|
||||
int key_cmp(const uchar *str, uint length);
|
||||
uint packed_col_length(const uchar *to, uint length);
|
||||
@ -3250,9 +3252,9 @@ public:
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
int cmp_max(const uchar *, const uchar *, uint max_length);
|
||||
int cmp(const uchar *a,const uchar *b)
|
||||
{ return cmp_max(a, b, ~0L); }
|
||||
{ return cmp_max(a, b, ~0U); }
|
||||
int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length);
|
||||
int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
|
||||
int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U);
|
||||
int key_cmp(const uchar *,const uchar*);
|
||||
int key_cmp(const uchar *str, uint length);
|
||||
/* Never update the value of min_val for a blob field */
|
||||
@ -3878,7 +3880,7 @@ public:
|
||||
|
||||
bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root);
|
||||
|
||||
bool prepare_create_field(uint *blob_columns, longlong table_flags);
|
||||
bool prepare_create_field(uint *blob_columns, ulonglong table_flags);
|
||||
|
||||
bool check(THD *thd);
|
||||
|
||||
@ -4028,26 +4030,26 @@ bool check_expression(Virtual_column_info *vcol, const char *name,
|
||||
The following are for the interface with the .frm file
|
||||
*/
|
||||
|
||||
#define FIELDFLAG_DECIMAL 1
|
||||
#define FIELDFLAG_BINARY 1 // Shares same flag
|
||||
#define FIELDFLAG_NUMBER 2
|
||||
#define FIELDFLAG_ZEROFILL 4
|
||||
#define FIELDFLAG_PACK 120 // Bits used for packing
|
||||
#define FIELDFLAG_INTERVAL 256 // mangled with decimals!
|
||||
#define FIELDFLAG_BITFIELD 512 // mangled with decimals!
|
||||
#define FIELDFLAG_BLOB 1024 // mangled with decimals!
|
||||
#define FIELDFLAG_GEOM 2048 // mangled with decimals!
|
||||
#define FIELDFLAG_DECIMAL 1U
|
||||
#define FIELDFLAG_BINARY 1U // Shares same flag
|
||||
#define FIELDFLAG_NUMBER 2U
|
||||
#define FIELDFLAG_ZEROFILL 4U
|
||||
#define FIELDFLAG_PACK 120U // Bits used for packing
|
||||
#define FIELDFLAG_INTERVAL 256U // mangled with decimals!
|
||||
#define FIELDFLAG_BITFIELD 512U // mangled with decimals!
|
||||
#define FIELDFLAG_BLOB 1024U // mangled with decimals!
|
||||
#define FIELDFLAG_GEOM 2048U // mangled with decimals!
|
||||
|
||||
#define FIELDFLAG_TREAT_BIT_AS_CHAR 4096 /* use Field_bit_as_char */
|
||||
#define FIELDFLAG_LONG_DECIMAL 8192
|
||||
#define FIELDFLAG_NO_DEFAULT 16384 /* sql */
|
||||
#define FIELDFLAG_MAYBE_NULL ((uint) 32768)// sql
|
||||
#define FIELDFLAG_HEX_ESCAPE ((uint) 0x10000)
|
||||
#define FIELDFLAG_TREAT_BIT_AS_CHAR 4096U /* use Field_bit_as_char */
|
||||
#define FIELDFLAG_LONG_DECIMAL 8192U
|
||||
#define FIELDFLAG_NO_DEFAULT 16384U /* sql */
|
||||
#define FIELDFLAG_MAYBE_NULL 32768U // sql
|
||||
#define FIELDFLAG_HEX_ESCAPE 0x10000U
|
||||
#define FIELDFLAG_PACK_SHIFT 3
|
||||
#define FIELDFLAG_DEC_SHIFT 8
|
||||
#define FIELDFLAG_MAX_DEC 63
|
||||
#define FIELDFLAG_MAX_DEC 63U
|
||||
|
||||
#define MTYP_TYPENR(type) (type & 127) /* Remove bits from type */
|
||||
#define MTYP_TYPENR(type) (type & 127U) /* Remove bits from type */
|
||||
|
||||
#define f_is_dec(x) ((x) & FIELDFLAG_DECIMAL)
|
||||
#define f_is_num(x) ((x) & FIELDFLAG_NUMBER)
|
||||
@ -4061,7 +4063,7 @@ bool check_expression(Virtual_column_info *vcol, const char *name,
|
||||
#define f_is_bitfield(x) (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD)
|
||||
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)
|
||||
#define f_is_geom(x) (((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM)
|
||||
#define f_settype(x) (((int) (x)) << FIELDFLAG_PACK_SHIFT)
|
||||
#define f_settype(x) (((uint) (x)) << FIELDFLAG_PACK_SHIFT)
|
||||
#define f_maybe_null(x) ((x) & FIELDFLAG_MAYBE_NULL)
|
||||
#define f_no_default(x) ((x) & FIELDFLAG_NO_DEFAULT)
|
||||
#define f_bit_as_char(x) ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR)
|
||||
|
157
sql/handler.h
157
sql/handler.h
@ -2,7 +2,7 @@
|
||||
#define HANDLER_INCLUDED
|
||||
/*
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
@ -236,12 +236,12 @@ enum enum_alter_inplace_result {
|
||||
@note This optimization in combination with batching may be used to
|
||||
remove even more roundtrips.
|
||||
*/
|
||||
#define HA_READ_BEFORE_WRITE_REMOVAL (1LL << 43)
|
||||
#define HA_READ_BEFORE_WRITE_REMOVAL (1ULL << 43)
|
||||
|
||||
/*
|
||||
Engine supports extended fulltext API
|
||||
*/
|
||||
#define HA_CAN_FULLTEXT_EXT (1LL << 44)
|
||||
#define HA_CAN_FULLTEXT_EXT (1ULL << 44)
|
||||
|
||||
/*
|
||||
Storage engine supports table export using the
|
||||
@ -249,7 +249,7 @@ enum enum_alter_inplace_result {
|
||||
(meaning, after this statement one can copy table files out of the
|
||||
datadir and later "import" (somehow) in another MariaDB instance)
|
||||
*/
|
||||
#define HA_CAN_EXPORT (1LL << 45)
|
||||
#define HA_CAN_EXPORT (1ULL << 45)
|
||||
|
||||
/*
|
||||
Storage engine does not require an exclusive metadata lock
|
||||
@ -259,7 +259,7 @@ enum enum_alter_inplace_result {
|
||||
read or modify the table - this is defined by THR locks and the
|
||||
::store_lock() method).
|
||||
*/
|
||||
#define HA_CONCURRENT_OPTIMIZE (1LL << 46)
|
||||
#define HA_CONCURRENT_OPTIMIZE (1ULL << 46)
|
||||
|
||||
/*
|
||||
Set of all binlog flags. Currently only contain the capabilities
|
||||
@ -298,24 +298,24 @@ enum enum_alter_inplace_result {
|
||||
Partitioning needs both ADD and DROP to be supported by its underlying
|
||||
handlers, due to error handling, see bug#57778.
|
||||
*/
|
||||
#define HA_INPLACE_ADD_INDEX_NO_READ_WRITE (1L << 0)
|
||||
#define HA_INPLACE_DROP_INDEX_NO_READ_WRITE (1L << 1)
|
||||
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE (1L << 2)
|
||||
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE (1L << 3)
|
||||
#define HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE (1L << 4)
|
||||
#define HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE (1L << 5)
|
||||
#define HA_INPLACE_ADD_INDEX_NO_READ_WRITE (1UL << 0)
|
||||
#define HA_INPLACE_DROP_INDEX_NO_READ_WRITE (1UL << 1)
|
||||
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE (1UL << 2)
|
||||
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE (1UL << 3)
|
||||
#define HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE (1UL << 4)
|
||||
#define HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE (1UL << 5)
|
||||
/*
|
||||
These are set if different kinds of indexes can be created or dropped
|
||||
in-place while still allowing concurrent reads (but not writes) of table
|
||||
data. If a handler is capable of one or more of these, it should also set
|
||||
the corresponding *_NO_READ_WRITE bit(s).
|
||||
*/
|
||||
#define HA_INPLACE_ADD_INDEX_NO_WRITE (1L << 6)
|
||||
#define HA_INPLACE_DROP_INDEX_NO_WRITE (1L << 7)
|
||||
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE (1L << 8)
|
||||
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1L << 9)
|
||||
#define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1L << 10)
|
||||
#define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1L << 11)
|
||||
#define HA_INPLACE_ADD_INDEX_NO_WRITE (1UL << 6)
|
||||
#define HA_INPLACE_DROP_INDEX_NO_WRITE (1UL << 7)
|
||||
#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE (1UL << 8)
|
||||
#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1UL << 9)
|
||||
#define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1UL << 10)
|
||||
#define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1UL << 11)
|
||||
/*
|
||||
HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
|
||||
supported at all.
|
||||
@ -341,9 +341,9 @@ enum enum_alter_inplace_result {
|
||||
the storage engine. A typical engine to support this is NDB (through
|
||||
WL #2498).
|
||||
*/
|
||||
#define HA_PARTITION_FUNCTION_SUPPORTED (1L << 12)
|
||||
#define HA_FAST_CHANGE_PARTITION (1L << 13)
|
||||
#define HA_PARTITION_ONE_PHASE (1L << 14)
|
||||
#define HA_PARTITION_FUNCTION_SUPPORTED (1UL << 12)
|
||||
#define HA_FAST_CHANGE_PARTITION (1UL << 13)
|
||||
#define HA_PARTITION_ONE_PHASE (1UL << 14)
|
||||
|
||||
/* operations for disable/enable indexes */
|
||||
#define HA_KEY_SWITCH_NONUNIQ 0
|
||||
@ -369,25 +369,25 @@ enum enum_alter_inplace_result {
|
||||
HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED
|
||||
*/
|
||||
|
||||
#define HA_OPEN_KEYFILE 1
|
||||
#define HA_READ_ONLY 16 /* File opened as readonly */
|
||||
#define HA_OPEN_KEYFILE 1U
|
||||
#define HA_READ_ONLY 16U /* File opened as readonly */
|
||||
/* Try readonly if can't open with read and write */
|
||||
#define HA_TRY_READ_ONLY 32
|
||||
#define HA_TRY_READ_ONLY 32U
|
||||
|
||||
/* Some key definitions */
|
||||
#define HA_KEY_NULL_LENGTH 1
|
||||
#define HA_KEY_BLOB_LENGTH 2
|
||||
|
||||
#define HA_LEX_CREATE_TMP_TABLE 1
|
||||
#define HA_CREATE_TMP_ALTER 8
|
||||
#define HA_LEX_CREATE_TMP_TABLE 1U
|
||||
#define HA_CREATE_TMP_ALTER 8U
|
||||
|
||||
#define HA_MAX_REC_LENGTH 65535
|
||||
|
||||
/* Table caching type */
|
||||
#define HA_CACHE_TBL_NONTRANSACT 0
|
||||
#define HA_CACHE_TBL_NOCACHE 1
|
||||
#define HA_CACHE_TBL_ASKTRANSACT 2
|
||||
#define HA_CACHE_TBL_TRANSACT 4
|
||||
#define HA_CACHE_TBL_NOCACHE 1U
|
||||
#define HA_CACHE_TBL_ASKTRANSACT 2U
|
||||
#define HA_CACHE_TBL_TRANSACT 4U
|
||||
|
||||
/**
|
||||
Options for the START TRANSACTION statement.
|
||||
@ -409,9 +409,9 @@ static const uint MYSQL_START_TRANS_OPT_READ_ONLY = 2;
|
||||
static const uint MYSQL_START_TRANS_OPT_READ_WRITE = 4;
|
||||
|
||||
/* Flags for method is_fatal_error */
|
||||
#define HA_CHECK_DUP_KEY 1
|
||||
#define HA_CHECK_DUP_UNIQUE 2
|
||||
#define HA_CHECK_FK_ERROR 4
|
||||
#define HA_CHECK_DUP_KEY 1U
|
||||
#define HA_CHECK_DUP_UNIQUE 2U
|
||||
#define HA_CHECK_FK_ERROR 4U
|
||||
#define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE)
|
||||
#define HA_CHECK_ALL (~0U)
|
||||
|
||||
@ -478,49 +478,49 @@ enum enum_binlog_command {
|
||||
/* struct to hold information about the table that should be created */
|
||||
|
||||
/* Bits in used_fields */
|
||||
#define HA_CREATE_USED_AUTO (1L << 0)
|
||||
#define HA_CREATE_USED_RAID (1L << 1) //RAID is no longer availble
|
||||
#define HA_CREATE_USED_UNION (1L << 2)
|
||||
#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
|
||||
#define HA_CREATE_USED_MIN_ROWS (1L << 4)
|
||||
#define HA_CREATE_USED_MAX_ROWS (1L << 5)
|
||||
#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
|
||||
#define HA_CREATE_USED_PACK_KEYS (1L << 7)
|
||||
#define HA_CREATE_USED_CHARSET (1L << 8)
|
||||
#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
|
||||
#define HA_CREATE_USED_DATADIR (1L << 10)
|
||||
#define HA_CREATE_USED_INDEXDIR (1L << 11)
|
||||
#define HA_CREATE_USED_ENGINE (1L << 12)
|
||||
#define HA_CREATE_USED_CHECKSUM (1L << 13)
|
||||
#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
|
||||
#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
|
||||
#define HA_CREATE_USED_COMMENT (1L << 16)
|
||||
#define HA_CREATE_USED_PASSWORD (1L << 17)
|
||||
#define HA_CREATE_USED_CONNECTION (1L << 18)
|
||||
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
|
||||
#define HA_CREATE_USED_AUTO (1UL << 0)
|
||||
#define HA_CREATE_USED_RAID (1UL << 1) //RAID is no longer availble
|
||||
#define HA_CREATE_USED_UNION (1UL << 2)
|
||||
#define HA_CREATE_USED_INSERT_METHOD (1UL << 3)
|
||||
#define HA_CREATE_USED_MIN_ROWS (1UL << 4)
|
||||
#define HA_CREATE_USED_MAX_ROWS (1UL << 5)
|
||||
#define HA_CREATE_USED_AVG_ROW_LENGTH (1UL << 6)
|
||||
#define HA_CREATE_USED_PACK_KEYS (1UL << 7)
|
||||
#define HA_CREATE_USED_CHARSET (1UL << 8)
|
||||
#define HA_CREATE_USED_DEFAULT_CHARSET (1UL << 9)
|
||||
#define HA_CREATE_USED_DATADIR (1UL << 10)
|
||||
#define HA_CREATE_USED_INDEXDIR (1UL << 11)
|
||||
#define HA_CREATE_USED_ENGINE (1UL << 12)
|
||||
#define HA_CREATE_USED_CHECKSUM (1UL << 13)
|
||||
#define HA_CREATE_USED_DELAY_KEY_WRITE (1UL << 14)
|
||||
#define HA_CREATE_USED_ROW_FORMAT (1UL << 15)
|
||||
#define HA_CREATE_USED_COMMENT (1UL << 16)
|
||||
#define HA_CREATE_USED_PASSWORD (1UL << 17)
|
||||
#define HA_CREATE_USED_CONNECTION (1UL << 18)
|
||||
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1UL << 19)
|
||||
/* The following two are used by Maria engine: */
|
||||
#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
|
||||
#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
|
||||
#define HA_CREATE_USED_TRANSACTIONAL (1UL << 20)
|
||||
#define HA_CREATE_USED_PAGE_CHECKSUM (1UL << 21)
|
||||
/** This is set whenever STATS_PERSISTENT=0|1|default has been
|
||||
specified in CREATE/ALTER TABLE. See also HA_OPTION_STATS_PERSISTENT in
|
||||
include/my_base.h. It is possible to distinguish whether
|
||||
STATS_PERSISTENT=default has been specified or no STATS_PERSISTENT= is
|
||||
given at all. */
|
||||
#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
|
||||
#define HA_CREATE_USED_STATS_PERSISTENT (1UL << 22)
|
||||
/**
|
||||
This is set whenever STATS_AUTO_RECALC=0|1|default has been
|
||||
specified in CREATE/ALTER TABLE. See enum_stats_auto_recalc.
|
||||
It is possible to distinguish whether STATS_AUTO_RECALC=default
|
||||
has been specified or no STATS_AUTO_RECALC= is given at all.
|
||||
*/
|
||||
#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
|
||||
#define HA_CREATE_USED_STATS_AUTO_RECALC (1UL << 23)
|
||||
/**
|
||||
This is set whenever STATS_SAMPLE_PAGES=N|default has been
|
||||
specified in CREATE/ALTER TABLE. It is possible to distinguish whether
|
||||
STATS_SAMPLE_PAGES=default has been specified or no STATS_SAMPLE_PAGES= is
|
||||
given at all.
|
||||
*/
|
||||
#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
|
||||
#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1UL << 24)
|
||||
|
||||
|
||||
/*
|
||||
@ -614,8 +614,7 @@ struct xid_t {
|
||||
}
|
||||
uint length()
|
||||
{
|
||||
return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
|
||||
gtrid_length+bqual_length;
|
||||
return static_cast<uint>(sizeof(formatID)) + key_length();
|
||||
}
|
||||
uchar *key() const
|
||||
{
|
||||
@ -623,7 +622,8 @@ struct xid_t {
|
||||
}
|
||||
uint key_length() const
|
||||
{
|
||||
return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
|
||||
return static_cast<uint>(sizeof(gtrid_length)+sizeof(bqual_length)+
|
||||
gtrid_length+bqual_length);
|
||||
}
|
||||
};
|
||||
typedef struct xid_t XID;
|
||||
@ -2332,12 +2332,13 @@ public:
|
||||
|
||||
/**
|
||||
Whether or not all costs in the object are zero
|
||||
|
||||
|
||||
@return true if all costs are zero, false otherwise
|
||||
*/
|
||||
bool is_zero() const
|
||||
{
|
||||
return !(io_count || cpu_cost || import_cost || mem_cost);
|
||||
{
|
||||
return io_count == 0.0 && cpu_cost == 0.0 &&
|
||||
import_cost == 0.0 && mem_cost == 0.0;
|
||||
}
|
||||
|
||||
void reset()
|
||||
@ -2402,29 +2403,29 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted,
|
||||
The ranges may not use the full key but all of them will use the same number
|
||||
of key parts.
|
||||
*/
|
||||
#define HA_MRR_SINGLE_POINT 1
|
||||
#define HA_MRR_FIXED_KEY 2
|
||||
#define HA_MRR_SINGLE_POINT 1U
|
||||
#define HA_MRR_FIXED_KEY 2U
|
||||
|
||||
/*
|
||||
Indicates that RANGE_SEQ_IF::next(&range) doesn't need to fill in the
|
||||
'range' parameter.
|
||||
*/
|
||||
#define HA_MRR_NO_ASSOCIATION 4
|
||||
#define HA_MRR_NO_ASSOCIATION 4U
|
||||
|
||||
/*
|
||||
The MRR user will provide ranges in key order, and MRR implementation
|
||||
must return rows in key order.
|
||||
*/
|
||||
#define HA_MRR_SORTED 8
|
||||
#define HA_MRR_SORTED 8U
|
||||
|
||||
/* MRR implementation doesn't have to retrieve full records */
|
||||
#define HA_MRR_INDEX_ONLY 16
|
||||
#define HA_MRR_INDEX_ONLY 16U
|
||||
|
||||
/*
|
||||
The passed memory buffer is of maximum possible size, the caller can't
|
||||
assume larger buffer.
|
||||
*/
|
||||
#define HA_MRR_LIMITS 32
|
||||
#define HA_MRR_LIMITS 32U
|
||||
|
||||
|
||||
/*
|
||||
@ -2433,14 +2434,14 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted,
|
||||
flag. SQL layer remembers the flag value and then passes it to
|
||||
multi_read_range_init().
|
||||
*/
|
||||
#define HA_MRR_USE_DEFAULT_IMPL 64
|
||||
#define HA_MRR_USE_DEFAULT_IMPL 64U
|
||||
|
||||
/*
|
||||
Used only as parameter to multi_range_read_info():
|
||||
Flag set <=> the caller guarantees that the bounds of the scanned ranges
|
||||
will not have NULL values.
|
||||
*/
|
||||
#define HA_MRR_NO_NULL_ENDPOINTS 128
|
||||
#define HA_MRR_NO_NULL_ENDPOINTS 128U
|
||||
|
||||
/*
|
||||
The MRR user has materialized range keys somewhere in the user's buffer.
|
||||
@ -2451,7 +2452,7 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted,
|
||||
pointer in range->start_key.key will point to a key value that will remain
|
||||
there until the end of the MRR scan.
|
||||
*/
|
||||
#define HA_MRR_MATERIALIZED_KEYS 256
|
||||
#define HA_MRR_MATERIALIZED_KEYS 256U
|
||||
|
||||
/*
|
||||
The following bits are reserved for use by MRR implementation. The intended
|
||||
@ -2469,15 +2470,15 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted,
|
||||
handler->multi_range_read_explain_info(mrr_mode) to get a text description
|
||||
of the picked MRR scan; the description will be a part of EXPLAIN output.
|
||||
*/
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG1 512
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG2 1024
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG3 2048
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG4 4096
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG5 8192
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG6 16384
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG1 512U
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG2 1024U
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG3 2048U
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG4 4096U
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG5 8192U
|
||||
#define HA_MRR_IMPLEMENTATION_FLAG6 16384U
|
||||
|
||||
#define HA_MRR_IMPLEMENTATION_FLAGS \
|
||||
(512 | 1024 | 2048 | 4096 | 8192 | 16384)
|
||||
(512U | 1024U | 2048U | 4096U | 8192U | 16384U)
|
||||
|
||||
/*
|
||||
This is a buffer area that the handler can use to store rows.
|
||||
|
21
sql/item.h
21
sql/item.h
@ -2,7 +2,7 @@
|
||||
#define SQL_ITEM_INCLUDED
|
||||
|
||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -96,6 +96,13 @@ enum precedence {
|
||||
|
||||
typedef Bounds_checked_array<Item*> Ref_ptr_array;
|
||||
|
||||
static inline uint32
|
||||
char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg)
|
||||
{
|
||||
ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg;
|
||||
return tmp > UINT_MAX32 ? UINT_MAX32 : static_cast<uint32>(tmp);
|
||||
}
|
||||
|
||||
bool mark_unsupported_function(const char *where, void *store, uint result);
|
||||
|
||||
/* convenience helper for mark_unsupported_function() above */
|
||||
@ -403,7 +410,7 @@ class Copy_query_with_rewrite
|
||||
bool copy_up_to(size_t bytes)
|
||||
{
|
||||
DBUG_ASSERT(bytes >= from);
|
||||
return dst->append(src + from, bytes - from);
|
||||
return dst->append(src + from, uint32(bytes - from));
|
||||
}
|
||||
|
||||
public:
|
||||
@ -1694,6 +1701,16 @@ public:
|
||||
bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs);
|
||||
bool too_big_for_varchar() const
|
||||
{ return max_char_length() > CONVERT_IF_BIGGER_TO_BLOB; }
|
||||
void fix_length_and_charset(uint32 max_char_length_arg, CHARSET_INFO *cs)
|
||||
{
|
||||
max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
|
||||
collation.collation= cs;
|
||||
}
|
||||
void fix_char_length(size_t max_char_length_arg)
|
||||
{
|
||||
max_length= char_to_byte_length_safe(max_char_length_arg,
|
||||
collation.collation->mbmaxlen);
|
||||
}
|
||||
/*
|
||||
Return TRUE if the item points to a column of an outer-joined table.
|
||||
*/
|
||||
|
@ -3462,7 +3462,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
|
||||
args[i]->fix_fields(thd, args + i)) ||
|
||||
args[i]->check_cols(1))
|
||||
return TRUE;
|
||||
with_subselect|= args[i]->with_subselect;
|
||||
with_subselect|= args[i]->with_subselect;
|
||||
}
|
||||
|
||||
/* skip charset aggregation for order columns */
|
||||
|
21
sql/log.cc
21
sql/log.cc
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -646,7 +646,7 @@ void Log_to_csv_event_handler::cleanup()
|
||||
|
||||
bool Log_to_csv_event_handler::
|
||||
log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id_arg,
|
||||
uint user_host_len, my_thread_id thread_id_arg,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len,
|
||||
CHARSET_INFO *client_cs)
|
||||
@ -1056,7 +1056,7 @@ bool Log_to_file_event_handler::
|
||||
|
||||
bool Log_to_file_event_handler::
|
||||
log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id_arg,
|
||||
uint user_host_len, my_thread_id thread_id_arg,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len,
|
||||
CHARSET_INFO *client_cs)
|
||||
@ -2850,12 +2850,11 @@ void MYSQL_QUERY_LOG::reopen_file()
|
||||
*/
|
||||
|
||||
bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id_arg,
|
||||
uint user_host_len, my_thread_id thread_id_arg,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len)
|
||||
{
|
||||
char buff[32];
|
||||
uint length= 0;
|
||||
char local_time_buff[MAX_TIME_SIZE];
|
||||
struct tm start;
|
||||
uint time_buff_len= 0;
|
||||
@ -2889,7 +2888,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
|
||||
goto err;
|
||||
|
||||
/* command_type, thread_id */
|
||||
length= my_snprintf(buff, 32, "%5ld ", (long) thread_id_arg);
|
||||
size_t length= my_snprintf(buff, 32, "%5llu ", thread_id_arg);
|
||||
|
||||
if (my_b_write(&log_file, (uchar*) buff, length))
|
||||
goto err;
|
||||
@ -2973,7 +2972,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
|
||||
int tmp_errno= 0;
|
||||
char buff[80], *end;
|
||||
char query_time_buff[22+7], lock_time_buff[22+7];
|
||||
uint buff_len;
|
||||
size_t buff_len;
|
||||
end= buff;
|
||||
|
||||
if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT))
|
||||
@ -10244,8 +10243,8 @@ IO_CACHE * get_trans_log(THD * thd)
|
||||
if (cache_mngr)
|
||||
return cache_mngr->get_binlog_cache_log(true);
|
||||
|
||||
WSREP_DEBUG("binlog cache not initialized, conn: %lld",
|
||||
(longlong) thd->thread_id);
|
||||
WSREP_DEBUG("binlog cache not initialized, conn: %llu",
|
||||
thd->thread_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -10283,8 +10282,8 @@ void thd_binlog_trx_reset(THD * thd)
|
||||
|
||||
void thd_binlog_rollback_stmt(THD * thd)
|
||||
{
|
||||
WSREP_DEBUG("thd_binlog_rollback_stmt connection: %lld",
|
||||
(longlong) thd->thread_id);
|
||||
WSREP_DEBUG("thd_binlog_rollback_stmt connection: %llu",
|
||||
thd->thread_id);
|
||||
binlog_cache_mngr *const cache_mngr=
|
||||
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
|
||||
if (cache_mngr)
|
||||
|
16
sql/log.h
16
sql/log.h
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, Monty Program Ab
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -287,9 +287,9 @@ typedef struct st_log_info
|
||||
#define MAX_LOG_HANDLERS_NUM 3
|
||||
|
||||
/* log event handler flags */
|
||||
#define LOG_NONE 1
|
||||
#define LOG_FILE 2
|
||||
#define LOG_TABLE 4
|
||||
#define LOG_NONE 1U
|
||||
#define LOG_FILE 2U
|
||||
#define LOG_TABLE 4U
|
||||
|
||||
class Log_event;
|
||||
class Rows_log_event;
|
||||
@ -355,7 +355,7 @@ public:
|
||||
MYSQL_QUERY_LOG() : last_time(0) {}
|
||||
void reopen_file();
|
||||
bool write(time_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id,
|
||||
uint user_host_len, my_thread_id thread_id,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len);
|
||||
bool write(THD *thd, time_t current_time,
|
||||
@ -907,7 +907,7 @@ public:
|
||||
virtual bool log_error(enum loglevel level, const char *format,
|
||||
va_list args)= 0;
|
||||
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id,
|
||||
uint user_host_len, my_thread_id thread_id,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len,
|
||||
CHARSET_INFO *client_cs)= 0;
|
||||
@ -936,7 +936,7 @@ public:
|
||||
virtual bool log_error(enum loglevel level, const char *format,
|
||||
va_list args);
|
||||
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id,
|
||||
uint user_host_len, my_thread_id thread_id,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len,
|
||||
CHARSET_INFO *client_cs);
|
||||
@ -968,7 +968,7 @@ public:
|
||||
virtual bool log_error(enum loglevel level, const char *format,
|
||||
va_list args);
|
||||
virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
|
||||
uint user_host_len, int thread_id,
|
||||
uint user_host_len, my_thread_id thread_id,
|
||||
const char *command_type, uint command_type_len,
|
||||
const char *sql_text, uint sql_text_len,
|
||||
CHARSET_INFO *client_cs);
|
||||
|
@ -2894,8 +2894,8 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
|
||||
case 2:
|
||||
{
|
||||
strmake(typestr, "ENUM(2 bytes)", typestr_length);
|
||||
if (!ptr)
|
||||
goto return_null;
|
||||
if (!ptr)
|
||||
goto return_null;
|
||||
|
||||
int32 i32= uint2korr(ptr);
|
||||
my_b_printf(file, "%d", i32);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2014, Monty Program Ab.
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -828,7 +828,7 @@ typedef struct st_print_event_info
|
||||
char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH];
|
||||
uint lc_time_names_number;
|
||||
uint charset_database_number;
|
||||
uint thread_id;
|
||||
my_thread_id thread_id;
|
||||
bool thread_id_printed;
|
||||
uint32 server_id;
|
||||
bool server_id_printed;
|
||||
@ -2008,7 +2008,7 @@ public:
|
||||
uint32 q_len;
|
||||
uint32 db_len;
|
||||
uint16 error_code;
|
||||
ulong thread_id;
|
||||
my_thread_id thread_id;
|
||||
/*
|
||||
For events created by Query_log_event::do_apply_event (and
|
||||
Load_log_event::do_apply_event()) we need the *original* thread
|
||||
@ -2435,7 +2435,7 @@ public:
|
||||
void print_query(THD *thd, bool need_db, const char *cs, String *buf,
|
||||
my_off_t *fn_start, my_off_t *fn_end,
|
||||
const char *qualify_db);
|
||||
ulong thread_id;
|
||||
my_thread_id thread_id;
|
||||
ulong slave_proxy_id;
|
||||
uint32 table_name_len;
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2009 Monty Program Ab
|
||||
/* Copyright (C) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -16,23 +16,22 @@
|
||||
/* Defining what to log to slow log */
|
||||
|
||||
#define LOG_SLOW_VERBOSITY_INIT 0
|
||||
#define LOG_SLOW_VERBOSITY_INNODB (1 << 0)
|
||||
#define LOG_SLOW_VERBOSITY_QUERY_PLAN (1 << 1)
|
||||
#define LOG_SLOW_VERBOSITY_EXPLAIN (1 << 2)
|
||||
#define LOG_SLOW_VERBOSITY_INNODB (1U << 0)
|
||||
#define LOG_SLOW_VERBOSITY_QUERY_PLAN (1U << 1)
|
||||
#define LOG_SLOW_VERBOSITY_EXPLAIN (1U << 2)
|
||||
|
||||
#define QPLAN_INIT QPLAN_QC_NO
|
||||
|
||||
#define QPLAN_ADMIN (1 << 0)
|
||||
#define QPLAN_FILESORT (1 << 1)
|
||||
#define QPLAN_FILESORT_DISK (1 << 2)
|
||||
#define QPLAN_FULL_JOIN (1 << 3)
|
||||
#define QPLAN_FULL_SCAN (1 << 4)
|
||||
#define QPLAN_QC (1 << 5)
|
||||
#define QPLAN_QC_NO (1 << 6)
|
||||
#define QPLAN_TMP_DISK (1 << 7)
|
||||
#define QPLAN_TMP_TABLE (1 << 8)
|
||||
#define QPLAN_FILESORT_PRIORITY_QUEUE (1 << 9)
|
||||
#define QPLAN_ADMIN (1U << 0)
|
||||
#define QPLAN_FILESORT (1U << 1)
|
||||
#define QPLAN_FILESORT_DISK (1U << 2)
|
||||
#define QPLAN_FULL_JOIN (1U << 3)
|
||||
#define QPLAN_FULL_SCAN (1U << 4)
|
||||
#define QPLAN_QC (1U << 5)
|
||||
#define QPLAN_QC_NO (1U << 6)
|
||||
#define QPLAN_TMP_DISK (1U << 7)
|
||||
#define QPLAN_TMP_TABLE (1U << 8)
|
||||
#define QPLAN_FILESORT_PRIORITY_QUEUE (1U << 9)
|
||||
|
||||
/* ... */
|
||||
#define QPLAN_MAX (((ulong) 1) << 31) /* reserved as placeholder */
|
||||
|
||||
#define QPLAN_MAX (1UL << 31) /* reserved as placeholder */
|
||||
|
@ -8762,7 +8762,7 @@ static int mysql_init_variables(void)
|
||||
mysql_home_ptr= mysql_home;
|
||||
log_error_file_ptr= log_error_file;
|
||||
protocol_version= PROTOCOL_VERSION;
|
||||
what_to_log= ~ (1L << (uint) COM_TIME);
|
||||
what_to_log= ~(1UL << COM_TIME);
|
||||
denied_connections= 0;
|
||||
executed_events= 0;
|
||||
global_query_id= 1;
|
||||
|
24
sql/mysqld.h
24
sql/mysqld.h
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, MariaDB
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -49,16 +49,16 @@ typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */
|
||||
#endif
|
||||
|
||||
/* Bits from testflag */
|
||||
#define TEST_PRINT_CACHED_TABLES 1
|
||||
#define TEST_NO_KEY_GROUP 2
|
||||
#define TEST_MIT_THREAD 4
|
||||
#define TEST_BLOCKING 8
|
||||
#define TEST_KEEP_TMP_TABLES 16
|
||||
#define TEST_READCHECK 64 /**< Force use of readcheck */
|
||||
#define TEST_NO_EXTRA 128
|
||||
#define TEST_CORE_ON_SIGNAL 256 /**< Give core if signal */
|
||||
#define TEST_SIGINT 1024 /**< Allow sigint on threads */
|
||||
#define TEST_SYNCHRONIZATION 2048 /**< get server to do sleep in
|
||||
#define TEST_PRINT_CACHED_TABLES 1U
|
||||
#define TEST_NO_KEY_GROUP 2U
|
||||
#define TEST_MIT_THREAD 4U
|
||||
#define TEST_BLOCKING 8U
|
||||
#define TEST_KEEP_TMP_TABLES 16U
|
||||
#define TEST_READCHECK 64U /**< Force use of readcheck */
|
||||
#define TEST_NO_EXTRA 128U
|
||||
#define TEST_CORE_ON_SIGNAL 256U /**< Give core if signal */
|
||||
#define TEST_SIGINT 1024U /**< Allow sigint on threads */
|
||||
#define TEST_SYNCHRONIZATION 2048U /**< get server to do sleep in
|
||||
some places */
|
||||
|
||||
/* Keep things compatible */
|
||||
@ -721,7 +721,7 @@ inline query_id_t get_query_id()
|
||||
/* increment global_thread_id and return it. */
|
||||
inline __attribute__((warn_unused_result)) my_thread_id next_thread_id()
|
||||
{
|
||||
return my_atomic_add64_explicit(&global_thread_id, 1, MY_MEMORY_ORDER_RELAXED);
|
||||
return my_atomic_add64_explicit((int64*) &global_thread_id, 1, MY_MEMORY_ORDER_RELAXED);
|
||||
}
|
||||
|
||||
#if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32)
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define SESSION_TRACKER_INCLUDED
|
||||
|
||||
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2016, MariaDB
|
||||
Copyright (c) 2016, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -280,7 +280,7 @@ private:
|
||||
|
||||
inline void update_change_flags(THD *thd)
|
||||
{
|
||||
tx_changed &= ~TX_CHG_STATE;
|
||||
tx_changed &= uint(~TX_CHG_STATE);
|
||||
tx_changed |= (tx_curr_state != tx_reported_state) ? TX_CHG_STATE : 0;
|
||||
if (tx_changed != TX_CHG_NONE)
|
||||
mark_as_changed(thd, NULL);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define SQL_ACL_INCLUDED
|
||||
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -20,35 +21,35 @@
|
||||
#include "violite.h" /* SSL_type */
|
||||
#include "sql_class.h" /* LEX_COLUMN */
|
||||
|
||||
#define SELECT_ACL (1L << 0)
|
||||
#define INSERT_ACL (1L << 1)
|
||||
#define UPDATE_ACL (1L << 2)
|
||||
#define DELETE_ACL (1L << 3)
|
||||
#define CREATE_ACL (1L << 4)
|
||||
#define DROP_ACL (1L << 5)
|
||||
#define RELOAD_ACL (1L << 6)
|
||||
#define SHUTDOWN_ACL (1L << 7)
|
||||
#define PROCESS_ACL (1L << 8)
|
||||
#define FILE_ACL (1L << 9)
|
||||
#define GRANT_ACL (1L << 10)
|
||||
#define REFERENCES_ACL (1L << 11)
|
||||
#define INDEX_ACL (1L << 12)
|
||||
#define ALTER_ACL (1L << 13)
|
||||
#define SHOW_DB_ACL (1L << 14)
|
||||
#define SUPER_ACL (1L << 15)
|
||||
#define CREATE_TMP_ACL (1L << 16)
|
||||
#define LOCK_TABLES_ACL (1L << 17)
|
||||
#define EXECUTE_ACL (1L << 18)
|
||||
#define REPL_SLAVE_ACL (1L << 19)
|
||||
#define REPL_CLIENT_ACL (1L << 20)
|
||||
#define CREATE_VIEW_ACL (1L << 21)
|
||||
#define SHOW_VIEW_ACL (1L << 22)
|
||||
#define CREATE_PROC_ACL (1L << 23)
|
||||
#define ALTER_PROC_ACL (1L << 24)
|
||||
#define CREATE_USER_ACL (1L << 25)
|
||||
#define EVENT_ACL (1L << 26)
|
||||
#define TRIGGER_ACL (1L << 27)
|
||||
#define CREATE_TABLESPACE_ACL (1L << 28)
|
||||
#define SELECT_ACL (1UL << 0)
|
||||
#define INSERT_ACL (1UL << 1)
|
||||
#define UPDATE_ACL (1UL << 2)
|
||||
#define DELETE_ACL (1UL << 3)
|
||||
#define CREATE_ACL (1UL << 4)
|
||||
#define DROP_ACL (1UL << 5)
|
||||
#define RELOAD_ACL (1UL << 6)
|
||||
#define SHUTDOWN_ACL (1UL << 7)
|
||||
#define PROCESS_ACL (1UL << 8)
|
||||
#define FILE_ACL (1UL << 9)
|
||||
#define GRANT_ACL (1UL << 10)
|
||||
#define REFERENCES_ACL (1UL << 11)
|
||||
#define INDEX_ACL (1UL << 12)
|
||||
#define ALTER_ACL (1UL << 13)
|
||||
#define SHOW_DB_ACL (1UL << 14)
|
||||
#define SUPER_ACL (1UL << 15)
|
||||
#define CREATE_TMP_ACL (1UL << 16)
|
||||
#define LOCK_TABLES_ACL (1UL << 17)
|
||||
#define EXECUTE_ACL (1UL << 18)
|
||||
#define REPL_SLAVE_ACL (1UL << 19)
|
||||
#define REPL_CLIENT_ACL (1UL << 20)
|
||||
#define CREATE_VIEW_ACL (1UL << 21)
|
||||
#define SHOW_VIEW_ACL (1UL << 22)
|
||||
#define CREATE_PROC_ACL (1UL << 23)
|
||||
#define ALTER_PROC_ACL (1UL << 24)
|
||||
#define CREATE_USER_ACL (1UL << 25)
|
||||
#define EVENT_ACL (1UL << 26)
|
||||
#define TRIGGER_ACL (1UL << 27)
|
||||
#define CREATE_TABLESPACE_ACL (1UL << 28)
|
||||
/*
|
||||
don't forget to update
|
||||
1. static struct show_privileges_st sys_privileges[]
|
||||
@ -57,7 +58,7 @@
|
||||
4. acl_init() or whatever - to define behaviour for old privilege tables
|
||||
5. sql_yacc.yy - for GRANT/REVOKE to work
|
||||
*/
|
||||
#define NO_ACCESS (1L << 30)
|
||||
#define NO_ACCESS (1UL << 30)
|
||||
#define DB_ACLS \
|
||||
(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
|
||||
GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL | CREATE_TMP_ACL | \
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define SQL_AUDIT_INCLUDED
|
||||
|
||||
/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -160,7 +161,7 @@ void mysql_audit_general(THD *thd, uint event_subtype,
|
||||
event.general_user_length= make_user_name(thd, user_buff);
|
||||
event.general_thread_id= (unsigned long)thd->thread_id;
|
||||
event.general_query= thd->query_string.str();
|
||||
event.general_query_length= thd->query_string.length();
|
||||
event.general_query_length= (unsigned) thd->query_string.length();
|
||||
event.general_charset= thd->query_string.charset();
|
||||
event.general_rows= thd->get_stmt_da()->current_row_for_warning();
|
||||
event.database= thd->db;
|
||||
|
@ -4823,9 +4823,9 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
|
||||
fix_session_vcol_expr(thd, (*df)->default_value))
|
||||
goto err;
|
||||
|
||||
for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++)
|
||||
if (fix_session_vcol_expr(thd, (*cc)))
|
||||
goto err;
|
||||
for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++)
|
||||
if (fix_session_vcol_expr(thd, (*cc)))
|
||||
goto err;
|
||||
|
||||
thd->security_ctx= save_security_ctx;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -179,7 +179,7 @@ public:
|
||||
}
|
||||
|
||||
inline char *str() const { return string.str; }
|
||||
inline uint32 length() const { return string.length; }
|
||||
inline size_t length() const { return string.length; }
|
||||
CHARSET_INFO *charset() const { return cs; }
|
||||
|
||||
friend LEX_STRING * thd_query_string (MYSQL_THD thd);
|
||||
@ -1068,7 +1068,10 @@ public:
|
||||
|
||||
|
||||
inline char *query() const { return query_string.str(); }
|
||||
inline uint32 query_length() const { return query_string.length(); }
|
||||
inline uint32 query_length() const
|
||||
{
|
||||
return static_cast<uint32>(query_string.length());
|
||||
}
|
||||
CHARSET_INFO *query_charset() const { return query_string.charset(); }
|
||||
void set_query_inner(const CSET_STRING &string_arg)
|
||||
{
|
||||
|
@ -1259,9 +1259,9 @@ void With_clause::print(String *str, enum_query_type query_type)
|
||||
with_elem;
|
||||
with_elem= with_elem->next)
|
||||
{
|
||||
with_elem->print(str, query_type);
|
||||
if (with_elem != with_list.first)
|
||||
str->append(", ");
|
||||
with_elem->print(str, query_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -50,7 +51,7 @@ public:
|
||||
Convert a bitmask consisting of MYSQL_TIME_{NOTE|WARN}_XXX bits
|
||||
to WARN_LEVEL_XXX
|
||||
*/
|
||||
static enum_warning_level time_warn_level(int warnings)
|
||||
static enum_warning_level time_warn_level(uint warnings)
|
||||
{
|
||||
return MYSQL_TIME_WARN_HAVE_WARNINGS(warnings) ?
|
||||
WARN_LEVEL_WARN : WARN_LEVEL_NOTE;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, MariaDB
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1498,8 +1498,8 @@ public:
|
||||
This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT
|
||||
(exclusive) set.
|
||||
*/
|
||||
static const int BINLOG_STMT_UNSAFE_ALL_FLAGS=
|
||||
((1 << BINLOG_STMT_UNSAFE_COUNT) - 1);
|
||||
static const uint32 BINLOG_STMT_UNSAFE_ALL_FLAGS=
|
||||
((1U << BINLOG_STMT_UNSAFE_COUNT) - 1);
|
||||
|
||||
/**
|
||||
Maps elements of enum_binlog_stmt_unsafe to error codes.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2005, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2012, Monty Program Ab
|
||||
Copyright (c) 2009, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -53,9 +53,9 @@ extern ulong dlopen_count;
|
||||
/*
|
||||
the following flags are valid for plugin_init()
|
||||
*/
|
||||
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
|
||||
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2
|
||||
#define PLUGIN_INIT_SKIP_INITIALIZATION 4
|
||||
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1U
|
||||
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2U
|
||||
#define PLUGIN_INIT_SKIP_INITIALIZATION 4U
|
||||
|
||||
#define INITIAL_LEX_PLUGIN_LIST_SIZE 16
|
||||
|
||||
@ -71,12 +71,12 @@ typedef struct st_mysql_show_var SHOW_VAR;
|
||||
It's a bitmap, because it makes it easier to test
|
||||
"whether the state is one of those..."
|
||||
*/
|
||||
#define PLUGIN_IS_FREED 1
|
||||
#define PLUGIN_IS_DELETED 2
|
||||
#define PLUGIN_IS_UNINITIALIZED 4
|
||||
#define PLUGIN_IS_READY 8
|
||||
#define PLUGIN_IS_DYING 16
|
||||
#define PLUGIN_IS_DISABLED 32
|
||||
#define PLUGIN_IS_FREED 1U
|
||||
#define PLUGIN_IS_DELETED 2U
|
||||
#define PLUGIN_IS_UNINITIALIZED 4U
|
||||
#define PLUGIN_IS_READY 8U
|
||||
#define PLUGIN_IS_DYING 16U
|
||||
#define PLUGIN_IS_DISABLED 32U
|
||||
|
||||
struct st_ptr_backup {
|
||||
void **ptr;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define SQL_SELECT_INCLUDED
|
||||
|
||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2015, MariaDB
|
||||
Copyright (c) 2008, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -36,9 +36,9 @@
|
||||
|
||||
typedef struct st_join_table JOIN_TAB;
|
||||
/* Values in optimize */
|
||||
#define KEY_OPTIMIZE_EXISTS 1
|
||||
#define KEY_OPTIMIZE_REF_OR_NULL 2
|
||||
#define KEY_OPTIMIZE_EQ 4
|
||||
#define KEY_OPTIMIZE_EXISTS 1U
|
||||
#define KEY_OPTIMIZE_REF_OR_NULL 2U
|
||||
#define KEY_OPTIMIZE_EQ 4U
|
||||
|
||||
inline uint get_hash_join_key_no() { return MAX_KEY; }
|
||||
|
||||
@ -178,10 +178,10 @@ enum sj_strategy_enum
|
||||
};
|
||||
|
||||
/* Values for JOIN_TAB::packed_info */
|
||||
#define TAB_INFO_HAVE_VALUE 1
|
||||
#define TAB_INFO_USING_INDEX 2
|
||||
#define TAB_INFO_USING_WHERE 4
|
||||
#define TAB_INFO_FULL_SCAN_ON_NULL 8
|
||||
#define TAB_INFO_HAVE_VALUE 1U
|
||||
#define TAB_INFO_USING_INDEX 2U
|
||||
#define TAB_INFO_USING_WHERE 4U
|
||||
#define TAB_INFO_FULL_SCAN_ON_NULL 8U
|
||||
|
||||
typedef enum_nested_loop_state
|
||||
(*Next_select_func)(JOIN *, struct st_join_table *, bool);
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
/*
|
||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2013, Monty Program Ab.
|
||||
Copyright (c) 2008, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -97,9 +97,9 @@ public:
|
||||
Convert a string between character sets.
|
||||
"dstcs" and "srccs" cannot be &my_charset_bin.
|
||||
*/
|
||||
uint convert_fix(CHARSET_INFO *dstcs, char *dst, uint dst_length,
|
||||
CHARSET_INFO *srccs, const char *src, uint src_length,
|
||||
uint nchars)
|
||||
size_t convert_fix(CHARSET_INFO *dstcs, char *dst, uint dst_length,
|
||||
CHARSET_INFO *srccs, const char *src, uint src_length,
|
||||
uint nchars)
|
||||
{
|
||||
return my_convert_fix(dstcs, dst, dst_length,
|
||||
srccs, src, src_length, nchars, this, this);
|
||||
@ -677,7 +677,7 @@ public:
|
||||
{
|
||||
DBUG_ASSERT(Alloced_length >= (str_length + net_length_size(length)));
|
||||
char *pos= (char *) net_store_length((uchar *)(Ptr + str_length), length);
|
||||
str_length= pos - Ptr;
|
||||
str_length= uint32(pos - Ptr);
|
||||
}
|
||||
void q_net_store_data(const uchar *from, size_t length)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, MariaDB
|
||||
Copyright (c) 2010, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -2845,7 +2845,7 @@ bool check_duplicates_in_interval(const char *set_or_name,
|
||||
*/
|
||||
|
||||
bool Column_definition::prepare_create_field(uint *blob_columns,
|
||||
longlong table_flags)
|
||||
ulonglong table_flags)
|
||||
{
|
||||
uint dup_val_count;
|
||||
uint decimals_orig= decimals;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2006, 2014, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2014, Monty Program Ab.
|
||||
Copyright (c) 2011, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -251,6 +251,7 @@ bool quick_rm_table(THD *thd, handlerton *base, const char *db,
|
||||
const char *table_name, uint flags,
|
||||
const char *table_path=0);
|
||||
void close_cached_table(THD *thd, TABLE *table);
|
||||
void sp_prepare_create_field(THD *thd, Column_definition *sql_field);
|
||||
CHARSET_INFO* get_sql_field_charset(Create_field *sql_field,
|
||||
HA_CREATE_INFO *create_info);
|
||||
bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags);
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
/*
|
||||
Copyright (c) 2004, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -273,8 +274,8 @@ public:
|
||||
Field **nullable_fields() { return record0_field; }
|
||||
void reset_extra_null_bitmap()
|
||||
{
|
||||
int null_bytes= (trigger_table->s->stored_fields -
|
||||
trigger_table->s->null_fields + 7)/8;
|
||||
size_t null_bytes= (trigger_table->s->stored_fields -
|
||||
trigger_table->s->null_fields + 7)/8;
|
||||
bzero(extra_null_bitmap, null_bytes);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define STRUCTS_INCLUDED
|
||||
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -331,26 +332,26 @@ typedef struct st_index_stats
|
||||
|
||||
|
||||
/* Bits in form->update */
|
||||
#define REG_MAKE_DUPP 1 /* Make a copy of record when read */
|
||||
#define REG_NEW_RECORD 2 /* Write a new record if not found */
|
||||
#define REG_UPDATE 4 /* Uppdate record */
|
||||
#define REG_DELETE 8 /* Delete found record */
|
||||
#define REG_PROG 16 /* User is updating database */
|
||||
#define REG_CLEAR_AFTER_WRITE 32
|
||||
#define REG_MAY_BE_UPDATED 64
|
||||
#define REG_AUTO_UPDATE 64 /* Used in D-forms for scroll-tables */
|
||||
#define REG_OVERWRITE 128
|
||||
#define REG_SKIP_DUP 256
|
||||
#define REG_MAKE_DUPP 1U /* Make a copy of record when read */
|
||||
#define REG_NEW_RECORD 2U /* Write a new record if not found */
|
||||
#define REG_UPDATE 4U /* Uppdate record */
|
||||
#define REG_DELETE 8U /* Delete found record */
|
||||
#define REG_PROG 16U /* User is updating database */
|
||||
#define REG_CLEAR_AFTER_WRITE 32U
|
||||
#define REG_MAY_BE_UPDATED 64U
|
||||
#define REG_AUTO_UPDATE 64U /* Used in D-forms for scroll-tables */
|
||||
#define REG_OVERWRITE 128U
|
||||
#define REG_SKIP_DUP 256U
|
||||
|
||||
/* Bits in form->status */
|
||||
#define STATUS_NO_RECORD (1+2) /* Record isn't usably */
|
||||
#define STATUS_GARBAGE 1
|
||||
#define STATUS_NOT_FOUND 2 /* No record in database when needed */
|
||||
#define STATUS_NO_PARENT 4 /* Parent record wasn't found */
|
||||
#define STATUS_NOT_READ 8 /* Record isn't read */
|
||||
#define STATUS_UPDATED 16 /* Record is updated by formula */
|
||||
#define STATUS_NULL_ROW 32 /* table->null_row is set */
|
||||
#define STATUS_DELETED 64
|
||||
#define STATUS_NO_RECORD (1U+2U) /* Record isn't usable */
|
||||
#define STATUS_GARBAGE 1U
|
||||
#define STATUS_NOT_FOUND 2U /* No record in database when needed */
|
||||
#define STATUS_NO_PARENT 4U /* Parent record wasn't found */
|
||||
#define STATUS_NOT_READ 8U /* Record isn't read */
|
||||
#define STATUS_UPDATED 16U /* Record is updated by formula */
|
||||
#define STATUS_NULL_ROW 32U /* table->null_row is set */
|
||||
#define STATUS_DELETED 64U
|
||||
|
||||
/*
|
||||
Such interval is "discrete": it is the set of
|
||||
|
@ -2465,7 +2465,7 @@ static Sys_var_uint Sys_protocol_version(
|
||||
"protocol_version",
|
||||
"The version of the client/server protocol used by the MySQL server",
|
||||
READ_ONLY GLOBAL_VAR(protocol_version), CMD_LINE_HELP_ONLY,
|
||||
VALID_RANGE(0, ~0), DEFAULT(PROTOCOL_VERSION), BLOCK_SIZE(1));
|
||||
VALID_RANGE(0, ~0U), DEFAULT(PROTOCOL_VERSION), BLOCK_SIZE(1));
|
||||
|
||||
static Sys_var_proxy_user Sys_proxy_user(
|
||||
"proxy_user", "The proxy user account name used when logging in",
|
||||
|
56
sql/table.h
56
sql/table.h
@ -2,7 +2,7 @@
|
||||
#define TABLE_INCLUDED
|
||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2014, SkySQL Ab.
|
||||
Copyright (c) 2016, MariaDB Corporation
|
||||
Copyright (c) 2016, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1500,13 +1500,13 @@ typedef struct st_foreign_key_info
|
||||
|
||||
LEX_CSTRING *fk_option_name(enum_fk_option opt);
|
||||
|
||||
#define MY_I_S_MAYBE_NULL 1
|
||||
#define MY_I_S_UNSIGNED 2
|
||||
#define MY_I_S_MAYBE_NULL 1U
|
||||
#define MY_I_S_UNSIGNED 2U
|
||||
|
||||
|
||||
#define SKIP_OPEN_TABLE 0 // do not open table
|
||||
#define OPEN_FRM_ONLY 1 // open FRM file only
|
||||
#define OPEN_FULL_TABLE 2 // open FRM,MYD, MYI files
|
||||
#define SKIP_OPEN_TABLE 0U // do not open table
|
||||
#define OPEN_FRM_ONLY 1U // open FRM file only
|
||||
#define OPEN_FULL_TABLE 2U // open FRM,MYD, MYI files
|
||||
|
||||
typedef struct st_field_info
|
||||
{
|
||||
@ -1570,27 +1570,27 @@ class IS_table_read_plan;
|
||||
Types of derived tables. The ending part is a bitmap of phases that are
|
||||
applicable to a derived table of the type.
|
||||
*/
|
||||
#define DTYPE_ALGORITHM_UNDEFINED 0
|
||||
#define DTYPE_VIEW 1
|
||||
#define DTYPE_TABLE 2
|
||||
#define DTYPE_MERGE 4
|
||||
#define DTYPE_MATERIALIZE 8
|
||||
#define DTYPE_MULTITABLE 16
|
||||
#define DTYPE_MASK 19
|
||||
#define DTYPE_ALGORITHM_UNDEFINED 0U
|
||||
#define DTYPE_VIEW 1U
|
||||
#define DTYPE_TABLE 2U
|
||||
#define DTYPE_MERGE 4U
|
||||
#define DTYPE_MATERIALIZE 8U
|
||||
#define DTYPE_MULTITABLE 16U
|
||||
#define DTYPE_MASK (DTYPE_VIEW|DTYPE_TABLE|DTYPE_MULTITABLE)
|
||||
|
||||
/*
|
||||
Phases of derived tables/views handling, see sql_derived.cc
|
||||
Values are used as parts of a bitmap attached to derived table types.
|
||||
*/
|
||||
#define DT_INIT 1
|
||||
#define DT_PREPARE 2
|
||||
#define DT_OPTIMIZE 4
|
||||
#define DT_MERGE 8
|
||||
#define DT_MERGE_FOR_INSERT 16
|
||||
#define DT_CREATE 32
|
||||
#define DT_FILL 64
|
||||
#define DT_REINIT 128
|
||||
#define DT_PHASES 8
|
||||
#define DT_INIT 1U
|
||||
#define DT_PREPARE 2U
|
||||
#define DT_OPTIMIZE 4U
|
||||
#define DT_MERGE 8U
|
||||
#define DT_MERGE_FOR_INSERT 16U
|
||||
#define DT_CREATE 32U
|
||||
#define DT_FILL 64U
|
||||
#define DT_REINIT 128U
|
||||
#define DT_PHASES 8U
|
||||
/* Phases that are applicable to all derived tables. */
|
||||
#define DT_COMMON (DT_INIT + DT_PREPARE + DT_REINIT + DT_OPTIMIZE)
|
||||
/* Phases that are applicable only to materialized derived tables. */
|
||||
@ -1610,13 +1610,13 @@ class IS_table_read_plan;
|
||||
representation for backward compatibility.
|
||||
*/
|
||||
|
||||
#define VIEW_ALGORITHM_UNDEFINED_FRM 0
|
||||
#define VIEW_ALGORITHM_MERGE_FRM 1
|
||||
#define VIEW_ALGORITHM_TMPTABLE_FRM 2
|
||||
#define VIEW_ALGORITHM_UNDEFINED_FRM 0U
|
||||
#define VIEW_ALGORITHM_MERGE_FRM 1U
|
||||
#define VIEW_ALGORITHM_TMPTABLE_FRM 2U
|
||||
|
||||
#define JOIN_TYPE_LEFT 1
|
||||
#define JOIN_TYPE_RIGHT 2
|
||||
#define JOIN_TYPE_OUTER 4 /* Marker that this is an outer join */
|
||||
#define JOIN_TYPE_LEFT 1U
|
||||
#define JOIN_TYPE_RIGHT 2U
|
||||
#define JOIN_TYPE_OUTER 4U /* Marker that this is an outer join */
|
||||
|
||||
#define VIEW_SUID_INVOKER 0
|
||||
#define VIEW_SUID_DEFINER 1
|
||||
|
@ -412,7 +412,7 @@ void BLKFILMR2::MakeValueBitmap(void)
|
||||
Void = !Bmp[N]; // There are no good values in the file
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
Bxp[i] = ~0;
|
||||
Bxp[i] = ~0U;
|
||||
|
||||
if (noteq)
|
||||
Bmp[i] = Bxp[i];
|
||||
@ -708,7 +708,7 @@ void BLKFILIN2::MakeValueBitmap(void)
|
||||
Void = !Bmp[N]; // There are no good values in the file
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
Bxp[i] = ~0;
|
||||
Bxp[i] = ~0U;
|
||||
|
||||
if (noteq) {
|
||||
Bmp[i] = Bxp[i];
|
||||
@ -828,7 +828,7 @@ BLKFILIN2::BLKFILIN2(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp)
|
||||
Bxp[i] |= btp;
|
||||
|
||||
for (N = i--; i >= 0; i--)
|
||||
Bxp[i] = ~0;
|
||||
Bxp[i] = ~0U;
|
||||
|
||||
break;
|
||||
} // endif Bmp
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2012, Facebook Inc.
|
||||
Copyright (c) 2014, 2016, MariaDB Corporation
|
||||
Copyright (c) 2014, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
@ -725,7 +725,7 @@ btr_page_free_low(
|
||||
offsets = rec_get_offsets(rec, index,
|
||||
offsets, ULINT_UNDEFINED,
|
||||
&heap);
|
||||
uint size = rec_offs_data_size(offsets);
|
||||
ulint size = rec_offs_data_size(offsets);
|
||||
memset(rec, 0, size);
|
||||
rec = page_rec_get_next(rec);
|
||||
cnt++;
|
||||
@ -890,7 +890,7 @@ btr_page_get_father_node_ptr_func(
|
||||
ulint latch_mode,/*!< in: BTR_CONT_MODIFY_TREE
|
||||
or BTR_CONT_SEARCH_TREE */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
dtuple_t* tuple;
|
||||
@ -2396,7 +2396,7 @@ btr_insert_on_non_leaf_level_func(
|
||||
ulint level, /*!< in: level, must be > 0 */
|
||||
dtuple_t* tuple, /*!< in: the record to be inserted */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
big_rec_t* dummy_big_rec;
|
||||
|
@ -105,22 +105,24 @@ throughput clearly from about 100000. */
|
||||
#define BTR_CUR_FINE_HISTORY_LENGTH 100000
|
||||
|
||||
/** Number of searches down the B-tree in btr_cur_search_to_nth_level(). */
|
||||
ulint btr_cur_n_non_sea = 0;
|
||||
/** Number of successful adaptive hash index lookups in
|
||||
btr_cur_search_to_nth_level(). */
|
||||
ulint btr_cur_n_sea = 0;
|
||||
ulint btr_cur_n_non_sea;
|
||||
/** Old value of btr_cur_n_non_sea. Copied by
|
||||
srv_refresh_innodb_monitor_stats(). Referenced by
|
||||
srv_printf_innodb_monitor(). */
|
||||
ulint btr_cur_n_non_sea_old = 0;
|
||||
ulint btr_cur_n_non_sea_old;
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/** Number of successful adaptive hash index lookups in
|
||||
btr_cur_search_to_nth_level(). */
|
||||
ulint btr_cur_n_sea;
|
||||
/** Old value of btr_cur_n_sea. Copied by
|
||||
srv_refresh_innodb_monitor_stats(). Referenced by
|
||||
srv_printf_innodb_monitor(). */
|
||||
ulint btr_cur_n_sea_old = 0;
|
||||
ulint btr_cur_n_sea_old;
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/* Flag to limit optimistic insert records */
|
||||
uint btr_cur_limit_optimistic_insert_debug = 0;
|
||||
uint btr_cur_limit_optimistic_insert_debug;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/** In the optimistic insert, if the insert does not fit, but this much space
|
||||
@ -146,7 +148,7 @@ can be released by page reorganize, then it is reorganized */
|
||||
@param not_empty table not empty
|
||||
@return estimated table wide stats from sampled value */
|
||||
#define BTR_TABLE_STATS_FROM_SAMPLE(value, index, sample, ext_size, not_empty) \
|
||||
(((value) * static_cast<int64_t>(index->stat_n_leaf_pages) \
|
||||
(((value) * static_cast<ib_uint64_t>(index->stat_n_leaf_pages) \
|
||||
+ (sample) - 1 + (ext_size) + (not_empty)) / ((sample) + (ext_size)))
|
||||
|
||||
/* @} */
|
||||
@ -412,7 +414,7 @@ btr_cur_optimistic_latch_leaves(
|
||||
ulint* latch_mode,
|
||||
btr_cur_t* cursor,
|
||||
const char* file,
|
||||
ulint line,
|
||||
unsigned line,
|
||||
mtr_t* mtr)
|
||||
{
|
||||
ulint mode;
|
||||
@ -745,7 +747,7 @@ btr_cur_search_to_nth_level(
|
||||
caller currently has on search system:
|
||||
RW_S_LATCH, or 0 */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr, /*!< in: mtr */
|
||||
ib_uint64_t autoinc)/*!< in: PAGE_ROOT_AUTO_INC to be written
|
||||
(0 if none) */
|
||||
@ -953,7 +955,7 @@ btr_cur_search_to_nth_level(
|
||||
|
||||
if (has_search_latch) {
|
||||
/* Release possible search latch to obey latching order */
|
||||
rw_lock_s_unlock(btr_get_search_latch(index));
|
||||
btr_search_s_unlock(index);
|
||||
}
|
||||
|
||||
/* Store the position of the tree latch we push to mtr so that we
|
||||
@ -1477,6 +1479,7 @@ retry_page_get:
|
||||
cursor->low_match =
|
||||
DICT_INDEX_SPATIAL_NODEPTR_SIZE + 1;
|
||||
}
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
} else if (height == 0 && btr_search_enabled
|
||||
&& !dict_index_is_spatial(index)) {
|
||||
/* The adaptive hash index is only used when searching
|
||||
@ -1486,6 +1489,7 @@ retry_page_get:
|
||||
page_cur_search_with_match_bytes(
|
||||
block, index, tuple, page_mode, &up_match, &up_bytes,
|
||||
&low_match, &low_bytes, page_cursor);
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
} else {
|
||||
/* Search for complete index fields. */
|
||||
up_bytes = low_bytes = 0;
|
||||
@ -1966,7 +1970,7 @@ need_opposite_intention:
|
||||
index, autoinc, mtr, false);
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_ADAPT
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/* We do a dirty read of btr_search_enabled here. We
|
||||
will properly check btr_search_enabled again in
|
||||
btr_search_build_page_hash_index() before building a
|
||||
@ -1978,7 +1982,7 @@ need_opposite_intention:
|
||||
) {
|
||||
btr_search_info_update(index, cursor);
|
||||
}
|
||||
#endif
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
ut_ad(cursor->up_match != ULINT_UNDEFINED
|
||||
|| mode != PAGE_CUR_GE);
|
||||
ut_ad(cursor->up_match != ULINT_UNDEFINED
|
||||
@ -2014,8 +2018,7 @@ func_exit:
|
||||
}
|
||||
|
||||
if (has_search_latch) {
|
||||
|
||||
rw_lock_s_lock(btr_get_search_latch(index));
|
||||
btr_search_s_lock(index);
|
||||
}
|
||||
|
||||
if (mbr_adj) {
|
||||
@ -2039,7 +2042,7 @@ btr_cur_open_at_index_side_func(
|
||||
ulint level, /*!< in: level to search for
|
||||
(0=leaf). */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in/out: mini-transaction */
|
||||
{
|
||||
page_cur_t* page_cursor;
|
||||
@ -2411,7 +2414,7 @@ btr_cur_open_at_rnd_pos_func(
|
||||
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
|
||||
btr_cur_t* cursor, /*!< in/out: B-tree cursor */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
page_cur_t* page_cursor;
|
||||
@ -3271,12 +3274,12 @@ btr_cur_pessimistic_insert(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_ADAPT
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
# ifdef MYSQL_INDEX_DISABLE_AHI
|
||||
if (index->disable_ahi); else
|
||||
# endif
|
||||
btr_search_update_hash_on_insert(cursor);
|
||||
#endif
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
if (inherit && !(flags & BTR_NO_LOCKING_FLAG)) {
|
||||
|
||||
lock_update_insert(btr_cur_get_block(cursor), *rec);
|
||||
@ -3609,7 +3612,6 @@ btr_cur_update_in_place(
|
||||
rec_t* rec;
|
||||
roll_ptr_t roll_ptr = 0;
|
||||
ulint was_delete_marked;
|
||||
ibool is_hashed;
|
||||
|
||||
rec = btr_cur_get_rec(cursor);
|
||||
index = cursor->index;
|
||||
@ -3621,7 +3623,7 @@ btr_cur_update_in_place(
|
||||
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|
||||
|| dict_index_is_clust(index));
|
||||
ut_ad(thr_get_trx(thr)->id == trx_id
|
||||
|| (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))
|
||||
|| (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)))
|
||||
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
|
||||
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
|
||||
ut_ad(fil_page_index_page_check(btr_cur_get_page(cursor)));
|
||||
@ -3668,9 +3670,8 @@ btr_cur_update_in_place(
|
||||
was_delete_marked = rec_get_deleted_flag(
|
||||
rec, page_is_comp(buf_block_get_frame(block)));
|
||||
|
||||
is_hashed = (block->index != NULL);
|
||||
|
||||
if (is_hashed) {
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
if (block->index) {
|
||||
/* TO DO: Can we skip this if none of the fields
|
||||
index->search_info->curr_n_fields
|
||||
are being updated? */
|
||||
@ -3687,14 +3688,17 @@ btr_cur_update_in_place(
|
||||
btr_search_update_hash_on_delete(cursor);
|
||||
}
|
||||
|
||||
rw_lock_x_lock(btr_get_search_latch(index));
|
||||
btr_search_x_lock(index);
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
row_upd_rec_in_place(rec, index, offsets, update, page_zip);
|
||||
|
||||
if (is_hashed) {
|
||||
rw_lock_x_unlock(btr_get_search_latch(index));
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
if (block->index) {
|
||||
btr_search_x_unlock(index);
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
btr_cur_update_in_place_log(flags, rec, index, update,
|
||||
trx_id, roll_ptr, mtr);
|
||||
@ -3786,7 +3790,7 @@ btr_cur_optimistic_update(
|
||||
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|
||||
|| dict_index_is_clust(index));
|
||||
ut_ad(thr_get_trx(thr)->id == trx_id
|
||||
|| (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))
|
||||
|| (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)))
|
||||
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
|
||||
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
|
||||
ut_ad(fil_page_index_page_check(page));
|
||||
@ -4119,7 +4123,7 @@ btr_cur_pessimistic_update(
|
||||
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|
||||
|| dict_index_is_clust(index));
|
||||
ut_ad(thr_get_trx(thr)->id == trx_id
|
||||
|| (flags & ~BTR_KEEP_POS_FLAG)
|
||||
|| (flags & ulint(~BTR_KEEP_POS_FLAG))
|
||||
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
|
||||
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
|
||||
|
||||
@ -6227,12 +6231,12 @@ btr_cur_set_ownership_of_extern_field(
|
||||
byte_val = mach_read_from_1(data + local_len + BTR_EXTERN_LEN);
|
||||
|
||||
if (val) {
|
||||
byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG);
|
||||
byte_val &= ~BTR_EXTERN_OWNER_FLAG;
|
||||
} else {
|
||||
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
|
||||
ut_a(!(byte_val & BTR_EXTERN_OWNER_FLAG));
|
||||
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
|
||||
byte_val = byte_val | BTR_EXTERN_OWNER_FLAG;
|
||||
byte_val |= BTR_EXTERN_OWNER_FLAG;
|
||||
}
|
||||
|
||||
if (page_zip) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved.
|
||||
Copyright (C) 2014, 2016, MariaDB Corporation. All Rights Reserved.
|
||||
Copyright (C) 2014, 2017, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
@ -696,8 +696,8 @@ btr_defragment_n_pages(
|
||||
(data_size_per_rec
|
||||
* srv_defragment_fill_factor_n_recs));
|
||||
optimal_page_size -= reserved_space;
|
||||
n_new_slots = (total_data_size + optimal_page_size - 1)
|
||||
/ optimal_page_size;
|
||||
n_new_slots = uint((total_data_size + optimal_page_size - 1)
|
||||
/ optimal_page_size);
|
||||
if (n_new_slots >= n_pages) {
|
||||
/* Can't defragment. */
|
||||
if (end_of_index)
|
||||
|
@ -229,7 +229,7 @@ btr_pcur_restore_position_func(
|
||||
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /*!< in: detached persistent cursor */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
dict_index_t* index;
|
||||
@ -586,7 +586,7 @@ btr_pcur_open_on_user_rec_func(
|
||||
btr_pcur_t* cursor, /*!< in: memory buffer for persistent
|
||||
cursor */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
btr_pcur_open_low(index, 0, tuple, mode, latch_mode, cursor,
|
||||
|
@ -254,11 +254,10 @@ btr_page_needs_scrubbing(
|
||||
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
|
||||
}
|
||||
|
||||
page_t* page = buf_block_get_frame(block);
|
||||
uint type = fil_page_get_type(page);
|
||||
const page_t* page = buf_block_get_frame(block);
|
||||
|
||||
if (allocated == BTR_SCRUB_PAGE_ALLOCATED) {
|
||||
if (type != FIL_PAGE_INDEX) {
|
||||
if (fil_page_get_type(page) != FIL_PAGE_INDEX) {
|
||||
/* this function is called from fil-crypt-threads.
|
||||
* these threads iterate all pages of all tablespaces
|
||||
* and don't know about fil_page_type.
|
||||
@ -275,7 +274,7 @@ btr_page_needs_scrubbing(
|
||||
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
|
||||
}
|
||||
|
||||
if (page_has_garbage(page) == false) {
|
||||
if (!page_has_garbage(page)) {
|
||||
/* no garbage (from deleted/shrunken records) */
|
||||
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
|
||||
}
|
||||
@ -283,11 +282,12 @@ btr_page_needs_scrubbing(
|
||||
} else if (allocated == BTR_SCRUB_PAGE_FREE ||
|
||||
allocated == BTR_SCRUB_PAGE_ALLOCATION_UNKNOWN) {
|
||||
|
||||
if (! (type == FIL_PAGE_INDEX ||
|
||||
type == FIL_PAGE_TYPE_BLOB ||
|
||||
type == FIL_PAGE_TYPE_ZBLOB ||
|
||||
type == FIL_PAGE_TYPE_ZBLOB2)) {
|
||||
|
||||
switch (fil_page_get_type(page)) {
|
||||
case FIL_PAGE_INDEX:
|
||||
case FIL_PAGE_TYPE_ZBLOB:
|
||||
case FIL_PAGE_TYPE_ZBLOB2:
|
||||
break;
|
||||
default:
|
||||
/**
|
||||
* If this is a dropped page, we also need to scrub
|
||||
* BLOB pages
|
||||
@ -299,7 +299,8 @@ btr_page_needs_scrubbing(
|
||||
}
|
||||
}
|
||||
|
||||
if (btr_page_get_index_id(page) == IBUF_INDEX_ID) {
|
||||
if (block->page.id.space() == TRX_SYS_SPACE
|
||||
&& btr_page_get_index_id(page) == IBUF_INDEX_ID) {
|
||||
/* skip ibuf */
|
||||
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2008, Google Inc.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted by
|
||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||
@ -31,6 +32,7 @@ Created 2/17/1996 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#include "btr0sea.h"
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
#ifdef UNIV_NONINL
|
||||
#include "btr0sea.ic"
|
||||
#endif /* UNIV_NOINL */
|
||||
@ -375,43 +377,6 @@ btr_search_enable()
|
||||
btr_search_x_unlock_all();
|
||||
}
|
||||
|
||||
/** Creates and initializes a search info struct.
|
||||
@param[in] heap heap where created.
|
||||
@return own: search info struct */
|
||||
btr_search_t*
|
||||
btr_search_info_create(mem_heap_t* heap)
|
||||
{
|
||||
btr_search_t* info;
|
||||
|
||||
info = (btr_search_t*) mem_heap_alloc(heap, sizeof(btr_search_t));
|
||||
|
||||
ut_d(info->magic_n = BTR_SEARCH_MAGIC_N);
|
||||
|
||||
info->ref_count = 0;
|
||||
info->root_guess = NULL;
|
||||
info->withdraw_clock = 0;
|
||||
|
||||
info->hash_analysis = 0;
|
||||
info->n_hash_potential = 0;
|
||||
|
||||
info->last_hash_succ = FALSE;
|
||||
|
||||
#ifdef UNIV_SEARCH_PERF_STAT
|
||||
info->n_hash_succ = 0;
|
||||
info->n_hash_fail = 0;
|
||||
info->n_patt_succ = 0;
|
||||
info->n_searches = 0;
|
||||
#endif /* UNIV_SEARCH_PERF_STAT */
|
||||
|
||||
/* Set some sensible values */
|
||||
info->n_fields = 1;
|
||||
info->n_bytes = 0;
|
||||
|
||||
info->left_side = TRUE;
|
||||
|
||||
return(info);
|
||||
}
|
||||
|
||||
/** Returns the value of ref_count. The value is protected by latch.
|
||||
@param[in] info search info
|
||||
@param[in] index index identifier
|
||||
@ -1583,9 +1548,9 @@ btr_search_build_page_hash_index(
|
||||
|
||||
block->n_hash_helps = 0;
|
||||
|
||||
block->curr_n_fields = n_fields;
|
||||
block->curr_n_bytes = n_bytes;
|
||||
block->curr_left_side = left_side;
|
||||
block->curr_n_fields = unsigned(n_fields);
|
||||
block->curr_n_bytes = unsigned(n_bytes);
|
||||
block->curr_left_side = unsigned(left_side);
|
||||
block->index = index;
|
||||
|
||||
for (i = 0; i < n_cached; i++) {
|
||||
@ -2177,3 +2142,4 @@ btr_search_validate()
|
||||
}
|
||||
|
||||
#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
@ -1536,7 +1536,9 @@ buf_block_init(
|
||||
|
||||
ut_d(block->page.file_page_was_freed = FALSE);
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
block->index = NULL;
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
block->skip_flush_check = false;
|
||||
|
||||
ut_d(block->page.in_page_hash = FALSE);
|
||||
@ -1547,9 +1549,11 @@ buf_block_init(
|
||||
ut_d(block->in_unzip_LRU_list = FALSE);
|
||||
ut_d(block->in_withdraw_list = FALSE);
|
||||
|
||||
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
|
||||
block->n_pointers = 0;
|
||||
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
|
||||
# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
page_zip_des_init(&block->page.zip);
|
||||
|
||||
mutex_create(LATCH_ID_BUF_BLOCK_MUTEX, &block->mutex);
|
||||
@ -1950,7 +1954,8 @@ buf_pool_init_instance(
|
||||
buf_pool->watch = (buf_page_t*) ut_zalloc_nokey(
|
||||
sizeof(*buf_pool->watch) * BUF_POOL_WATCH_SIZE);
|
||||
for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) {
|
||||
buf_pool->watch[i].buf_pool_index = buf_pool->instance_no;
|
||||
buf_pool->watch[i].buf_pool_index
|
||||
= unsigned(buf_pool->instance_no);
|
||||
}
|
||||
|
||||
/* All fields are initialized by ut_zalloc_nokey(). */
|
||||
@ -2260,11 +2265,13 @@ buf_page_realloc(
|
||||
|
||||
/* set other flags of buf_block_t */
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
ut_ad(!block->index);
|
||||
new_block->index = NULL;
|
||||
new_block->n_hash_helps = 0;
|
||||
new_block->n_fields = 1;
|
||||
new_block->left_side = TRUE;
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
new_block->lock_hash_val = block->lock_hash_val;
|
||||
ut_ad(new_block->lock_hash_val == lock_rec_hash(
|
||||
@ -2726,7 +2733,7 @@ buf_pool_resize()
|
||||
|
||||
buf_pool_mutex_exit(buf_pool);
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/* disable AHI if needed */
|
||||
bool btr_search_disabled = false;
|
||||
|
||||
@ -2745,6 +2752,7 @@ buf_pool_resize()
|
||||
if (btr_search_disabled) {
|
||||
ib::info() << "disabled adaptive hash index.";
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
/* set withdraw target */
|
||||
for (ulint i = 0; i < srv_buf_pool_instances; i++) {
|
||||
@ -3116,7 +3124,10 @@ calc_buf_pool_size:
|
||||
dict_resize();
|
||||
|
||||
ib::info() << "Resized hash tables at lock_sys,"
|
||||
" adaptive hash index, dictionary.";
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
" adaptive hash index,"
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
" dictionary.";
|
||||
}
|
||||
|
||||
/* normalize ibuf->max_size */
|
||||
@ -3130,11 +3141,13 @@ calc_buf_pool_size:
|
||||
srv_buf_pool_old_size = srv_buf_pool_size;
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/* enable AHI if needed */
|
||||
if (btr_search_disabled) {
|
||||
btr_search_enable();
|
||||
ib::info() << "Re-enabled adaptive hash index.";
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
char now[32];
|
||||
|
||||
@ -3196,11 +3209,10 @@ DECLARE_THREAD(buf_resize_thread)(void*)
|
||||
OS_THREAD_DUMMY_RETURN;
|
||||
}
|
||||
|
||||
/********************************************************************//**
|
||||
Clears the adaptive hash index on all pages in the buffer pool. */
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/** Clear the adaptive hash index on all pages in the buffer pool. */
|
||||
void
|
||||
buf_pool_clear_hash_index(void)
|
||||
/*===========================*/
|
||||
buf_pool_clear_hash_index()
|
||||
{
|
||||
ulint p;
|
||||
|
||||
@ -3237,6 +3249,7 @@ buf_pool_clear_hash_index(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
/********************************************************************//**
|
||||
Relocate a buffer control block. Relocates the block on the LRU list
|
||||
@ -3920,13 +3933,15 @@ buf_block_init_low(
|
||||
/*===============*/
|
||||
buf_block_t* block) /*!< in: block to init */
|
||||
{
|
||||
block->index = NULL;
|
||||
block->skip_flush_check = false;
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
block->index = NULL;
|
||||
|
||||
block->n_hash_helps = 0;
|
||||
block->n_fields = 1;
|
||||
block->n_bytes = 0;
|
||||
block->left_side = TRUE;
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
}
|
||||
|
||||
/********************************************************************//**
|
||||
@ -3998,6 +4013,7 @@ buf_zip_decompress(
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
/** Get a buffer block from an adaptive hash index pointer.
|
||||
This function does not return if the block is not identified.
|
||||
@param[in] ptr pointer to within a page frame
|
||||
@ -4040,6 +4056,7 @@ buf_block_from_ahi(const byte* ptr)
|
||||
ut_ad(state == BUF_BLOCK_FILE_PAGE || state == BUF_BLOCK_REMOVE_HASH);
|
||||
return(block);
|
||||
}
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
|
||||
/********************************************************************//**
|
||||
Find out if a pointer belongs to a buf_block_t. It can be a pointer to
|
||||
@ -4196,7 +4213,7 @@ buf_page_get_gen(
|
||||
buf_block_t* guess,
|
||||
ulint mode,
|
||||
const char* file,
|
||||
ulint line,
|
||||
unsigned line,
|
||||
mtr_t* mtr,
|
||||
dberr_t* err)
|
||||
{
|
||||
@ -4866,7 +4883,7 @@ buf_page_optimistic_get(
|
||||
buf_block_t* block, /*!< in: guessed buffer block */
|
||||
ib_uint64_t modify_clock,/*!< in: modify clock value */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mini-transaction */
|
||||
{
|
||||
buf_pool_t* buf_pool;
|
||||
@ -4986,7 +5003,7 @@ buf_page_get_known_nowait(
|
||||
buf_block_t* block, /*!< in: the known page */
|
||||
ulint mode, /*!< in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */
|
||||
const char* file, /*!< in: file name */
|
||||
ulint line, /*!< in: line where called */
|
||||
unsigned line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mini-transaction */
|
||||
{
|
||||
buf_pool_t* buf_pool;
|
||||
@ -5094,7 +5111,7 @@ buf_block_t*
|
||||
buf_page_try_get_func(
|
||||
const page_id_t& page_id,
|
||||
const char* file,
|
||||
ulint line,
|
||||
unsigned line,
|
||||
mtr_t* mtr)
|
||||
{
|
||||
buf_block_t* block;
|
||||
@ -7452,7 +7469,8 @@ buf_page_encrypt_before_write(
|
||||
page_size,
|
||||
dst_frame);
|
||||
|
||||
ulint key_version = mach_read_from_4(dst_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
|
||||
uint32_t key_version = mach_read_from_4(
|
||||
dst_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
|
||||
ut_ad(key_version == 0 || key_version >= bpage->key_version);
|
||||
bpage->key_version = key_version;
|
||||
bpage->real_size = page_size.physical();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user