Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks
This commit is contained in:
commit
9d47c4cfdb
@ -69,13 +69,9 @@ ENDMACRO()
|
||||
# Get mysql version and other interesting variables
|
||||
GET_MYSQL_VERSION()
|
||||
|
||||
SET(MYSQL_TCP_PORT_DEFAULT "3306")
|
||||
|
||||
SET(MYSQL_TCP_PORT_DEFAULT 0)
|
||||
IF(NOT MYSQL_TCP_PORT)
|
||||
SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT})
|
||||
SET(MYSQL_TCP_PORT_DEFAULT "0")
|
||||
ELSEIF(MYSQL_TCP_PORT EQUAL MYSQL_TCP_PORT_DEFAULT)
|
||||
SET(MYSQL_TCP_PORT_DEFAULT "0")
|
||||
SET(MYSQL_TCP_PORT 3306)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT COMPILATION_COMMENT)
|
||||
|
@ -2460,7 +2460,7 @@ static os_thread_ret_t log_copying_thread(void*)
|
||||
|
||||
log_copying_running = false;
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
os_thread_exit();
|
||||
|
||||
return(0);
|
||||
}
|
||||
@ -2483,7 +2483,7 @@ static os_thread_ret_t io_watching_thread(void*)
|
||||
|
||||
io_watching_thread_running = false;
|
||||
|
||||
os_thread_exit(NULL);
|
||||
os_thread_exit();
|
||||
|
||||
return(0);
|
||||
}
|
||||
@ -2523,7 +2523,7 @@ data_copy_thread_func(
|
||||
pthread_mutex_unlock(&ctxt->count_mutex);
|
||||
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
os_thread_exit();
|
||||
OS_THREAD_DUMMY_RETURN;
|
||||
}
|
||||
|
||||
|
@ -336,9 +336,14 @@ sub start_kill {
|
||||
|
||||
sub dump_core {
|
||||
my ($self)= @_;
|
||||
return if IS_WINDOWS;
|
||||
my $pid= $self->{SAFE_PID};
|
||||
die "Can't get core from not started process" unless defined $pid;
|
||||
|
||||
if (IS_WINDOWS) {
|
||||
system("$safe_kill $pid dump");
|
||||
return 1;
|
||||
}
|
||||
|
||||
_verbose("Sending ABRT to $self");
|
||||
kill ("ABRT", $pid);
|
||||
return 1;
|
||||
|
@ -25,6 +25,7 @@ SET(INSTALL_ARGS
|
||||
IF (WIN32)
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS})
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS})
|
||||
TARGET_LINK_LIBRARIES(my_safe_kill dbghelp psapi)
|
||||
ELSE()
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
|
||||
ENDIF()
|
||||
|
@ -25,6 +25,80 @@
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <psapi.h>
|
||||
#include <DbgHelp.h>
|
||||
|
||||
static int create_dump(DWORD pid)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
char working_dir[MAX_PATH];
|
||||
int ret= -1;
|
||||
HANDLE process= INVALID_HANDLE_VALUE;
|
||||
HANDLE file= INVALID_HANDLE_VALUE;
|
||||
char *p;
|
||||
|
||||
process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, (DWORD)pid);
|
||||
if (!process)
|
||||
{
|
||||
fprintf(stderr,"safe_kill : cannot open process pid=%u to create dump, last error %u\n",
|
||||
pid, GetLastError());
|
||||
goto exit;
|
||||
}
|
||||
|
||||
DWORD size = MAX_PATH;
|
||||
if (QueryFullProcessImageName(process, 0, path, &size) == 0)
|
||||
{
|
||||
fprintf(stderr,"safe_kill : cannot read process path for pid %u, last error %u\n",
|
||||
pid, GetLastError());
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((p = strrchr(path, '.')) == 0)
|
||||
p= path + strlen(path);
|
||||
|
||||
strncpy(p, ".dmp", path + MAX_PATH - p);
|
||||
|
||||
/* Create dump in current directory.*/
|
||||
const char *filename= strrchr(path, '\\');
|
||||
if (filename == 0)
|
||||
filename = path;
|
||||
else
|
||||
filename++;
|
||||
|
||||
if (!GetCurrentDirectory(MAX_PATH, working_dir))
|
||||
{
|
||||
fprintf(stderr, "GetCurrentDirectory failed, last error %u",GetLastError());
|
||||
goto exit;
|
||||
}
|
||||
|
||||
file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE,
|
||||
0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
fprintf(stderr,"safe_kill : CreateFile() failed for file %s, working dir %s, last error = %u\n",
|
||||
filename, working_dir, GetLastError());
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!MiniDumpWriteDump(process, pid, file, MiniDumpNormal, 0,0,0))
|
||||
{
|
||||
fprintf(stderr, "Failed to write minidump to %s, working dir %s, last error %u\n",
|
||||
filename, working_dir, GetLastError());
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
fprintf(stderr, "Minidump written to %s, directory %s\n", filename, working_dir);
|
||||
|
||||
exit:
|
||||
if(process!= 0 && process != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(process);
|
||||
|
||||
if (file != 0 && file != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(file);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, const char** argv )
|
||||
{
|
||||
@ -37,12 +111,16 @@ int main(int argc, const char** argv )
|
||||
signal(SIGBREAK, SIG_IGN);
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "safe_kill <pid>\n");
|
||||
if ((argc != 2 && argc != 3) || (argc == 3 && strcmp(argv[2],"dump"))) {
|
||||
fprintf(stderr, "safe_kill <pid> [dump]\n");
|
||||
exit(2);
|
||||
}
|
||||
pid= atoi(argv[1]);
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
return create_dump(pid);
|
||||
}
|
||||
_snprintf(safe_process_name, sizeof(safe_process_name),
|
||||
"safe_process[%d]", pid);
|
||||
|
||||
|
@ -11,3 +11,14 @@ t1 CREATE TABLE `t1` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
drop table t1;
|
||||
set @@sql_mode=default;
|
||||
create table t1 (
|
||||
id1 int(11) not null auto_increment,
|
||||
id2 varchar(30) not null,
|
||||
id3 datetime not null default current_timestamp,
|
||||
primary key (id1),
|
||||
unique key unique_id2 (id2)
|
||||
) engine=innodb;
|
||||
alter table t1 change column id2 id4 varchar(100) not null;
|
||||
select * from t1 where id4 like 'a';
|
||||
id1 id4 id3
|
||||
drop table t1;
|
||||
|
@ -640,10 +640,8 @@ CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL;
|
||||
ALTER TABLE t1o DROP INDEX ct, DROP INDEX FTS_DOC_ID_INDEX,
|
||||
CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL;
|
||||
ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id);
|
||||
call mtr.add_suppression("InnoDB: No matching column for `FTS_DOC_ID` in index `ct` of table `test`\\.`t1o`");
|
||||
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
|
||||
ADD FULLTEXT INDEX(ct);
|
||||
ERROR HY000: Index for table 't1o' is corrupt; try to repair it
|
||||
DROP TABLE sys_indexes;
|
||||
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID;
|
||||
|
@ -8,3 +8,17 @@ create index idx1 on t1(a(3073));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
set @@sql_mode=default;
|
||||
|
||||
#
|
||||
# MDEV-14081 ALTER TABLE CHANGE COLUMN Corrupts Index Leading to Crashes in 10.2
|
||||
#
|
||||
create table t1 (
|
||||
id1 int(11) not null auto_increment,
|
||||
id2 varchar(30) not null,
|
||||
id3 datetime not null default current_timestamp,
|
||||
primary key (id1),
|
||||
unique key unique_id2 (id2)
|
||||
) engine=innodb;
|
||||
alter table t1 change column id2 id4 varchar(100) not null;
|
||||
select * from t1 where id4 like 'a';
|
||||
drop table t1;
|
||||
|
@ -370,16 +370,8 @@ CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL;
|
||||
|
||||
ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id);
|
||||
|
||||
# FIXME: MDEV-9469 'Incorrect key file' on ALTER TABLE
|
||||
call mtr.add_suppression("InnoDB: No matching column for `FTS_DOC_ID` in index `ct` of table `test`\\.`t1o`");
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
|
||||
ADD FULLTEXT INDEX(ct);
|
||||
# FIXME: MDEV-9469 (enable this)
|
||||
#--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
#ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
|
||||
#ALGORITHM=INPLACE;
|
||||
#end of MDEV-9469 FIXME
|
||||
|
||||
DROP TABLE sys_indexes;
|
||||
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
|
31
mysql-test/suite/innodb_fts/r/truncate.result
Normal file
31
mysql-test/suite/innodb_fts/r/truncate.result
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE
|
||||
#
|
||||
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b),
|
||||
FULLTEXT fts2(c));
|
||||
TRUNCATE TABLE t1;
|
||||
INSERT INTO t1 (a,d,b,c) VALUES (
|
||||
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
|
||||
cuullucocraloracurooulrooauuar','1'));
|
||||
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b));
|
||||
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1'));
|
||||
create procedure insert_t2(IN total int)
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= total) DO
|
||||
insert into t2 select * from t2;
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
CALL insert_t2(15);
|
||||
SET @save_dbug = @@SESSION.DEBUG_DBUG;
|
||||
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate';
|
||||
INSERT INTO t1 (a,d,b,c) VALUES (
|
||||
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
|
||||
cuullucocraloracurooulrooauuar','1'));
|
||||
SET DEBUG_DBUG = @save_dbug;
|
||||
DROP PROCEDURE insert_t2;
|
||||
DROP TABLE t1,t2;
|
1
mysql-test/suite/innodb_fts/t/truncate.opt
Normal file
1
mysql-test/suite/innodb_fts/t/truncate.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb-random-read-ahead=1
|
50
mysql-test/suite/innodb_fts/t/truncate.test
Normal file
50
mysql-test/suite/innodb_fts/t/truncate.test
Normal file
@ -0,0 +1,50 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b),
|
||||
FULLTEXT fts2(c));
|
||||
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
INSERT INTO t1 (a,d,b,c) VALUES (
|
||||
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
|
||||
cuullucocraloracurooulrooauuar','1'));
|
||||
|
||||
# The following CREATE TABLE and INSERTs are used to remove the pages related to table t1
|
||||
# from the buffer pool.
|
||||
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b));
|
||||
|
||||
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1'));
|
||||
|
||||
delimiter |;
|
||||
create procedure insert_t2(IN total int)
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= total) DO
|
||||
insert into t2 select * from t2;
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
CALL insert_t2(15);
|
||||
|
||||
SET @save_dbug = @@SESSION.DEBUG_DBUG;
|
||||
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate';
|
||||
|
||||
INSERT INTO t1 (a,d,b,c) VALUES (
|
||||
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
|
||||
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
|
||||
cuullucocraloracurooulrooauuar','1'));
|
||||
|
||||
SET DEBUG_DBUG = @save_dbug;
|
||||
|
||||
DROP PROCEDURE insert_t2;
|
||||
|
||||
DROP TABLE t1,t2;
|
@ -3046,7 +3046,7 @@ READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||
VARIABLE_NAME INNODB_VERSION
|
||||
SESSION_VALUE NULL
|
||||
GLOBAL_VALUE 5.7.19
|
||||
GLOBAL_VALUE 5.7.20
|
||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||
DEFAULT_VALUE NULL
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
|
@ -114,6 +114,17 @@ if [ "$basedir" != "/usr" ]; then
|
||||
fi
|
||||
cflags="$include @CFLAGS_FOR_CLIENTS@"
|
||||
|
||||
mariadb_config="$basedir/bin/mariadb_config"
|
||||
if test -x "$basedir/bin/mariadb_config"; then
|
||||
cflags=`"$mariadb_config" --cflags`
|
||||
include=`"$mariadb_config" --include`
|
||||
libs=`"$mariadb_config" --libs`
|
||||
plugindir=`"$mariadb_config" --plugindir`
|
||||
socket=`"$mariadb_config" --socket`
|
||||
port=`"$mariadb_config" --port`
|
||||
version=`"$mariadb_config" --version`
|
||||
fi
|
||||
|
||||
usage () {
|
||||
cat <<EOF
|
||||
Usage: $0 [OPTIONS]
|
||||
|
@ -45,7 +45,7 @@ case "$1" in
|
||||
# "traditional" notation
|
||||
readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
|
||||
fi
|
||||
readonly WSREP_SST_OPT_PORT=$(echo $WSREP_SST_OPT_ADDR | \
|
||||
readonly WSREP_SST_OPT_ADDR_PORT=$(echo $WSREP_SST_OPT_ADDR | \
|
||||
cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1)
|
||||
readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/}
|
||||
shift
|
||||
@ -124,6 +124,17 @@ readonly WSREP_SST_OPT_BYPASS
|
||||
readonly WSREP_SST_OPT_BINLOG
|
||||
readonly WSREP_SST_OPT_CONF_SUFFIX
|
||||
|
||||
if [ -n "$WSREP_SST_OPT_ADDR_PORT" ]; then
|
||||
if [ -n "$WSREP_SST_OPT_PORT" ]; then
|
||||
if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
|
||||
wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# try to use my_print_defaults, mysql and mysqldump that come with the sources
|
||||
# (for MTR suite)
|
||||
SCRIPTS_DIR="$(cd $(dirname "$0"); pwd -P)"
|
||||
|
@ -117,7 +117,7 @@ GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" |\
|
||||
$MYSQL_CLIENT $AUTH -S$WSREP_SST_OPT_SOCKET --disable-reconnect --connect_timeout=10 |\
|
||||
tail -1 | awk -F ' ' '{ print $2 }')
|
||||
|
||||
MYSQL="$MYSQL_CLIENT --defaults-extra-file=$WSREP_SST_OPT_CONF "\
|
||||
MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF "\
|
||||
"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED:-$WSREP_SST_OPT_HOST} "\
|
||||
"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10"
|
||||
|
||||
|
@ -4643,6 +4643,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
||||
double roru_index_costs;
|
||||
ha_rows roru_total_records;
|
||||
double roru_intersect_part= 1.0;
|
||||
ulong n_child_scans;
|
||||
DBUG_ENTER("get_best_disjunct_quick");
|
||||
DBUG_PRINT("info", ("Full table scan cost: %g", read_time));
|
||||
|
||||
@ -4659,7 +4660,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
||||
}
|
||||
}
|
||||
|
||||
size_t n_child_scans= imerge->trees_next - imerge->trees;
|
||||
n_child_scans= imerge->trees_next - imerge->trees;
|
||||
|
||||
if (!n_child_scans)
|
||||
DBUG_RETURN(NULL);
|
||||
@ -4877,8 +4878,8 @@ skip_to_ror_scan:
|
||||
(TIME_FOR_COMPARE_ROWID * M_LN2) +
|
||||
get_sweep_read_cost(param, roru_total_records);
|
||||
|
||||
DBUG_PRINT("info", ("ROR-union: cost %g, %d members", roru_total_cost,
|
||||
n_child_scans));
|
||||
DBUG_PRINT("info", ("ROR-union: cost %g, %lu members",
|
||||
roru_total_cost, n_child_scans));
|
||||
TRP_ROR_UNION* roru;
|
||||
if (roru_total_cost < read_time)
|
||||
{
|
||||
|
@ -85,8 +85,9 @@ static my_bool print_cached_tables_callback(TDC_element *element,
|
||||
while ((entry= it++))
|
||||
{
|
||||
THD *in_use= entry->in_use;
|
||||
printf("%-14.14s %-32s%6ld%8ld%6d %s\n",
|
||||
entry->s->db.str, entry->s->table_name.str, element->version,
|
||||
printf("%-14.14s %-32s%6lu%8ld%6d %s\n",
|
||||
entry->s->db.str, entry->s->table_name.str,
|
||||
(ulong) element->version,
|
||||
in_use ? (long) in_use->thread_id : (long) 0,
|
||||
entry->db_stat ? 1 : 0,
|
||||
in_use ? lock_descriptions[(int)entry->reginfo.lock_type] :
|
||||
@ -106,7 +107,8 @@ static void print_cached_tables(void)
|
||||
|
||||
tdc_iterate(0, (my_hash_walk_action) print_cached_tables_callback, NULL, true);
|
||||
|
||||
printf("\nCurrent refresh version: %ld\n", tdc_refresh_version());
|
||||
printf("\nCurrent refresh version: %ld\n",
|
||||
(long) tdc_refresh_version());
|
||||
fflush(stdout);
|
||||
/* purecov: end */
|
||||
return;
|
||||
|
@ -1459,7 +1459,7 @@ int BLKFAM::ReadBuffer(PGLOBAL g)
|
||||
// Read the entire next block
|
||||
n = fread(To_Buf, 1, (size_t)BlkLen, Stream);
|
||||
|
||||
if (n == BlkLen) {
|
||||
if ((size_t) n == (size_t) BlkLen) {
|
||||
// ReadBlks++;
|
||||
num_read++;
|
||||
Rbuf = (CurBlk == Block - 1) ? Last : Nrec;
|
||||
|
@ -176,6 +176,17 @@ buf_read_page_low(
|
||||
dst = ((buf_block_t*) bpage)->frame;
|
||||
}
|
||||
|
||||
DBUG_EXECUTE_IF(
|
||||
"innodb_invalid_read_after_truncate",
|
||||
if (fil_space_t* space = fil_space_acquire(page_id.space())) {
|
||||
if (!strcmp(space->name, "test/t1")
|
||||
&& page_id.page_no() == space->size - 1) {
|
||||
type = 0;
|
||||
sync = true;
|
||||
}
|
||||
fil_space_release(space);
|
||||
});
|
||||
|
||||
IORequest request(type | IORequest::READ);
|
||||
|
||||
*err = fil_io(
|
||||
@ -321,6 +332,19 @@ buf_read_ahead_random(
|
||||
that is, reside near the start of the LRU list. */
|
||||
|
||||
for (i = low; i < high; i++) {
|
||||
DBUG_EXECUTE_IF(
|
||||
"innodb_invalid_read_after_truncate",
|
||||
if (fil_space_t* space = fil_space_acquire(
|
||||
page_id.space())) {
|
||||
bool skip = !strcmp(space->name, "test/t1");
|
||||
fil_space_release(space);
|
||||
if (skip) {
|
||||
high = space->size;
|
||||
buf_pool_mutex_exit(buf_pool);
|
||||
goto read_ahead;
|
||||
}
|
||||
});
|
||||
|
||||
const buf_page_t* bpage = buf_page_hash_get(
|
||||
buf_pool, page_id_t(page_id.space(), i));
|
||||
|
||||
|
@ -1218,6 +1218,7 @@ fil_mutex_enter_and_prepare_for_io(
|
||||
fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
|
||||
|
||||
count++;
|
||||
mutex_enter(&fil_system->mutex);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -149,13 +149,6 @@ struct fts_query_t {
|
||||
bool multi_exist; /*!< multiple FTS_EXIST oper */
|
||||
|
||||
st_mysql_ftparser* parser; /*!< fts plugin parser */
|
||||
|
||||
/** limit value for the fts query */
|
||||
ulonglong limit;
|
||||
|
||||
/** number of docs fetched by query. This is to restrict the
|
||||
result with limit value */
|
||||
ulonglong n_docs;
|
||||
};
|
||||
|
||||
/** For phrase matching, first we collect the documents and the positions
|
||||
@ -3228,11 +3221,6 @@ fts_query_filter_doc_ids(
|
||||
ulint decoded = 0;
|
||||
ib_rbt_t* doc_freqs = word_freq->doc_freqs;
|
||||
|
||||
if (query->limit != ULONG_UNDEFINED
|
||||
&& query->n_docs >= query->limit) {
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
/* Decode the ilist and add the doc ids to the query doc_id set. */
|
||||
while (decoded < len) {
|
||||
ulint freq = 0;
|
||||
@ -3320,17 +3308,11 @@ fts_query_filter_doc_ids(
|
||||
/* Add the word to the document's matched RB tree. */
|
||||
fts_query_add_word_to_document(query, doc_id, word);
|
||||
}
|
||||
|
||||
if (query->limit != ULONG_UNDEFINED
|
||||
&& query->limit <= ++query->n_docs) {
|
||||
goto func_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Some sanity checks. */
|
||||
ut_a(doc_id == node->last_doc_id);
|
||||
|
||||
func_exit:
|
||||
if (query->total_size > fts_result_cache_limit) {
|
||||
return(DB_FTS_EXCEED_RESULT_CACHE_LIMIT);
|
||||
} else {
|
||||
@ -3941,7 +3923,6 @@ fts_query_can_optimize(
|
||||
@param[in] query_str FTS query
|
||||
@param[in] query_len FTS query string len in bytes
|
||||
@param[in,out] result result doc ids
|
||||
@param[in] limit limit value
|
||||
@return DB_SUCCESS if successful otherwise error code */
|
||||
dberr_t
|
||||
fts_query(
|
||||
@ -3950,8 +3931,7 @@ fts_query(
|
||||
uint flags,
|
||||
const byte* query_str,
|
||||
ulint query_len,
|
||||
fts_result_t** result,
|
||||
ulonglong limit)
|
||||
fts_result_t** result)
|
||||
{
|
||||
fts_query_t query;
|
||||
dberr_t error = DB_SUCCESS;
|
||||
@ -4013,10 +3993,6 @@ fts_query(
|
||||
|
||||
query.total_docs = dict_table_get_n_rows(index->table);
|
||||
|
||||
query.limit = limit;
|
||||
|
||||
query.n_docs = 0;
|
||||
|
||||
query.fts_common_table.suffix = "DELETED";
|
||||
|
||||
/* Read the deleted doc_ids, we need these for filtering. */
|
||||
@ -4078,19 +4054,6 @@ fts_query(
|
||||
fts_result_cache_limit = 2048;
|
||||
);
|
||||
|
||||
/* Optimisation is allowed for limit value
|
||||
when
|
||||
i) No ranking involved
|
||||
ii) Only FTS Union operations involved. */
|
||||
if (query.limit != ULONG_UNDEFINED
|
||||
&& !fts_ast_node_check_union(ast)) {
|
||||
query.limit = ULONG_UNDEFINED;
|
||||
}
|
||||
|
||||
DBUG_EXECUTE_IF("fts_union_limit_off",
|
||||
query.limit = ULONG_UNDEFINED;
|
||||
);
|
||||
|
||||
/* Traverse the Abstract Syntax Tree (AST) and execute
|
||||
the query. */
|
||||
query.error = fts_ast_visit(
|
||||
|
@ -10537,10 +10537,8 @@ ha_innobase::ft_init_ext(
|
||||
const byte* q = reinterpret_cast<const byte*>(
|
||||
const_cast<char*>(query));
|
||||
|
||||
// JAN: TODO: support for ft_init_ext_with_hints(), remove the line below
|
||||
m_prebuilt->m_fts_limit= ULONG_UNDEFINED;
|
||||
dberr_t error = fts_query(trx, index, flags, q, query_len, &result,
|
||||
m_prebuilt->m_fts_limit);
|
||||
// FIXME: support ft_init_ext_with_hints(), pass LIMIT
|
||||
dberr_t error = fts_query(trx, index, flags, q, query_len, &result);
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
my_error(convert_error_code_to_mysql(error, 0, NULL), MYF(0));
|
||||
|
@ -4850,7 +4850,7 @@ new_clustered_failed:
|
||||
|
||||
ctx->add_index[a] = row_merge_create_index(
|
||||
ctx->trx, ctx->new_table,
|
||||
&index_defs[a], add_v, ctx->col_names);
|
||||
&index_defs[a], add_v);
|
||||
|
||||
add_key_nums[a] = index_defs[a].key_number;
|
||||
|
||||
|
@ -579,7 +579,6 @@ fts_commit(
|
||||
@param[in] query_str FTS query
|
||||
@param[in] query_len FTS query string len in bytes
|
||||
@param[in,out] result result doc ids
|
||||
@param[in] limit limit value
|
||||
@return DB_SUCCESS if successful otherwise error code */
|
||||
dberr_t
|
||||
fts_query(
|
||||
@ -588,8 +587,7 @@ fts_query(
|
||||
uint flags,
|
||||
const byte* query_str,
|
||||
ulint query_len,
|
||||
fts_result_t** result,
|
||||
ulonglong limit)
|
||||
fts_result_t** result)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
/******************************************************************//**
|
||||
|
@ -265,16 +265,13 @@ row_merge_rename_index_to_drop(
|
||||
@param[in] index_def the index definition
|
||||
@param[in] add_v new virtual columns added along with add
|
||||
index call
|
||||
@param[in] col_names column names if columns are renamed
|
||||
or NULL
|
||||
@return index, or NULL on error */
|
||||
dict_index_t*
|
||||
row_merge_create_index(
|
||||
trx_t* trx,
|
||||
dict_table_t* table,
|
||||
const index_def_t* index_def,
|
||||
const dict_add_v_col_t* add_v,
|
||||
const char** col_names)
|
||||
const dict_add_v_col_t* add_v)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
/*********************************************************************//**
|
||||
|
@ -844,9 +844,6 @@ struct row_prebuilt_t {
|
||||
|
||||
/** The MySQL table object */
|
||||
TABLE* m_mysql_table;
|
||||
|
||||
/** limit value to avoid fts result overflow */
|
||||
ulonglong m_fts_limit;
|
||||
};
|
||||
|
||||
/** Callback for row_mysql_sys_index_iterate() */
|
||||
|
@ -41,7 +41,7 @@ Created 1/20/1994 Heikki Tuuri
|
||||
|
||||
#define INNODB_VERSION_MAJOR 5
|
||||
#define INNODB_VERSION_MINOR 7
|
||||
#define INNODB_VERSION_BUGFIX 19
|
||||
#define INNODB_VERSION_BUGFIX 20
|
||||
|
||||
/* The following is the InnoDB version as shown in
|
||||
SELECT plugin_version FROM information_schema.plugins;
|
||||
|
@ -6614,15 +6614,15 @@ lock_validate()
|
||||
Release both mutexes during the validation check. */
|
||||
|
||||
for (ulint i = 0; i < hash_get_n_cells(lock_sys->rec_hash); i++) {
|
||||
const lock_t* lock;
|
||||
ib_uint64_t limit = 0;
|
||||
|
||||
while ((lock = lock_rec_validate(i, &limit)) != 0) {
|
||||
|
||||
ulint space = lock->un_member.rec_lock.space;
|
||||
ulint page_no = lock->un_member.rec_lock.page_no;
|
||||
|
||||
pages.insert(std::make_pair(space, page_no));
|
||||
while (const lock_t* lock = lock_rec_validate(i, &limit)) {
|
||||
if (lock_rec_find_set_bit(lock) == ULINT_UNDEFINED) {
|
||||
/* The lock bitmap is empty; ignore it. */
|
||||
continue;
|
||||
}
|
||||
const lock_rec_t& l = lock->un_member.rec_lock;
|
||||
pages.insert(std::make_pair(l.space, l.page_no));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,8 @@ rec_get_offsets_func(
|
||||
case REC_STATUS_SUPREMUM:
|
||||
/* infimum or supremum record */
|
||||
ut_ad(rec_get_heap_no_new(rec)
|
||||
== (rec_get_status(rec) == REC_STATUS_INFIMUM
|
||||
== ulint(rec_get_status(rec)
|
||||
== REC_STATUS_INFIMUM
|
||||
? PAGE_HEAP_NO_INFIMUM
|
||||
: PAGE_HEAP_NO_SUPREMUM));
|
||||
n = 1;
|
||||
|
@ -4362,16 +4362,13 @@ row_merge_create_index_graph(
|
||||
@param[in] index_def the index definition
|
||||
@param[in] add_v new virtual columns added along with add
|
||||
index call
|
||||
@param[in] col_names column names if columns are renamed
|
||||
or NULL
|
||||
@return index, or NULL on error */
|
||||
dict_index_t*
|
||||
row_merge_create_index(
|
||||
trx_t* trx,
|
||||
dict_table_t* table,
|
||||
const index_def_t* index_def,
|
||||
const dict_add_v_col_t* add_v,
|
||||
const char** col_names)
|
||||
const dict_add_v_col_t* add_v)
|
||||
{
|
||||
dict_index_t* index;
|
||||
dberr_t err;
|
||||
@ -4410,22 +4407,9 @@ row_merge_create_index(
|
||||
name = dict_table_get_v_col_name(
|
||||
table, ifield->col_no);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
Alter table renaming a column and then adding a index
|
||||
to this new name e.g ALTER TABLE t
|
||||
CHANGE COLUMN b c INT NOT NULL, ADD UNIQUE INDEX (c);
|
||||
requires additional check as column names are not yet
|
||||
changed when new index definitions are created. Table's
|
||||
new column names are on a array of column name pointers
|
||||
if any of the column names are changed. */
|
||||
|
||||
if (col_names && col_names[i]) {
|
||||
name = col_names[i];
|
||||
} else {
|
||||
name = dict_table_get_col_name(table, ifield->col_no);
|
||||
}
|
||||
}
|
||||
|
||||
dict_mem_index_add_field(index, name, ifield->prefix_len);
|
||||
}
|
||||
|
@ -332,8 +332,8 @@ int ma_checkpoint_init(ulong interval)
|
||||
res= 1;
|
||||
else if (interval > 0)
|
||||
{
|
||||
compile_time_assert(sizeof(void *) >= sizeof(ulong));
|
||||
size_t intv= interval;
|
||||
compile_time_assert(sizeof(void *) >= sizeof(ulong));
|
||||
if ((res= mysql_thread_create(key_thread_checkpoint,
|
||||
&checkpoint_control.thread, NULL,
|
||||
ma_checkpoint_background,
|
||||
|
@ -125,6 +125,7 @@ analyze table t1;
|
||||
-- enable_query_log
|
||||
|
||||
# One row results tests for cases where a single row matches all conditions
|
||||
--replace_column 9 #
|
||||
explain select key1,key2 from t1 where key1=100 and key2=100;
|
||||
select key1,key2 from t1 where key1=100 and key2=100;
|
||||
if (!$skip_ror_EXPLAIN_for_MyRocks)
|
||||
|
@ -603,7 +603,7 @@ count(*)
|
||||
64801
|
||||
explain select key1,key2 from t1 where key1=100 and key2=100;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge key1,key2 key2,key1 5,5 NULL 2 Using intersect(key2,key1); Using where; Using index
|
||||
1 SIMPLE t1 index_merge key1,key2 key2,key1 5,5 NULL # Using intersect(key2,key1); Using where; Using index
|
||||
select key1,key2 from t1 where key1=100 and key2=100;
|
||||
key1 key2
|
||||
100 100
|
||||
|
Loading…
x
Reference in New Issue
Block a user