Skip to content

Commit 7170ae6

Browse files
committed
WL#16232 Make CREATE/DROP DATABASE DDL atomic
Problem: -------------------------------------------------------------------- - "DROP SCHEMA/DATABASE" could leave behind a database directory if a crash occurred just before directory deletion step. - "CREATE SCHEMA/DATABASE" could fail due to a pre-existing directory if a crash happened after directory creation. Solution: -------------------------------------------------------------------- - Introduce a new type of log entry "DELETE_SCHEMA_DIRECTORY_LOG" in the DDL_Log (an existing WAL mechanism in InnoDB) to perform directory deletion step. - DROP SCHEMA: -------------- - Updates Data Dictionary and logs "DELETE_SCHEMA_DIRECTORY_LOG" in the same transaction. The actual directory deletion is done as part of post-ddl hook, after the transaction is committed. - In case of a crash: 1. Before commit: The recovery rollbacks the incomplete transaction. 2. After commit: The recovery replays the committed log and deletes the schema directory. - Complies with the behavior defined in WL#7524 i.e. If files with "known" extensions are present in the schema directory, the "DROP DATABASE" query will succeed (with a warning) but will not delete the directory. - Switches to traditional/non-atomic way when executed as part of an upgrade. - CREATE SCHEMA: ---------------- - Logs and commits "DELETE_SCHEMA_DIRECTORY_LOG" in n innodb transaction which is committed separately, independently of the main transaction. Within the main transaction, creates the file system directory, updates the Data Dictionary and deletes the previously added DDL_Log entry. - If a crash occurs after the schema directory is created, recovery rolls back the incomplete transaction and deletes the directory. - Switches to traditional/non-atomic way when executed as part of an upgrade. Results: -------------------------------------------------------------------- - Improves atomicity, consistency and robustness of CREATE/DROP SCHEMA operations. - Simplifies handling of leftovers during crashes. Change-Id: If981dc7438640f9975bf3d1f70148ac2f833e221
1 parent 723fb64 commit 7170ae6

24 files changed

+807
-55
lines changed

include/my_sys.h

