Commit 89cd3da4 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.7 into 10.8

parents 1596ef73 33c30da1
......@@ -20,7 +20,7 @@
#ifndef _my_alloc_h
#define _my_alloc_h
typedef unsigned int PSI_memory_key;
#include "mysql/psi/psi_base.h"
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
......
......@@ -238,7 +238,9 @@ typedef struct st_mysql_field {
typedef char **MYSQL_ROW;
typedef unsigned int MYSQL_FIELD_OFFSET;
typedef unsigned long long my_ulonglong;
extern "C" {
typedef unsigned int PSI_memory_key;
}
extern "C" {
typedef struct st_used_mem
{
......
extern "C" {
typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v1
{
PSI_memory_key *m_key;
......
extern "C" {
typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v2
{
int placeholder;
......
......@@ -164,6 +164,13 @@ extern "C" {
/** @} */
/**
Instrumented memory key.
To instrument memory, a memory key must be obtained using @c register_memory.
Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_memory_key;
#ifdef __cplusplus
}
#endif
......
......@@ -53,13 +53,6 @@ extern "C" {
struct PSI_thread;
/**
Instrumented memory key.
To instrument memory, a memory key must be obtained using @c register_memory.
Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_memory_key;
#ifdef HAVE_PSI_1
/**
......
......@@ -12,10 +12,14 @@ c char(32) DEFAULT 'dummy_text',
PRIMARY KEY (i)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert into t1(i) values(null);
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 variable that may have a different value on the slave
select * from t1;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
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 variable that may have a different value on the slave
select * from t1;
i c
1 dummy_text
......@@ -46,10 +50,14 @@ c char(32) DEFAULT 'dummy_text',
PRIMARY KEY (i)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert into t1(i) values(null);
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 variable that may have a different value on the slave
select * from t1;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
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 variable that may have a different value on the slave
select * from t1;
i c
1 dummy_text
......
......@@ -18,9 +18,17 @@
--connection node_2
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log");
--enable_query_log
--connection node_1
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log");
--enable_query_log
CREATE TABLE t1 (
i int(11) NOT NULL AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text',
......
......@@ -465,7 +465,7 @@ class ha_innobase final : public handler
/* @return true if it's necessary to switch current statement log
format from STATEMENT to ROW if binary log format is MIXED and
autoincrement values are changed in the statement */
bool autoinc_lock_mode_stmt_unsafe() const;
bool autoinc_lock_mode_stmt_unsafe() const override;
dict_index_t* innobase_get_index(uint keynr);
#ifdef WITH_WSREP
......
......@@ -8730,13 +8730,14 @@ inline bool rollback_inplace_alter_table(Alter_inplace_info *ha_alter_info,
const bool fts_exist= (ctx->new_table->flags2 &
(DICT_TF2_FTS_HAS_DOC_ID | DICT_TF2_FTS)) ||
ctx->adding_fulltext_index();
if (fts_exist)
{
fts_optimize_remove_table(ctx->new_table);
purge_sys.stop_FTS(*ctx->new_table);
}
if (ctx->need_rebuild())
{
if (fts_exist)
{
fts_optimize_remove_table(ctx->new_table);
purge_sys.stop_FTS(*ctx->new_table);
}
dberr_t err= lock_table_for_trx(ctx->new_table, ctx->trx, LOCK_X);
if (fts_exist)
{
......@@ -8783,12 +8784,25 @@ inline bool rollback_inplace_alter_table(Alter_inplace_info *ha_alter_info,
if (fts_exist)
{
const dict_index_t *fts_index= nullptr;
for (ulint a= 0; a < ctx->num_to_add_index; a++)
{
const dict_index_t *index = ctx->add_index[a];
if (index->type & DICT_FTS)
ut_a(!fts_lock_index_tables(ctx->trx, *index));
fts_index= index;
}
/* Remove the fts table from fts_optimize_wq if there are
no FTS secondary index exist other than newly added one */
if (fts_index &&
(ib_vector_is_empty(prebuilt->table->fts->indexes) ||
(ib_vector_size(prebuilt->table->fts->indexes) == 1 &&
fts_index == static_cast<dict_index_t*>(
ib_vector_getp(prebuilt->table->fts->indexes, 0)))))
fts_optimize_remove_table(prebuilt->table);
purge_sys.stop_FTS(*prebuilt->table);
ut_a(!fts_index || !fts_lock_index_tables(ctx->trx, *fts_index));
ut_a(!fts_lock_common_tables(ctx->trx, *ctx->new_table));
ut_a(!lock_sys_tables(ctx->trx));
}
......
......@@ -2495,7 +2495,8 @@ dberr_t row_discard_tablespace_for_mysql(dict_table_t *table, trx_t *trx)
fts_optimize_add_table(table);
}
trx->rollback();
row_mysql_unlock_data_dictionary(trx);
if (trx->dict_operation_lock_mode)
row_mysql_unlock_data_dictionary(trx);
return err;
}
}
......
/* Copyright (C) 2019 MariaDB Corporation AB
/* Copyright (C) 2019, 2022, MariaDB Corporation AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -20,17 +20,17 @@
in myisamchk.h
*/
typedef struct st_sort_key_blocks /* Used when sorting */
struct st_sort_key_blocks /* Used when sorting */
{
uchar *buff, *end_pos;
uchar lastkey[MARIA_MAX_POSSIBLE_KEY_BUFF];
uint last_length;
int inited;
} MA_SORT_KEY_BLOCKS;
};
typedef struct st_sort_ftbuf
struct st_sort_ftbuf
{
uchar *buf, *end;
int count;
uchar lastkey[MARIA_MAX_KEY_BUFF];
} MA_SORT_FT_BUF;
};
......@@ -150,21 +150,21 @@ struct st_maria_share;
struct st_maria_handler; /* For referense */
struct st_maria_keydef;
typedef struct st_maria_key /* Internal info about a key */
struct st_maria_key /* Internal info about a key */
{
uchar *data; /* Data for key */
struct st_maria_keydef *keyinfo; /* Definition for key */
uint data_length; /* Length of key data */
uint ref_length; /* record ref + transid */
uint32 flag; /* 0 or SEARCH_PART_KEY */
} MARIA_KEY;
};
typedef struct st_maria_decode_tree /* Decode huff-table */
struct st_maria_decode_tree /* Decode huff-table */
{
uint16 *table;
uint quick_table_bits;
uchar *intervalls;
} MARIA_DECODE_TREE;
};
typedef struct s3_info S3_INFO;
......
#ifndef S3_FUNC_INCLUDED
#define S3_FUNC_INCLUDED
/* Copyright (C) 2019, 2020 MariaDB Corporation Ab
/* Copyright (C) 2019, 2022, MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -41,7 +41,7 @@ extern TYPELIB s3_protocol_typelib;
/* Store information about a s3 connection */
typedef struct s3_info
struct s3_info
{
/* Connection strings */
LEX_CSTRING access_key, secret_key, region, bucket, host_name;
......@@ -63,7 +63,7 @@ typedef struct s3_info
/* Protocol for the list bucket API call. 1 for Amazon, 2 for some others */
uint8_t protocol_version;
} S3_INFO;
};
/* flag + length is stored in this header */
......
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -613,21 +613,21 @@ typedef struct st_mi_block_info /* Parameter to _mi_get_block_info */
} MI_BLOCK_INFO;
typedef struct st_sort_key_blocks /* Used when sorting */
struct st_sort_key_blocks /* Used when sorting */
{
uchar *buff, *end_pos;
uchar lastkey[HA_MAX_POSSIBLE_KEY_BUFF];
uint last_length;
int inited;
} SORT_KEY_BLOCKS;
};
typedef struct st_sort_ftbuf
struct st_sort_ftbuf
{
uchar *buf, *end;
int count;
uchar lastkey[HA_MAX_KEY_BUFF];
} SORT_FT_BUF;
};
/* bits in return from _mi_get_block_info */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment