Skip to content

Commit

Permalink
Merge branch '10.11' into 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadb-YuchenPei committed May 31, 2024
2 parents 94999c1 + 22774dd commit 2d3e2c5
Show file tree
Hide file tree
Showing 119 changed files with 1,558 additions and 303 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Code status:
------------
# Code status:

* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com

## MariaDB: The innovative open source database
## MariaDB: The innovative open source database

MariaDB was designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.
Expand Down Expand Up @@ -33,20 +32,19 @@ https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

https://mariadb.com/kb/en/new-and-old-releases/

Getting the code, building it and testing it
---------------------------------------------------------------
# Getting the code, building it and testing it

Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/ which outlines how to correctly build the source code and run the MariaDB testing framework.
Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/
which outlines how to build the source code correctly and run the MariaDB testing framework,
as well as which branch to target for your contributions.

Help
-----
# Help

More help is available from the Maria Discuss mailing list
https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/ and MariaDB's Zulip
instance, https://mariadb.zulipchat.com/
instance, https://mariadb.zulipchat.com/

Licensing
---------
# Licensing

***************************************************************************

Expand All @@ -60,8 +58,7 @@ license information can be found in the THIRDPARTY file.

***************************************************************************

Bug Reports
------------
# Bug Reports

Bug and/or error reports regarding MariaDB should be submitted at:
https://jira.mariadb.org
Expand Down
2 changes: 1 addition & 1 deletion client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ int main(int argc,char *argv[])
is given a t!=0, we get an endless loop, or n iterations if --count=n
was given an n!=0. If --sleep wasn't given, we get one iteration.
To wit, --wait loops the connection-attempts, while --sleep loops
To wait, --wait loops the connection-attempts, while --sleep loops
the command execution (endlessly if no --count is given).
*/

Expand Down
6 changes: 3 additions & 3 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -5993,7 +5993,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
free_root(&glob_root, MYF(0));
}
maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names);
/* We shall countinue here, if --force was given */
/* We shall continue here, if --force was given */
}
}
end= pos;
Expand All @@ -6014,7 +6014,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
free_root(&glob_root, MYF(0));
}
DB_error(mysql, "when doing LOCK TABLES");
/* We shall countinue here, if --force was given */
/* We shall continue here, if --force was given */
}
}
dynstr_free(&lock_tables_query);
Expand All @@ -6026,7 +6026,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
free_root(&glob_root, MYF(0));
DB_error(mysql, "when doing refresh");
}
/* We shall countinue here, if --force was given */
/* We shall continue here, if --force was given */
else
verbose_msg("-- dump_selected_tables : logs flushed successfully!\n");
}
Expand Down
8 changes: 4 additions & 4 deletions client/mysqlimport.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static void lock_table(MYSQL *mysql, int tablecount, char **raw_tablename)
dynstr_append(&query, " WRITE,");
}
if (mysql_real_query(mysql, query.str, (ulong)query.length-1))
db_error(mysql); /* We shall countinue here, if --force was given */
db_error(mysql); /* We shall continue here, if --force was given */
}


Expand Down Expand Up @@ -631,7 +631,7 @@ pthread_handler_t worker_thread(void *arg)

if (mysql_query(mysql, "/*!40101 set @@character_set_database=binary */;"))
{
db_error(mysql); /* We shall countinue here, if --force was given */
db_error(mysql); /* We shall continue here, if --force was given */
goto error;
}

Expand Down Expand Up @@ -759,12 +759,12 @@ int main(int argc, char **argv)
if (!(mysql= db_connect(current_host,current_db,current_user,opt_password)))
{
free_defaults(argv_to_free);
return(1); /* purecov: deadcode */
return(1); /* purecov: dead code */
}

if (mysql_query(mysql, "/*!40101 set @@character_set_database=binary */;"))
{
db_error(mysql); /* We shall countinue here, if --force was given */
db_error(mysql); /* We shall continue here, if --force was given */
return(1);
}

Expand Down
2 changes: 1 addition & 1 deletion cmake/maintainer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ FOREACH(F ${MY_WARNING_FLAGS})
MY_CHECK_AND_SET_COMPILER_FLAG(${F} DEBUG RELWITHDEBINFO)
ENDFOREACH()

SET(MY_ERROR_FLAGS -Werror)
SET(MY_ERROR_FLAGS -Werror -fno-operator-names)

IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=maybe-uninitialized)
Expand Down
6 changes: 3 additions & 3 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -901,14 +901,14 @@ bool is_system_table(const char *dbname, const char *tablename)
DBUG_ASSERT(dbname);
DBUG_ASSERT(tablename);

LEX_CSTRING lex_dbname;
LEX_CSTRING lex_tablename;
Lex_ident_db lex_dbname;
Lex_ident_table lex_tablename;
lex_dbname.str = dbname;
lex_dbname.length = strlen(dbname);
lex_tablename.str = tablename;
lex_tablename.length = strlen(tablename);

