Percona-Server-5.5.32-rel31.0.tar.gz

This commit is contained in:
Sergei Golubchik 2013-07-16 14:55:47 +02:00
parent bcfa90b471
commit 6bd24f07d4
179 changed files with 1316 additions and 9523 deletions

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@ -1349,27 +1349,13 @@ btr_cur_optimistic_insert(
Subtract one byte for the encoded heap_no in the
modification log. */
ulint free_space_zip = page_zip_empty_size(
cursor->index->n_fields, zip_size) - 1;
cursor->index->n_fields, zip_size);
ulint n_uniq = dict_index_get_n_unique_in_tree(index);
ut_ad(dict_table_is_comp(index->table));
/* There should be enough room for two node pointer
records on an empty non-leaf page. This prevents
infinite page splits. */
if (UNIV_LIKELY(entry->n_fields >= n_uniq)
&& UNIV_UNLIKELY(REC_NODE_PTR_SIZE
+ rec_get_converted_size_comp_prefix(
index, entry->fields, n_uniq,
NULL)
/* On a compressed page, there is
a two-byte entry in the dense
page directory for every record.
But there is no record header. */
- (REC_N_NEW_EXTRA_BYTES - 2)
> free_space_zip / 2)) {
if (free_space_zip == 0) {
too_big:
if (big_rec_vec) {
dtuple_convert_back_big_rec(
index, entry, big_rec_vec);
@ -1377,6 +1363,27 @@ btr_cur_optimistic_insert(
return(DB_TOO_BIG_RECORD);
}
/* Subtract one byte for the encoded heap_no in the
modification log. */
free_space_zip--;
/* There should be enough room for two node pointer
records on an empty non-leaf page. This prevents
infinite page splits. */
if (entry->n_fields >= n_uniq
&& (REC_NODE_PTR_SIZE
+ rec_get_converted_size_comp_prefix(
index, entry->fields, n_uniq, NULL)
/* On a compressed page, there is
a two-byte entry in the dense
page directory for every record.
But there is no record header. */
- (REC_N_NEW_EXTRA_BYTES - 2)
> free_space_zip / 2)) {
goto too_big;
}
}
LIMIT_OPTIMISTIC_INSERT_DEBUG(page_get_n_recs(page),

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@ -581,6 +581,8 @@ UNIV_INTERN
ibool
buf_page_is_corrupted(
/*==================*/
ibool check_lsn, /*!< in: TRUE if we need to check
and complain about the LSN */
const byte* read_buf, /*!< in: a database page */
ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */
@ -600,7 +602,7 @@ buf_page_is_corrupted(
}
#ifndef UNIV_HOTBACKUP
if (recv_lsn_checks_on) {
if (check_lsn && recv_lsn_checks_on) {
ib_uint64_t current_lsn;
if (log_peek_lsn(&current_lsn)
@ -1998,7 +2000,7 @@ lookup:
buf_read_page(space, zip_size, offset, trx);
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 37 || buf_validate());
ut_a(++buf_dbg_counter % 5771 || buf_validate());
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
}
@ -2556,6 +2558,10 @@ loop2:
retries = 0;
} else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
++retries;
DBUG_EXECUTE_IF(
"innodb_page_corruption_retries",
retries = BUF_PAGE_READ_MAX_RETRIES;
);
} else {
fprintf(stderr, "InnoDB: Error: Unable"
" to read tablespace %lu page no"
@ -2577,7 +2583,7 @@ loop2:
}
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 37 || buf_validate());
ut_a(++buf_dbg_counter % 5771 || buf_validate());
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
goto loop;
}
@ -2593,6 +2599,7 @@ got_block:
/* The page is being read to buffer pool,
but we cannot wait around for the read to
complete. */
null_exit:
//buf_pool_mutex_exit(buf_pool);
mutex_exit(block_mutex);
@ -2603,7 +2610,6 @@ got_block:
srv_pass_corrupt_table <= 1)) {
mutex_exit(block_mutex);
return(NULL);
}
@ -2622,6 +2628,14 @@ got_block:
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
ut_ad(block_mutex == &buf_pool->zip_mutex);
if (mode == BUF_PEEK_IF_IN_POOL) {
/* This mode is only used for dropping an
adaptive hash index. There cannot be an
adaptive hash index for a compressed-only
page, so do not bother decompressing the page. */
goto null_exit;
}
bpage = &block->page;
/* Protect bpage->buf_fix_count. */
//mutex_enter(&buf_pool->zip_mutex);
@ -3779,7 +3793,7 @@ buf_page_create(
memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 357 || buf_validate());
ut_a(++buf_dbg_counter % 5771 || buf_validate());
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(buf_block_get_space(block),
@ -3933,7 +3947,7 @@ buf_page_io_complete(
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
if (buf_page_is_corrupted(frame,
if (buf_page_is_corrupted(TRUE, frame,
buf_page_get_zip_size(bpage))) {
corrupt:
fprintf(stderr,

View file

@ -220,7 +220,7 @@ not_to_recover:
ut_ad(buf_page_in_file(bpage));
if(sync) {
if (sync) {
thd_wait_begin(NULL, THD_WAIT_DISKIO);
}

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -42,6 +42,22 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
#include "ut0vec.h"
#include "ha_prototypes.h"
/*************************************************************************
Checks if a table name contains the string TEMP_TABLE_PATH_PREFIX which
denotes temporary tables in MySQL. */
static
ibool
row_is_mysql_tmp_table_name(
/*========================*/
/* out: TRUE if temporary table */
const char* name) /* in: table name in the form
'database/tablename' */
{
return(strstr(name, TEMP_TABLE_PATH_PREFIX) != NULL);
}
/*****************************************************************//**
Based on a table object, this function builds the entry to be inserted
@ -1630,18 +1646,46 @@ dict_create_add_foreign_to_dictionary(
{
ulint error;
ulint i;
pars_info_t* info = pars_info_create();
pars_info_t* info;
if (foreign->id == NULL) {
/* Generate a new constraint id */
ulint namelen = strlen(table->name);
char* id = mem_heap_alloc(foreign->heap, namelen + 20);
/* no overflow if number < 1e13 */
sprintf(id, "%s_ibfk_%lu", table->name, (ulong) (*id_nr)++);
if (row_is_mysql_tmp_table_name(table->name)) {
sprintf(id, "%s_ibfk_%lu", table->name,
(ulong) (*id_nr)++);
} else {
char table_name[MAX_TABLE_NAME_LEN + 20] = "";
uint errors = 0;
strncpy(table_name, table->name,
MAX_TABLE_NAME_LEN + 20);
innobase_convert_to_system_charset(
strchr(table_name, '/') + 1,
strchr(table->name, '/') + 1,
MAX_TABLE_NAME_LEN, &errors);
if (errors) {
strncpy(table_name, table->name,
MAX_TABLE_NAME_LEN + 20);
}
sprintf(id, "%s_ibfk_%lu", table_name,
(ulong) (*id_nr)++);
if (innobase_check_identifier_length(
strchr(id,'/') + 1)) {
return(DB_IDENTIFIER_TOO_LONG);
}
}
foreign->id = id;
}
info = pars_info_create();
pars_info_add_str_literal(info, "id", foreign->id);
pars_info_add_str_literal(info, "for_name", table->name);

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -775,8 +775,11 @@ dict_table_get(
/* If table->ibd_file_missing == TRUE, this will
print an error message and return without doing
anything. */
dict_update_statistics(table, TRUE /* only update stats
if they have not been initialized */, FALSE);
dict_update_statistics(
table,
TRUE, /* only update stats if not initialized */
FALSE,
FALSE /* update even if not changed too much */);
}
return(table);
@ -1119,22 +1122,78 @@ dict_table_rename_in_cache(
dict_mem_foreign_table_name_lookup_set(foreign, FALSE);
}
if (strchr(foreign->id, '/')) {
/* This is a >= 4.0.18 format id */
ulint db_len;
char* old_id;
char old_name_cs_filename[MAX_TABLE_NAME_LEN+20];
uint errors = 0;
/* This is a >= 4.0.18 format id */
/* All table names are internally stored in charset
my_charset_filename (except the temp tables and the
partition identifier suffix in partition tables). The
foreign key constraint names are internally stored
in UTF-8 charset. The variable fkid here is used
to store foreign key constraint name in charset
my_charset_filename for comparison further below. */
char fkid[MAX_TABLE_NAME_LEN+20];
ibool on_tmp = FALSE;
/* The old table name in my_charset_filename is stored
in old_name_cs_filename */
strncpy(old_name_cs_filename, old_name,
MAX_TABLE_NAME_LEN);
if (strstr(old_name, TEMP_TABLE_PATH_PREFIX) == NULL) {
innobase_convert_to_system_charset(
strchr(old_name_cs_filename, '/') + 1,
strchr(old_name, '/') + 1,
MAX_TABLE_NAME_LEN, &errors);
if (errors) {
/* There has been an error to convert
old table into UTF-8. This probably
means that the old table name is
actually in UTF-8. */
innobase_convert_to_filename_charset(
strchr(old_name_cs_filename,
'/') + 1,
strchr(old_name, '/') + 1,
MAX_TABLE_NAME_LEN);
} else {
/* Old name already in
my_charset_filename */
strncpy(old_name_cs_filename, old_name,
MAX_TABLE_NAME_LEN);
}
}
strncpy(fkid, foreign->id, MAX_TABLE_NAME_LEN);
if (strstr(fkid, TEMP_TABLE_PATH_PREFIX) == NULL) {
innobase_convert_to_filename_charset(
strchr(fkid, '/') + 1,
strchr(foreign->id, '/') + 1,
MAX_TABLE_NAME_LEN+20);
} else {
on_tmp = TRUE;
}
old_id = mem_strdup(foreign->id);
if (ut_strlen(foreign->id) > ut_strlen(old_name)
if (ut_strlen(fkid) > ut_strlen(old_name_cs_filename)
+ ((sizeof dict_ibfk) - 1)
&& !memcmp(foreign->id, old_name,
ut_strlen(old_name))
&& !memcmp(foreign->id + ut_strlen(old_name),
&& !memcmp(fkid, old_name_cs_filename,
ut_strlen(old_name_cs_filename))
&& !memcmp(fkid + ut_strlen(old_name_cs_filename),
dict_ibfk, (sizeof dict_ibfk) - 1)) {
/* This is a generated >= 4.0.18 format id */
char table_name[MAX_TABLE_NAME_LEN] = "";
uint errors = 0;
if (strlen(table->name) > strlen(old_name)) {
foreign->id = mem_heap_alloc(
foreign->heap,
@ -1142,11 +1201,36 @@ dict_table_rename_in_cache(
+ strlen(old_id) + 1);
}
/* Convert the table name to UTF-8 */
strncpy(table_name, table->name,
MAX_TABLE_NAME_LEN);
innobase_convert_to_system_charset(
strchr(table_name, '/') + 1,
strchr(table->name, '/') + 1,
MAX_TABLE_NAME_LEN, &errors);
if (errors) {
/* Table name could not be converted
from charset my_charset_filename to
UTF-8. This means that the table name
is already in UTF-8 (#mysql#50). */
strncpy(table_name, table->name,
MAX_TABLE_NAME_LEN);
}
/* Replace the prefix 'databasename/tablename'
with the new names */
strcpy(foreign->id, table->name);
strcat(foreign->id,
old_id + ut_strlen(old_name));
strcpy(foreign->id, table_name);
if (on_tmp) {
strcat(foreign->id,
old_id + ut_strlen(old_name));
} else {
sprintf(strchr(foreign->id, '/') + 1,
"%s%s",
strchr(table_name, '/') +1,
strstr(old_id, "_ibfk_") );
}
} else {
/* This is a >= 4.0.18 format id where the user
gave the id name */
@ -1529,6 +1613,10 @@ dict_index_too_big_for_tree(
/* maximum allowed size of a node pointer record */
ulint page_ptr_max;
DBUG_EXECUTE_IF(
"ib_force_create_table",
return(FALSE););
comp = dict_table_is_comp(table);
zip_size = dict_table_zip_size(table);
@ -1543,7 +1631,10 @@ dict_index_too_big_for_tree(
number in the page modification log. The maximum
allowed node pointer size is half that. */
page_rec_max = page_zip_empty_size(new_index->n_fields,
zip_size) - 1;
zip_size);
if (page_rec_max) {
page_rec_max--;
}
page_ptr_max = page_rec_max / 2;
/* On a compressed page, there is a two-byte entry in
the dense page directory for every record. But there
@ -4707,7 +4798,12 @@ dict_update_statistics(
update/recalc the stats if they have
not been initialized yet, otherwise
do nothing */
ibool sync) /*!< in: TRUE if must update SYS_STATS */
ibool sync, /*!< in: TRUE if must update
SYS_STATS */
ibool only_calc_if_changed_too_much)/*!< in: only
update/recalc the stats if the table
has been changed too much since the
last stats update/recalc */
{
dict_index_t* index;
ulint sum_of_index_sizes = 0;
@ -4758,7 +4854,10 @@ dict_update_statistics(
dict_table_stats_lock(table, RW_X_LATCH);
if (only_calc_if_missing_stats && table->stat_initialized) {
if ((only_calc_if_missing_stats && table->stat_initialized)
|| (only_calc_if_changed_too_much
&& !DICT_TABLE_CHANGED_TOO_MUCH(table))) {
dict_table_stats_unlock(table, RW_X_LATCH);
return;
}
@ -5000,8 +5099,14 @@ dict_table_print_low(
ut_ad(mutex_own(&(dict_sys->mutex)));
if (srv_stats_auto_update)
dict_update_statistics(table, FALSE /* update even if initialized */, FALSE);
if (srv_stats_auto_update) {
dict_update_statistics(
table,
FALSE /* update even if initialized */,
FALSE,
FALSE /* update even if not changed too much */);
}
dict_table_stats_lock(table, RW_S_LATCH);

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2013, Innobase Oy. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -355,8 +355,11 @@ dict_process_sys_tables_rec(
/* Update statistics if DICT_TABLE_UPDATE_STATS
is set */
dict_update_statistics(*table, FALSE /* update even if
initialized */, FALSE);
dict_update_statistics(
*table,
FALSE, /* update even if initialized */
FALSE,
FALSE /* update even if not changed too much */);
}
return(NULL);

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@ -35,7 +35,7 @@ UNIV_INTERN
dyn_block_t*
dyn_array_add_block(
/*================*/
dyn_array_t* arr) /*!< in: dyn array */
dyn_array_t* arr) /*!< in/out: dyn array */
{
mem_heap_t* heap;
dyn_block_t* block;

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -1883,11 +1883,63 @@ fil_write_flushed_lsn_to_data_files(
return(DB_SUCCESS);
}
/*******************************************************************//**
Checks the consistency of the first data page of a data file
at database startup.
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
static __attribute__((warn_unused_result))
const char*
fil_check_first_page(
/*=================*/
const page_t* page, /*!< in: data page */
ibool first_page) /*!< in: TRUE if this is the
first page of the tablespace */
{
ulint space_id;
ulint flags;
if (srv_force_recovery >= SRV_FORCE_IGNORE_CORRUPT) {
return(NULL);
}
space_id = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_ID + page);
flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page);
if (first_page && !space_id && !flags) {
ulint nonzero_bytes = UNIV_PAGE_SIZE;
const byte* b = page;
while (!*b && --nonzero_bytes) {
b++;
}
if (!nonzero_bytes) {
return("space header page consists of zero bytes");
}
}
if (buf_page_is_corrupted(
FALSE, page, dict_table_flags_to_zip_size(flags))) {
return("checksum mismatch");
}
if (!first_page
|| (page_get_space_id(page) == space_id
&& page_get_page_no(page) == 0)) {
return(NULL);
}
return("inconsistent data in space header");
}
/*******************************************************************//**
Reads the flushed lsn, arch no, and tablespace flag fields from a data
file at database startup. */
file at database startup.
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
UNIV_INTERN
void
const char*
fil_read_first_page(
/*================*/
os_file_t data_file, /*!< in: open data file */
@ -1909,6 +1961,7 @@ fil_read_first_page(
byte* buf;
page_t* page;
ib_uint64_t flushed_lsn;
const char* check_msg;
buf = ut_malloc(2 * UNIV_PAGE_SIZE);
/* Align the memory for a possible read from a raw device */
@ -1916,13 +1969,18 @@ fil_read_first_page(
os_file_read(data_file, page, 0, 0, UNIV_PAGE_SIZE);
*flags = mach_read_from_4(page +
FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
*flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page);
flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN);
check_msg = fil_check_first_page(page, !one_read_already);
ut_free(buf);
if (check_msg) {
return(check_msg);
}
if (!one_read_already) {
*min_flushed_lsn = flushed_lsn;
*max_flushed_lsn = flushed_lsn;
@ -1930,7 +1988,7 @@ fil_read_first_page(
*min_arch_log_no = arch_log_no;
*max_arch_log_no = arch_log_no;
#endif /* UNIV_LOG_ARCHIVE */
return;
return(NULL);
}
if (*min_flushed_lsn > flushed_lsn) {
@ -1947,6 +2005,8 @@ fil_read_first_page(
*max_arch_log_no = arch_log_no;
}
#endif /* UNIV_LOG_ARCHIVE */
return(NULL);
}
/*================ SINGLE-TABLE TABLESPACES ==========================*/
@ -3271,6 +3331,7 @@ fil_open_single_table_tablespace(
os_file_t file;
char* filepath;
ibool success;
const char* check_msg;
byte* buf2;
byte* page;
ulint space_id;
@ -3331,6 +3392,8 @@ fil_open_single_table_tablespace(
success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
check_msg = fil_check_first_page(page, TRUE);
/* We have to read the tablespace id and flags from the file. */
space_id = fsp_header_get_space_id(page);
@ -3366,7 +3429,7 @@ fil_open_single_table_tablespace(
current_lsn = log_get_lsn();
/* check the header page's consistency */
if (buf_page_is_corrupted(page,
if (buf_page_is_corrupted(TRUE, page,
dict_table_flags_to_zip_size(space_flags))) {
fprintf(stderr, "InnoDB: page 0 of %s seems corrupt.\n", filepath);
file_is_corrupt = TRUE;
@ -3788,8 +3851,20 @@ skip_write:
ut_free(buf2);
if (UNIV_UNLIKELY(space_id != id
|| space_flags != (flags & ~(~0 << DICT_TF_BITS)))) {
if (check_msg) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Error: %s in file ", check_msg);
ut_print_filename(stderr, filepath);
fprintf(stderr, " (tablespace id=%lu, flags=%lu)\n"
"InnoDB: Please refer to " REFMAN
"innodb-troubleshooting-datadict.html\n",
(ulong) id, (ulong) flags);
success = FALSE;
goto func_exit;
}
if (space_id != id
|| space_flags != (flags & ~(~0 << DICT_TF_BITS))) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: tablespace id and flags in file ",
@ -4280,10 +4355,21 @@ fil_load_single_table_tablespace(
page = ut_align(buf2, UNIV_PAGE_SIZE);
if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
const char* check_msg;
success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
/* We have to read the tablespace id from the file */
check_msg = fil_check_first_page(page, TRUE);
if (check_msg) {
fprintf(stderr,
"InnoDB: Error: %s in file %s",
check_msg, filepath);
goto func_exit;
}
space_id = fsp_header_get_space_id(page);
flags = fsp_header_get_flags(page);
} else {
@ -4861,6 +4947,26 @@ fil_extend_space_to_desired_size(
start_page_no = space->size;
file_start_page_no = space->size - node->size;
#ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) {
offset_high = (size_after_extend - file_start_page_no)
* page_size / (4ULL * 1024 * 1024 * 1024);
offset_low = (size_after_extend - file_start_page_no)
* page_size % (4ULL * 1024 * 1024 * 1024);
mutex_exit(&fil_system->mutex);
success = os_file_set_size(node->name, node->handle,
offset_low, offset_high);
mutex_enter(&fil_system->mutex);
if (success) {
node->size += (size_after_extend - start_page_no);
space->size += (size_after_extend - start_page_no);
os_has_said_disk_full = FALSE;
}
goto complete_io;
}
#endif
/* Extend at most 64 pages at a time */
buf_size = ut_min(64, size_after_extend - start_page_no) * page_size;
buf2 = mem_alloc(buf_size + page_size);
@ -4919,6 +5025,10 @@ fil_extend_space_to_desired_size(
fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
#ifdef HAVE_POSIX_FALLOCATE
complete_io:
#endif
*actual_size = space->size;
#ifndef UNIV_HOTBACKUP

View file

@ -2913,15 +2913,15 @@ fsp_reserve_free_pages(
ulint space, /*!< in: space id, must be != 0 */
fsp_header_t* space_header, /*!< in: header of that space,
x-latched */
ulint size, /*!< in: size of the tablespace in pages,
must be < FSP_EXTENT_SIZE / 2 */
ulint size, /*!< in: size of the tablespace in
pages, must be < FSP_EXTENT_SIZE */
mtr_t* mtr) /*!< in: mtr */
{
xdes_t* descr;
ulint n_used;
ut_a(space != 0);
ut_a(size < FSP_EXTENT_SIZE / 2);
ut_a(size < FSP_EXTENT_SIZE);
descr = xdes_get_descriptor_with_space_hdr(space_header, space, 0,
mtr);
@ -3004,7 +3004,7 @@ fsp_reserve_free_extents(
try_again:
size = mtr_read_ulint(space_header + FSP_SIZE, MLOG_4BYTES, mtr);
if (size < FSP_EXTENT_SIZE / 2) {
if (size < FSP_EXTENT_SIZE) {
/* Use different rules for small single-table tablespaces */
*n_reserved = 0;
return(fsp_reserve_free_pages(space, space_header, size, mtr));
@ -3019,11 +3019,8 @@ try_again:
some of them will contain extent descriptor pages, and therefore
will not be free extents */
if (size <= free_limit) {
n_free_up = 0;
} else {
n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
}
ut_ad(size >= free_limit);
n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
if (n_free_up > 0) {
n_free_up--;

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@ -186,6 +186,7 @@ static my_bool innobase_file_format_check = TRUE;
static my_bool innobase_log_archive = FALSE;
static char* innobase_log_arch_dir = NULL;
#endif /* UNIV_LOG_ARCHIVE */
static my_bool innobase_use_atomic_writes = FALSE;
static my_bool innobase_use_doublewrite = TRUE;
static my_bool innobase_use_checksums = TRUE;
static my_bool innobase_fast_checksum = FALSE;
@ -205,7 +206,6 @@ static uint innobase_buffer_pool_shm_key = 0;
static ulong srv_lazy_drop_table = 0;
static char* internal_innobase_data_file_path = NULL;
static char* innodb_version_str = (char*) INNODB_VERSION_STR;
@ -866,6 +866,10 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_rows_read, SHOW_LONG},
{"rows_updated",
(char*) &export_vars.innodb_rows_updated, SHOW_LONG},
{"read_views_memory",
(char*) &export_vars.innodb_read_views_memory, SHOW_LONG},
{"descriptors_memory",
(char*) &export_vars.innodb_descriptors_memory, SHOW_LONG},
{"s_lock_os_waits",
(char*) &export_vars.innodb_s_lock_os_waits, SHOW_LONGLONG},
{"s_lock_spin_rounds",
@ -1303,6 +1307,8 @@ convert_error_code_to_mysql(
return(HA_ERR_UNDO_REC_TOO_BIG);
case DB_OUT_OF_MEMORY:
return(HA_ERR_OUT_OF_MEM);
case DB_IDENTIFIER_TOO_LONG:
return(HA_ERR_INTERNAL_ERROR);
}
}
@ -1383,6 +1389,31 @@ innobase_convert_from_table_id(
strconvert(cs, from, &my_charset_filename, to, (uint) len, &errors);
}
/**********************************************************************
Check if the length of the identifier exceeds the maximum allowed.
return true when length of identifier is too long. */
extern "C"
my_bool
innobase_check_identifier_length(
/*=============================*/
const char* id) /* in: FK identifier to check excluding the
database portion. */
{
int well_formed_error = 0;
CHARSET_INFO *cs = system_charset_info;
DBUG_ENTER("innobase_check_identifier_length");
uint res = cs->cset->well_formed_len(cs, id, id + strlen(id),
NAME_CHAR_LEN,
&well_formed_error);
if (well_formed_error || res == NAME_CHAR_LEN) {
my_error(ER_TOO_LONG_IDENT, MYF(0), id);
DBUG_RETURN(true);
}
DBUG_RETURN(false);
}
/******************************************************************//**
Converts an identifier to UTF-8. */
extern "C" UNIV_INTERN
@ -3082,6 +3113,39 @@ innobase_change_buffering_inited_ok:
srv_kill_idle_transaction = 0;
#endif
srv_use_atomic_writes = (ibool) innobase_use_atomic_writes;
if (innobase_use_atomic_writes) {
fprintf(stderr, "InnoDB: using atomic writes.\n");
/* Force doublewrite buffer off, atomic writes replace it. */
if (srv_use_doublewrite_buf) {
fprintf(stderr,
"InnoDB: Switching off doublewrite buffer "
"because of atomic writes.\n");
innobase_use_doublewrite = FALSE;
srv_use_doublewrite_buf = FALSE;
}
/* Force O_DIRECT on Unixes (on Windows writes are always
unbuffered)*/
#ifndef _WIN32
if(!innobase_file_flush_method ||
!strstr(innobase_file_flush_method, "O_DIRECT")) {
innobase_file_flush_method =
srv_file_flush_method_str = (char*)"O_DIRECT";
fprintf(stderr,
"InnoDB: using O_DIRECT due to atomic "
"writes.\n");
}
#endif
#ifdef HAVE_POSIX_FALLOCATE
/* Due to a bug in directFS, using atomics needs
posix_fallocate() to extend the file, because pwrite() past the
end of the file won't work */
srv_use_posix_fallocate = TRUE;
#endif
}
#ifdef HAVE_PSI_INTERFACE
/* Register keys with MySQL performance schema */
if (PSI_server) {
@ -4579,7 +4643,6 @@ ha_innobase::open(
dict_table_t* ib_table;
char norm_name[1000];
THD* thd;
ulint retries = 0;
char* is_part = NULL;
ibool par_case_name_set = FALSE;
char par_case_name[MAX_FULL_NAME_LEN + 1];
@ -4619,17 +4682,13 @@ ha_innobase::open(
upd_buf_size = 0;
/* We look for pattern #P# to see if the table is partitioned
MySQL table. The retry logic for partitioned tables is a
workaround for http://bugs.mysql.com/bug.php?id=33349. Look
at support issue https://support.mysql.com/view.php?id=21080
for more details. */
MySQL table. */
#ifdef __WIN__
is_part = strstr(norm_name, "#p#");
#else
is_part = strstr(norm_name, "#P#");
#endif /* __WIN__ */
retry:
/* Get pointer to a table object in InnoDB dictionary cache */
ib_table = dict_table_get(norm_name, TRUE);
@ -4646,7 +4705,7 @@ retry:
share->ib_table = ib_table;
if (NULL == ib_table) {
if (is_part && retries < 10) {
if (is_part) {
/* MySQL partition engine hard codes the file name
separator as "#P#". The text case is fixed even if
lower_case_table_names is set to 1 or 2. This is true
@ -4689,11 +4748,7 @@ retry:
ib_table = dict_table_get(
par_case_name, FALSE);
}
if (!ib_table) {
++retries;
os_thread_sleep(100000);
goto retry;
} else {
if (ib_table) {
#ifndef __WIN__
sql_print_warning("Partition table %s opened "
"after converting to lower "
@ -4719,9 +4774,8 @@ retry:
}
if (is_part) {
sql_print_error("Failed to open table %s after "
"%lu attempts.\n", norm_name,
retries);
sql_print_error("Failed to open table %s.\n",
norm_name);
}
sql_print_error("Cannot find or open table %s from\n"
@ -6475,6 +6529,8 @@ ha_innobase::unlock_row(void)
{
DBUG_ENTER("ha_innobase::unlock_row");
ut_ad(prebuilt->trx->state == TRX_ACTIVE);
/* Consistent read does not take any locks, thus there is
nothing to unlock. */
@ -8516,12 +8572,18 @@ innobase_rename_table(
DEBUG_SYNC_C("innodb_rename_table_ready");
/* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */
no deadlocks can occur then in these operations. Start the
transaction first to avoid a possible deadlock in the server. */
trx_start_if_not_started(trx);
if (lock_and_commit) {
row_mysql_lock_data_dictionary(trx);
}
/* Flag this transaction as a dictionary operation, so that
the data dictionary will be locked in crash recovery. */
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
error = row_rename_table_for_mysql(
norm_from, norm_to, trx, lock_and_commit);
@ -9072,9 +9134,11 @@ ha_innobase::info_low(
prebuilt->trx->op_info = "updating table statistics";
dict_update_statistics(ib_table,
FALSE /* update even if stats
are initialized */, called_from_analyze);
dict_update_statistics(
ib_table,
FALSE, /* update even if initialized */
called_from_analyze,
FALSE /* update even if not changed too much */);
prebuilt->trx->op_info = "returning various info to MySQL";
}
@ -12264,6 +12328,63 @@ innodb_change_buffering_update(
*static_cast<const char*const*>(save);
}
#ifndef DBUG_OFF
static char* srv_buffer_pool_evict;
/****************************************************************//**
Called on SET GLOBAL innodb_buffer_pool_evict=...
Handles some values specially, to evict pages from the buffer pool.
SET GLOBAL innodb_buffer_pool_evict='uncompressed'
evicts all uncompressed page frames of compressed tablespaces. */
static
void
innodb_buffer_pool_evict_update(
/*============================*/
THD* thd, /*!< in: thread handle */
struct st_mysql_sys_var*var, /*!< in: pointer to system variable */
void* var_ptr,/*!< out: ignored */
const void* save) /*!< in: immediate result
from check function */
{
if (const char* op = *static_cast<const char*const*>(save)) {
if (!strcmp(op, "uncompressed")) {
/* Evict all uncompressed pages of compressed
tables from the buffer pool. Keep the compressed
pages in the buffer pool. */
for (ulint i = 0; i < srv_buf_pool_instances; i++) {
buf_pool_t* buf_pool = &buf_pool_ptr[i];
//buf_pool_mutex_enter(buf_pool);
mutex_enter(&buf_pool->LRU_list_mutex);
for (buf_block_t* block = UT_LIST_GET_LAST(
buf_pool->unzip_LRU);
block != NULL; ) {
buf_block_t* prev_block
= UT_LIST_GET_PREV(unzip_LRU,
block);
ut_ad(buf_block_get_state(block)
== BUF_BLOCK_FILE_PAGE);
ut_ad(block->in_unzip_LRU_list);
ut_ad(block->page.in_LRU_list);
mutex_enter(&block->mutex);
buf_LRU_free_block(&block->page,
FALSE, FALSE);
mutex_exit(&block->mutex);
block = prev_block;
}
mutex_exit(&buf_pool->LRU_list_mutex);
//buf_pool_mutex_exit(buf_pool);
}
}
}
}
#endif /* !DBUG_OFF */
static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{
innodb_export_status();
@ -12425,6 +12546,15 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
"Disable with --skip-innodb-doublewrite.",
NULL, NULL, TRUE);
static MYSQL_SYSVAR_BOOL(use_atomic_writes, innobase_use_atomic_writes,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Prevent partial page writes, via atomic writes (beta). "
"The option is used to prevent partial writes in case of a crash/poweroff, "
"as faster alternative to doublewrite buffer. "
"Currently this option works only "
"on Linux only with FusionIO device, and directFS filesystem.",
NULL, NULL, FALSE);
static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
PLUGIN_VAR_RQCMDARG,
"Number of IOPs the server can do. Tunes the background IO rate",
@ -12637,6 +12767,13 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
"Data file autoextend increment in megabytes",
NULL, NULL, 8L, 1L, 1000L, 0);
#ifndef DBUG_OFF
static MYSQL_SYSVAR_STR(buffer_pool_evict, srv_buffer_pool_evict,
PLUGIN_VAR_RQCMDARG,
"Evict pages from the InnoDB buffer pool.",
NULL, innodb_buffer_pool_evict_update, "");
#endif /* !DBUG_OFF */
static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
@ -13055,6 +13192,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(log_block_size),
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
#ifndef DBUG_OFF
MYSQL_SYSVAR(buffer_pool_evict),
#endif /* !DBUG_OFF */
MYSQL_SYSVAR(buffer_pool_size),
MYSQL_SYSVAR(buffer_pool_populate),
MYSQL_SYSVAR(buffer_pool_instances),
@ -13069,6 +13209,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(doublewrite_file),
MYSQL_SYSVAR(data_home_dir),
MYSQL_SYSVAR(doublewrite),
MYSQL_SYSVAR(use_atomic_writes),
MYSQL_SYSVAR(recovery_stats),
MYSQL_SYSVAR(fast_shutdown),
MYSQL_SYSVAR(file_io_threads),
@ -13352,3 +13493,55 @@ test_innobase_convert_name()
}
#endif /* UNIV_COMPILE_TEST_FUNCS */
/**********************************************************************
Converts an identifier from my_charset_filename to UTF-8 charset. */
extern "C"
uint
innobase_convert_to_filename_charset(
/*=================================*/
char* to, /* out: converted identifier */
const char* from, /* in: identifier to convert */
ulint len) /* in: length of 'to', in bytes */
{
uint errors;
uint rlen;
CHARSET_INFO* cs_to = &my_charset_filename;
CHARSET_INFO* cs_from = system_charset_info;
rlen = strconvert(cs_from, from, cs_to, to, len, &errors);
if (errors) {
fprintf(stderr, "InnoDB: There was a problem in converting"
"'%s' in charset %s to charset %s", from, cs_from->name,
cs_to->name);
}
return(rlen);
}
/**********************************************************************
Converts an identifier from my_charset_filename to UTF-8 charset. */
extern "C"
uint
innobase_convert_to_system_charset(
/*===============================*/
char* to, /* out: converted identifier */
const char* from, /* in: identifier to convert */
ulint len, /* in: length of 'to', in bytes */
uint* errors) /* out: error return */
{
uint rlen;
CHARSET_INFO* cs1 = &my_charset_filename;
CHARSET_INFO* cs2 = system_charset_info;
rlen = strconvert(cs1, from, cs2, to, len, errors);
if (*errors) {
fprintf(stderr, "InnoDB: There was a problem in converting"
"'%s' in charset %s to charset %s", from, cs1->name,
cs2->name);
}
return(rlen);
}

View file

@ -52,7 +52,7 @@ extern "C" {
#include "dict0mem.h"
#include "dict0types.h"
#include "ha_prototypes.h" /* for innobase_convert_name() */
#include "srv0srv.h" /* for srv_track_changed_pages */
#include "srv0srv.h" /* for srv_max_changed_pages */
#include "srv0start.h" /* for srv_was_started */
#include "trx0i_s.h"
#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
@ -2314,6 +2314,7 @@ i_s_innodb_buffer_stats_fill_table(
buf_pool_info_t* pool_info;
DBUG_ENTER("i_s_innodb_buffer_fill_general");
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
/* Only allow the PROCESS privilege holder to access the stats */
if (check_global_access(thd, PROCESS_ACL)) {
@ -2930,6 +2931,7 @@ i_s_innodb_fill_buffer_pool(
mem_heap_t* heap;
DBUG_ENTER("i_s_innodb_fill_buffer_pool");
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
heap = mem_heap_create(10000);
@ -2970,7 +2972,8 @@ i_s_innodb_fill_buffer_pool(
i_s_innodb_buffer_page_get_info(
&block->page, pool_id, block_id,
info_buffer + num_page);
mutex_exit(block_mutex);
if (block_mutex)
mutex_exit(block_mutex);
block_id++;
num_page++;
}
@ -3496,7 +3499,6 @@ i_s_innodb_fill_buffer_lru(
mutex_t* block_mutex;
DBUG_ENTER("i_s_innodb_fill_buffer_lru");
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
/* Obtain buf_pool mutex before allocate info_buffer, since
@ -7472,6 +7474,7 @@ i_s_innodb_changed_pages_fill(
ib_uint64_t output_rows_num = 0UL;
ib_uint64_t max_lsn = IB_ULONGLONG_MAX;
ib_uint64_t min_lsn = 0ULL;
int ret = 0;
DBUG_ENTER("i_s_innodb_changed_pages_fill");
@ -7483,10 +7486,6 @@ i_s_innodb_changed_pages_fill(
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
if (!srv_track_changed_pages) {
DBUG_RETURN(0);
}
if (cond) {
limit_lsn_range_from_condition(table, cond, &min_lsn,
&max_lsn);
@ -7562,8 +7561,13 @@ i_s_innodb_changed_pages_fill(
++output_rows_num;
}
if (i.failed) {
my_error(ER_CANT_FIND_SYSTEM_REC, MYF(0));
ret = 1;
}
log_online_bitmap_iterator_release(&i);
DBUG_RETURN(0);
DBUG_RETURN(ret);
}
static

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -4319,7 +4319,7 @@ Deletes from ibuf the record on which pcur is positioned. If we have to
resort to a pessimistic delete, this function commits mtr and closes
the cursor.
@return TRUE if mtr was committed and pcur closed in this operation */
static
static __attribute__((warn_unused_result))
ibool
ibuf_delete_rec(
/*============*/
@ -4625,6 +4625,12 @@ ibuf_merge_or_delete_for_page(
loop:
ibuf_mtr_start(&mtr);
/* Position pcur in the insert buffer at the first entry for this
index page */
btr_pcur_open_on_user_rec(
ibuf->index, search_tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF,
&pcur, &mtr);
if (block) {
ibool success;
@ -4643,12 +4649,6 @@ loop:
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
}
/* Position pcur in the insert buffer at the first entry for this
index page */
btr_pcur_open_on_user_rec(
ibuf->index, search_tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF,
&pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) {
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
@ -4733,6 +4733,16 @@ loop:
== page_no);
ut_ad(ibuf_rec_get_space(&mtr, rec) == space);
/* Mark the change buffer record processed,
so that it will not be merged again in case
the server crashes between the following
mtr_commit() and the subsequent mtr_commit()
of deleting the change buffer record. */
btr_cur_set_deleted_flag_for_ibuf(
btr_pcur_get_rec(&pcur), NULL,
TRUE, &mtr);
btr_pcur_store_position(&pcur, &mtr);
ibuf_btr_pcur_commit_specify_mtr(&pcur, &mtr);
@ -4781,6 +4791,7 @@ loop:
/* Deletion was pessimistic and mtr was committed:
we start from the beginning again */
ut_ad(mtr.state == MTR_COMMITTED);
goto loop;
} else if (btr_pcur_is_after_last_on_page(&pcur)) {
ibuf_mtr_commit(&mtr);
@ -4911,6 +4922,7 @@ loop:
/* Deletion was pessimistic and mtr was committed:
we start from the beginning again */
ut_ad(mtr.state == MTR_COMMITTED);
goto loop;
}

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -684,9 +684,12 @@ UNIV_INTERN
ibool
buf_page_is_corrupted(
/*==================*/
ibool check_lsn, /*!< in: TRUE if we need to check
and complain about the LSN */
const byte* read_buf, /*!< in: a database page */
ulint zip_size); /*!< in: size of compressed page;
ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */
__attribute__((warn_unused_result));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Gets the space id, page offset, and byte offset within page of a

View file

@ -114,6 +114,7 @@ enum db_err {
DB_UNDO_RECORD_TOO_BIG, /* the undo log record is too big */
DB_TABLE_IN_FK_CHECK, /* table is being used in foreign
key check */
DB_IDENTIFIER_TOO_LONG, /* Identifier name too long */
/* The following are partial failure codes */
DB_FAIL = 1000,

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -1124,6 +1124,18 @@ ulint
dict_index_calc_min_rec_len(
/*========================*/
const dict_index_t* index); /*!< in: index */
/** Calculate new statistics if 1 / 16 of table has been modified
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often.
@param t table
@return true if the table has changed too much and stats need to be
recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
((ib_int64_t) (t)->stat_modified_counter > 16 + (t)->stat_n_rows / 16)
/*********************************************************************//**
Calculates new estimates for table and index statistics. The statistics
are used in query optimization. */
@ -1132,11 +1144,15 @@ void
dict_update_statistics(
/*===================*/
dict_table_t* table, /*!< in/out: table */
ibool only_calc_if_missing_stats, /*!< in: only
ibool only_calc_if_missing_stats,/*!< in: only
update/recalc the stats if they have
not been initialized yet, otherwise
do nothing */
ibool sync);
ibool sync,
ibool only_calc_if_changed_too_much);/*!< in: only
update/recalc the stats if the table
has been changed too much since the
last stats update/recalc */
/*********************************************************************//**
*/
UNIV_INTERN

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -127,7 +127,7 @@ This could result in rescursive calls and out of stack error eventually.
DICT_FK_MAX_RECURSIVE_LOAD defines the maximum number of recursive loads,
when exceeded, the child table will not be loaded. It will be loaded when
the foreign constraint check needs to be run. */
#define DICT_FK_MAX_RECURSIVE_LOAD 255
#define DICT_FK_MAX_RECURSIVE_LOAD 20
/** Similarly, when tables are chained together with foreign key constraints
with on cascading delete/update clause, delete from parent table could
@ -607,7 +607,13 @@ struct dict_table_struct{
/*!< flag: TRUE if the maximum length of
a single row exceeds BIG_ROW_SIZE;
initialized in dict_table_add_to_cache() */
/** Statistics for query optimization */
/** Statistics for query optimization.
The following stat_* members are usually
protected by dict_table_stats_lock(). In
some exceptional cases (performance critical
code paths) we access or modify stat_n_rows
and stat_modified_counter without any
protection. */
/* @{ */
unsigned stat_initialized:1; /*!< TRUE if statistics have
been calculated the first time

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -58,4 +58,7 @@ enum dict_err_ignore {
typedef enum dict_err_ignore dict_err_ignore_t;
#define TEMP_TABLE_PREFIX "#sql"
#define TEMP_TABLE_PATH_PREFIX "/" TEMP_TABLE_PREFIX
#endif

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@ -47,15 +47,17 @@ UNIV_INLINE
dyn_array_t*
dyn_array_create(
/*=============*/
dyn_array_t* arr); /*!< in: pointer to a memory buffer of
dyn_array_t* arr) /*!< in/out memory buffer of
size sizeof(dyn_array_t) */
__attribute__((nonnull));
/************************************************************//**
Frees a dynamic array. */
UNIV_INLINE
void
dyn_array_free(
/*===========*/
dyn_array_t* arr); /*!< in: dyn array */
dyn_array_t* arr) /*!< in,own: dyn array */
__attribute__((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to a buffer in it.
After copying the elements, the caller must close the buffer using
@ -66,8 +68,9 @@ byte*
dyn_array_open(
/*===========*/
dyn_array_t* arr, /*!< in: dynamic array */
ulint size); /*!< in: size in bytes of the buffer; MUST be
ulint size) /*!< in: size in bytes of the buffer; MUST be
smaller than DYN_ARRAY_DATA_SIZE! */
__attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
Closes the buffer returned by dyn_array_open. */
UNIV_INLINE
@ -75,7 +78,8 @@ void
dyn_array_close(
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
byte* ptr); /*!< in: buffer space from ptr up was not used */
const byte* ptr) /*!< in: end of used space */
__attribute__((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to
the added element. The caller must copy the element to
@ -85,8 +89,9 @@ UNIV_INLINE
void*
dyn_array_push(
/*===========*/
dyn_array_t* arr, /*!< in: dynamic array */
ulint size); /*!< in: size in bytes of the element */
dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
__attribute__((nonnull, warn_unused_result));
/************************************************************//**
Returns pointer to an element in dyn array.
@return pointer to element */
@ -94,9 +99,10 @@ UNIV_INLINE
void*
dyn_array_get_element(
/*==================*/
dyn_array_t* arr, /*!< in: dyn array */
ulint pos); /*!< in: position of element as bytes
from array start */
const dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element
in bytes from array start */
__attribute__((nonnull, warn_unused_result));
/************************************************************//**
Returns the size of stored data in a dyn array.
@return data size in bytes */
@ -104,30 +110,33 @@ UNIV_INLINE
ulint
dyn_array_get_data_size(
/*====================*/
dyn_array_t* arr); /*!< in: dyn array */
const dyn_array_t* arr) /*!< in: dyn array */
__attribute__((nonnull, warn_unused_result, pure));
/************************************************************//**
Gets the first block in a dyn array. */
UNIV_INLINE
dyn_block_t*
dyn_array_get_first_block(
/*======================*/
dyn_array_t* arr); /*!< in: dyn array */
Gets the first block in a dyn array.
@param arr dyn array
@return first block */
#define dyn_array_get_first_block(arr) (arr)
/************************************************************//**
Gets the last block in a dyn array. */
UNIV_INLINE
dyn_block_t*
dyn_array_get_last_block(
/*=====================*/
dyn_array_t* arr); /*!< in: dyn array */
Gets the last block in a dyn array.
@param arr dyn array
@return last block */
#define dyn_array_get_last_block(arr) \
((arr)->heap ? UT_LIST_GET_LAST((arr)->base) : (arr))
/********************************************************************//**
Gets the next block in a dyn array.
@return pointer to next, NULL if end of list */
UNIV_INLINE
dyn_block_t*
dyn_array_get_next_block(
/*=====================*/
dyn_array_t* arr, /*!< in: dyn array */
dyn_block_t* block); /*!< in: dyn array block */
@param arr dyn array
@param block dyn array block
@return pointer to next, NULL if end of list */
#define dyn_array_get_next_block(arr, block) \
((arr)->heap ? UT_LIST_GET_NEXT(list, block) : NULL)
/********************************************************************//**
Gets the previous block in a dyn array.
@param arr dyn array
@param block dyn array block
@return pointer to previous, NULL if end of list */
#define dyn_array_get_prev_block(arr, block) \
((arr)->heap ? UT_LIST_GET_PREV(list, block) : NULL)
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
@return number of bytes used */
@ -135,7 +144,8 @@ UNIV_INLINE
ulint
dyn_block_get_used(
/*===============*/
dyn_block_t* block); /*!< in: dyn array block */
const dyn_block_t* block) /*!< in: dyn array block */
__attribute__((nonnull, warn_unused_result, pure));
/********************************************************************//**
Gets pointer to the start of data in a dyn array block.
@return pointer to data */
@ -143,16 +153,18 @@ UNIV_INLINE
byte*
dyn_block_get_data(
/*===============*/
dyn_block_t* block); /*!< in: dyn array block */
const dyn_block_t* block) /*!< in: dyn array block */
__attribute__((nonnull, warn_unused_result, pure));
/********************************************************//**
Pushes n bytes to a dyn array. */
UNIV_INLINE
void
dyn_push_string(
/*============*/
dyn_array_t* arr, /*!< in: dyn array */
dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
ulint len); /*!< in: string length */
ulint len) /*!< in: string length */
__attribute__((nonnull));
/*#################################################################*/

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@ -35,56 +35,8 @@ UNIV_INTERN
dyn_block_t*
dyn_array_add_block(
/*================*/
dyn_array_t* arr); /*!< in: dyn array */
/************************************************************//**
Gets the first block in a dyn array. */
UNIV_INLINE
dyn_block_t*
dyn_array_get_first_block(
/*======================*/
dyn_array_t* arr) /*!< in: dyn array */
{
return(arr);
}
/************************************************************//**
Gets the last block in a dyn array. */
UNIV_INLINE
dyn_block_t*
dyn_array_get_last_block(
/*=====================*/
dyn_array_t* arr) /*!< in: dyn array */
{
if (arr->heap == NULL) {
return(arr);
}
return(UT_LIST_GET_LAST(arr->base));
}
/********************************************************************//**
Gets the next block in a dyn array.
@return pointer to next, NULL if end of list */
UNIV_INLINE
dyn_block_t*
dyn_array_get_next_block(
/*=====================*/
dyn_array_t* arr, /*!< in: dyn array */
dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(arr && block);
if (arr->heap == NULL) {
ut_ad(arr == block);
return(NULL);
}
return(UT_LIST_GET_NEXT(list, block));
}
dyn_array_t* arr) /*!< in/out: dyn array */
__attribute__((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
@ -93,7 +45,7 @@ UNIV_INLINE
ulint
dyn_block_get_used(
/*===============*/
dyn_block_t* block) /*!< in: dyn array block */
const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);
@ -107,11 +59,11 @@ UNIV_INLINE
byte*
dyn_block_get_data(
/*===============*/
dyn_block_t* block) /*!< in: dyn array block */
const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);
return(block->data);
return((byte*) block->data);
}
/*********************************************************************//**
@ -121,7 +73,7 @@ UNIV_INLINE
dyn_array_t*
dyn_array_create(
/*=============*/
dyn_array_t* arr) /*!< in: pointer to a memory buffer of
dyn_array_t* arr) /*!< in/out: memory buffer of
size sizeof(dyn_array_t) */
{
ut_ad(arr);
@ -132,10 +84,9 @@ dyn_array_create(
arr->heap = NULL;
arr->used = 0;
#ifdef UNIV_DEBUG
arr->buf_end = 0;
arr->magic_n = DYN_BLOCK_MAGIC_N;
#endif
ut_d(arr->buf_end = 0);
ut_d(arr->magic_n = DYN_BLOCK_MAGIC_N);
return(arr);
}
@ -151,9 +102,7 @@ dyn_array_free(
mem_heap_free(arr->heap);
}
#ifdef UNIV_DEBUG
arr->magic_n = 0;
#endif
ut_d(arr->magic_n = 0);
}
/*********************************************************************//**
@ -164,7 +113,7 @@ UNIV_INLINE
void*
dyn_array_push(
/*===========*/
dyn_array_t* arr, /*!< in: dynamic array */
dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
{
dyn_block_t* block;
@ -176,24 +125,23 @@ dyn_array_push(
ut_ad(size);
block = arr;
used = block->used;
if (used + size > DYN_ARRAY_DATA_SIZE) {
if (block->used + size > DYN_ARRAY_DATA_SIZE) {
/* Get the last array block */
block = dyn_array_get_last_block(arr);
used = block->used;
if (used + size > DYN_ARRAY_DATA_SIZE) {
if (block->used + size > DYN_ARRAY_DATA_SIZE) {
block = dyn_array_add_block(arr);
used = block->used;
}
}
used = block->used;
block->used = used + size;
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
return((block->data) + used);
return(block->data + used);
}
/*********************************************************************//**
@ -210,7 +158,6 @@ dyn_array_open(
smaller than DYN_ARRAY_DATA_SIZE! */
{
dyn_block_t* block;
ulint used;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@ -218,28 +165,23 @@ dyn_array_open(
ut_ad(size);
block = arr;
used = block->used;
if (used + size > DYN_ARRAY_DATA_SIZE) {
if (block->used + size > DYN_ARRAY_DATA_SIZE) {
/* Get the last array block */
block = dyn_array_get_last_block(arr);
used = block->used;
if (used + size > DYN_ARRAY_DATA_SIZE) {
if (block->used + size > DYN_ARRAY_DATA_SIZE) {
block = dyn_array_add_block(arr);
used = block->used;
ut_a(size <= DYN_ARRAY_DATA_SIZE);
}
}
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
#ifdef UNIV_DEBUG
ut_ad(arr->buf_end == 0);
ut_d(arr->buf_end = block->used + size);
arr->buf_end = used + size;
#endif
return((block->data) + used);
return(block->data + block->used);
}
/*********************************************************************//**
@ -248,8 +190,8 @@ UNIV_INLINE
void
dyn_array_close(
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
byte* ptr) /*!< in: buffer space from ptr up was not used */
dyn_array_t* arr, /*!< in/out: dynamic array */
const byte* ptr) /*!< in: end of used space */
{
dyn_block_t* block;
@ -264,9 +206,7 @@ dyn_array_close(
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
#ifdef UNIV_DEBUG
arr->buf_end = 0;
#endif
ut_d(arr->buf_end = 0);
}
/************************************************************//**
@ -276,12 +216,11 @@ UNIV_INLINE
void*
dyn_array_get_element(
/*==================*/
dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element as bytes
from array start */
const dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element
in bytes from array start */
{
dyn_block_t* block;
ulint used;
const dyn_block_t* block;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@ -290,21 +229,23 @@ dyn_array_get_element(
block = dyn_array_get_first_block(arr);
if (arr->heap != NULL) {
used = dyn_block_get_used(block);
for (;;) {
ulint used = dyn_block_get_used(block);
if (pos < used) {
break;
}
while (pos >= used) {
pos -= used;
block = UT_LIST_GET_NEXT(list, block);
ut_ad(block);
used = dyn_block_get_used(block);
}
}
ut_ad(block);
ut_ad(dyn_block_get_used(block) >= pos);
return(block->data + pos);
return((byte*) block->data + pos);
}
/************************************************************//**
@ -314,10 +255,10 @@ UNIV_INLINE
ulint
dyn_array_get_data_size(
/*====================*/
dyn_array_t* arr) /*!< in: dyn array */
const dyn_array_t* arr) /*!< in: dyn array */
{
dyn_block_t* block;
ulint sum = 0;
const dyn_block_t* block;
ulint sum = 0;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@ -344,7 +285,7 @@ UNIV_INLINE
void
dyn_push_string(
/*============*/
dyn_array_t* arr, /*!< in: dyn array */
dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
ulint len) /*!< in: string length */
{

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -328,10 +328,12 @@ fil_write_flushed_lsn_to_data_files(
ulint arch_log_no); /*!< in: latest archived log
file number */
/*******************************************************************//**
Reads the flushed lsn and arch no fields from a data file at database
startup. */
Reads the flushed lsn, arch no, and tablespace flag fields from a data
file at database startup.
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
UNIV_INTERN
void
const char*
fil_read_first_page(
/*================*/
os_file_t data_file, /*!< in: open data file */
@ -347,8 +349,9 @@ fil_read_first_page(
#endif /* UNIV_LOG_ARCHIVE */
ib_uint64_t* min_flushed_lsn, /*!< out: min of flushed
lsn values in data files */
ib_uint64_t* max_flushed_lsn); /*!< out: max of flushed
ib_uint64_t* max_flushed_lsn) /*!< out: max of flushed
lsn values in data files */
__attribute__((warn_unused_result));
/*******************************************************************//**
Increments the count of pending operation, if space is not being deleted.
@return TRUE if being deleted, and operation should be skipped */

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2006, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -325,4 +325,35 @@ thd_merge_sort_block_size(
void* thd); /*!< in: thread handle (THD*), or NULL to query
the global merge_sort_block_size */
/**********************************************************************
Check if the length of the identifier exceeds the maximum allowed.
The input to this function is an identifier in charset my_charset_filename.
return true when length of identifier is too long. */
UNIV_INTERN
my_bool
innobase_check_identifier_length(
/*=============================*/
const char* id); /* in: identifier to check. it must belong
to charset my_charset_filename */
/**********************************************************************
Converts an identifier from my_charset_filename to UTF-8 charset. */
uint
innobase_convert_to_system_charset(
/*===============================*/
char* to, /* out: converted identifier */
const char* from, /* in: identifier to convert */
ulint len, /* in: length of 'to', in bytes */
uint* errors); /* out: error return */
/**********************************************************************
Converts an identifier from my_charset_filename to UTF-8 charset. */
uint
innobase_convert_to_filename_charset(
/*=================================*/
char* to, /* out: converted identifier */
const char* from, /* in: identifier to convert */
ulint len); /* in: length of 'to', in bytes */
#endif

View file

@ -400,7 +400,9 @@ log_group_read_log_seg(
byte* buf, /*!< in: buffer where to read */
log_group_t* group, /*!< in: log group */
ib_uint64_t start_lsn, /*!< in: read area start */
ib_uint64_t end_lsn); /*!< in: read area end */
ib_uint64_t end_lsn, /*!< in: read area end */
ibool release_mutex); /*!< in: whether the log_sys->mutex
should be released before the read */
/******************************************************//**
Writes a buffer to a log file group. */
UNIV_INTERN

View file

@ -159,6 +159,8 @@ struct log_online_bitmap_file_range_struct {
/** Struct for an iterator through all bits of changed pages bitmap blocks */
struct log_bitmap_iterator_struct
{
ibool failed; /*!< Has the iteration
stopped prematurely */
log_online_bitmap_file_range_t in_files; /*!< The bitmap files
for this iterator */
size_t in_i; /*!< Currently read

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -295,9 +295,10 @@ UNIV_INTERN
void
mtr_memo_release(
/*=============*/
mtr_t* mtr, /*!< in: mtr */
mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
ulint type); /*!< in: object type: MTR_MEMO_S_LOCK, ... */
ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
__attribute__((nonnull));
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**********************************************************//**
@ -309,7 +310,8 @@ mtr_memo_contains(
/*==============*/
mtr_t* mtr, /*!< in: mtr */
const void* object, /*!< in: object to search */
ulint type); /*!< in: type of object */
ulint type) /*!< in: type of object */
__attribute__((warn_unused_result, nonnull));
/**********************************************************//**
Checks if memo contains the given page.

View file

@ -21,7 +21,7 @@ Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
***********************************************************************/
@ -76,15 +76,19 @@ extern ulint os_n_pending_writes;
#endif
#ifdef __WIN__
#define SRV_PATH_SEPARATOR '\\'
/** File handle */
# define os_file_t HANDLE
# define os_file_invalid INVALID_HANDLE_VALUE
/** Convert a C file descriptor to a native file handle
@param fd file descriptor
@return native file handle */
# define OS_FILE_FROM_FD(fd) (HANDLE) _get_osfhandle(fd)
#else
#define SRV_PATH_SEPARATOR '/'
/** File handle */
typedef int os_file_t;
# define os_file_invalid (-1)
/** Convert a C file descriptor to a native file handle
@param fd file descriptor
@return native file handle */
@ -819,7 +823,6 @@ pfs_os_file_rename_func(
ulint src_line);/*!< in: line where the func invoked */
#endif /* UNIV_PFS_IO */
#ifdef UNIV_HOTBACKUP
/***********************************************************************//**
Closes a file handle.
@return TRUE if success */
@ -828,7 +831,6 @@ ibool
os_file_close_no_error_handling(
/*============================*/
os_file_t file); /*!< in, own: handle to a file */
#endif /* UNIV_HOTBACKUP */
/***********************************************************************//**
Gets a file size.
@return TRUE if success */

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2005, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -188,8 +188,8 @@ page_zip_rec_needs_ext(
one record on an empty leaf page. Subtract 1 byte for
the encoded heap number. Check also the available space
on the uncompressed page. */
return(rec_size - (REC_N_NEW_EXTRA_BYTES - 2)
>= (page_zip_empty_size(n_fields, zip_size) - 1)
return(rec_size - (REC_N_NEW_EXTRA_BYTES - 2 - 1)
>= page_zip_empty_size(n_fields, zip_size)
|| rec_size >= page_get_free_space_of_empty(TRUE) / 2);
}
@ -229,9 +229,7 @@ ibool
page_zip_get_trailer_len(
/*=====================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
ibool is_clust,/*!< in: TRUE if clustered index */
ulint* entry_size)/*!< out: size of the uncompressed
portion of a user record */
ibool is_clust)/*!< in: TRUE if clustered index */
{
ulint uncompressed_size;
@ -250,10 +248,6 @@ page_zip_get_trailer_len(
ut_ad(!page_zip->n_blobs);
}
if (entry_size) {
*entry_size = uncompressed_size;
}
return((page_dir_get_n_heap(page_zip->data) - 2)
* uncompressed_size
+ page_zip->n_blobs * BTR_EXTERN_FIELD_REF_SIZE);
@ -270,11 +264,9 @@ page_zip_max_ins_size(
const page_zip_des_t* page_zip,/*!< in: compressed page */
ibool is_clust)/*!< in: TRUE if clustered index */
{
ulint uncompressed_size;
ulint trailer_len;
trailer_len = page_zip_get_trailer_len(page_zip, is_clust,
&uncompressed_size);
trailer_len = page_zip_get_trailer_len(page_zip, is_clust);
/* When a record is created, a pointer may be added to
the dense directory.
@ -283,7 +275,7 @@ page_zip_max_ins_size(
Also the BLOB pointers will be allocated from there, but
we may as well count them in the length of the record. */
trailer_len += uncompressed_size;
trailer_len += PAGE_ZIP_DIR_SLOT_SIZE;
return((lint) page_zip_get_size(page_zip)
- trailer_len - page_zip->m_end
@ -303,13 +295,11 @@ page_zip_available(
ulint create) /*!< in: nonzero=add the record to
the heap */
{
ulint uncompressed_size;
ulint trailer_len;
ut_ad(length > REC_N_NEW_EXTRA_BYTES);
trailer_len = page_zip_get_trailer_len(page_zip, is_clust,
&uncompressed_size);
trailer_len = page_zip_get_trailer_len(page_zip, is_clust);
/* Subtract the fixed extra bytes and add the maximum
space needed for identifying the record (encoded heap_no). */
@ -323,7 +313,7 @@ page_zip_available(
Also the BLOB pointers will be allocated from there, but
we may as well count them in the length of the record. */
trailer_len += uncompressed_size;
trailer_len += PAGE_ZIP_DIR_SLOT_SIZE;
}
return(UNIV_LIKELY(length

View file

@ -246,6 +246,11 @@ extern ulong srv_sys_stats_root_page;
#endif
extern ibool srv_use_doublewrite_buf;
extern ibool srv_use_atomic_writes;
#ifdef HAVE_POSIX_FALLOCATE
extern ibool srv_use_posix_fallocate;
#endif
extern ibool srv_use_checksums;
extern ibool srv_fast_checksum;
@ -289,6 +294,9 @@ extern ulint srv_n_rows_updated;
extern ulint srv_n_rows_deleted;
extern ulint srv_n_rows_read;
extern ulint srv_read_views_memory;
extern ulint srv_descriptors_memory;
extern ibool srv_print_innodb_monitor;
extern ibool srv_print_innodb_lock_monitor;
extern ibool srv_print_innodb_tablespace_monitor;
@ -893,6 +901,8 @@ struct export_var_struct{
ulint innodb_rows_updated; /*!< srv_n_rows_updated */
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
ulint innodb_read_views_memory; /*!< srv_read_views_memory */
ulint innodb_descriptors_memory; /*!< srv_descriptors_memory */
ib_int64_t innodb_s_lock_os_waits;
ib_int64_t innodb_s_lock_spin_rounds;
ib_int64_t innodb_s_lock_spin_waits;

View file

@ -55,47 +55,8 @@ ut_dbg_assertion_failed(
ulint line) /*!< in: line number of the assertion */
UNIV_COLD __attribute__((nonnull(2)));
#if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
#elif defined(__GNUC__) && (__GNUC__ > 2)
# define UT_DBG_USE_ABORT
#endif
#ifndef UT_DBG_USE_ABORT
/** A null pointer that will be dereferenced to trigger a memory trap */
extern ulint* ut_dbg_null_ptr;
#endif
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
will stop at the next ut_a() or ut_ad(). */
extern ibool ut_dbg_stop_threads;
/*************************************************************//**
Stop a thread after assertion failure. */
UNIV_INTERN
void
ut_dbg_stop_thread(
/*===============*/
const char* file,
ulint line);
#endif
#ifdef UT_DBG_USE_ABORT
/** Abort the execution. */
# define UT_DBG_PANIC abort()
/** Stop threads (null operation) */
# define UT_DBG_STOP do {} while (0)
#else /* UT_DBG_USE_ABORT */
/** Abort the execution. */
# define UT_DBG_PANIC \
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
/** Stop threads in ut_a(). */
# define UT_DBG_STOP do \
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
#endif /* UT_DBG_USE_ABORT */
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */
@ -105,7 +66,6 @@ ut_dbg_stop_thread(
__FILE__, (ulint) __LINE__); \
UT_DBG_PANIC; \
} \
UT_DBG_STOP; \
} while (0)
/** Abort execution. */

View file

@ -2005,6 +2005,8 @@ lock_rec_lock_fast(
|| mode - (LOCK_MODE_MASK & mode) == 0
|| mode - (LOCK_MODE_MASK & mode) == LOCK_REC_NOT_GAP);
DBUG_EXECUTE_IF("innodb_report_deadlock", return(LOCK_REC_FAIL););
lock = lock_rec_get_first_on_page(block);
trx = thr_get_trx(thr);
@ -2082,6 +2084,8 @@ lock_rec_lock_slow(
trx = thr_get_trx(thr);
DBUG_EXECUTE_IF("innodb_report_deadlock", return(DB_DEADLOCK););
lock = lock_rec_has_expl(mode, block, heap_no, trx);
if (lock) {
if (lock->type_mode & LOCK_CONV_BY_OTHER) {
@ -4145,6 +4149,7 @@ lock_rec_unlock(
ut_ad(trx && rec);
ut_ad(block->frame == page_align(rec));
ut_ad(trx->state == TRX_ACTIVE);
heap_no = page_rec_get_heap_no(rec);
@ -5002,6 +5007,7 @@ lock_rec_validate_page(
{
const lock_t* lock;
const rec_t* rec;
dict_index_t* index;
ulint nth_lock = 0;
ulint nth_bit = 0;
ulint i;
@ -5051,6 +5057,7 @@ loop:
if (i == 1 || lock_rec_get_nth_bit(lock, i)) {
index = lock->index;
rec = page_find_rec_with_heap_no(block->frame, i);
ut_a(rec);
offsets = rec_get_offsets(rec, lock->index, offsets,
@ -5067,7 +5074,7 @@ loop:
check WILL break the latching order and may
cause a deadlock of threads. */
lock_rec_queue_validate(block, rec, lock->index,
lock_rec_queue_validate(block, rec, index,
offsets);
lock_mutex_enter_kernel();

View file

@ -2307,7 +2307,8 @@ loop:
}
/******************************************************//**
Reads a specified log segment to a buffer. */
Reads a specified log segment to a buffer. Optionally releases the log mutex
before the I/O. */
UNIV_INTERN
void
log_group_read_log_seg(
@ -2316,7 +2317,9 @@ log_group_read_log_seg(
byte* buf, /*!< in: buffer where to read */
log_group_t* group, /*!< in: log group */
ib_uint64_t start_lsn, /*!< in: read area start */
ib_uint64_t end_lsn) /*!< in: read area end */
ib_uint64_t end_lsn, /*!< in: read area end */
ibool release_mutex) /*!< in: whether the log_sys->mutex
should be released before the read */
{
ulint len;
ulint source_offset;
@ -2346,6 +2349,10 @@ loop:
log_sys->n_log_ios++;
if (release_mutex) {
mutex_exit(&(log_sys->mutex));
}
fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id, 0,
source_offset / UNIV_PAGE_SIZE, source_offset % UNIV_PAGE_SIZE,
len, buf, NULL);
@ -2355,6 +2362,9 @@ loop:
if (start_lsn != end_lsn) {
if (release_mutex) {
mutex_enter(&(log_sys->mutex));
}
goto loop;
}
}
@ -2846,7 +2856,7 @@ arch_none:
log_group_read_log_seg(LOG_ARCHIVE, log_sys->archive_buf,
UT_LIST_GET_FIRST(log_sys->log_groups),
start_lsn, limit_lsn);
start_lsn, limit_lsn, FALSE);
mutex_exit(&(log_sys->mutex));

View file

@ -43,8 +43,8 @@ UNIV_INTERN mysql_pfs_key_t log_bmp_sys_mutex_key;
/** Log parsing and bitmap output data structure */
struct log_bitmap_struct {
byte read_buf[FOLLOW_SCAN_SIZE];
/*!< log read buffer */
byte* read_buf_ptr; /*!< Unaligned log read buffer */
byte* read_buf; /*!< log read buffer */
byte parse_buf[RECV_PARSING_BUF_SIZE];
/*!< log parse buffer */
byte* parse_buf_end; /*!< parse buffer position where the
@ -53,6 +53,8 @@ struct log_bitmap_struct {
parsed, it points to the start,
otherwise points immediatelly past the
end of the incomplete log record. */
char bmp_file_home[FN_REFLEN];
/*!< directory for bitmap files */
log_online_bitmap_file_t out; /*!< The current bitmap file */
ulint out_seq_num; /*!< the bitmap file sequence number */
ib_uint64_t start_lsn; /*!< the LSN of the next unparsed
@ -490,9 +492,8 @@ log_online_make_bitmap_name(
ib_uint64_t start_lsn) /*!< in: the start LSN name part */
{
ut_snprintf(log_bmp_sys->out.name, FN_REFLEN, bmp_file_name_template,
srv_data_home, bmp_file_name_stem,
log_bmp_sys->bmp_file_home, bmp_file_name_stem,
log_bmp_sys->out_seq_num, start_lsn);
}
/*********************************************************************//**
@ -509,7 +510,8 @@ log_online_should_overwrite(
/* Currently, it's OK to overwrite 0-sized files only */
success = os_file_get_status(path, &file_info);
return success && file_info.size == 0LL;
return success && file_info.type == OS_FILE_TYPE_FILE
&& file_info.size == 0LL;
}
/*********************************************************************//**
@ -525,7 +527,7 @@ log_online_start_bitmap_file(void)
/* Check for an old file that should be deleted first */
if (log_online_should_overwrite(log_bmp_sys->out.name)) {
success = os_file_delete(log_bmp_sys->out.name);
success = os_file_delete_if_exists(log_bmp_sys->out.name);
}
if (UNIV_LIKELY(success)) {
@ -544,7 +546,6 @@ log_online_start_bitmap_file(void)
fprintf(stderr,
"InnoDB: Error: Cannot create \'%s\'\n",
log_bmp_sys->out.name);
log_bmp_sys->out.file = -1;
return FALSE;
}
@ -563,9 +564,9 @@ log_online_rotate_bitmap_file(
ib_uint64_t next_file_start_lsn) /*!<in: the start LSN name
part */
{
if (log_bmp_sys->out.file != -1) {
if (log_bmp_sys->out.file != os_file_invalid) {
os_file_close(log_bmp_sys->out.file);
log_bmp_sys->out.file = -1;
log_bmp_sys->out.file = os_file_invalid;
}
log_bmp_sys->out_seq_num++;
log_online_make_bitmap_name(next_file_start_lsn);
@ -613,6 +614,7 @@ log_online_read_init(void)
os_file_dir_t bitmap_dir;
os_file_stat_t bitmap_dir_file_info;
ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;
size_t srv_data_home_len;
/* Bitmap data start and end in a bitmap block must be 8-byte
aligned. */
@ -620,20 +622,39 @@ log_online_read_init(void)
compile_time_assert(MODIFIED_PAGE_BLOCK_BITMAP_LEN % 8 == 0);
log_bmp_sys = ut_malloc(sizeof(*log_bmp_sys));
log_bmp_sys->read_buf_ptr = ut_malloc(FOLLOW_SCAN_SIZE
+ OS_FILE_LOG_BLOCK_SIZE);
log_bmp_sys->read_buf = ut_align(log_bmp_sys->read_buf_ptr,
OS_FILE_LOG_BLOCK_SIZE);
mutex_create(log_bmp_sys_mutex_key, &log_bmp_sys->mutex,
SYNC_LOG_ONLINE);
/* Initialize bitmap file directory from srv_data_home and add a path
separator if needed. */
srv_data_home_len = strlen(srv_data_home);
ut_a (srv_data_home_len < FN_REFLEN);
strcpy(log_bmp_sys->bmp_file_home, srv_data_home);
if (srv_data_home_len
&& log_bmp_sys->bmp_file_home[srv_data_home_len - 1]
!= SRV_PATH_SEPARATOR) {
ut_a (srv_data_home_len < FN_REFLEN - 1);
log_bmp_sys->bmp_file_home[srv_data_home_len]
= SRV_PATH_SEPARATOR;
log_bmp_sys->bmp_file_home[srv_data_home_len + 1] = '\0';
}
/* Enumerate existing bitmap files to either open the last one to get
the last tracked LSN either to find that there are none and start
tracking from scratch. */
log_bmp_sys->out.name[0] = '\0';
log_bmp_sys->out_seq_num = 0;
bitmap_dir = os_file_opendir(srv_data_home, TRUE);
bitmap_dir = os_file_opendir(log_bmp_sys->bmp_file_home, TRUE);
ut_a(bitmap_dir);
while (!os_file_readdir_next_file(srv_data_home, bitmap_dir,
&bitmap_dir_file_info)) {
while (!os_file_readdir_next_file(log_bmp_sys->bmp_file_home,
bitmap_dir, &bitmap_dir_file_info)) {
ulong file_seq_num;
ib_uint64_t file_start_lsn;
@ -648,8 +669,8 @@ log_online_read_init(void)
&& bitmap_dir_file_info.size > 0) {
log_bmp_sys->out_seq_num = file_seq_num;
last_file_start_lsn = file_start_lsn;
/* No dir component (srv_data_home) here, because
that's the cwd */
/* No dir component (log_bmp_sys->bmp_file_home) here,
because that's the cwd */
strncpy(log_bmp_sys->out.name,
bitmap_dir_file_info.name, FN_REFLEN - 1);
log_bmp_sys->out.name[FN_REFLEN - 1] = '\0';
@ -659,7 +680,7 @@ log_online_read_init(void)
if (os_file_closedir(bitmap_dir)) {
os_file_get_last_error(TRUE);
fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
srv_data_home);
log_bmp_sys->bmp_file_home);
exit(1);
}
@ -762,9 +783,9 @@ log_online_read_shutdown(void)
{
ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list;
if (log_bmp_sys->out.file != -1) {
if (log_bmp_sys->out.file != os_file_invalid) {
os_file_close(log_bmp_sys->out.file);
log_bmp_sys->out.file = -1;
log_bmp_sys->out.file = os_file_invalid;
}
rbt_free(log_bmp_sys->modified_pages);
@ -777,6 +798,7 @@ log_online_read_shutdown(void)
mutex_free(&log_bmp_sys->mutex);
ut_free(log_bmp_sys->read_buf_ptr);
ut_free(log_bmp_sys);
}
@ -978,8 +1000,8 @@ log_online_follow_log_seg(
mutex_enter(&log_sys->mutex);
log_group_read_log_seg(LOG_RECOVER, log_bmp_sys->read_buf,
group, block_start_lsn, block_end_lsn);
mutex_exit(&log_sys->mutex);
group, block_start_lsn, block_end_lsn, TRUE);
/* log_group_read_log_seg will release the log_sys->mutex for us */
while (log_block < log_block_end
&& log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) {
@ -1256,15 +1278,18 @@ log_online_setup_bitmap_file_range(
os_file_dir_t bitmap_dir;
os_file_stat_t bitmap_dir_file_info;
ulong first_file_seq_num = ULONG_MAX;
ulong last_file_seq_num = 0;
ib_uint64_t first_file_start_lsn = IB_ULONGLONG_MAX;
ut_ad(range_end >= range_start);
bitmap_files->count = 0;
bitmap_files->files = NULL;
/* 1st pass: size the info array */
bitmap_dir = os_file_opendir(srv_data_home, FALSE);
if (!bitmap_dir) {
if (UNIV_UNLIKELY(!bitmap_dir)) {
fprintf(stderr,
"InnoDB: Error: "
"failed to open bitmap directory \'%s\'\n",
@ -1286,12 +1311,17 @@ log_online_setup_bitmap_file_range(
continue;
}
if (file_seq_num > last_file_seq_num) {
last_file_seq_num = file_seq_num;
}
if (file_start_lsn >= range_start
|| file_start_lsn == first_file_start_lsn
|| first_file_start_lsn > range_start) {
/* A file that falls into the range */
bitmap_files->count++;
if (file_start_lsn < first_file_start_lsn) {
first_file_start_lsn = file_start_lsn;
@ -1309,23 +1339,27 @@ log_online_setup_bitmap_file_range(
}
}
ut_a(first_file_seq_num != ULONG_MAX || bitmap_files->count == 0);
if (UNIV_UNLIKELY(os_file_closedir(bitmap_dir))) {
if (os_file_closedir(bitmap_dir)) {
os_file_get_last_error(TRUE);
fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
srv_data_home);
return FALSE;
}
if (!bitmap_files->count) {
if (first_file_seq_num == ULONG_MAX && last_file_seq_num == 0) {
bitmap_files->count = 0;
return TRUE;
}
bitmap_files->count = last_file_seq_num - first_file_seq_num + 1;
/* 2nd pass: get the file names in the file_seq_num order */
bitmap_dir = os_file_opendir(srv_data_home, FALSE);
if (!bitmap_dir) {
if (UNIV_UNLIKELY(!bitmap_dir)) {
fprintf(stderr, "InnoDB: Error: "
"failed to open bitmap directory \'%s\'\n",
srv_data_home);
@ -1349,11 +1383,25 @@ log_online_setup_bitmap_file_range(
&file_start_lsn)
|| file_start_lsn >= range_end
|| file_start_lsn < first_file_start_lsn) {
continue;
}
array_pos = file_seq_num - first_file_seq_num;
if (UNIV_UNLIKELY(array_pos >= bitmap_files->count)) {
fprintf(stderr,
"InnoDB: Error: inconsistent bitmap file "
"directory for a "
"INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query"
"\n");
free(bitmap_files->files);
return FALSE;
}
if (file_seq_num > bitmap_files->files[array_pos].seq_num) {
bitmap_files->files[array_pos].seq_num = file_seq_num;
strncpy(bitmap_files->files[array_pos].name,
bitmap_dir_file_info.name, FN_REFLEN);
@ -1364,7 +1412,8 @@ log_online_setup_bitmap_file_range(
}
}
if (os_file_closedir(bitmap_dir)) {
if (UNIV_UNLIKELY(os_file_closedir(bitmap_dir))) {
os_file_get_last_error(TRUE);
fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
srv_data_home);
@ -1411,6 +1460,8 @@ log_online_open_bitmap_file_read_only(
ulint size_low;
ulint size_high;
ut_ad(name[0] != '\0');
ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name);
bitmap_file->file
= os_file_create_simple_no_error_handling(innodb_file_bmp_key,
@ -1418,7 +1469,8 @@ log_online_open_bitmap_file_read_only(
OS_FILE_OPEN,
OS_FILE_READ_ONLY,
&success);
if (!success) {
if (UNIV_UNLIKELY(!success)) {
/* Here and below assume that bitmap file names do not
contain apostrophes, thus no need for ut_print_filename(). */
fprintf(stderr,
@ -1461,7 +1513,8 @@ log_online_diagnose_bitmap_eof(
|| (bitmap_file->offset
> bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE)) {
if (bitmap_file->offset != bitmap_file->size) {
if (UNIV_UNLIKELY(bitmap_file->offset != bitmap_file->size)) {
/* If we are not at EOF and we have less than one page
to read, it's junk. This error is not fatal in
itself. */
@ -1472,7 +1525,8 @@ log_online_diagnose_bitmap_eof(
bitmap_file->name);
}
if (!last_page_in_run) {
if (UNIV_UNLIKELY(!last_page_in_run)) {
/* We are at EOF but the last read page did not finish
a run */
/* It's a "Warning" here because it's not a fatal error
@ -1512,18 +1566,29 @@ log_online_bitmap_iterator_init(
if (!log_online_setup_bitmap_file_range(&i->in_files, min_lsn,
max_lsn)) {
i->failed = TRUE;
return FALSE;
}
ut_a(i->in_files.count > 0);
i->in_i = 0;
if (i->in_files.count == 0) {
/* Empty range */
i->in.file = os_file_invalid;
i->page = NULL;
i->failed = FALSE;
return TRUE;
}
/* Open the 1st bitmap file */
i->in_i = 0;
if (!log_online_open_bitmap_file_read_only(i->in_files.files[i->in_i].
name,
&i->in)) {
if (UNIV_UNLIKELY(!log_online_open_bitmap_file_read_only(
i->in_files.files[i->in_i].name,
&i->in))) {
i->in_i = i->in_files.count;
free(i->in_files.files);
i->failed = TRUE;
return FALSE;
}
@ -1534,6 +1599,7 @@ log_online_bitmap_iterator_init(
i->first_page_id = 0;
i->last_page_in_run = TRUE;
i->changed = FALSE;
i->failed = FALSE;
return TRUE;
}
@ -1548,11 +1614,20 @@ log_online_bitmap_iterator_release(
{
ut_a(i);
if (i->in_i < i->in_files.count) {
if (i->in.file != os_file_invalid) {
os_file_close(i->in.file);
i->in.file = os_file_invalid;
}
ut_free(i->in_files.files);
ut_free(i->page);
if (i->in_files.files) {
ut_free(i->in_files.files);
}
if (i->page) {
ut_free(i->page);
}
i->failed = TRUE;
}
/*********************************************************************//**
@ -1567,10 +1642,16 @@ log_online_bitmap_iterator_next(
log_bitmap_iterator_t *i) /*!<in/out: iterator */
{
ibool checksum_ok = FALSE;
ibool success;
ut_a(i);
if (i->bit_offset < MODIFIED_PAGE_BLOCK_BITMAP_LEN)
if (UNIV_UNLIKELY(i->in_files.count == 0)) {
return FALSE;
}
if (UNIV_LIKELY(i->bit_offset < MODIFIED_PAGE_BLOCK_BITMAP_LEN))
{
++i->bit_offset;
i->changed =
@ -1587,29 +1668,56 @@ log_online_bitmap_iterator_next(
/* Advance file */
i->in_i++;
os_file_close(i->in.file);
log_online_diagnose_bitmap_eof(&i->in,
i->last_page_in_run);
if (i->in_i == i->in_files.count
|| i->in_files.files[i->in_i].seq_num == 0) {
success = os_file_close_no_error_handling(i->in.file);
i->in.file = os_file_invalid;
if (UNIV_UNLIKELY(!success)) {
os_file_get_last_error(TRUE);
i->failed = TRUE;
return FALSE;
}
success = log_online_diagnose_bitmap_eof(
&i->in, i->last_page_in_run);
if (UNIV_UNLIKELY(!success)) {
i->failed = TRUE;
return FALSE;
}
if (i->in_i == i->in_files.count) {
return FALSE;
}
if (!log_online_open_bitmap_file_read_only(
if (UNIV_UNLIKELY(i->in_files.files[i->in_i].seq_num
== 0)) {
i->failed = TRUE;
return FALSE;
}
success = log_online_open_bitmap_file_read_only(
i->in_files.files[i->in_i].name,
&i->in)) {
&i->in);
if (UNIV_UNLIKELY(!success)) {
i->failed = TRUE;
return FALSE;
}
}
if (!log_online_read_bitmap_page(&i->in, i->page,
&checksum_ok)) {
success = log_online_read_bitmap_page(&i->in, i->page,
&checksum_ok);
if (UNIV_UNLIKELY(!success)) {
os_file_get_last_error(TRUE);
fprintf(stderr,
"InnoDB: Warning: failed reading "
"changed page bitmap file \'%s\'\n",
i->in_files.files[i->in_i].name);
i->failed = TRUE;
return FALSE;
}
}
@ -1666,7 +1774,7 @@ log_online_purge_changed_page_bitmaps(
/* If we have to delete the current output file, close it
first. */
os_file_close(log_bmp_sys->out.file);
log_bmp_sys->out.file = -1;
log_bmp_sys->out.file = os_file_invalid;
}
for (i = 0; i < bitmap_files.count; i++) {

View file

@ -546,7 +546,8 @@ recv_copy_group(
}
log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
up_to_date_group, start_lsn, end_lsn);
up_to_date_group, start_lsn, end_lsn,
FALSE);
len = (ulint) (end_lsn - start_lsn);
@ -590,7 +591,7 @@ recv_synchronize_groups(
ut_a(start_lsn != end_lsn);
log_group_read_log_seg(LOG_RECOVER, recv_sys->last_block,
up_to_date_group, start_lsn, end_lsn);
up_to_date_group, start_lsn, end_lsn, FALSE);
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@ -1709,19 +1710,6 @@ recv_recover_page_func(
}
#endif /* UNIV_ZIP_DEBUG */
mutex_enter(&(recv_sys->mutex));
if (recv_max_page_lsn < page_lsn) {
recv_max_page_lsn = page_lsn;
}
recv_addr->state = RECV_PROCESSED;
ut_a(recv_sys->n_addrs);
recv_sys->n_addrs--;
mutex_exit(&(recv_sys->mutex));
#ifndef UNIV_HOTBACKUP
if (modification_to_page) {
ut_a(block);
@ -1738,6 +1726,20 @@ recv_recover_page_func(
mtr.modifications = FALSE;
mtr_commit(&mtr);
mutex_enter(&(recv_sys->mutex));
if (recv_max_page_lsn < page_lsn) {
recv_max_page_lsn = page_lsn;
}
recv_addr->state = RECV_PROCESSED;
ut_a(recv_sys->n_addrs);
recv_sys->n_addrs--;
mutex_exit(&(recv_sys->mutex));
}
#ifndef UNIV_HOTBACKUP
@ -2887,7 +2889,7 @@ recv_group_scan_log_recs(
end_lsn = start_lsn + RECV_SCAN_SIZE;
log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
group, start_lsn, end_lsn);
group, start_lsn, end_lsn, FALSE);
finished = recv_scan_log_recs(
(buf_pool_get_n_pages()

View file

@ -353,7 +353,13 @@ mem_heap_create_block(
block = (mem_block_t*) buf_block->frame;
}
ut_ad(block);
if(!block) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Unable to allocate memory of size %lu.\n",
len);
ut_error;
}
block->buf_block = buf_block;
block->free_block = NULL;
#else /* !UNIV_HOTBACKUP */

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -58,72 +58,81 @@ mtr_block_dirtied(
/*****************************************************************//**
Releases the item in the slot given. */
static
static __attribute__((nonnull))
void
mtr_memo_slot_release(
/*==================*/
mtr_t* mtr, /*!< in: mtr */
mtr_memo_slot_release_func(
/*=======================*/
#ifdef UNIV_DEBUG
mtr_t* mtr, /*!< in/out: mini-transaction */
#endif /* UNIV_DEBUG */
mtr_memo_slot_t* slot) /*!< in: memo slot */
{
void* object;
ulint type;
ut_ad(mtr);
ut_ad(slot);
#ifndef UNIV_DEBUG
UT_NOT_USED(mtr);
#endif /* UNIV_DEBUG */
object = slot->object;
type = slot->type;
if (UNIV_LIKELY(object != NULL)) {
if (type <= MTR_MEMO_BUF_FIX) {
buf_page_release((buf_block_t*)object, type);
} else if (type == MTR_MEMO_S_LOCK) {
rw_lock_s_unlock((rw_lock_t*)object);
#ifdef UNIV_DEBUG
} else if (type != MTR_MEMO_X_LOCK) {
ut_ad(type == MTR_MEMO_MODIFY);
ut_ad(mtr_memo_contains(mtr, object,
MTR_MEMO_PAGE_X_FIX));
#endif /* UNIV_DEBUG */
} else {
rw_lock_x_unlock((rw_lock_t*)object);
}
}
void* object = slot->object;
slot->object = NULL;
/* slot release is a local operation for the current mtr.
We must not be holding the flush_order mutex while
doing this. */
ut_ad(!log_flush_order_mutex_own());
switch (slot->type) {
case MTR_MEMO_PAGE_S_FIX:
case MTR_MEMO_PAGE_X_FIX:
case MTR_MEMO_BUF_FIX:
buf_page_release((buf_block_t*) object, slot->type);
break;
case MTR_MEMO_S_LOCK:
rw_lock_s_unlock((rw_lock_t*) object);
break;
case MTR_MEMO_X_LOCK:
rw_lock_x_unlock((rw_lock_t*) object);
break;
#ifdef UNIV_DEBUG
default:
ut_ad(slot->type == MTR_MEMO_MODIFY);
ut_ad(mtr_memo_contains(mtr, object, MTR_MEMO_PAGE_X_FIX));
#endif /* UNIV_DEBUG */
}
}
#ifdef UNIV_DEBUG
# define mtr_memo_slot_release(mtr, slot) mtr_memo_slot_release_func(mtr, slot)
#else /* UNIV_DEBUG */
# define mtr_memo_slot_release(mtr, slot) mtr_memo_slot_release_func(slot)
#endif /* UNIV_DEBUG */
/**********************************************************//**
Releases the mlocks and other objects stored in an mtr memo.
They are released in the order opposite to which they were pushed
to the memo. */
static
static __attribute__((nonnull))
void
mtr_memo_pop_all(
/*=============*/
mtr_t* mtr) /*!< in: mtr */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
mtr_memo_slot_t* slot;
dyn_array_t* memo;
ulint offset;
const dyn_block_t* block;
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_COMMITTING); /* Currently only used in
commit */
memo = &(mtr->memo);
offset = dyn_array_get_data_size(memo);
for (block = dyn_array_get_last_block(&mtr->memo);
block;
block = dyn_array_get_prev_block(&mtr->memo, block)) {
const mtr_memo_slot_t* start
= (mtr_memo_slot_t*) dyn_block_get_data(block);
mtr_memo_slot_t* slot
= (mtr_memo_slot_t*) (dyn_block_get_data(block)
+ dyn_block_get_used(block));
while (offset > 0) {
offset -= sizeof(mtr_memo_slot_t);
slot = dyn_array_get_element(memo, offset);
ut_ad(!(dyn_block_get_used(block) % sizeof(mtr_memo_slot_t)));
mtr_memo_slot_release(mtr, slot);
while (slot-- != start) {
if (slot->object != NULL) {
mtr_memo_slot_release(mtr, slot);
}
}
}
}
@ -319,42 +328,36 @@ UNIV_INTERN
void
mtr_memo_release(
/*=============*/
mtr_t* mtr, /*!< in: mtr */
mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
{
mtr_memo_slot_t* slot;
dyn_array_t* memo;
ulint offset;
const dyn_block_t* block;
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_ACTIVE);
/* We cannot release a page that has been written to in the
middle of a mini-transaction. */
ut_ad(!mtr->modifications || type != MTR_MEMO_PAGE_X_FIX);
memo = &(mtr->memo);
for (block = dyn_array_get_last_block(&mtr->memo);
block;
block = dyn_array_get_prev_block(&mtr->memo, block)) {
const mtr_memo_slot_t* start
= (mtr_memo_slot_t*) dyn_block_get_data(block);
mtr_memo_slot_t* slot
= (mtr_memo_slot_t*) (dyn_block_get_data(block)
+ dyn_block_get_used(block));
offset = dyn_array_get_data_size(memo);
ut_ad(!(dyn_block_get_used(block) % sizeof(mtr_memo_slot_t)));
log_flush_order_mutex_enter();
while (offset > 0) {
offset -= sizeof(mtr_memo_slot_t);
slot = dyn_array_get_element(memo, offset);
if (object == slot->object && type == slot->type) {
/* We cannot release a page that has been written
to in the middle of a mini-transaction. */
ut_ad(!(mtr->modifications
&& slot->type == MTR_MEMO_PAGE_X_FIX));
mtr_memo_slot_release(mtr, slot);
break;
while (slot-- != start) {
if (object == slot->object && type == slot->type) {
mtr_memo_slot_release(mtr, slot);
return;
}
}
}
log_flush_order_mutex_exit();
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -21,7 +21,7 @@ Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
***********************************************************************/
@ -62,6 +62,13 @@ Created 10/21/1995 Heikki Tuuri
#include <libaio.h>
#endif
#if defined(UNIV_LINUX) && defined(HAVE_SYS_IOCTL_H)
# include <sys/ioctl.h>
# ifndef DFS_IOCTL_ATOMIC_WRITE_SET
# define DFS_IOCTL_ATOMIC_WRITE_SET _IOW(0x95, 2, uint)
# endif
#endif
/* This specifies the file permissions InnoDB uses when it creates files in
Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to
my_umask */
@ -1366,6 +1373,38 @@ os_file_set_nocache(
#endif
}
/****************************************************************//**
Tries to enable the atomic write feature, if available, for the specified file
handle.
@return TRUE if success */
static __attribute__((warn_unused_result))
ibool
os_file_set_atomic_writes(
/*======================*/
const char* name /*!< in: name of the file */
__attribute__((unused)),
os_file_t file /*!< in: handle to the file */
__attribute__((unused)))
{
#ifdef DFS_IOCTL_ATOMIC_WRITE_SET
int atomic_option = 1;
if (ioctl(file, DFS_IOCTL_ATOMIC_WRITE_SET, &atomic_option)) {
os_file_handle_error_no_exit(name, "ioctl");
return(FALSE);
}
return(TRUE);
#else
fprintf(stderr, "InnoDB: Error: trying to enable atomic writes on "
"non-supported platform! Please restart with "
"innodb_use_atomic_writes disabled.\n");
return(FALSE);
#endif
}
/****************************************************************//**
NOTE! Use the corresponding macro os_file_create(), not directly
this function!
@ -1637,6 +1676,14 @@ try_again:
}
#endif /* USE_FILE_LOCK */
if (srv_use_atomic_writes && type == OS_DATA_FILE
&& os_file_set_atomic_writes(name, file)) {
*success = FALSE;
close(file);
file = -1;
}
return(file);
#endif /* __WIN__ */
}
@ -1846,7 +1893,6 @@ os_file_close_func(
#endif
}
#ifdef UNIV_HOTBACKUP
/***********************************************************************//**
Closes a file handle.
@return TRUE if success */
@ -1881,7 +1927,6 @@ os_file_close_no_error_handling(
return(TRUE);
#endif
}
#endif /* UNIV_HOTBACKUP */
/***********************************************************************//**
Gets a file size.
@ -1980,6 +2025,22 @@ os_file_set_size(
current_size = 0;
desired_size = (ib_int64_t)size + (((ib_int64_t)size_high) << 32);
#ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) {
if (posix_fallocate(file, current_size, desired_size) == -1) {
fprintf(stderr, "InnoDB: Error: preallocating file "
"space for file \'%s\' failed. Current size "
"%lld, desired size %lld\n",
name, current_size, desired_size);
os_file_handle_error_no_exit(name, "posix_fallocate");
return(FALSE);
}
return(TRUE);
}
#endif
/* Write up to 1 megabyte at a time. */
buf_size = ut_min(64, (ulint) (desired_size / UNIV_PAGE_SIZE))
* UNIV_PAGE_SIZE;

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2005, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -837,11 +837,12 @@ page_zip_compress_node_ptrs(
c_stream->next_in = (byte*) rec;
c_stream->avail_in = rec_offs_data_size(offsets)
- REC_NODE_PTR_SIZE;
ut_ad(c_stream->avail_in);
err = deflate(c_stream, Z_NO_FLUSH);
if (UNIV_UNLIKELY(err != Z_OK)) {
break;
if (c_stream->avail_in) {
err = deflate(c_stream, Z_NO_FLUSH);
if (UNIV_UNLIKELY(err != Z_OK)) {
break;
}
}
ut_ad(!c_stream->avail_in);
@ -2274,13 +2275,12 @@ zlib_done:
if (UNIV_UNLIKELY
(page_zip_get_trailer_len(page_zip,
dict_index_is_clust(index), NULL)
dict_index_is_clust(index))
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_node_ptrs:"
" %lu + %lu >= %lu, %lu\n",
(ulong) page_zip_get_trailer_len(
page_zip, dict_index_is_clust(index),
NULL),
page_zip, dict_index_is_clust(index)),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip),
(ulong) dict_index_is_clust(index)));
@ -2431,12 +2431,12 @@ zlib_done:
page_zip->m_nonempty = mod_log_ptr != d_stream->next_in;
}
if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, FALSE, NULL)
if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, FALSE)
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_sec: %lu + %lu >= %lu\n",
(ulong) page_zip_get_trailer_len(
page_zip, FALSE, NULL),
page_zip, FALSE),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip)));
return(FALSE);
@ -2762,12 +2762,12 @@ zlib_done:
page_zip->m_nonempty = mod_log_ptr != d_stream->next_in;
}
if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, TRUE, NULL)
if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, TRUE)
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_clust: %lu + %lu >= %lu\n",
(ulong) page_zip_get_trailer_len(
page_zip, TRUE, NULL),
page_zip, TRUE),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip)));
return(FALSE);
@ -4642,8 +4642,7 @@ page_zip_copy_recs(
memcpy(page_zip, src_zip, sizeof *page_zip);
page_zip->data = data;
}
ut_ad(page_zip_get_trailer_len(page_zip,
dict_index_is_clust(index), NULL)
ut_ad(page_zip_get_trailer_len(page_zip, dict_index_is_clust(index))
+ page_zip->m_end < page_zip_get_size(page_zip));
if (!page_is_leaf(src)

View file

@ -1,16 +0,0 @@
perl;
$file = $ENV{'grep_file'};
$pattern = $ENV{'grep_pattern'};
open(FILE, "$file")
or die("Cannot open file $file: $!\n");
$lines = 0;
while(<FILE>) {
$lines++ if (/$pattern/);
}
print "$lines\n";
close(FILE);
EOF

View file

@ -1,4 +0,0 @@
-- require r/have_response_time_distribution.require
disable_query_log;
show variables like 'have_response_time_distribution';
enable_query_log;

View file

@ -1,2 +0,0 @@
Variable_name Value
have_response_time_distribution YES

View file

@ -1,21 +0,0 @@
SET @old_slow_query_log_file=@@global.slow_query_log_file;
SET GLOBAL slow_query_log=on;
SET LOCAL log_slow_verbosity='profiling';
SET LOCAL long_query_time=0;
SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';;
SELECT 1;
1
1
# User@Host: root[root] @ localhost []
# Thread_id: X Schema: test Last_errno: X Killed: X
# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
# Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
# Profile_total: X.X Profile_total_cpu: X.X
# User@Host: root[root] @ localhost []
# Thread_id: X Schema: test Last_errno: X Killed: X
# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
# Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
# Profile_total: X.X Profile_total_cpu: X.X
SET GLOBAL slow_query_log_file=@old_slow_query_log_file;

View file

@ -1,49 +0,0 @@
#
# This test suffers from server
# Bug#38124 "general_log_file" variable silently unset when using expression
# In short:
# SET GLOBAL general_log_file = @<whatever>
# SET GLOBAL slow_query_log = @<whatever>
# cause that the value of these server system variables is set to default
# instead of the assigned values. There comes no error message or warning.
# If this bug is fixed please
# 1. try this test with "let $fixed_bug38124 = 0;"
# 2. remove all workarounds if 1. was successful.
--source include/have_profiling.inc
let $fixed_bug38124 = 0;
SET @old_slow_query_log_file=@@global.slow_query_log_file;
SET GLOBAL slow_query_log=on;
SET LOCAL log_slow_verbosity='profiling';
SET LOCAL long_query_time=0;
let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SET GLOBAL slow_query_log_file='$slogfile';
SELECT 1;
perl;
$slogfile= $ENV{'slogfile'};
open(FILE, "$slogfile") or
die("Unable to read slow query log file $slogfile: $!\n");
while(<FILE>) {
next if (!/^#/);
next if (/^# Time:/);
s/[0-9]+/X/g;
print;
}
close(FILE);
EOF
SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
if(!$fixed_bug38124)
{
--disable_query_log
let $my_var = `SELECT @old_slow_query_log_file`;
eval SET @@global.slow_query_log_file = '$my_var';
--enable_query_log
}

View file

@ -1 +0,0 @@
--innodb_flush_neighbor_pages=cont

View file

@ -1,21 +0,0 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
INSERT INTO t1(foo) VALUES ('a'), ('b');
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
DROP TABLE t1;

View file

@ -1,36 +0,0 @@
# Test for innodb_flush_neighbor_pages=contiguous.
# The test is very crude: we simply overflow the buffer pool with such a number of
# new/modified pages that some flushing is bound to happen.
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (id INT AUTO_INCREMENT, foo CHAR(255), PRIMARY KEY (id)) ENGINE=InnoDB;
INSERT INTO t1(foo) VALUES ('a'), ('b');
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
INSERT INTO t1(foo) SELECT foo FROM t1;
# TODO: cannot record a stable value here. A check of > 0 should be enough,
# but the variable is not accessible through INFORMATION_SCHEMA currently.
# SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed';
DROP TABLE t1;

View file

@ -1 +0,0 @@
--innodb_buffer_pool_shm_key=123456

View file

@ -1,4 +0,0 @@
show variables like 'innodb_buffer_pool_shm%';
Variable_name Value
innodb_buffer_pool_shm_checksum ON
innodb_buffer_pool_shm_key 123456

View file

@ -1,2 +0,0 @@
--source include/have_innodb.inc
show variables like 'innodb_buffer_pool_shm%';

View file

@ -1,28 +0,0 @@
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
# Establish connection con3 (user=root)
# Drop test table
drop table if exists t;
# Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
# Insert two rows to test table
insert into t values(2,1);
insert into t values(1,2);
# Switch to connection con1
BEGIN;
SELECT b FROM t WHERE a=1 FOR UPDATE;
# Switch to connection con2
BEGIN;
SELECT b FROM t WHERE a=2 FOR UPDATE;
# Switch to connection con1
SELECT b FROM t WHERE a=2 FOR UPDATE;
# Switch to connection con2
SELECT b FROM t WHERE a=1 FOR UPDATE;
# Switch to connection con1
ROLLBACK;
# Switch to connection con2
ROLLBACK;
# Switch to connection con3
Deadlocks: 1
# Drop test table
drop table t;

View file

@ -1,61 +0,0 @@
--source include/have_innodb.inc
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--echo # Establish connection con3 (user=root)
connect (con3,localhost,root,,);
--echo # Drop test table
--disable_warnings
drop table if exists t;
--enable_warnings
--echo # Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
--echo # Insert two rows to test table
insert into t values(2,1);
insert into t values(1,2);
#--echo # Save current deadlock count
let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
--disable_result_log
--echo # Switch to connection con1
connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
--echo # Switch to connection con2
connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
--echo # Switch to connection con1
connection con1;
SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
--echo # Switch to connection con2
connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
--echo # Switch to connection con1
connection con1;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
--echo # Switch to connection con2
connection con2;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
--echo # Switch to connection con3
connection con3;
let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
--enable_result_log
let $diff = `SELECT $result - $current`;
echo Deadlocks: $diff;
--echo # Drop test table
drop table t;

View file

@ -1 +0,0 @@
--innodb_doublewrite_file=ib_doublewrite

View file

@ -1,4 +0,0 @@
show variables like 'innodb_doublewrite%';
Variable_name Value
innodb_doublewrite ON
innodb_doublewrite_file ib_doublewrite

View file

@ -1,2 +0,0 @@
--source include/have_innodb.inc
show variables like 'innodb_doublewrite%';

View file

@ -1,64 +0,0 @@
CREATE TABLE t1(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a CHAR(1) NOT NULL,
b CHAR(36) NOT NULL) ENGINE=InnoDB;
INSERT INTO t1(a,b) VALUES ('a','b');
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
ALTER TABLE t1 ADD KEY (a);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
id 1
select_type SIMPLE
table t1
type ALL
possible_keys a
key NULL
key_len NULL
ref NULL
rows 16
Extra
id 1
select_type SIMPLE
table t2
type ref
possible_keys a
key a
key_len 1
ref test.t1.a
rows 1
Extra Using where
ALTER TABLE t1 DROP KEY a;
SET expand_fast_index_creation = 1;
SELECT @@expand_fast_index_creation;
@@expand_fast_index_creation
1
ALTER TABLE t1 ADD KEY (a);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
id 1
select_type SIMPLE
table t1
type ALL
possible_keys a
key NULL
key_len NULL
ref NULL
rows 16
Extra
id 1
select_type SIMPLE
table t2
type ALL
possible_keys a
key NULL
key_len NULL
ref NULL
rows 16
Extra Using where; Using join buffer
SET expand_fast_index_creation = 0;
DROP TABLE t1;

View file

@ -1,45 +0,0 @@
--source include/have_innodb.inc
########################################################################
# Bug #857590: Fast index creation does not update index statistics
########################################################################
CREATE TABLE t1(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a CHAR(1) NOT NULL,
b CHAR(36) NOT NULL) ENGINE=InnoDB;
INSERT INTO t1(a,b) VALUES ('a','b');
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
# Check that fast index creation is used
--enable_info
ALTER TABLE t1 ADD KEY (a);
--disable_info
# The default (wrong) plan due to bogus statistics
--vertical_results
EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
--horizontal_results
ALTER TABLE t1 DROP KEY a;
SET expand_fast_index_creation = 1;
SELECT @@expand_fast_index_creation;
# Check that stats are updated with the option enabled
--enable_info
ALTER TABLE t1 ADD KEY (a);
--disable_info
--vertical_results
EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
--horizontal_results
SET expand_fast_index_creation = 0;
DROP TABLE t1;

View file

@ -1,55 +0,0 @@
DROP TABLE IF EXISTS t1;
# Checking variables
SHOW VARIABLES LIKE 'innodb_fake_changes';
Variable_name Value
innodb_fake_changes OFF
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
VARIABLE_VALUE
OFF
SET innodb_fake_changes=1;
SHOW VARIABLES LIKE 'innodb_fake_changes';
Variable_name Value
innodb_fake_changes ON
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
VARIABLE_VALUE
ON
SET innodb_fake_changes=default;
SHOW VARIABLES LIKE 'innodb_fake_changes';
Variable_name Value
innodb_fake_changes OFF
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
VARIABLE_VALUE
OFF
# Explicit COMMIT should fail when innodb_fake_changes is enabled
# DML should be fine
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
INSERT INTO t1 VALUES (2);
UPDATE t1 SET a=0;
DELETE FROM t1 LIMIT 1;
SELECT * FROM t1;
a
1
COMMIT;
ERROR HY000: Got error 131 during COMMIT
SET innodb_fake_changes=default;
DROP TABLE t1;
# DDL must result in error
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
ERROR HY000: Can't create table 'test.t2' (errno: 131)
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
TRUNCATE TABLE t1;
ERROR HY000: Got error 131 during COMMIT
ALTER TABLE t1 ENGINE=MyISAM;
ERROR HY000: Got error 131 during COMMIT
ROLLBACK;
SET innodb_fake_changes=default;
DROP TABLE t1;

View file

@ -1,49 +0,0 @@
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # Checking variables
SHOW VARIABLES LIKE 'innodb_fake_changes';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
SET innodb_fake_changes=1;
SHOW VARIABLES LIKE 'innodb_fake_changes';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
SET innodb_fake_changes=default;
SHOW VARIABLES LIKE 'innodb_fake_changes';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
--echo # Explicit COMMIT should fail when innodb_fake_changes is enabled
--echo # DML should be fine
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
INSERT INTO t1 VALUES (2);
UPDATE t1 SET a=0;
DELETE FROM t1 LIMIT 1;
SELECT * FROM t1;
--error 1180
COMMIT;
SET innodb_fake_changes=default;
DROP TABLE t1;
--echo # DDL must result in error
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
--error 1005
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
--error 1051
DROP TABLE t1;
--error 1180
TRUNCATE TABLE t1;
--error 1180
ALTER TABLE t1 ENGINE=MyISAM;
ROLLBACK;
SET innodb_fake_changes=default;
DROP TABLE t1;

View file

@ -1,19 +0,0 @@
DROP TABLE IF EXISTS t1;
# Verifying that X_LOCK not acquired
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
SET innodb_lock_wait_timeout=3;
UPDATE t1 SET a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 LOCK IN SHARE MODE;
a
1
ROLLBACK;
SET innodb_fake_changes=default;
DROP TABLE t1;

View file

@ -1,24 +0,0 @@
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # Verifying that X_LOCK not acquired
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connect (conn1,localhost,root,,)
--connection conn1
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
--connection default
SET innodb_lock_wait_timeout=3;
--error 1205
UPDATE t1 SET a=2;
SELECT * FROM t1 LOCK IN SHARE MODE;
--connection conn1
ROLLBACK;
SET innodb_fake_changes=default;
DROP TABLE t1;

View file

@ -1,41 +0,0 @@
DROP TABLE IF EXISTS t1;
SET autocommit=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0
SET GLOBAL innodb_kill_idle_transaction=1;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 1
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 1
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3);
COMMIT;
SELECT * FROM t1;
a
1
2
3
BEGIN;
INSERT INTO t1 VALUES (4),(5),(6);
SELECT * FROM t1;
ERROR HY000: MySQL server has gone away
SELECT * FROM t1;
a
1
2
3
DROP TABLE t1;
SET GLOBAL innodb_kill_idle_transaction=0;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0

View file

@ -1,28 +0,0 @@
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
SET autocommit=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
--source include/percona_innodb_kill_idle_trx_show.inc
SET GLOBAL innodb_kill_idle_transaction=1;
--source include/percona_innodb_kill_idle_trx_show.inc
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3);
COMMIT;
SELECT * FROM t1;
BEGIN;
INSERT INTO t1 VALUES (4),(5),(6);
sleep 3;
--enable_reconnect
--error 2006 --error CR_SERVER_GONE_ERROR
SELECT * FROM t1;
SELECT * FROM t1;
DROP TABLE t1;
SET GLOBAL innodb_kill_idle_transaction=0;
--source include/percona_innodb_kill_idle_trx_show.inc

View file

@ -1,45 +0,0 @@
DROP TABLE IF EXISTS t1;
SET autocommit=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0
SET GLOBAL innodb_kill_idle_transaction=5;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 5
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 5
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3);
COMMIT;
SELECT * FROM t1;
a
1
2
3
### Locking rows. Lock should be released when idle trx is killed.
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
2
3
UPDATE t1 set a=4;
SELECT * FROM t1;
a
4
4
4
DROP TABLE t1;
SET GLOBAL innodb_kill_idle_transaction=0;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0

View file

@ -1,31 +0,0 @@
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
SET autocommit=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
--source include/percona_innodb_kill_idle_trx_show.inc
SET GLOBAL innodb_kill_idle_transaction=5;
--source include/percona_innodb_kill_idle_trx_show.inc
connect (conn1,localhost,root,,);
connection conn1;
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3);
COMMIT;
SELECT * FROM t1;
--echo ### Locking rows. Lock should be released when idle trx is killed.
BEGIN;
SELECT * FROM t1 FOR UPDATE;
connection default;
UPDATE t1 set a=4;
SELECT * FROM t1;
DROP TABLE t1;
SET GLOBAL innodb_kill_idle_transaction=0;
--source include/percona_innodb_kill_idle_trx_show.inc

View file

@ -1,2 +0,0 @@
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';

View file

@ -1 +0,0 @@
--innodb_use_sys_stats_table

View file

@ -1,3 +0,0 @@
show variables like 'innodb_use_sys_stats%';
Variable_name Value
innodb_use_sys_stats_table ON

View file

@ -1,2 +0,0 @@
--source include/have_innodb.inc
show variables like 'innodb_use_sys_stats%';

View file

@ -1 +0,0 @@
--log-error

View file

@ -1,16 +0,0 @@
SET @old_max_connections = @@max_connections;
SET @old_log_warnings = @@log_warnings;
SET GLOBAL max_connections=2;
SET GLOBAL LOG_WARNINGS = 0;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL LOG_WARNINGS = 1;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL LOG_WARNINGS = 0;
connect(localhost,root,,test,port,socket);
ERROR HY000: Too many connections
SET GLOBAL max_connections = @old_max_connections;
SET GLOBAL log_warnings = @old_log_warnings;
[log_grep.inc] file: percona.log_connection_error.err pattern: Too many connections
[log_grep.inc] lines: 1

View file

@ -1,54 +0,0 @@
--source include/not_embedded.inc
connect (main,localhost,root,,);
connection main;
SET @old_max_connections = @@max_connections;
SET @old_log_warnings = @@log_warnings;
SET GLOBAL max_connections=2;
let $port=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'port'`;
let $socket=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'socket'`;
SET GLOBAL LOG_WARNINGS = 0;
--connect (conn0,localhost,root,,)
connection conn0;
replace_result $port port $socket socket;
--error 1040
--connect(conn1,localhost,root,,)
disconnect conn0;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL LOG_WARNINGS = 1;
--connect (conn1,localhost,root,,)
replace_result $port port $socket socket;
--error 1040
--connect (conn0,localhost,root,,)
disconnect conn1;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL LOG_WARNINGS = 0;
--connect (conn0,localhost,root,,)
replace_result $port port $socket socket;
--error 1040
--connect(conn1,localhost,root,,)
disconnect conn0;
SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
connection main;
SET GLOBAL max_connections = @old_max_connections;
SET GLOBAL log_warnings = @old_log_warnings;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
}
--let log_error=$log_error_
--let log_file=percona.log_connection_error.err
--let log_file_full_path=$log_error
--let grep_pattern= Too many connections
--source include/log_grep.inc

View file

@ -1 +0,0 @@
--log-error

View file

@ -1,31 +0,0 @@
SET @old_log_warnings = @@log_warnings;
SET @old_log_warnings_suppress = @@log_warnings_suppress;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
SET GLOBAL log_warnings_suppress='';
SET GLOBAL LOG_WARNINGS=0;
SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
Variable_name Value
log_warnings_suppress
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL log_warnings_suppress='1592';
SET GLOBAL LOG_WARNINGS=0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
# Count the number of times the "Unsafe" message was printed
# to the error log.
Occurrences: 1

View file

@ -1,47 +0,0 @@
-- source include/have_log_bin.inc
-- source include/have_binlog_format_statement.inc
SET @old_log_warnings = @@log_warnings;
SET @old_log_warnings_suppress = @@log_warnings_suppress;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
SET GLOBAL log_warnings_suppress='';
SET GLOBAL LOG_WARNINGS=0;
SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL log_warnings_suppress='1592';
SET GLOBAL LOG_WARNINGS=0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
}
# Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_;
--echo # Count the number of times the "Unsafe" message was printed
--echo # to the error log.
perl;
use strict;
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
my $count = () = grep(/suppress_1592/g,<FILE>);
print "Occurrences: $count\n";
close(FILE);
EOF

View file

@ -1,70 +0,0 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
CREATE TABLE t1 (a INT);
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
SELECT a FROM t2 WHERE a > 15;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 2
### root ### test Query ### ### CREATE TABLE t1 (a INT) 0 0 1
### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 2 5 6
SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
id info rows_sent rows_examined rows_read
### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
### CREATE TABLE t1 (a INT) 0 0 1
### SELECT a FROM t2 WHERE a > 15 2 5 6
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
a
20
20
SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
SELECT a FROM t2 WHERE a < 15;
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
SELECT a FROM t2 WHERE a > 15;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
### root ### test Query ### ### SELECT a FROM t2 WHERE a < 15 1 0 1
### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 1 0 3
SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
id info rows_sent rows_examined rows_read
### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
### SELECT a FROM t2 WHERE a < 15 1 0 1
### SELECT a FROM t2 WHERE a > 15 1 0 3
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
a
10
10
10
a
20
20
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
UPDATE t2 SET a = 15 WHERE a = 20;
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
UPDATE t2 SET a = 15 WHERE a = 10;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 20 0 5 6
### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
id info rows_sent rows_examined rows_read
### SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id 0 0 1
### UPDATE t2 SET a = 15 WHERE a = 20 0 5 6
### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
DROP TABLES t1, t2;

View file

@ -1,79 +0,0 @@
# Testing of INFORMATION_SCHEMA.PROCESSLIST fields ROWS_SENT, ROWS_EXAMINED, ROWS_READ
--source include/have_debug_sync.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
--connect (conn1, localhost, root, ,)
--connect (conn2, localhost, root, ,)
--connection conn1
SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
send CREATE TABLE t1 (a INT);
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
--connection conn2
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
send SELECT a FROM t2 WHERE a > 15;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
--source include/percona_processlist_row_stats_show.inc
--connection conn1
reap;
--connection conn2
reap;
--connection conn1
SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
send SELECT a FROM t2 WHERE a < 15;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
--connection conn2
SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
send SELECT a FROM t2 WHERE a > 15;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
--source include/percona_processlist_row_stats_show.inc
--connection conn1
reap;
--connection conn2
reap;
--connection conn1
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
send UPDATE t2 SET a = 15 WHERE a = 20;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
--connection conn2
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
send UPDATE t2 SET a = 15 WHERE a = 10;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
--source include/percona_processlist_row_stats_show.inc
--connection conn1
reap;
--connection conn2
reap;
--connection default
disconnect conn1;
disconnect conn2;
DROP TABLES t1, t2;

View file

@ -1,117 +0,0 @@
--source include/percona_query_cache_with_comments_clear.inc
let $query=/* with comment first */select * from t1;
eval $query;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=/* with comment first and "quote" */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
/* with comment and whitespaces first */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
# with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
-- with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment with "quote" *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* *\/ */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */* a comment \*/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select *# a comment \\
from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select *-- a comment \\
from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select "\\\\"" /* not a comment */" from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select "\\\\"" /*! not a comment */" from t1;
--source include/percona_query_cache_with_comments_eval.inc
# following two queries related to bug #856404.
# There are different queries, but opt_query_cache_strip_comments thinks that they are equal.
let $query=select ' \' ' from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select ' \' /* comment inside quotes with internal backslash quote */' from t1;
--source include/percona_query_cache_with_comments_eval.inc

View file

@ -1,88 +0,0 @@
--source include/percona_query_cache_with_comments_clear.inc
let $query=/* with comment first */select * from t1;
eval $query;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=/* with comment first and "quote" */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=# with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=-- with comment first and "quote"
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
/* with comment and whitespaces first */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
# with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=
-- with comment and whitespaces first
select * from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $internal=* internal comment with "quote" *;
let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1
/* comment in the end */
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end;
--source include/percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end
;
--source include/percona_query_cache_with_comments_eval.inc

File diff suppressed because it is too large Load diff

View file

@ -1,5 +0,0 @@
--disable_ps_protocol
set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
-- source include/percona_query_cache_with_comments_end.inc

View file

@ -1,12 +0,0 @@
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
--source include/percona_query_cache_with_comments_clear.inc

View file

@ -1,5 +0,0 @@
# Reset query cache variables.
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;

View file

@ -1,21 +0,0 @@
set GLOBAL query_cache_size=1355776;
drop table if exists t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
flush query cache;
flush query cache;
reset query cache;
flush status;
( select * from t1 );
a
1
2
3
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
/* only comment */;
# only comment
;
-- only comment
;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;

View file

@ -1,22 +0,0 @@
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
( select * from t1 );
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := REPLACE(REPLACE(@@SQL_MODE, 'ANSI_QUOTES', ''), ',,', ','), @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
/* only comment */;
let query=# only comment
;
eval $query;
let query=-- only comment
;
eval $query;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
-- source include/percona_query_cache_with_comments_end.inc

View file

@ -1,3 +0,0 @@
DROP TABLE t1;
SET GLOBAL query_cache_size=default;
set global query_cache_strip_comments=OFF;

View file

@ -1,7 +0,0 @@
echo -----------------------------------------------------;
echo $query;
echo -----------------------------------------------------;
--source include/percona_query_cache_with_comments_show.inc
eval $query;
eval $query;
--source include/percona_query_cache_with_comments_show.inc

View file

@ -1,396 +0,0 @@
set GLOBAL query_cache_size=1355776;
flush query cache;
flush query cache;
reset query cache;
flush status;
drop table if exists t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
set global query_cache_strip_comments=ON;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
prepare stmt from '/* with comment */ select * from t1';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
execute stmt;
a
1
2
3
execute stmt;
a
1
2
3
execute stmt;
a
1
2
3
execute stmt;
a
1
2
3
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 5
prepare stmt from 'select * from t1';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 6
prepare stmt from 'select * /*internal comment*/from t1';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 7
prepare stmt from 'select * /*internal comment*/ from t1';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 8
prepare stmt from 'select * from t1 /* at the end */';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
prepare stmt from 'select * from t1 /* with "quote" */';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 10
prepare stmt from 'select * from t1 /* with \'quote\' */';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
prepare stmt from 'select * from t1 # 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
prepare stmt from 'select * from t1 # 123 with "quote"
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
prepare stmt from 'select * from t1 # 123 with \'quote\'
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 14
prepare stmt from 'select * from t1
# 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 15
prepare stmt from '#456
select * from t1
# 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 16
prepare stmt from 'select * from t1 -- 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 17
prepare stmt from 'select * from t1
-- 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 18
prepare stmt from '-- comment in first
select * from t1
# 123
';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 19
prepare stmt from '(#456(
select * from t1
# 123(
)';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 19
prepare stmt from '/*test*/(-- comment in first(
select * from t1
-- 123 asdasd
/* test */)';
execute stmt;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 20
prepare stmt from 'select "test",a from t1';
execute stmt;
test a
test 1
test 2
test 3
execute stmt;
test a
test 1
test 2
test 3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 21
prepare stmt from 'select "test /* internal \'comment\' */",a from t1';
execute stmt;
test /* internal 'comment' */ a
test /* internal 'comment' */ 1
test /* internal 'comment' */ 2
test /* internal 'comment' */ 3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 21
prepare stmt from 'select "test #internal comment" ,a from t1';
execute stmt;
test #internal comment a
test #internal comment 1
test #internal comment 2
test #internal comment 3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 5
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 5
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 21
prepare stmt from 'select "test #internal comment" #external comment
,a from t1';
execute stmt;
test #internal comment a
test #internal comment 1
test #internal comment 2
test #internal comment 3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 5
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 5
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 22
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
set global query_cache_strip_comments=OFF;

View file

@ -1,208 +0,0 @@
-- source include/have_query_cache.inc
set GLOBAL query_cache_size=1355776;
# Reset query cache variables.
flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# First simple test
#
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
set global query_cache_strip_comments=ON;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '/* with comment */ select * from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
execute stmt;
execute stmt;
execute stmt;
execute stmt;
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * /*internal comment*/from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * /*internal comment*/ from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* at the end */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* with "quote" */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 /* with \'quote\' */';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123 with "quote"
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 # 123 with \'quote\'
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '#456
select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1 -- 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select * from t1
-- 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '-- comment in first
select * from t1
# 123
';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '(#456(
select * from t1
# 123(
)';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from '/*test*/(-- comment in first(
select * from t1
-- 123 asdasd
/* test */)';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test",a from t1';
execute stmt;
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test /* internal \'comment\' */",a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test #internal comment" ,a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
prepare stmt from 'select "test #internal comment" #external comment
,a from t1';
execute stmt;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
set global query_cache_strip_comments=OFF;

View file

@ -1,8 +0,0 @@
let $show=show status like "Qcache_queries_in_cache";
eval $show;
let $show=show status like "Qcache_inserts";
eval $show;
let $show=show status like "Qcache_hits";
eval $show;

View file

@ -1,727 +0,0 @@
SET GLOBAL query_exec_time=0.1;
include/master-slave.inc
[connection master]
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 1 0.100000
0.250000 0 0.000000
0.500000 30 10.650000
1.000000 3 1.500000
2.000000 15 19.500000
4.000000 12 30.000000
8.000000 6 27.599997
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 1 0.100000
0.250000 0 0.000000
0.500000 30 10.650000
1.000000 3 1.500000
2.000000 15 19.500000
4.000000 12 30.000000
8.000000 6 27.599997
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 1 0.100000
0.250000 0 0.000000
0.500000 30 10.650000
1.000000 3 1.500000
2.000000 15 19.500000
4.000000 12 30.000000
8.000000 6 27.599997
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 1 0.100000
0.250000 0 0.000000
0.500000 30 10.650000
1.000000 3 1.500000
2.000000 15 19.500000
4.000000 12 30.000000
8.000000 6 27.599997
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.000010 0 0.000000
0.000100 0 0.000000
0.001000 0 0.000000
0.010000 0 0.000000
0.100000 0 0.000000
1.000000 34 12.250000
10.000000 33 77.099997
100.000000 0 0.000000
1000.000000 0 0.000000
10000.000000 0 0.000000
100000.000000 0 0.000000
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.000010 0 0.000000
0.000100 0 0.000000
0.001000 0 0.000000
0.010000 0 0.000000
0.100000 0 0.000000
1.000000 34 12.250000
10.000000 33 77.099997
100.000000 0 0.000000
1000.000000 0 0.000000
10000.000000 0 0.000000
100000.000000 0 0.000000
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 7
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.000008 0 0.000000
0.000059 0 0.000000
0.000416 0 0.000000
0.002915 0 0.000000
0.020408 0 0.000000
0.142857 1 0.100000
1.000000 33 12.150000
7.000000 33 77.099997
49.000000 0 0.000000
343.000000 0 0.000000
2401.000000 0 0.000000
16807.000000 0 0.000000
117649.000000 0 0.000000
823543.000000 0 0.000000
5764801.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.000008 0 0.000000
0.000059 0 0.000000
0.000416 0 0.000000
0.002915 0 0.000000
0.020408 0 0.000000
0.142857 1 0.100000
1.000000 33 12.150000
7.000000 33 77.099997
49.000000 0 0.000000
343.000000 0 0.000000
2401.000000 0 0.000000
16807.000000 0 0.000000
117649.000000 0 0.000000
823543.000000 0 0.000000
5764801.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 156
SHOW QUERY_RESPONSE_TIME;
0.000041 1 0.000000
0.006410 0 0.000000
1.000000 34 12.250000
156.000000 33 77.099997
24336.000000 0 0.000000
3796416.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000041 1 0.000000
0.006410 0 0.000000
1.000000 34 12.250000
156.000000 33 77.099997
24336.000000 0 0.000000
3796416.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.001000 0 0.000000
1.000000 34 12.250000
1000.000000 33 77.099997
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.001000 0 0.000000
1.000000 34 12.250000
1000.000000 33 77.099997
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
CREATE TABLE t(id INT);
SET GLOBAL query_exec_time = 0.1;
include/restart_slave.inc
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SET SESSION query_exec_time = 0.31;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.32;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.33;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.34;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.35;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.36;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.37;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.38;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.39;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.2;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 1.4;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 0.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.3;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 2.5;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 3.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 4.1;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time = 5.1;
INSERT INTO t VALUES(1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
SHOW QUERY_RESPONSE_TIME;
0.000001 1 0.000000
0.001000 0 0.000000
1.000000 34 12.250000
1000.000000 33 77.099997
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 1 0.000000
0.001000 0 0.000000
1.000000 34 12.250000
1000.000000 33 77.099997
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP TABLE t;
include/rpl_end.inc
SET GLOBAL query_exec_time=default;
SET GLOBAL query_exec_time=default;

View file

@ -1,28 +0,0 @@
SET GLOBAL query_exec_time=0.1;
--source include/have_response_time_distribution.inc
--source include/have_debug.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
--let base=1
--source include/query_response_time-replication.inc
--let base=2
--source include/query_response_time-replication.inc
--let base=10
--source include/query_response_time-replication.inc
--let base=7
--source include/query_response_time-replication.inc
--let base=156
--source include/query_response_time-replication.inc
--let base=1000
--source include/query_response_time-replication.inc
--let base=1001
--source include/query_response_time-replication.inc
--source include/rpl_end.inc
SET GLOBAL query_exec_time=default;
connection slave;
SET GLOBAL query_exec_time=default;

View file

@ -1,544 +0,0 @@
CREATE TABLE t(a INT);
CREATE PROCEDURE test_f(t DECIMAL(3,2))
BEGIN
SET SESSION query_exec_time=t;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time=0.1;
DELETE FROM t;
END^
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 44 4.400000
0.250000 0 0.000000
0.500000 10 3.550000
1.000000 1 0.500000
2.000000 5 6.500000
4.000000 4 10.000000
8.000000 2 9.199999
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 44 4.400000
0.250000 0 0.000000
0.500000 10 3.550000
1.000000 1 0.500000
2.000000 5 6.500000
4.000000 4 10.000000
8.000000 2 9.199999
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=2;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 2
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 44 4.400000
0.250000 0 0.000000
0.500000 10 3.550000
1.000000 1 0.500000
2.000000 5 6.500000
4.000000 4 10.000000
8.000000 2 9.199999
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.000003 0 0.000000
0.000007 0 0.000000
0.000015 0 0.000000
0.000030 0 0.000000
0.000061 0 0.000000
0.000122 0 0.000000
0.000244 0 0.000000
0.000488 0 0.000000
0.000976 0 0.000000
0.001953 0 0.000000
0.003906 0 0.000000
0.007812 0 0.000000
0.015625 0 0.000000
0.031250 0 0.000000
0.062500 0 0.000000
0.125000 44 4.400000
0.250000 0 0.000000
0.500000 10 3.550000
1.000000 1 0.500000
2.000000 5 6.500000
4.000000 4 10.000000
8.000000 2 9.199999
16.000000 0 0.000000
32.000000 0 0.000000
64.000000 0 0.000000
128.000000 0 0.000000
256.000000 0 0.000000
512.000000 0 0.000000
1024.000000 0 0.000000
2048.000000 0 0.000000
4096.000000 0 0.000000
8192.000000 0 0.000000
16384.000000 0 0.000000
32768.000000 0 0.000000
65536.000000 0 0.000000
131072.000000 0 0.000000
262144.000000 0 0.000000
524288.000000 0 0.000000
1048576.000000 0 0.000000
2097152.000000 0 0.000000
4194304.000000 0 0.000000
8388608.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=10;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 10
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.000010 0 0.000000
0.000100 0 0.000000
0.001000 0 0.000000
0.010000 0 0.000000
0.100000 0 0.000000
1.000000 55 8.450000
10.000000 11 25.699999
100.000000 0 0.000000
1000.000000 0 0.000000
10000.000000 0 0.000000
100000.000000 0 0.000000
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.000010 0 0.000000
0.000100 0 0.000000
0.001000 0 0.000000
0.010000 0 0.000000
0.100000 0 0.000000
1.000000 55 8.450000
10.000000 11 25.699999
100.000000 0 0.000000
1000.000000 0 0.000000
10000.000000 0 0.000000
100000.000000 0 0.000000
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=7;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 7
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.000008 0 0.000000
0.000059 0 0.000000
0.000416 0 0.000000
0.002915 0 0.000000
0.020408 0 0.000000
0.142857 44 4.400000
1.000000 11 4.050000
7.000000 11 25.699999
49.000000 0 0.000000
343.000000 0 0.000000
2401.000000 0 0.000000
16807.000000 0 0.000000
117649.000000 0 0.000000
823543.000000 0 0.000000
5764801.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.000008 0 0.000000
0.000059 0 0.000000
0.000416 0 0.000000
0.002915 0 0.000000
0.020408 0 0.000000
0.142857 44 4.400000
1.000000 11 4.050000
7.000000 11 25.699999
49.000000 0 0.000000
343.000000 0 0.000000
2401.000000 0 0.000000
16807.000000 0 0.000000
117649.000000 0 0.000000
823543.000000 0 0.000000
5764801.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=156;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 156
SHOW QUERY_RESPONSE_TIME;
0.000041 45 0.000000
0.006410 0 0.000000
1.000000 55 8.450000
156.000000 11 25.699999
24336.000000 0 0.000000
3796416.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000041 45 0.000000
0.006410 0 0.000000
1.000000 55 8.450000
156.000000 11 25.699999
24336.000000 0 0.000000
3796416.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1000;
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.001000 0 0.000000
1.000000 55 8.450000
1000.000000 11 25.699999
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.001000 0 0.000000
1.000000 55 8.450000
1000.000000 11 25.699999
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET SESSION query_exec_time=0.1;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=1001;
Warnings:
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
CALL test_f(0.31);
CALL test_f(0.32);
CALL test_f(0.33);
CALL test_f(0.34);
CALL test_f(0.35);
CALL test_f(0.36);
CALL test_f(0.37);
CALL test_f(0.38);
CALL test_f(0.39);
CALL test_f(0.4);
CALL test_f(1.1);
CALL test_f(1.2);
CALL test_f(1.3);
CALL test_f(1.5);
CALL test_f(1.4);
CALL test_f(0.5);
CALL test_f(2.1);
CALL test_f(2.3);
CALL test_f(2.5);
CALL test_f(3.1);
CALL test_f(4.1);
CALL test_f(5.1);
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value
query_response_time_range_base 1000
SHOW QUERY_RESPONSE_TIME;
0.000001 45 0.000000
0.001000 0 0.000000
1.000000 55 8.450000
1000.000000 11 25.699999
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
time count total
0.000001 45 0.000000
0.001000 0 0.000000
1.000000 55 8.450000
1000.000000 11 25.699999
1000000.000000 0 0.000000
TOO LONG 0 TOO LONG
SET SESSION query_exec_time=default;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP PROCEDURE test_f;
DROP TABLE t;

View file

@ -1,36 +0,0 @@
--source include/have_response_time_distribution.inc
--source include/have_debug.inc
CREATE TABLE t(a INT);
delimiter ^;
CREATE PROCEDURE test_f(t DECIMAL(3,2))
BEGIN
SET SESSION query_exec_time=t;
INSERT INTO t VALUES(1);
SET SESSION query_exec_time=0.1;
DELETE FROM t;
END^
delimiter ;^
--let base=1
--source include/query_response_time-stored.inc
--let base=2
--source include/query_response_time-stored.inc
--let base=10
--source include/query_response_time-stored.inc
--let base=7
--source include/query_response_time-stored.inc
--let base=156
--source include/query_response_time-stored.inc
--let base=1000
--source include/query_response_time-stored.inc
--let base=1001
--source include/query_response_time-stored.inc
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;
DROP PROCEDURE test_f;
DROP TABLE t;

File diff suppressed because it is too large Load diff

View file

@ -1,20 +0,0 @@
--source include/have_response_time_distribution.inc
--source include/have_debug.inc
--let base=1
--source include/query_response_time.inc
--let base=2
--source include/query_response_time.inc
--let base=10
--source include/query_response_time.inc
--let base=7
--source include/query_response_time.inc
--let base=156
--source include/query_response_time.inc
--let base=1000
--source include/query_response_time.inc
--let base=1001
--source include/query_response_time.inc
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE=default;
SET GLOBAL QUERY_RESPONSE_TIME_STATS=default;

View file

@ -1 +0,0 @@
FLUSH QUERY_RESPONSE_TIME;

View file

@ -1,8 +0,0 @@
SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;

View file

@ -1,19 +0,0 @@
SET SESSION debug="+d,query_exec_time_0.31";
SET SESSION debug="+d,query_exec_time_0.32";
SET SESSION debug="+d,query_exec_time_0.33";
SET SESSION debug="+d,query_exec_time_0.34";
SET SESSION debug="+d,query_exec_time_0.35";
SET SESSION debug="+d,query_exec_time_0.36";
SET SESSION debug="+d,query_exec_time_0.37";
SET SESSION debug="+d,query_exec_time_0.38";
SET SESSION debug="+d,query_exec_time_0.39";
SET SESSION debug="+d,query_exec_time_0.4";
SET SESSION debug="+d,query_exec_time_1.1";
SET SESSION debug="+d,query_exec_time_1.2";
SET SESSION debug="+d,query_exec_time_1.3";
SET SESSION debug="+d,query_exec_time_1.5";
SET SESSION debug="+d,query_exec_time_1.4";
SET SESSION debug="+d,query_exec_time_0.5";
SET SESSION debug="+d,query_exec_time_2.1";
SET SESSION debug="+d,query_exec_time_2.3";
SET SESSION debug="+d,query_exec_time_2.5";

View file

@ -1,3 +0,0 @@
--source include/have_response_time_distribution.inc
--source include/have_innodb.inc
SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;

View file

@ -1,382 +0,0 @@
SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
Variable_name
AUTOCOMMIT
AUTOMATIC_SP_PRIVILEGES
AUTO_INCREMENT_INCREMENT
AUTO_INCREMENT_OFFSET
BACK_LOG
BASEDIR
BIG_TABLES
BINLOG_CACHE_SIZE
BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
BINLOG_FORMAT
BINLOG_STMT_CACHE_SIZE
BULK_INSERT_BUFFER_SIZE
CHARACTER_SETS_DIR
CHARACTER_SET_CLIENT
CHARACTER_SET_CONNECTION
CHARACTER_SET_DATABASE
CHARACTER_SET_FILESYSTEM
CHARACTER_SET_RESULTS
CHARACTER_SET_SERVER
CHARACTER_SET_SYSTEM
COLLATION_CONNECTION
COLLATION_DATABASE
COLLATION_SERVER
COMPLETION_TYPE
CONCURRENT_INSERT
CONNECT_TIMEOUT
DATADIR
DATETIME_FORMAT
DATE_FORMAT
DEBUG
DEBUG_SYNC
DEFAULT_STORAGE_ENGINE
DEFAULT_WEEK_FORMAT
DELAYED_INSERT_LIMIT
DELAYED_INSERT_TIMEOUT
DELAYED_QUEUE_SIZE
DELAY_KEY_WRITE
DIV_PRECISION_INCREMENT
ENGINE_CONDITION_PUSHDOWN
ERROR_COUNT
EVENT_SCHEDULER
EXPAND_FAST_INDEX_CREATION
EXPIRE_LOGS_DAYS
EXTERNAL_USER
FAST_INDEX_CREATION
FLUSH
FLUSH_TIME
FOREIGN_KEY_CHECKS
FT_BOOLEAN_SYNTAX
FT_MAX_WORD_LEN
FT_MIN_WORD_LEN
FT_QUERY_EXPANSION_LIMIT
FT_STOPWORD_FILE
GENERAL_LOG
GENERAL_LOG_FILE
GROUP_CONCAT_MAX_LEN
HAVE_COMPRESS
HAVE_CRYPT
HAVE_CSV
HAVE_DYNAMIC_LOADING
HAVE_GEOMETRY
HAVE_INNODB
HAVE_NDBCLUSTER
HAVE_OPENSSL
HAVE_PARTITIONING
HAVE_PROFILING
HAVE_QUERY_CACHE
HAVE_RESPONSE_TIME_DISTRIBUTION
HAVE_RTREE_KEYS
HAVE_SSL
HAVE_SYMLINK
HOSTNAME
IDENTITY
IGNORE_BUILTIN_INNODB
INIT_CONNECT
INIT_FILE
INIT_SLAVE
INNODB_ADAPTIVE_FLUSHING
INNODB_ADAPTIVE_FLUSHING_METHOD
INNODB_ADAPTIVE_HASH_INDEX
INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
INNODB_ADDITIONAL_MEM_POOL_SIZE
INNODB_AUTOEXTEND_INCREMENT
INNODB_AUTOINC_LOCK_MODE
INNODB_BLOCKING_BUFFER_POOL_RESTORE
INNODB_BUFFER_POOL_INSTANCES
INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
INNODB_BUFFER_POOL_SHM_CHECKSUM
INNODB_BUFFER_POOL_SHM_KEY
INNODB_BUFFER_POOL_SIZE
INNODB_CHANGE_BUFFERING
INNODB_CHANGE_BUFFERING_DEBUG
INNODB_CHECKPOINT_AGE_TARGET
INNODB_CHECKSUMS
INNODB_COMMIT_CONCURRENCY
INNODB_CONCURRENCY_TICKETS
INNODB_CORRUPT_TABLE_ACTION
INNODB_DATA_FILE_PATH
INNODB_DATA_HOME_DIR
INNODB_DICT_SIZE_LIMIT
INNODB_DOUBLEWRITE
INNODB_DOUBLEWRITE_FILE
INNODB_FAKE_CHANGES
INNODB_FAST_CHECKSUM
INNODB_FAST_SHUTDOWN
INNODB_FILE_FORMAT
INNODB_FILE_FORMAT_CHECK
INNODB_FILE_FORMAT_MAX
INNODB_FILE_PER_TABLE
INNODB_FLUSH_CHECKPOINT_DEBUG
INNODB_FLUSH_LOG_AT_TRX_COMMIT
INNODB_FLUSH_METHOD
INNODB_FLUSH_NEIGHBOR_PAGES
INNODB_FORCE_LOAD_CORRUPTED
INNODB_FORCE_RECOVERY
INNODB_IBUF_ACCEL_RATE
INNODB_IBUF_ACTIVE_CONTRACT
INNODB_IBUF_MAX_SIZE
INNODB_IMPORT_TABLE_FROM_XTRABACKUP
INNODB_IO_CAPACITY
INNODB_KILL_IDLE_TRANSACTION
INNODB_LARGE_PREFIX
INNODB_LAZY_DROP_TABLE
INNODB_LOCKS_UNSAFE_FOR_BINLOG
INNODB_LOCK_WAIT_TIMEOUT
INNODB_LOG_BLOCK_SIZE
INNODB_LOG_BUFFER_SIZE
INNODB_LOG_FILES_IN_GROUP
INNODB_LOG_FILE_SIZE
INNODB_LOG_GROUP_HOME_DIR
INNODB_MAX_DIRTY_PAGES_PCT
INNODB_MAX_PURGE_LAG
INNODB_MIRRORED_LOG_GROUPS
INNODB_OLD_BLOCKS_PCT
INNODB_OLD_BLOCKS_TIME
INNODB_OPEN_FILES
INNODB_PAGE_SIZE
INNODB_PURGE_BATCH_SIZE
INNODB_PURGE_THREADS
INNODB_RANDOM_READ_AHEAD
INNODB_READ_AHEAD
INNODB_READ_AHEAD_THRESHOLD
INNODB_READ_IO_THREADS
INNODB_RECOVERY_STATS
INNODB_RECOVERY_UPDATE_RELAY_LOG
INNODB_REPLICATION_DELAY
INNODB_ROLLBACK_ON_TIMEOUT
INNODB_ROLLBACK_SEGMENTS
INNODB_SHOW_LOCKS_HELD
INNODB_SHOW_VERBOSE_LOCKS
INNODB_SPIN_WAIT_DELAY
INNODB_STATS_AUTO_UPDATE
INNODB_STATS_METHOD
INNODB_STATS_ON_METADATA
INNODB_STATS_SAMPLE_PAGES
INNODB_STATS_UPDATE_NEED_LOCK
INNODB_STRICT_MODE
INNODB_SUPPORT_XA
INNODB_SYNC_SPIN_LOOPS
INNODB_TABLE_LOCKS
INNODB_THREAD_CONCURRENCY
INNODB_THREAD_CONCURRENCY_TIMER_BASED
INNODB_THREAD_SLEEP_DELAY
INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
INNODB_USE_NATIVE_AIO
INNODB_USE_SYS_MALLOC
INNODB_USE_SYS_STATS_TABLE
INNODB_VERSION
INNODB_WRITE_IO_THREADS
INSERT_ID
INTERACTIVE_TIMEOUT
JOIN_BUFFER_SIZE
KEEP_FILES_ON_CREATE
KEY_BUFFER_SIZE
KEY_CACHE_AGE_THRESHOLD
KEY_CACHE_BLOCK_SIZE
KEY_CACHE_DIVISION_LIMIT
LARGE_FILES_SUPPORT
LARGE_PAGES
LARGE_PAGE_SIZE
LAST_INSERT_ID
LC_MESSAGES
LC_MESSAGES_DIR
LC_TIME_NAMES
LICENSE
LOCAL_INFILE
LOCKED_IN_MEMORY
LOCK_WAIT_TIMEOUT
LOG
LOG_BIN
LOG_BIN_TRUST_FUNCTION_CREATORS
LOG_ERROR
LOG_OUTPUT
LOG_QUERIES_NOT_USING_INDEXES
LOG_SLAVE_UPDATES
LOG_SLOW_ADMIN_STATEMENTS
LOG_SLOW_FILTER
LOG_SLOW_QUERIES
LOG_SLOW_RATE_LIMIT
LOG_SLOW_SLAVE_STATEMENTS
LOG_SLOW_SP_STATEMENTS
LOG_SLOW_VERBOSITY
LOG_WARNINGS
LOG_WARNINGS_SUPPRESS
LONG_QUERY_TIME
LOWER_CASE_FILE_SYSTEM
LOWER_CASE_TABLE_NAMES
LOW_PRIORITY_UPDATES
MAX_ALLOWED_PACKET
MAX_BINLOG_CACHE_SIZE
MAX_BINLOG_SIZE
MAX_BINLOG_STMT_CACHE_SIZE
MAX_CONNECTIONS
MAX_CONNECT_ERRORS
MAX_DELAYED_THREADS
MAX_ERROR_COUNT
MAX_HEAP_TABLE_SIZE
MAX_INSERT_DELAYED_THREADS
MAX_JOIN_SIZE
MAX_LENGTH_FOR_SORT_DATA
MAX_LONG_DATA_SIZE
MAX_PREPARED_STMT_COUNT
MAX_RELAY_LOG_SIZE
MAX_SEEKS_FOR_KEY
MAX_SORT_LENGTH
MAX_SP_RECURSION_DEPTH
MAX_TMP_TABLES
MAX_USER_CONNECTIONS
MAX_WRITE_LOCK_COUNT
METADATA_LOCKS_CACHE_SIZE
MIN_EXAMINED_ROW_LIMIT
MULTI_RANGE_COUNT
MYISAM_DATA_POINTER_SIZE
MYISAM_MAX_SORT_FILE_SIZE
MYISAM_MMAP_SIZE
MYISAM_RECOVER_OPTIONS
MYISAM_REPAIR_THREADS
MYISAM_SORT_BUFFER_SIZE
MYISAM_STATS_METHOD
MYISAM_USE_MMAP
NET_BUFFER_LENGTH
NET_READ_TIMEOUT
NET_RETRY_COUNT
NET_WRITE_TIMEOUT
NEW
OLD
OLD_ALTER_TABLE
OLD_PASSWORDS
OPEN_FILES_LIMIT
OPTIMIZER_FIX
OPTIMIZER_PRUNE_LEVEL
OPTIMIZER_SEARCH_DEPTH
OPTIMIZER_SWITCH
PERFORMANCE_SCHEMA
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
PERFORMANCE_SCHEMA_MAX_COND_CLASSES
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
PID_FILE
PLUGIN_DIR
PORT
PRELOAD_BUFFER_SIZE
PROFILING
PROFILING_HISTORY_SIZE
PROTOCOL_VERSION
PROXY_USER
PSEUDO_THREAD_ID
QUERY_ALLOC_BLOCK_SIZE
QUERY_CACHE_LIMIT
QUERY_CACHE_MIN_RES_UNIT
QUERY_CACHE_SIZE
QUERY_CACHE_STRIP_COMMENTS
QUERY_CACHE_TYPE
QUERY_CACHE_WLOCK_INVALIDATE
QUERY_EXEC_TIME
QUERY_PREALLOC_SIZE
QUERY_RESPONSE_TIME_RANGE_BASE
QUERY_RESPONSE_TIME_STATS
RAND_SEED1
RAND_SEED2
RANGE_ALLOC_BLOCK_SIZE
READ_BUFFER_SIZE
READ_ONLY
READ_RND_BUFFER_SIZE
RELAY_LOG
RELAY_LOG_INDEX
RELAY_LOG_INFO_FILE
RELAY_LOG_PURGE
RELAY_LOG_RECOVERY
RELAY_LOG_SPACE_LIMIT
REPORT_HOST
REPORT_PASSWORD
REPORT_PORT
REPORT_USER
RPL_RECOVERY_RANK
SECURE_AUTH
SECURE_FILE_PRIV
SERVER_ID
SKIP_EXTERNAL_LOCKING
SKIP_NAME_RESOLVE
SKIP_NETWORKING
SKIP_SHOW_DATABASE
SLAVE_COMPRESSED_PROTOCOL
SLAVE_EXEC_MODE
SLAVE_LOAD_TMPDIR
SLAVE_NET_TIMEOUT
SLAVE_SKIP_ERRORS
SLAVE_TRANSACTION_RETRIES
SLAVE_TYPE_CONVERSIONS
SLOW_LAUNCH_TIME
SLOW_QUERY_LOG
SLOW_QUERY_LOG_FILE
SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
SLOW_QUERY_LOG_TIMESTAMP_PRECISION
SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
SOCKET
SORT_BUFFER_SIZE
SQL_AUTO_IS_NULL
SQL_BIG_SELECTS
SQL_BIG_TABLES
SQL_BUFFER_RESULT
SQL_LOG_BIN
SQL_LOG_OFF
SQL_LOW_PRIORITY_UPDATES
SQL_MAX_JOIN_SIZE
SQL_MODE
SQL_NOTES
SQL_QUOTE_SHOW_CREATE
SQL_SAFE_UPDATES
SQL_SELECT_LIMIT
SQL_SLAVE_SKIP_COUNTER
SQL_WARNINGS
SSL_CA
SSL_CAPATH
SSL_CERT
SSL_CIPHER
SSL_KEY
STORAGE_ENGINE
SYNC_BINLOG
SYNC_FRM
SYNC_MASTER_INFO
SYNC_RELAY_LOG
SYNC_RELAY_LOG_INFO
SYSTEM_TIME_ZONE
TABLE_DEFINITION_CACHE
TABLE_OPEN_CACHE
THREAD_CACHE_SIZE
THREAD_CONCURRENCY
THREAD_HANDLING
THREAD_STACK
THREAD_STATISTICS
TIMED_MUTEXES
TIMESTAMP
TIME_FORMAT
TIME_ZONE
TMPDIR
TMP_TABLE_SIZE
TRANSACTION_ALLOC_BLOCK_SIZE
TRANSACTION_PREALLOC_SIZE
TX_ISOLATION
UNIQUE_CHECKS
UPDATABLE_VIEWS_WITH_LIMIT
USERSTAT
VERSION
VERSION_COMMENT
VERSION_COMPILE_MACHINE
VERSION_COMPILE_OS
WAIT_TIMEOUT
WARNING_COUNT

Some files were not shown because too many files have changed in this diff Show more