Skip to content
Permalink
Browse files
Merge 10.4 into 10.5
  • Loading branch information
dr-m committed Feb 7, 2020
2 parents 8b97eba + c1eaa38 commit 8b6cfda
Show file tree
Hide file tree
Showing 69 changed files with 587 additions and 294 deletions.
@@ -400,6 +400,7 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves);
void maria_versioning(MARIA_HA *info, my_bool versioning);
void maria_ignore_trids(MARIA_HA *info);
uint maria_max_key_length(void);
my_bool maria_too_big_key_for_sort(MARIA_KEYDEF *key, ha_rows rows);
#define maria_max_key_segments() HA_MAX_KEY_SEG

/* fulltext functions */
@@ -1,6 +1,6 @@
#ifndef MY_CPU_INCLUDED
#define MY_CPU_INCLUDED
/* Copyright (c) 2013, MariaDB foundation Ab and SkySQL
/* Copyright (c) 2013, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,6 +50,13 @@
# define HAVE_PAUSE_INSTRUCTION /* added in Intel Pentium 4 */
#endif

#ifdef _WIN32
#elif defined HAVE_PAUSE_INSTRUCTION
#elif defined(_ARCH_PWR8)
#else
# include "my_atomic.h"
#endif

static inline void MY_RELAX_CPU(void)
{
#ifdef _WIN32
@@ -432,6 +432,7 @@ int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
int sort_write_record(MI_SORT_PARAM *sort_param);
int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulonglong);
my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows);

#ifdef __cplusplus
}
@@ -1,5 +1,4 @@
/* Copyright (c) 2009, 2019, MariaDB
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@@ -86,12 +85,24 @@ int main(int argc, char **argv)
int rc = EINVAL;
void *dlh;
wsrep_loader_fun dlfun;
const char *provider= getenv("WSREP_PROVIDER");

if (!(dlh = dlopen(getenv("WSREP_PROVIDER"), RTLD_NOW | RTLD_LOCAL))) {
goto err;
if (!provider)
{
fprintf(stderr, "WSREP_PROVIDER is not set\n");
return 1;
}
if (!(dlh = dlopen(provider, RTLD_NOW | RTLD_LOCAL)))
{
fprintf(stderr, "Can't open WSREP_PROVIDER (%s) library, error: %s\n",
provider, dlerror());
goto err;
}

if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader"))) {
if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader")))
{
fprintf(stderr, "Can't find 'wsrep_loader' symbol in %s\n",
provider);
goto err;
}

@@ -265,3 +265,8 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con1;
connection default;
DROP TABLE t1, t2;
CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
ERROR 42000: Specified key was too long; max key length is 2000 bytes
create table t1(a int, unique(a) using hash);
#BULK insert > 100 rows (MI_MIN_ROWS_TO_DISABLE_INDEXES)
drop table t1;
@@ -317,3 +317,26 @@ INSERT IGNORE INTO t1 VALUES (4, 1)/*4*/;
--disconnect con1
--connection default
DROP TABLE t1, t2;

#
# MDEV-18791 Wrong error upon creating Aria table with long index on BLOB
#
--error ER_TOO_LONG_KEY
CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;

#
# MDEV-20001 Potential dangerous regression: INSERT INTO >=100 rows fail for myisam table with HASH indexes
#
create table t1(a int, unique(a) using hash);
--let $count=150
--let insert_stmt= insert into t1 values(200)
while ($count)
{
--let $insert_stmt=$insert_stmt,($count)
--dec $count
}
--disable_query_log
--echo #BULK insert > 100 rows (MI_MIN_ROWS_TO_DISABLE_INDEXES)
--eval $insert_stmt
--enable_query_log
drop table t1;
@@ -1797,6 +1797,16 @@ select * from t2;
ERROR HY000: Table 't2' was not locked with LOCK TABLES
SET STATEMENT max_statement_time=900 FOR unlock tables;
drop table t1, t2;
#
# MDEV-21616: Server crash when using
# "SET STATEMENT max_statement_time=0 FOR desc xxx" lead to collapse
#
create table t1 (a int);
SET STATEMENT max_statement_time=0 FOR desc t1;
Field Type Null Key Default Extra
a int(11) YES NULL
drop table t1;
SET STATEMENT max_statement_time=0 FOR do 1;
# End of 10.4 tests
#
# Start of 10.5 tests
@@ -1565,6 +1565,16 @@ select * from t2;
SET STATEMENT max_statement_time=900 FOR unlock tables;
drop table t1, t2;

