Hi!

>>>>> "Benjamin" == Benjamin Pflugmann <[EMAIL PROTECTED]> writes:

Benjamin> Hi.
Benjamin> On Wed, Dec 19, 2001 at 05:03:25PM -0700, [EMAIL PROTECTED] 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

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to