Skip to content

Bug #83741 - InnoDB: Failing assertion: lock->magic_n == 22643 #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <functional>
#include <list>
#include <set>
#include <unistd.h> // this library will help us to detect file system status
#include <string.h>
#include <string>

#include <fenv.h>
Expand Down Expand Up @@ -4389,6 +4391,21 @@ static void test_lc_time_sz()
}
#endif//DBUG_OFF

// checks if file system is read-only
int is_filesystem_read_only(char const* name) {
if (access(name, W_OK) == -1) {
if (access(name, R_OK) == 0) {
return R_OK; // read only
} else if (access(name, F_OK) == 0) {
return F_OK; // file exists but have not any access
} else {
return -1; // file does not exist
}
} else {
return W_OK; // read/write
}
}

#ifdef _WIN32
int win_main(int argc, char **argv)
#else
Expand All @@ -4411,6 +4428,19 @@ int mysqld_main(int argc, char **argv)
my_message_local(ERROR_LEVEL, "my_init() failed.");
return 1;
}

// Get --datadir value to check if filesystem is read-only
for (int i = 1; i < argc; i++) {
if (strstr(argv[i], "--datadir")) {
std::string str(argv[i]);
char const* dataDirPath = str.substr(10, str.length()).c_str();
if (is_filesystem_read_only(dataDirPath) == R_OK) {
my_message_local(ERROR_LEVEL, "File system (%s) is read-only", dataDirPath);
return 1;
}
break;
}
}
#endif /* _WIN32 */

orig_argc= argc;
Expand Down
1 change: 1 addition & 0 deletions sql/mysqld.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void my_init_signals();
bool gtid_server_init();
void gtid_server_cleanup();
const char *fixup_enforce_gtid_consistency_command_line(char *value_arg);
int is_filesystem_read_only(char const* path);

extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
Expand Down
5 changes: 3 additions & 2 deletions storage/innobase/row/row0mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3109,10 +3109,11 @@ row_create_index_for_mysql(
len = ut_max(len, field_lengths[i]);
}

DBUG_EXECUTE_IF(
// bug fix for http://bugs.mysql.com/bug.php?id=83741
/*DBUG_EXECUTE_IF(
"ib_create_table_fail_at_create_index",
len = DICT_MAX_FIELD_LEN_BY_FORMAT(table) + 1;
);
);*/

/* Column or prefix length exceeds maximum column length */
if (len > (ulint) DICT_MAX_FIELD_LEN_BY_FORMAT(table)) {
Expand Down