Skip to content

Commit 2fff452

Browse files
committed
Merge branch '13.0' into 'main'
check_grant_db(), mysqld_show_create_db(), get_schema_privileges_for_show(), get_check_constraints_record(), and check_grant()'s any_combination_will_do path (via get_all_tables()) still treated GRANT OPTION alone as a real privilege, reintroduced by the MDEV-14443 DENY statement refactor. Same fix as the original MDEV-37951 patch: exclude GRANT_ACL from the group mask before testing "has any privilege".
2 parents cded2b2 + 1a4bb1b commit 2fff452

800 files changed

Lines changed: 18416 additions & 4838 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/windows-arm64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
$cidir = "$tmp/ci"
5454
mkdir $cidir
5555
fsutil file setCaseSensitiveInfo $cidir enable
56-
perl bld\mysql-test\mysql-test-run.pl --force --parallel=$parallel --suite=main,innodb --vardir=$cidir/var --skip-rpl --mysqld=--lower-case-table-names=0 --mysqld=--loose-innodb-flush-log-at-trx-commit=2 --mysqld=--debug-no-sync --skip-test=innodb-virtual-columns
56+
perl bld\mysql-test\mysql-test-run.pl --force --parallel=$parallel --suite=main,innodb,parts --vardir=$cidir/var --skip-rpl --mysqld=--lower-case-table-names=0 --mysqld=--loose-innodb-flush-log-at-trx-commit=2 --mysqld=--debug-no-sync --skip-test=innodb-virtual-columns

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ extra/pcre2
117117
extra/libfmt
118118
plugin/auth_pam/auth_pam_tool
119119
plugin/auth_pam/config_auth_pam.h
120+
plugin/auth_pam/testing/mariadb_mtr
120121
plugin/aws_key_management/aws-sdk-cpp
121122
plugin/aws_key_management/aws_sdk_cpp
122123
plugin/aws_key_management/aws_sdk_cpp-prefix

.gitmodules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
url = https://github.com/facebook/rocksdb.git
77
[submodule "wsrep-lib"]
88
path = wsrep-lib
9-
url = https://github.com/codership/wsrep-lib.git
10-
branch = master
9+
url = https://github.com/mariadb-corporation/wsrep-lib.git
1110
[submodule "extra/wolfssl/wolfssl"]
1211
path = extra/wolfssl/wolfssl
1312
url = https://github.com/wolfSSL/wolfssl.git

client/mysql.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ extern "C" {
102102
#define USE_POPEN
103103
}
104104

105+
#define HISTORY_FILE ".mariadb_history"
106+
105107
static CHARSET_INFO *charset_info= &my_charset_latin1;
106108

107109
#if defined(_WIN32)
@@ -1444,19 +1446,19 @@ int main(int argc,char *argv[])
14441446
else if ((home= getenv("HOME")))
14451447
{
14461448
size_t histfile_size=
1447-
strlen(home) + strlen("/.mysql_history") + 2;
1449+
strlen(home) + strlen("/" HISTORY_FILE) + 2;
14481450
histfile=(char*) my_malloc(PSI_NOT_INSTRUMENTED,
14491451
histfile_size, MYF(MY_WME));
14501452
if (histfile)
14511453
{
1452-
snprintf(histfile, histfile_size, "%s/.mariadb_history", home);
1454+
snprintf(histfile, histfile_size, "%s/%s", home, HISTORY_FILE);
14531455
if (my_access(histfile, F_OK))
14541456
{
14551457
/* no .mariadb_history, look for historical name and use if present */
14561458
snprintf(histfile, histfile_size, "%s/.mysql_history", home);
14571459
/* and go back to original if not found */
14581460
if (my_access(histfile, F_OK))
1459-
snprintf(histfile, histfile_size, "%s/.mariadb_history", home);
1461+
snprintf(histfile, histfile_size, "%s/%s", home, HISTORY_FILE);
14601462
}
14611463
char link_name[FN_REFLEN];
14621464
if (my_readlink(link_name, histfile, 0) == 0 &&

client/mysqladmin.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
849849
{
850850
/* We don't use mysql_kill(), since it only handles 32-bit IDs. */
851851
char buff[26], *out; /* "KILL " + max 20 digs + NUL */
852-
out= strxmov(buff, "KILL ", NullS);
852+
out= strmov(buff, "KILL ");
853853
ullstr(strtoull(pos, NULL, 0), out);
854854

855855
if (mysql_query(mysql, buff))
@@ -1498,7 +1498,7 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
14981498
{
14991499
MYSQL_ROW row=mysql_fetch_row(result);
15001500
if (row)
1501-
strmov(pidfile, row[1]);
1501+
strmake(pidfile, row[1], FN_REFLEN-1);
15021502
mysql_free_result(result);
15031503
return row == 0; /* Error if row = 0 */
15041504
}

client/mysqlcheck.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ static int handle_request_for_tables(char *tables, size_t length,
906906
my_bool view, my_bool dont_quote)
907907
{
908908
char *query, *end, options[100], message[100];
909-
char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name;
910909
size_t query_length= 0, query_size= sizeof(char)*(length+110);
911910
const char *op = 0;
912911
const char *tab_view;
@@ -984,21 +983,13 @@ static int handle_request_for_tables(char *tables, size_t length,
984983
DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
985984

986985
/* No backticks here as we added them before */
987-
query_length= snprintf(query, query_size, "%s%s%s %s", op,
988-
tab_view, tables, options);
989-
table_name= tables;
986+
query_length= my_snprintf(query, query_size, "%s%s%s %s", op,
987+
tab_view, tables, options);
990988
}
991989
else
992990
{
993-
char *ptr, *org;
994-
995-
org= ptr= strmov(strmov(query, op), tab_view);
996-
ptr= fix_table_name(ptr, tables);
997-
strmake(table_name_buff, org, MY_MIN((int) sizeof(table_name_buff)-1,
998-
(int) (ptr - org)));
999-
table_name= table_name_buff;
1000-
ptr= strxmov(ptr, " ", options, NullS);
1001-
query_length= (size_t) (ptr - query);
991+
query_length= my_snprintf(query, query_size, "%s%s%sQ %s",
992+
op, tab_view, tables, options);
1002993
}
1003994
if (verbose >= 3)
1004995
puts(query);
@@ -1013,7 +1004,7 @@ static int handle_request_for_tables(char *tables, size_t length,
10131004
print_result();
10141005
if (opt_flush_tables)
10151006
{
1016-
query_length= snprintf(query, query_size, "FLUSH TABLES %s", table_name);
1007+
query_length= my_snprintf(query, query_size, "FLUSH TABLES %sQ", tables);
10171008
if (mysql_real_query(sock, query, (ulong)query_length))
10181009
{
10191010
DBerror(sock, query);
@@ -1105,7 +1096,7 @@ static void __attribute__((noinline)) print_result()
11051096
}
11061097
else
11071098
printf("%-9s: %s\n", row[2], row[3]);
1108-
strmov(prev, row[0]);
1099+
strmake_buf(prev, row[0]);
11091100
}
11101101
/* add the last table to be repaired to the list */
11111102
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)

0 commit comments

Comments
 (0)