2 messages in com.mysql.lists.bugsRe: mysqldump --tab crashes when dump...| From | Sent On | Attachments |
|---|---|---|
| Benjamin Pflugmann | 27 Dec 2001 22:08 | |
| Michael Widenius | 28 Dec 2001 04:38 |
| Subject: | Re: mysqldump --tab crashes when dumping DB with many tables![]() |
|---|---|
| From: | Michael Widenius (mon...@mysql.com) |
| Date: | 12/28/2001 04:38:23 AM |
| List: | com.mysql.lists.bugs |
Hi!
"Benjamin" == Benjamin Pflugmann <benj...@pflugmann.de> writes:
Benjamin> Hi.
Benjamin> On Wed, Dec 19, 2001 at 05:03:25PM -0700, mys...@thames.eas.asu.edu
wrote:
Description:
This problem pertains to the Sun Solaris distributions, I have not tried others. Description follows: mysqldump --tab runs up against user resource limits on the number of open file descriptors when the number of tables in the database being dumped is high enough. Have reproduced this problem with the latest stable release, binary package: mysql-max-3.23.46-sun-solaris2.8-sparc
<cut>
Benjamin> Well, yes. There is a function to output the table structure and in Benjamin> case of --tab it opens itself the file in question (instead of using Benjamin> the file it gets passed), and the function is left without closing the Benjamin> file.
Benjamin> A (hopefully) working patch:
Benjamin> --- mysql-3.23.46/client/mysqldump.c Thu Nov 29 14:52:18 2001 Benjamin> +++ mysql-h-3.23.46/client/mysqldump.c Fri Dec 28 06:30:54 2001 Benjamin> @@ -864,6 +864,8 @@ Benjamin> if (!extended_insert) Benjamin> strpos=strmov(strpos,"("); Benjamin> } Benjamin> + if (path) Benjamin> + my_fclose(sql_file, MYF(MY_WME)); Benjamin> DBUG_RETURN(numFields); Benjamin> } /* getTableStructure */
Benjamin> ----------------------------------------------------------------
Benjamin> At least it compiles and doesn't break anything obvious for me. I Benjamin> didn't create the test environment, though, so I cannot say, whether Benjamin> it really fixes the bug completely, although it IMHO should.
Thanks!
Yes, it should fix the bug. I did apply it, with the following small change:
if (sql_file != md_result_file) my_fclose(sql_file, MYF(MY_WME));
As the above is a little more safer if someone changes some of the code above.
Regards, Monty