TABLE_CATEGORY tg = get_table_category(&lex_dbname, &lex_tablename);
TABLE_CATEGORY tg = get_table_category(lex_dbname, lex_tablename);

return (tg == TABLE_CATEGORY_LOG) || (tg == TABLE_CATEGORY_SYSTEM);
}
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6996,7 +6996,7 @@ static bool check_all_privileges()
if (opt_galera_info || opt_slave_info
|| opt_safe_slave_backup) {
check_result |= check_privilege(granted_privileges,
"REPLICA MONITOR", "*", "*",
"SLAVE MONITOR", "*", "*",
PRIVILEGE_WARNING);
}

Expand Down
11 changes: 10 additions & 1 deletion mysql-test/lib/My/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use File::Path;
use Carp;

use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC IS_FREEBSD
native_path posix_path mixed_path
check_socket_path_length process_alive open_for_append);

Expand Down Expand Up @@ -79,6 +79,15 @@ BEGIN {
}
}

BEGIN {
if ($^O eq "freebsd") {
eval 'sub IS_FREEBSD { 1 }';
}
else {
eval 'sub IS_FREEBSD { 0 }';
}
}

#
# native_path
# Convert from path format used by perl to the underlying
Expand Down
1 change: 1 addition & 0 deletions mysql-test/main/analyze_engine_stats2.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--innodb_buffer_pool_dump_at_shutdown=off --innodb_buffer_pool_load_at_startup=off --innodb-stats-persistent=1 --innodb-stats-auto-recalc=off
68 changes: 68 additions & 0 deletions mysql-test/main/analyze_engine_stats2.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale
#
create table t1 (
a varchar(255),
b varchar(255),
c varchar(255),
d varchar(255),
primary key(a,b,c,d)
) engine=innodb;
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
insert into t1 select
repeat(uuid(), 7),
repeat(uuid(), 7),
repeat(uuid(), 7),
repeat(uuid(), 7)
from seq_1_to_16384;
SET GLOBAL innodb_fast_shutdown=0;
# restart
set log_slow_verbosity='engine';
set long_query_time=0.0;
set @js='$analyze_output';
select @js;
@js
{
"query_optimization": {
"r_total_time_ms": "REPLACED"
},
"query_block": {
"select_id": 1,
"cost": 0.011647987,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "index",
"key": "PRIMARY",
"key_length": "1028",
"used_key_parts": ["a", "b", "c", "d"],
"loops": 1,
"r_loops": 1,
"rows": 1,
"r_rows": 16384,
"cost": 0.0110178,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
"pages_accessed": "REPLACED",
"pages_read_count": "REPLACED",
"pages_read_time_ms": "REPLACED"
},
"filtered": 100,
"r_filtered": 100
}
}
]
}
}
set @pages_read_time_ms=
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms'));


OK: pages_read_time is same in slow log and ANALYZE

set long_query_time=default;
drop table t1;
75 changes: 75 additions & 0 deletions mysql-test/main/analyze_engine_stats2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# r_engine_stats tests that require slow query log.
#
--source include/analyze-format.inc
--source include/have_sequence.inc
--source include/have_innodb.inc

--echo #
--echo # MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale
--echo #

# Each row is 1K.
create table t1 (
a varchar(255),
b varchar(255),
c varchar(255),
d varchar(255),
primary key(a,b,c,d)
) engine=innodb;

# The data size is 160K * 1K = 160M
# 16M / (page_size=16K) = 1K pages.
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
insert into t1 select
repeat(uuid(), 7),
repeat(uuid(), 7),
repeat(uuid(), 7),
repeat(uuid(), 7)
from seq_1_to_16384;

SET GLOBAL innodb_fast_shutdown=0;
source include/restart_mysqld.inc;
set log_slow_verbosity='engine';
set long_query_time=0.0;

let $analyze_output= `analyze format=json
select * from t1 force index (PRIMARY) order by a desc, b desc, c desc, d desc`;
evalp set @js='$analyze_output';

# Print it out for user-friendlines
--replace_regex /("(r_[a-z_]*_time_ms|pages[^"]*)": )[^, \n]*/\1"REPLACED"/
select @js;

set @pages_read_time_ms=
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms'));

let ANALYZE_PAGES=`select @pages_read_time_ms`;
let SLOW_LOG_FILE= `select @@slow_query_log_file`;

perl;
my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set";
my $analyze_pages=$ENV{'ANALYZE_PAGES'};
open(FILE, $slow_log_file) or die "Failed to open $slow_log_file";
# We didn't run any queries touching a storage engine after the query of
# interest, so we will be fine here if we just get the last occurrence of
# Pages_read_time: NNNN in the file
while(<FILE>) {
$slow_log_pages=$1 if (/Pages_read_time: ([0-9.]+)/);
}
close(FILE);

