Hi. 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 > > >How-To-Repeat: > 1. Use a MySQL database with more than 10 tables. > > 2. Limit the number of open file descriptors for the user running > mysqldump to a sufficiently small number, (say, less than the > number of tables in the database); e.g., with ksh: ulimit -n 10 > > 3. Run mysqldump on that database with the --tab=/dir/to/dump option. > > 4. You should see an error when it tries to save the structure, > i.e., while creating the .sql file, for the 7th table (with > ulimit -n 10 in step 2). > > >Fix: > Looks like it isn't closing any .sql files before opening others?
Well, yes. There is a function to output the table structure and in case of --tab it opens itself the file in question (instead of using the file it gets passed), and the function is left without closing the file. A (hopefully) working patch: --- mysql-3.23.46/client/mysqldump.c Thu Nov 29 14:52:18 2001 +++ mysql-h-3.23.46/client/mysqldump.c Fri Dec 28 06:30:54 2001 @@ -864,6 +864,8 @@ if (!extended_insert) strpos=strmov(strpos,"("); } + if (path) + my_fclose(sql_file, MYF(MY_WME)); DBUG_RETURN(numFields); } /* getTableStructure */ ---------------------------------------------------------------- At least it compiles and doesn't break anything obvious for me. I didn't create the test environment, though, so I cannot say, whether it really fixes the bug completely, although it IMHO should. Bye, Benjamin. PS: CC'ed to [EMAIL PROTECTED], because this is where the initial report belongs. Kept the full quote to make it easier for people who did not have the initial report (anymore). > > >Submitter-Id: <submitter ID> > >Originator: MySQL account > >Organization: > Dept. of Computer Science and Engineering, Arizona State University > >MySQL support: none > >Synopsis: mysqldump --tab exceeds user resource limit on Solaris > >Severity: non-critical > >Priority: medium > >Category: mysql > >Class: sw-bug > >Release: mysql-3.23.33 (Official MySQL binary) > >Server: /usr/local/mysql/bin/mysqladmin Ver 8.15 Distrib 3.23.33, for >sun-solaris2.7 on sparc > Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB > This software comes with ABSOLUTELY NO WARRANTY. This is free software, > and you are welcome to modify and redistribute it under the GPL license > > Server version 3.23.33 > Protocol version 10 > Connection Localhost via UNIX socket > UNIX socket /tmp/mysql.sock > Uptime: 56 min 48 sec > > Threads: 1 Questions: 3167 Slow queries: 0 Opens: 804 Flush tables: 1 Open >tables: 64 Queries per second avg: 0.929 > >Environment: > > System: SunOS thames.eas.asu.edu 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-5_10 > Architecture: sun4 > > Some paths: /usr/bin/perl /usr/ucb/cc > > Compilation info: CC='gcc' CFLAGS='-O3 ' CXX='gcc' CXXFLAGS='-O3 >-felide-constructors -fno-exceptions -fno-rtti' LDFLAGS='' > LIBC: > -rw-r--r-- 1 bin bin 1694308 Aug 28 2000 /lib/libc.a > lrwxrwxrwx 1 root root 11 Oct 8 1998 /lib/libc.so -> ./libc.so.1 > -rwxr-xr-x 1 bin bin 1115940 Aug 28 2000 /lib/libc.so.1 > -rw-r--r-- 1 bin bin 1694308 Aug 28 2000 /usr/lib/libc.a > lrwxrwxrwx 1 root root 11 Oct 8 1998 /usr/lib/libc.so -> ./libc.so.1 > -rwxr-xr-x 1 bin bin 1115940 Aug 28 2000 /usr/lib/libc.so.1 > Configure command: ./configure --prefix=/usr/local/mysql '--with-comment=Official >MySQL binary' --with-extra-charsets=complex --enable-assembler --disable-shared > Perl: This is perl, version 5.005_61 built for sun4-solaris > [...] -- [EMAIL PROTECTED] --------------------------------------------------------------------- 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