+3
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ extern int my_close(File fd, myf MyFlags);
587587
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
588588
extern int my_readlink(char *to, const char *filename, myf MyFlags);
589589
extern int my_is_symlink(const char *filename, ST_FILE_ID *file_id);
590+
extern bool my_rm_dir_w_symlink(const char *directory_path, bool send_error,
591+
bool send_intermediate_errors,
592+
bool &directory_deletion_failed);
590593
extern int my_realpath(char *to, const char *filename, myf MyFlags);
591594
extern int my_is_same_file(File file, const ST_FILE_ID *file_id);
592595
extern File my_create_with_symlink(const char *linkname, const char *filename,
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
2+
call mtr.add_suppression("Assertion `0' failed");
3+
# Points to verify in this test
4+
# scenario-1. if crash happens just after the schema directory is created, recovery should delete the directory.
5+
# scenario-2. if crash happens happens after we insert ddl log but before the directory is created,
6+
# we'll have ddl log committed but no directory yet. recovery should go-through in this case.
7+
#
8+
SET DEBUG = "+d,MAKE_SERVER_ABORT_AFTER_SCHEMA_DIR";
9+
CREATE SCHEMA DB1;
10+
# restart
11+
SET DEBUG = "-d,MAKE_SERVER_ABORT_AFTER_SCHEMA_DIR";
12+
CREATE SCHEMA DB1;
13+
DROP SCHEMA DB1;
14+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_SCHEMA_DIR";
15+
CREATE SCHEMA DB1;
16+
# restart
17+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_SCHEMA_DIR";
18+
CREATE SCHEMA DB1;
19+
DROP SCHEMA DB1;
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
2+
call mtr.add_suppression("Assertion `0' failed");
3+
# Points to verify in this test
4+
# scenario-1. if crash happens just before deleting the schema directory, recovery will delete the directory.
5+
# scenario-2. if crash happens happens after dropping 1/n tables, recovery should undo the transaction and
6+
# both dd entry and ddl log table should be restored in their original state.
7+
# scenario-3. if schema has tables from non transactional engines, DROP SCHEMA should behave transactional way.
8+
# scenario-1
9+
CREATE SCHEMA DB1;
10+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_NEW_WAY";
11+
DROP SCHEMA DB1;
12+
# restart
13+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_NEW_WAY";
14+
CREATE SCHEMA DB1;
15+
# scenario-2
16+
SET DEBUG = "+d,MAKE_SERVER_ABORT_AFTER_DROPPING_ONE_TABLE";
17+
CREATE TABLE DB1.T1 (C1 INT);
18+
CREATE TABLE DB1.T2 (C1 INT);
19+
DROP SCHEMA DB1;
20+
# restart
21+
SET DEBUG = "-d,MAKE_SERVER_ABORT_AFTER_DROPPING_ONE_TABLE";
22+
# scenario-3
23+
CREATE TABLE DB1.T3 (C1 INT) ENGINE=MyISAM;
24+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_OLD_WAY";
25+
DROP SCHEMA DB1;
26+
# restart
27+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_OLD_WAY";
28+
CREATE SCHEMA DB1;
29+
Got one of the listed errors

mysql-test/r/import.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ DROP TABLE s1.t1;
363363
# Drop s1 which is empty in DD, but which has files in directory
364364
DROP SCHEMA s1;
365365
Warnings:
366-
Warning 3607 Problem while dropping database. Can't remove database directory (Error dropping database (can't rmdir './s1', errno: ## - ...). Please remove it manually.
366+
Warning 3607 Problem while dropping database. Can't remove database directory (Error dropping database (can't rmdir './s1/', errno: ## - ...). Please remove it manually.
367367
# Show offending files
368368
t1.MYD
369369
t1.MYI

mysql-test/r/schema.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ connection default;
232232
# Reap DROP DATABASE. Statement should succeed, but send warnings
233233
# about problems with removing database directory to user ...
234234
Warnings:
235-
Warning 3607 Problem while dropping database. Can't remove database directory (Error dropping database (can't rmdir './db1', errno: ## - ...). Please remove it manually.
235+
Warning 3607 Problem while dropping database. Can't remove database directory (Error dropping database (can't rmdir './db1/', errno: ## - ...). Please remove it manually.
236236
# ... and error log too. Let's check that.
237237
Pattern "Problem while dropping database. Can't remove database directory .* Please remove it manually." found
238238
# Clean-up.

mysql-test/r/schema_names.result

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhh`;
2+
DROP SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhh`;
3+
CREATE SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhhx`;
4+
ERROR 42000: Identifier name 'aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhhx' is too long
5+
CREATE SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱`;
6+
Warnings:
7+
Warning 1300 Cannot convert string '\xF0\xA0\x9C\xB1\xF0\xA0...' from utf8mb4 to utf8mb3
8+
DROP SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱`;
9+
Warnings:
10+
Warning 1300 Cannot convert string '\xF0\xA0\x9C\xB1\xF0\xA0...' from utf8mb4 to utf8mb3
11+
CREATE SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱a`;
12+
ERROR HY000: Can't get stat of './@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003f@003fa' (OS error)

mysql-test/suite/innodb/r/innodb_read_only.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ERROR HY000: Table 't1' is read only
3636
RENAME TABLE WL6445.t1 TO WL6444.t2;
3737
ERROR 42000: Unknown database 'WL6444'
3838
DROP DATABASE WL6445;
39-
ERROR HY000: Storage engine can't drop table 'WL6445.t1'
39+
ERROR HY000: Running in read-only mode
4040
SHOW CREATE TABLE WL6445.t1;
4141
Table Create Table
4242
t1 CREATE TABLE `t1` (

mysql-test/suite/innodb/t/innodb_read_only.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ TRUNCATE TABLE WL6445.t1;
5252
RENAME TABLE WL6445.t1 TO WL6444.t2;
5353

5454
--replace_regex /wl6445/WL6445/i
55-
--error ER_ENGINE_CANT_DROP_TABLE
55+
--error ER_READ_ONLY_MODE
5656
DROP DATABASE WL6445;
5757

5858
SHOW CREATE TABLE WL6445.t1;
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
2+
call mtr.add_suppression("Assertion `0' failed");
3+
4+
--echo # Points to verify in this test
5+
--echo # scenario-1. if crash happens just after the schema directory is created, recovery should delete the directory.
6+
--echo # scenario-2. if crash happens happens after we insert ddl log but before the directory is created,
7+
--echo # we'll have ddl log committed but no directory yet. recovery should go-through in this case.
8+
--echo #
9+
10+
--source include/have_debug.inc
11+
12+
# to make server abort after the schema directory is created
13+
SET DEBUG = "+d,MAKE_SERVER_ABORT_AFTER_SCHEMA_DIR";
14+
15+
--source include/expect_crash.inc
16+
--error 0,2002,2013
17+
CREATE SCHEMA DB1;
18+
--source include/wait_until_disconnected.inc
19+
20+
# restart
21+
--source include/start_mysqld.inc
22+
--source include/wait_until_connected_again.inc
23+
24+
#deactivate the debug point
25+
SET DEBUG = "-d,MAKE_SERVER_ABORT_AFTER_SCHEMA_DIR";
26+
27+
# verify if the database really got deleted.
28+
CREATE SCHEMA DB1;
29+
DROP SCHEMA DB1;
30+
31+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_SCHEMA_DIR";
32+
33+
--source include/expect_crash.inc
34+
--error 0,2002,2013
35+
CREATE SCHEMA DB1;
36+
--source include/wait_until_disconnected.inc
37+
38+
# restart
39+
--source include/start_mysqld.inc
40+
--source include/wait_until_connected_again.inc
41+
42+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_SCHEMA_DIR";
43+
CREATE SCHEMA DB1;
44+
DROP SCHEMA DB1;

mysql-test/t/atomic_drop_schema.test

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
2+
call mtr.add_suppression("Assertion `0' failed");
3+
4+
--echo # Points to verify in this test
5+
--echo # scenario-1. if crash happens just before deleting the schema directory, recovery will delete the directory.
6+
--echo # scenario-2. if crash happens happens after dropping 1/n tables, recovery should undo the transaction and
7+
--echo # both dd entry and ddl log table should be restored in their original state.
8+
--echo # scenario-3. if schema has tables from non transactional engines, DROP SCHEMA should behave transactional way.
9+
10+
--source include/have_debug.inc
11+
12+
--echo # scenario-1
13+
14+
# crete the database
15+
CREATE SCHEMA DB1;
16+
17+
# activate the debug point
18+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_NEW_WAY";
19+
20+
# this is supposed to crash
21+
--source include/expect_crash.inc
22+
--error 0,2002,2013
23+
DROP SCHEMA DB1;
24+
--source include/wait_until_disconnected.inc
25+
26+
# restart
27+
--source include/start_mysqld.inc
28+
--source include/wait_until_connected_again.inc
29+
30+
# deactivate the debug point
31+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_NEW_WAY";
32+
33+
# verify if the database really got deleted.
34+
CREATE SCHEMA DB1;
35+
36+
--echo # scenario-2
37+
38+
SET DEBUG = "+d,MAKE_SERVER_ABORT_AFTER_DROPPING_ONE_TABLE";
39+
40+
CREATE TABLE DB1.T1 (C1 INT);
41+
CREATE TABLE DB1.T2 (C1 INT);
42+
43+
# this is supposed to crash
44+
--source include/expect_crash.inc
45+
--error 0,2002,2013
46+
DROP SCHEMA DB1;
47+
--source include/wait_until_disconnected.inc
48+
49+
# restart
50+
--source include/start_mysqld.inc
51+
--source include/wait_until_connected_again.inc
52+
53+
SET DEBUG = "-d,MAKE_SERVER_ABORT_AFTER_DROPPING_ONE_TABLE";
54+
55+
--echo # scenario-3
56+
57+
# verify that db didn't get deleted previously
58+
# also, final clean-up.
59+
CREATE TABLE DB1.T3 (C1 INT) ENGINE=MyISAM;
60+
61+
# Make server crash just before deleting the directory
62+
SET DEBUG = "+d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_OLD_WAY";
63+
64+
# this is supposed to crash
65+
--source include/expect_crash.inc
66+
--error 0,2002,2013
67+
DROP SCHEMA DB1;
68+
--source include/wait_until_disconnected.inc
69+
70+
# restart
71+
--source include/start_mysqld.inc
72+
--source include/wait_until_connected_again.inc
73+
74+
SET DEBUG = "-d,MAKE_SERVER_ABORT_BEFORE_DELETING_THE_SCHEMA_DIR_OLD_WAY";
75+
76+
--error ER_SCHEMA_DIR_EXISTS,ER_BAD_DB_ERROR
77+
CREATE SCHEMA DB1;
78+
79+
# final cleanup
80+
let MYSQLD_DATADIR =`SELECT @@datadir`;
81+
--force-rmdir $MYSQLD_DATADIR/DB1

mysql-test/t/schema.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ DROP SCHEMA broken;
687687

688688
--echo # but drop succeeds (with warning) when adding IF EXISTS
689689
--echo # Suppress output since it is not stable across platforms
690-
--disable_warnings ER_SCHEMA_DIR_MISSING ONCE
690+
--disable_warnings ER_SCHEMA_DIR_MISSING,ER_DB_DROP_RMDIR2 ONCE
691691
DROP SCHEMA IF EXISTS broken;
692692

693693
--echo # Create and drop schema again to make sure nothing is left behind

mysql-test/t/schema_names.test

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--source include/not_windows.inc
2+
#
3+
# Case-1: Single-Byte characters
4+
#
5+
6+
# Max length for schema name is 64 characters.
7+
CREATE SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhh`;
8+
DROP SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhh`;
9+
10+
--error ER_TOO_LONG_IDENT
11+
CREATE SCHEMA `aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffffgggggggghhhhhhhhx`;
12+
13+
#
14+
# Case-2: Multi-Byte characters
15+
#
16+
17+
# The utf8mb4 char '𠜱' expands to '@003f', and using 55 of them makes path 257 (255 + 2) chars long.
18+
CREATE SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱`;
19+
DROP SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱`;
20+
21+
# An attempt to use more than 55 of such chars makes `stat` system call in UNIX-like systems to fail
22+
# with `ENAMETOOLONG`.
23+
--replace_regex /OS errno.*/OS error)/
24+
--error 13
25+
CREATE SCHEMA `𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱𠜱a`;
26+

mysys/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ SET(MYSYS_SOURCES
8686
my_rdtsc.cc
8787
my_read.cc
8888
my_rename.cc
89+
my_rm_dir_w_symlink.cc
8990
my_seek.cc
9091
my_static.cc
9192
my_string.cc

mysys/my_rm_dir_w_symlink.cc

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
Copyright (c) 2024, Oracle and/or its affiliates.
3+
4+
This program is free software; you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License, version 2.0,
6+
as published by the Free Software Foundation.
7+
8+
This program is designed to work with certain software (including
9+
but not limited to OpenSSL) that is licensed under separate terms,
10+
as designated in a particular file or component or in included license
11+
documentation. The authors of MySQL hereby grant you an additional
12+
permission to link the program and your derivative works with the
13+
separately licensed software that they have either included with
14+
the program or referenced in the documentation.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License, version 2.0, for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with this program; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24+
25+
#ifdef _WIN32
26+
#include <direct.h>
27+
#endif
28+
29+
#ifdef HAVE_UNISTD_H
30+
#include <unistd.h>
31+
#endif
32+
33+
#include <errno.h>
34+
#include "m_string.h"
35+
#include "my_io.h"
36+
#include "my_sys.h"
37+
#include "my_thread_local.h"
38+
#include "mysql/psi/mysql_file.h"
39+
#include "mysql_com.h"
40+
41+
#ifdef HAVE_PSI_INTERFACE
42+
extern PSI_file_key key_file_misc;
43+
#endif
44+
45+
/**
46+
Deletes the specified directory. In case of linux, if it is
47+
symbolic link, it deletes the link first and then deletes
48+
the original directory pointed by it.
49+
50+
@param[in] directory_path Path to the directory/symbolic link
51+
@param[in] send_error Flag that specifies if this function
52+
should send error when deleting symbolic link (if any) and directory.
53+
@param[in] send_intermediate_errors Flag that specifies if this function
54+
should should send error when reading the symbolic link.
55+
@param[out] directory_deletion_failed Flag that specifies if the directory
56+
deletion step failed.
57+
58+
@retval false success
59+
@retval true failure
60+
*/
61+
62+
bool my_rm_dir_w_symlink(const char *directory_path, bool send_error,
63+
bool send_intermediate_errors,
64+
bool &directory_deletion_failed) {
65+
char tmp_path[FN_REFLEN], *pos;
66+
char *path = tmp_path;
67+
unpack_filename(tmp_path, directory_path);
68+
#ifndef _WIN32
69+
int error;
70+
char tmp2_path[FN_REFLEN];
71+
72+
/* Remove end FN_LIBCHAR as this causes problem on Linux in readlink */
73+
pos = strend(path);
74+
if (pos > path && pos[-1] == FN_LIBCHAR) *--pos = 0;
75+
76+
if ((error = my_readlink(tmp2_path, path,
77+
MYF(send_intermediate_errors ? MY_WME : 0))) < 0)
78+
return true;
79+
if (error == 0) {
80+
if (mysql_file_delete(
81+
key_file_misc, path,
82+
MYF((send_error && send_intermediate_errors) ? MY_WME : 0))) {
83+
return send_error;
84+
}
85+
/* Delete directory symbolic link pointed at */
86+
path = tmp2_path;
87+
}
88+
#endif
89+
/* Remove last FN_LIBCHAR to not cause a problem on OS/2 */
90+
pos = strend(path);
91+
92+
if (pos > path && pos[-1] == FN_LIBCHAR) *--pos = 0;
93+
if (rmdir(path) < 0 && send_error) {
94+
directory_deletion_failed = true;
95+
set_my_errno(errno);
96+
return true;
97+
}
98+
return false;
99+
}

share/messages_to_error_log.txt

+6
Original file line numberDiff line numberDiff line change
@@ -12781,6 +12781,12 @@ ER_INVALID_METER
1278112781
ER_INVALID_LOGGER
1278212782
eng "Invalid logger name or value for performance_schema_logger '%s'."
1278312783

12784+
ER_IB_DELETE_SCHEMA_DIR
12785+
eng "deleted the schema directory: %s"
12786+
12787+
ER_IB_INSERT_DELETE_SCHEMA_DIRECTORY_DDL_LOG
12788+
eng "%s"
12789+
1278412790
################################################################################
1278512791
# Error numbers 50000 to 51999 are reserved. Please do not use them for
1278612792
# other error messages.

0 commit comments

Comments
 (0)