Skip to content
Permalink
Browse files
Merge 10.6 into 10.7
  • Loading branch information
dr-m committed Jul 1, 2022
2 parents cac6f0a + 62a20f8 commit 3dff84c
Show file tree
Hide file tree
Showing 63 changed files with 707 additions and 456 deletions.
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 2021, MariaDB Corporation.
Copyright (c) 2009, 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
@@ -3666,7 +3666,6 @@ print_table_data(MYSQL_RES *result)
{
String separator(256);
MYSQL_ROW cur;
MYSQL_FIELD *field;
bool *num_flag;

num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
@@ -3678,7 +3677,7 @@ print_table_data(MYSQL_RES *result)
mysql_field_seek(result,0);
}
separator.copy("+",1,charset_info);
while ((field = mysql_fetch_field(result)))
while (MYSQL_FIELD *field= mysql_fetch_field(result))
{
uint length= column_names ? field->name_length : 0;
if (quick)
@@ -3700,7 +3699,7 @@ print_table_data(MYSQL_RES *result)
{
mysql_field_seek(result,0);
(void) tee_fputs("|", PAGER);
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
while (MYSQL_FIELD *field= mysql_fetch_field(result))
{
size_t name_length= (uint) strlen(field->name);
size_t numcells= charset_info->numcells(field->name,
@@ -3742,7 +3741,7 @@ print_table_data(MYSQL_RES *result)
data_length= (uint) lengths[off];
}

field= mysql_fetch_field(result);
MYSQL_FIELD *field= mysql_fetch_field(result);
field_max_length= field->max_length;

/*
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2017, MariaDB
Copyright (c) 2010, 2012, 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
@@ -1060,7 +1060,6 @@ static void print_result()
char prev[(NAME_LEN+9)*3+2];
char prev_alter[MAX_ALTER_STR_SIZE];
size_t length_of_db= strlen(sock->db);
uint i;
my_bool found_error=0, table_rebuild=0;
DYNAMIC_ARRAY *array4repair= &tables4repair;
DBUG_ENTER("print_result");
@@ -1069,7 +1068,7 @@ static void print_result()

prev[0] = '\0';
prev_alter[0]= 0;
for (i = 0; (row = mysql_fetch_row(res)); i++)
while ((row = mysql_fetch_row(res)))
{
int changed = strcmp(prev, row[0]);
my_bool status = !strcmp(row[2], "status");
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2017, MariaDB
Copyright (c) 2010, 2022, 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
@@ -1897,12 +1897,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)

pthread_handler_t run_task(void *p)
{
ulonglong counter= 0, queries;
ulonglong queries;
ulonglong detach_counter;
unsigned int commit_counter;
MYSQL *mysql;
MYSQL_RES *result;
MYSQL_ROW row;
statement *ptr;
thread_context *con= (thread_context *)p;

@@ -2023,8 +2022,7 @@ pthread_handler_t run_task(void *p)
my_progname, mysql_errno(mysql), mysql_error(mysql));
else
{
while ((row= mysql_fetch_row(result)))
counter++;
while (mysql_fetch_row(result)) {}
mysql_free_result(result);
}
}
@@ -2034,7 +2032,7 @@ pthread_handler_t run_task(void *p)
if (commit_rate && (++commit_counter == commit_rate))
{
commit_counter= 0;
run_query(mysql, "COMMIT", strlen("COMMIT"));
run_query(mysql, C_STRING_WITH_LEN("COMMIT"));
}

if (con->limit && queries == con->limit)
@@ -2046,7 +2044,7 @@ pthread_handler_t run_task(void *p)

end:
if (commit_rate)
run_query(mysql, "COMMIT", strlen("COMMIT"));
run_query(mysql, C_STRING_WITH_LEN("COMMIT"));

mysql_close(mysql);

@@ -1,5 +1,5 @@
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2021, MariaDB Corporation.
# Copyright (c) 2011, 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
@@ -106,6 +106,7 @@ ELSEIF(RPM)
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
SET(WITH_PCRE system CACHE STRING "")
SET(CLIENT_PLUGIN_ZSTD OFF)
IF(RPM MATCHES "fedora|centos|rhel")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ENDIF()
@@ -120,6 +121,7 @@ ELSEIF(DEB)
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
SET(WITH_PCRE system CACHE STRING "")
SET(CLIENT_PLUGIN_ZSTD OFF)
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
@@ -7,9 +7,7 @@
#include <my_sys.h>
#include <my_pthread.h>

int main (argc, argv)
int argc;
char *argv[];
int main (int argc, char **argv)
{
register int result, ix;
extern int factorial(int);
@@ -148,9 +148,7 @@ int main(int argc, char *argv[])
/* reads options */
/* Initiates DEBUG - but no debugging here ! */

static int static_get_options(argc,argv)
register int *argc;
register char **argv[];
static int static_get_options(int *argc, char***argv)
{
int help,version;
char *pos;
@@ -218,10 +216,9 @@ register char **argv[];
} /* static_get_options */


static int get_replace_strings(argc,argv,from_array,to_array)
register int *argc;
register char **argv[];
POINTER_ARRAY *from_array,*to_array;
static int get_replace_strings(int *argc, char ***argv,
POINTER_ARRAY *from_array,
POINTER_ARRAY *to_array)
{
char *pos;

@@ -974,9 +971,7 @@ static void free_buffer()
bytes read from disk.
*/

static int fill_buffer_retaining(fd,n)
File fd;
int n;
static int fill_buffer_retaining(File fd, int n)
{
int i;

@@ -1019,9 +1014,7 @@ int n;
/* Return 0 if convert is ok */
/* Global variable update is set if something was changed */

static int convert_pipe(rep,in,out)
REPLACE *rep;
FILE *in,*out;
static int convert_pipe(REPLACE *rep, FILE *in, FILE *out)
{
int retain,error;
uint length;
@@ -37,7 +37,9 @@ SELECT v.* FROM v JOIN INFORMATION_SCHEMA.TABLES WHERE DATA_LENGTH = -1;
--eval KILL $conid
--disconnect con1
--connection default
--disable_warnings
DROP VIEW IF EXISTS vv;
--enable_warnings
DROP VIEW v;
DROP FUNCTION f;
DROP TABLE t;
@@ -4,6 +4,8 @@
# because of a pair of slow Solaris Sparc machines in pb2,
# this test is marked as big:
--source include/big_test.inc
# This test often times out with MSAN
--source include/not_msan.inc

# MyISAM tables should be used
#
@@ -124,3 +124,24 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
#
# MDEV-28806 Assertion `flag == 1' failure in
# row_build_index_entry_low upon concurrent ALTER and UPDATE
#
CREATE TABLE t1(a CHAR(8), b INT, c INT AS (b), KEY(a)) ENGINE=InnoDB;
INSERT INTO t1(b) VALUES (1),(2);
connect con1,localhost,root,,test;
SET DEBUG_SYNC="alter_table_inplace_before_lock_upgrade SIGNAL dml_start WAIT_FOR dml_commit";
ALTER TABLE t1 ADD KEY ind (c);
connection default;
SET DEBUG_SYNC="now WAIT_FOR dml_start";
UPDATE t1 SET a ='foo';
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection con1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
disconnect con1;
connection default;
SET DEBUG_SYNC=RESET;
@@ -312,4 +312,30 @@ SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;

--echo #
--echo # MDEV-28806 Assertion `flag == 1' failure in
--echo # row_build_index_entry_low upon concurrent ALTER and UPDATE
--echo #

CREATE TABLE t1(a CHAR(8), b INT, c INT AS (b), KEY(a)) ENGINE=InnoDB;
INSERT INTO t1(b) VALUES (1),(2);

--connect (con1,localhost,root,,test)
SET DEBUG_SYNC="alter_table_inplace_before_lock_upgrade SIGNAL dml_start WAIT_FOR dml_commit";
send ALTER TABLE t1 ADD KEY ind (c);

--connection default
SET DEBUG_SYNC="now WAIT_FOR dml_start";
UPDATE t1 SET a ='foo';
SET DEBUG_SYNC="now SIGNAL dml_commit";

# Cleanup
--connection con1
--reap
CHECK TABLE t1;
DROP TABLE t1;
--disconnect con1
connection default;
SET DEBUG_SYNC=RESET;

--source include/wait_until_count_sessions.inc
@@ -130,3 +130,32 @@ UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Index for table 't2' is corrupt; try to repair it
DROP TABLE t1, t2;
#
# MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
# oindex.n_core_null_bytes || !not_redundant()' failed
#
call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
c INTEGER)engine=innodb;
ALTER TABLE t DISCARD TABLESPACE;
FLUSH TABLES;
ALTER TABLE t DROP COLUMN b, algorithm=instant;
Warnings:
Warning 1814 Tablespace has been discarded for table `t`
ALTER TABLE t DROP COLUMN c, algorithm=instant;
Warnings:
Warning 1814 Tablespace has been discarded for table `t`
CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
FLUSH TABLE t1 FOR EXPORT;
unlock tables;
ALTER TABLE t IMPORT tablespace;
Warnings:
Warning 1814 Tablespace has been discarded for table `t`
check table t;
Table Op Msg_type Msg_text
test.t check status OK
select * from t;
a
1
DROP TABLE t, t1;
@@ -2,8 +2,7 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/not_embedded.inc
# Valgrind gives leaks from the first shutdown which confuses mtr
#--source include/not_valgrind.inc
--source include/no_valgrind_without_big.inc

--echo #
--echo # MDEV-11415 AVOID INTERMEDIATE COMMIT WHILE DOING
@@ -1,5 +1,6 @@
--source include/maybe_debug.inc
--source include/innodb_page_size_small.inc
--source include/no_valgrind_without_big.inc

--echo #
--echo # Bug #16963396 INNODB: USE OF LARGE EXTERNALLY-STORED FIELDS MAKES
@@ -208,3 +208,28 @@ UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;

DROP TABLE t1, t2;

--echo #
--echo # MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
--echo # oindex.n_core_null_bytes || !not_redundant()' failed
--echo #
call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
c INTEGER)engine=innodb;
ALTER TABLE t DISCARD TABLESPACE;
FLUSH TABLES;
# Table does reload
ALTER TABLE t DROP COLUMN b, algorithm=instant;
ALTER TABLE t DROP COLUMN c, algorithm=instant;

CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
FLUSH TABLE t1 FOR EXPORT;
--let $MYSQLD_DATADIR= `select @@datadir`
--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t.cfg
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t.ibd
unlock tables;
ALTER TABLE t IMPORT tablespace;
check table t;
select * from t;
DROP TABLE t, t1;
@@ -2,6 +2,7 @@
# Embedded server does not support restarting
--source include/not_embedded.inc
--source include/have_debug.inc
--source include/no_valgrind_without_big.inc

--echo #
--echo # Bug#19685095 DO NOT CARE ABOUT UNRESOLVED MLOG_FILE_NAME
@@ -3,6 +3,7 @@
--source include/have_debug_sync.inc
# need to restart server
--source include/not_embedded.inc
--source include/no_valgrind_without_big.inc

--disable_query_log
# Ignore messages from the innodb_force_recovery=5 startup.
@@ -1,6 +1,7 @@
--source include/innodb_page_size.inc
# Embedded server tests do not support restarting
--source include/not_embedded.inc
--source include/no_valgrind_without_big.inc

--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
# Embedded server does not support restarting.
--source include/not_embedded.inc
--source include/no_valgrind_without_big.inc

# MDEV-8841 - close tables opened by previous tests,
# so they don't get marked crashed when the server gets crashed

0 comments on commit 3dff84c

Please sign in to comment.