Skip to content

Commit

Permalink
Merge 10.5 into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jul 1, 2022
2 parents ba3354f + b546913 commit 62a20f8
Show file tree
Hide file tree
Showing 48 changed files with 526 additions and 269 deletions.
9 changes: 4 additions & 5 deletions client/mysql.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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));
Expand All @@ -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)
Expand All @@ -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,
Expand Down Expand Up @@ -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;

/*
Expand Down
5 changes: 2 additions & 3 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
12 changes: 5 additions & 7 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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)
Expand All @@ -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);

Expand Down
4 changes: 1 addition & 3 deletions dbug/my_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 6 additions & 13 deletions extra/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
2 changes: 2 additions & 0 deletions mysql-test/main/information_schema_tables.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
29 changes: 29 additions & 0 deletions mysql-test/suite/innodb/r/instant_alter_import.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 1 addition & 2 deletions mysql-test/suite/innodb/t/alter_copy.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/blob-crash.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/suite/innodb/t/instant_alter_import.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/log_file_name_debug.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/read_only_recover_committed.test
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/table_flags.test
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/xa_recovery.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/suite/innodb_fts/r/crash_recovery.result
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,18 @@ id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
DROP TABLE mdev19073, mdev19073_2;
#
# MDEV-28706 Redundant InnoDB table fails during alter
#
SET @@global.innodb_file_per_table = 0;
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_text_1 TEXT
) ENGINE = InnoDB ROW_FORMAT = Redundant ;
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
INSERT INTO t1 VALUES ( 1255, "mariadb", "InnoDB");
# restart
ALTER TABLE t1 ADD FULLTEXT(col_text_1);
DROP TABLE t1;
SELECT * FROM information_schema.innodb_sys_tables WHERE name LIKE 'test/%';
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb_fts/r/fulltext2.result
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,10 @@ fts_doc_id first_name last_name score
6 Ned Flanders 0
7 Nelson Muntz 0
DROP TABLE t1;
CREATE TABLE t1(a INT, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
KEY FTS_DOC_ID_INDEX(FTS_DOC_ID))ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN c INT as (a) VIRTUAL;
ALTER TABLE t1 ADD d INT NULL;
ALTER TABLE t1 ADD FULLTEXT(b);
ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
DROP TABLE t1;
17 changes: 17 additions & 0 deletions mysql-test/suite/innodb_fts/t/crash_recovery.test
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,21 @@ SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
DROP TABLE mdev19073, mdev19073_2;

let $shutdown_timeout=;

--echo #
--echo # MDEV-28706 Redundant InnoDB table fails during alter
--echo #

SET @@global.innodb_file_per_table = 0;
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_text_1 TEXT
) ENGINE = InnoDB ROW_FORMAT = Redundant ;
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
INSERT INTO t1 VALUES ( 1255, "mariadb", "InnoDB");
--source include/restart_mysqld.inc
ALTER TABLE t1 ADD FULLTEXT(col_text_1);
DROP TABLE t1;

SELECT * FROM information_schema.innodb_sys_tables WHERE name LIKE 'test/%';
11 changes: 11 additions & 0 deletions mysql-test/suite/innodb_fts/t/fulltext2.test
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,14 @@ INSERT INTO t1 (id, first_name, last_name) VALUES
analyze table t1;
SELECT fts_doc_id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN BOOLEAN MODE) AS score FROM t1;
DROP TABLE t1;

#
# MDEV-28912 NON-UNIQUE FTS_DOC_ID mistaken as FTS_DOC_ID_INDEX
#
CREATE TABLE t1(a INT, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
KEY FTS_DOC_ID_INDEX(FTS_DOC_ID))ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN c INT as (a) VIRTUAL;
ALTER TABLE t1 ADD d INT NULL;
--error ER_INNODB_FT_WRONG_DOCID_INDEX
ALTER TABLE t1 ADD FULLTEXT(b);
DROP TABLE t1;
1 change: 1 addition & 0 deletions mysql-test/suite/multi_source/multi_parallel.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Slave_non_transactional_groups, Slave_transactional_groups
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
--let $rpl_server_count= 0

--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
Expand Down
Loading

0 comments on commit 62a20f8

Please sign in to comment.