if ( $slow_log_pages > $analyze_pages * 0.95 &&
$slow_log_pages < $analyze_pages * 1.05) {
print "\n\n OK: pages_read_time is same in slow log and ANALYZE\n\n";
} else {
print "\n\n FAIL: $slow_log_pages not equal to $analyze_pages\n";
}

EOF


set long_query_time=default;
drop table t1;


9 changes: 9 additions & 0 deletions mysql-test/main/connect-no-db.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations
#
connect con1,localhost,root,,"*NO-ONE*";
SELECT database();
database()
NULL
disconnect con1;
connection default;
10 changes: 10 additions & 0 deletions mysql-test/main/connect-no-db.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--echo #
--echo # MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations
--echo #

# Connect without a database

connect (con1,localhost,root,,"*NO-ONE*");
SELECT database();
disconnect con1;
connection default;
5 changes: 5 additions & 0 deletions mysql-test/main/drop.result
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,8 @@ drop database mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
set @@session.sql_if_exists=0;
#
# MDEV-34205 ASAN stack-buffer-overflow in strxnmov | frm_file_exists
#
DROP TABLE `##################################################_long`.`#################################################_long`;
ERROR 42S02: Unknown table '##################################################_long.#########################################...'
6 changes: 6 additions & 0 deletions mysql-test/main/drop.test
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,9 @@ drop table mysqltest.does_not_exists;
drop database mysqltest;
drop database mysqltest;
set @@session.sql_if_exists=0;

--echo #
--echo # MDEV-34205 ASAN stack-buffer-overflow in strxnmov | frm_file_exists
--echo #
--error ER_BAD_TABLE_ERROR
DROP TABLE `##################################################_long`.`#################################################_long`;
19 changes: 12 additions & 7 deletions mysql-test/main/dyncol.result
Original file line number Diff line number Diff line change
Expand Up @@ -1950,12 +1950,6 @@ ex
# End of 10.4 tests
#
#
# Start of 10.5 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol
#
SELECT hex(column_create(1,'a' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)) AS ex;
Expand All @@ -1967,5 +1961,16 @@ SELECT hex(column_add(column_create(
ex
00020001000302001353612162
#
# Start of 10.5 tests
# MDEV-31566 Fix buffer overrun of column_json function
#
create table t1 (
c1 varchar(32) primary key,
d1 blob
);
insert into t1 values ('var', 0x0402000A0000000300030023076A736E7375626A6563742E0005006C0027000200290002002B0002002D0002002F0002000C31000C3B000C4B000C51000F62006631663266336634663509E5A79AE8BF9CE6B48B0FE8819AE9809AE98791E6A1A5E5BA970537343530301031313634332F393634352F31313630300C080000000000EFBFBDEFBFBD192E), ('zzz', 0x0402000900000003000300740C6A736E766F6C756D652E000900EFBFBD004300020045000200470003004A0004004E00050053000500580005005D000500620005000C67000C6A000C6D000C7000052C00051B00052C000CEFBFBD0007EFBFBD006638663966313070696332626F785F63626F785F67626F785F6B626F785F7666355F696402343402343402333241687474703A2F2F6F73732E68646238382E636F6D2F302F70686F746F2F30373865653765376336343634616236386130343833373333323636613532612E67696608302E303532323732244F1E00030180C106);
select c1,column_json(d1) as not_crashing from t1 order by c1;
c1 not_crashing
var {"jsn":"\u0000\u0005\u0000l\u0000'\u0000\u0002\u0000)\u0000\u0002\u0000+\u0000\u0002\u0000-\u0000\u0002\u0000/\u0000\u0002\u0000\u000C1\u0000\u000C;\u0000\u000CK\u0000\u000CQ\u0000\u000Fb\u0000f1f2f3f4f5\u0009姚远洋\u000F聚通金桥店\u000574500\u001011643/9645/11600\u000C\u0008\u0000\u0000\u0000\u0000\u0000��\u0019","subject":""}
zzz {"jsn":"\u0000\u0009\u0000�\u0000C\u0000\u0002\u0000E\u0000\u0002\u0000G\u0000\u0003\u0000J\u0000\u0004\u0000N\u0000\u0005\u0000S\u0000\u0005\u0000X\u0000\u0005\u0000]\u0000\u0005\u0000b\u0000\u0005\u0000\u000Cg\u0000\u000Cj\u0000\u000Cm\u0000\u000Cp\u0000\u0005,\u0000\u0005\u001B\u0000\u0005,\u0000\u000C�\u0000\u0007�\u0000f8f9f10pic2box_cbox_gbox_kbox_vf5_id\u000244\u000244\u000232Ahttp://oss.hdb88.com/0/photo/078ee7e7c6464ab68a0483733266a52a.gif\u00080.052272$O\u001E\u0000","volume":193.6}
drop table t1;
# End of 10.5 tests
Loading

0 comments on commit 2d3e2c5

Please sign in to comment.