--echo #
--echo # MDEV-21616: Server crash when using
--echo # "SET STATEMENT max_statement_time=0 FOR desc xxx" lead to collapse
--echo #

create table t1 (a int);
SET STATEMENT max_statement_time=0 FOR desc t1;
drop table t1;
SET STATEMENT max_statement_time=0 FOR do 1;

--echo # End of 10.4 tests


@@ -358,4 +358,13 @@ t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin2 ROW_FORMAT=REDUNDANT
DROP TABLE t1;
#
# MDEV-21645 SIGSEGV in innobase_get_computed_value
#
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, va INTEGER GENERATED ALWAYS AS (a))
ENGINE=InnoDB;
INSERT INTO t1 SET a=1, b=NULL;
ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
@@ -343,6 +343,30 @@ UPDATE t1 SET b = 1;
SET DEBUG_SYNC='now SIGNAL update';
connection con2;
connection default;
DROP TABLE t1;
#
# MDEV-21658 Error on online ADD PRIMARY KEY after instant DROP/reorder
#
CREATE TABLE t1 (a INT, b INT, c INT, col INT) ENGINE=InnoDB;
INSERT INTO t1 () VALUES ();
ALTER TABLE t1 DROP b, DROP c, DROP col;
ALTER TABLE t1 ADD COLUMN col INT;
ALTER TABLE t1 DROP a, DROP col, ADD COLUMN b INT;
connection con2;
SET SQL_MODE= '';
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR dml';
ALTER TABLE t1 ADD PRIMARY KEY(b);
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
UPDATE t1 SET b = 1;
SET DEBUG_SYNC = 'now SIGNAL dml';
connection con2;
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
connection default;
SELECT * FROM t1;
b
1
SET DEBUG_SYNC='RESET';
disconnect con2;
DROP TABLE t1;
@@ -374,4 +374,14 @@ ALTER TABLE t1 MODIFY a CHAR, ALGORITHM=INSTANT;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # MDEV-21645 SIGSEGV in innobase_get_computed_value
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, va INTEGER GENERATED ALWAYS AS (a))
ENGINE=InnoDB;
INSERT INTO t1 SET a=1, b=NULL;
ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;

SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
@@ -385,6 +385,32 @@ SET DEBUG_SYNC='now SIGNAL update';
--reap

--connection default
DROP TABLE t1;

--echo #
--echo # MDEV-21658 Error on online ADD PRIMARY KEY after instant DROP/reorder
--echo #

CREATE TABLE t1 (a INT, b INT, c INT, col INT) ENGINE=InnoDB;
INSERT INTO t1 () VALUES ();
ALTER TABLE t1 DROP b, DROP c, DROP col;
ALTER TABLE t1 ADD COLUMN col INT;
ALTER TABLE t1 DROP a, DROP col, ADD COLUMN b INT;

--connection con2
SET SQL_MODE= '';
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR dml';
send ALTER TABLE t1 ADD PRIMARY KEY(b);

--connection default
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
UPDATE t1 SET b = 1;
SET DEBUG_SYNC = 'now SIGNAL dml';
--connection con2
reap;
--connection default
SELECT * FROM t1;

