mysql_install_db not handling mysqld startup failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Vlad Lesin | ||
5.1 |
Fix Released
|
Medium
|
Vlad Lesin | ||
5.5 |
Fix Released
|
Medium
|
Vlad Lesin | ||
5.6 |
Fix Released
|
Medium
|
Vlad Lesin |
Bug Description
Consider lp:mysql-server/5.6 revision 6130.
If we look into scripts/
my $create_
my $fill_system_tables = "$pkgdatadir/
The code use 'open(PIPE, "| $mysqld_
I would propose to check the return value of perl "close" function when the pipe is closed. Here is the description how to check error code of the child on another side of pipe with "close":
"If the filehandle came from a piped open, close returns false if one of the other syscalls involved fails or if its program exits with non-zero status. If the only problem was that the program exited non-zero, $! will be set to 0 . Closing a pipe also waits for the process executing on the pipe to exit--in case you wish to look at the output of the pipe afterwards--and implicitly puts the exit status value of that command into $? and ${^CHILD_
In the case of unexpected mysqld termination mysql_install_db must be stopped with corresponding error message.
How to repeate:
Run mysql_install_db in 5.6 with --enforce-
ERROR: 1787 When @@GLOBAL.
But mysql_install_db continues execution. As a result system tables will not be created and filled in.
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 47 lines (+28/-2)1 file modifiedPercona-Server/scripts/mysql_install_db.pl.in (+28/-2)
- Laurynas Biveinis (community): Approve
- Laurynas Biveinis (community): Approve
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-1553