SET DEBUG_SYNC='RESET';
--disconnect con2
DROP TABLE t1;
@@ -31,6 +31,14 @@ set global system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= '2011-02-29 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
set global system_versioning_asof= '2011-02-28 24:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
set global system_versioning_asof= '2011-00-28 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
set global system_versioning_asof= '0000-00-00 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
set system_versioning_asof= 'alley';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
set system_versioning_asof= null;
@@ -39,6 +47,14 @@ set system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= '2011-02-29 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
set system_versioning_asof= '2011-02-28 24:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
set system_versioning_asof= '2011-00-28 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
set system_versioning_asof= '0000-00-00 00:00';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
# GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
@@ -23,6 +23,14 @@ set global system_versioning_asof= null;
set global system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set global system_versioning_asof= 1.1;
--error ER_WRONG_VALUE_FOR_VAR
set global system_versioning_asof= '2011-02-29 00:00';
--error ER_WRONG_VALUE_FOR_VAR
set global system_versioning_asof= '2011-02-28 24:00';
--error ER_WRONG_VALUE_FOR_VAR
set global system_versioning_asof= '2011-00-28 00:00';
--error ER_WRONG_VALUE_FOR_VAR
set global system_versioning_asof= '0000-00-00 00:00';

# session
--error ER_WRONG_VALUE_FOR_VAR
@@ -33,6 +41,14 @@ set system_versioning_asof= null;
set system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set system_versioning_asof= 1.1;
--error ER_WRONG_VALUE_FOR_VAR
set system_versioning_asof= '2011-02-29 00:00';
--error ER_WRONG_VALUE_FOR_VAR
set system_versioning_asof= '2011-02-28 24:00';
--error ER_WRONG_VALUE_FOR_VAR
set system_versioning_asof= '2011-00-28 00:00';
--error ER_WRONG_VALUE_FOR_VAR
set system_versioning_asof= '0000-00-00 00:00';

--echo # GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
@@ -0,0 +1,5 @@
SET GLOBAL wsrep_on=ON;
SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 0
SET GLOBAL wsrep_on=OFF;
@@ -0,0 +1,8 @@
!include ../my.cnf

[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2
@@ -0,0 +1,10 @@
#
# Check SHOW GLOBAL STATUS after dynamic setting WSREP=ON
#
--source include/have_innodb.inc
--source include/have_wsrep_provider.inc
--source include/have_binlog_format_row.inc

SET GLOBAL wsrep_on=ON;
SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
SET GLOBAL wsrep_on=OFF;
@@ -1,4 +1,4 @@
/* Copyright (c) 2019, MariaDB Corporation.
/* Copyright (c) 2019, 2020, 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
@@ -14,7 +14,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include <my_global.h>
#include <my_atomic.h>
#include <my_cpu.h>
#include <my_rdtsc.h>

@@ -16,6 +16,7 @@

#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <mysql/plugin_auth_common.h>

struct param {
@@ -62,15 +63,16 @@ typedef struct st_mysql_server_auth_info
#include "auth_pam_base.c"


int main(int argc, char **argv)
int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{
struct param param;
MYSQL_SERVER_AUTH_INFO info;
unsigned char field;
int res;
char a_buf[MYSQL_USERNAME_LENGTH + 1 + 1024];

(void) setreuid(0, 0);
if ((res= setreuid(0, 0)))
fprintf(stderr, "Got error %d from setreuid()\n", (int) errno);

if (read(0, &field, 1) < 1)
return -1;
@@ -15,7 +15,7 @@

#define N 3

int pam_sm_authenticate(pam_handle_t *pamh, int flags,
int pam_sm_authenticate(pam_handle_t *pamh, int flags __attribute__((unused)),
int argc, const char *argv[])
{
struct pam_conv *conv;
@@ -72,8 +72,10 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
return retval;
}

int pam_sm_setcred(pam_handle_t *pamh, int flags,
int argc, const char *argv[])
int pam_sm_setcred(pam_handle_t *pamh __attribute__((unused)),
int flags __attribute__((unused)),
int argc __attribute__((unused)),
const char *argv[] __attribute__((unused)))
{

return PAM_SUCCESS;
@@ -6226,7 +6226,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
/* As all updated tables are temporary, nothing will be logged */
set_current_stmt_binlog_format_row();
}
else if (IF_WSREP((!WSREP(this) ||
else if (IF_WSREP((!WSREP_NNULL(this) ||
wsrep_cs().mode() ==
wsrep::client_state::m_local),1))
{

0 comments on commit 8b6cfda

Please sign in to comment.