Loading Docs/manual.texi +37 −4 Original line number Diff line number Diff line Loading @@ -27761,6 +27761,7 @@ How big a @code{VARCHAR} column can be * mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables * mysqlimport:: Importing data from text files * mysqlshow:: Showing databases, tables and columns * perror:: Displaying error messages * myisampack:: The @strong{MySQL} compressed read-only table generator @end menu Loading Loading @@ -28559,7 +28560,7 @@ mysqldump --all-databases > all_databases.sql @cindex files, text @cindex text files, importing @cindex @code{mysqlimport} @node mysqlimport, mysqlshow, mysqldump, Tools @node mysqlimport, perror, mysqldump, Tools @section Importing Data from Text Files @code{mysqlimport} provides a command-line interface to the @code{LOAD DATA Loading Loading @@ -28696,12 +28697,34 @@ $ mysql -e 'SELECT * FROM imptest' test +------+---------------+ @end example @cindex error messages, displaying @cindex perror @node perror, mysqlshow, mysqlimport, Tools @section Converting an error code to the corresponding error message @code{perror} can be used to print error message(s). @code{perror} can be invoked like this: @example shell> perror [OPTIONS] [ERRORCODE [ERRORCODE...]] For example: shell> perror 64 79 Error code 64: Machine is not on the network Error code 79: Can not access a needed shared library @end example @code{perror} can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. The error messages are mostly system dependent. @cindex databases, displaying @cindex displaying, database information @cindex tables, displaying @cindex columns, displaying @cindex showing, database information @node mysqlshow, myisampack, mysqlimport, Tools @node mysqlshow, myisampack, perror, Tools @section Showing Databases, Tables, and Columns @code{mysqlshow} can be used to quickly look at which databases exist, Loading Loading @@ -32091,6 +32114,14 @@ tmpdir=C:/temp assuming that the @file{c:\\temp} directory exists. @xref{Option files}. Check also the error code that you get with @code{perror}. One reason may also be a disk full error; @example shell >perror 28 Error code 28: No space left on device @end example @cindex commands out of sync @node Commands out of sync, Ignoring user, Cannot create, Common errors @subsection @code{Commands out of sync} error in client Loading Loading @@ -38932,10 +38963,12 @@ though, so Version 3.23 is not released as a stable version yet. Automatically remove Berkeley DB transaction logs that are no longer in use. @item Added a warning if number of rows changes on @code{REPAIR}/@code{OPTIMIZE}. @item Applied patches for OS2 by @code{Yuri Dario}. @item @code{FLUSH TABLES table_name} didn't always flush table properly to disk; One some cases the index tree wasn't completely written to disk. @code{FLUSH TABLES table_name} didn't always flush the index tree properly to disk. @item @code{--bootstrap} is now run in a separate thread. This fixes the problem that @code{mysql_install_db} core dumped on some Linux machines. myisam/mi_check.c +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ int chk_status(MI_CHECK *param, register MI_INFO *info) else if (mi_is_crashed(info)) mi_check_print_warning(param, "Table is marked as crashed"); if (share->state.open_count != (info->s->global_changed ? 1 : 0)) if (share->state.open_count != (uint) (info->s->global_changed ? 1 : 0)) { mi_check_print_warning(param, "%d clients is using or hasn't closed the table properly", Loading scripts/mysqlhotcopy.sh +109 −43 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file my $VERSION = "1.8"; my $VERSION = "1.9"; my $opt_tmpdir= $main::env{TMPDIR}; my $OPTIONS = <<"_OPTIONS"; Loading @@ -50,7 +51,7 @@ Usage: $0 db_name [new_db_name | directory] --allowold don't abort if target already exists (rename it _old) --keepold don't delete previous (now renamed) target when done --indices include index files in copy --noindices don't include full index files in copy --method=# method for copy (only "cp" currently supported) -q, --quiet be silent except for errors Loading @@ -61,6 +62,7 @@ Usage: $0 db_name [new_db_name | directory] --suffix=# suffix for names of copied databases --checkpoint=# insert checkpoint entry into specified db.table --flushlog flush logs once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) Try 'perldoc $0 for more complete documentation' _OPTIONS Loading @@ -71,7 +73,7 @@ sub usage { my %opt = ( user => getpwuid($>), indices => 1, # for safety noindices => 0, allowold => 0, # for safety keepold => 0, method => "cp", Loading @@ -86,7 +88,7 @@ GetOptions( \%opt, "socket|S=s", "allowold!", "keepold!", "indices!", "noindices!", "method=s", "debug", "quiet|q", Loading @@ -95,6 +97,7 @@ GetOptions( \%opt, "suffix=s", "checkpoint=s", "flushlog", "tmpdir|t=s", "dryrun|n", ) or usage("Invalid option"); Loading Loading @@ -133,6 +136,7 @@ else { my $mysqld_help; my %mysqld_vars; my $start_time = time; my $opt_tmpdir= $opt{tempdir} ? $opt{tmpdir} : $main::env{TMPDIR}; $0 = $1 if $0 =~ m:/([^/]+)$:; $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; Loading Loading @@ -238,13 +242,16 @@ foreach my $rdb ( @db_desc ) { my @db_files = sort ( $negated ? grep { $db_files{$_} !~ $t_regex } keys %db_files : grep { $db_files{$_} =~ $t_regex } keys %db_files ); my @index_files=(); ## remove indices unless we're told to keep them unless ($opt{indices}) { if ($opt{noindices}) { @index_files= grep { /\.(ISM|MYI)$/ } @db_files; @db_files = grep { not /\.(ISM|MYI)$/ } @db_files; } $rdb->{files} = [ @db_files ]; $rdb->{index} = [ @index_files ]; my @hc_tables = map { "$db.$_" } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; Loading Loading @@ -369,14 +376,65 @@ else { my @failed = (); foreach my $rdb ( @db_desc ) { foreach my $rdb ( @db_desc ) { my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; next unless @files; eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{index}}; if ($rdb->{index}) { # # Copy only the header of the index file # my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; foreach my $file ($rdb->{index}) { my $from="$datadir/$rdb->{src}/$file"; my $to="$rdb->{target}/$file"; my $buff; open(INPUT, $from) || die "Can't open file $from: $!\n"; my $length=read INPUT, $buff, 2048; die "Can't read index header from $from\n" if ($length <= 1024); close INPUT; if ( $opt{dryrun} ) { print '$opt{method}-header $from $to\n'; } elsif ($opt{method} eq 'cp') { !open(OUTPUT,$to) || die "Can\'t create file $to: $!\n"; if (write(OUTPUT,$buff) != length($buff)) { die "Error when writing data to $to: $!\n"; } close OUTPUT || die "Error on close of $to: $!\n"; } elsif ($opt{method} eq 'scp') { my $tmp=$tmpfile; open(OUTPUT,"$tmp") || die "Can\'t create file $tmp: $!\n"; if (write(OUTPUT,$buff) != length($buff)) { die "Error when writing data to $tmp: $!\n"; } close OUTPUT || die "Error on close of $tmp: $!\n"; safe_system('scp $tmp $to'); } else { die "Can't use unsupported method '$opt{method}'\n"; } } unlink "$opt_tmpdir/mysqlhotcopy$$"; } if ( $opt{checkpoint} ) { my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; Loading Loading @@ -469,13 +527,21 @@ sub copy_files { # add files to copy and the destination directory push @cmd, @$files, $target; } else { else { die "Can't use unsupported method '$method'\n"; } safe_system (@cmd); } if ( $opt{dryrun} ) { sub safe_system { my @cmd=shift; if ( $opt{dryrun} ) { print "@cmd\n"; next; return; } ## for some reason system fails but backticks works ok for scp... Loading @@ -488,6 +554,7 @@ sub copy_files { } } sub retire_directory { my ( @dir ) = @_; Loading Loading @@ -611,9 +678,9 @@ port to use when connecting to local server UNIX domain socket to use when connecting to local server =item --indices =item --noindices include index files in copy don't include index files in copy =item --method=# Loading Loading @@ -677,9 +744,6 @@ Add support for other copy methods (eg tar to single file?). Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. Add option to only copy the first 65KB of index files. That simplifies recovery (recovery with no index file at all is complicated). =head1 AUTHOR Tim Bunce Loading @@ -689,3 +753,5 @@ Martin Waite - added checkpoint, flushlog, regexp and dryrun options Ralph Corderoy - added synonyms for commands Scott Wiersdorf - added table regex and scp support Monty - working --noindex (copy only first 2048 bytes of index file) sql-bench/Results/ATIS-mysql-Linux_2.2.13_SMP_alpha +7 −7 Original line number Diff line number Diff line Testing server 'MySQL 3.23.28 gamma' at 2000-11-18 15:05:04 Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:24:55 ATIS table test Loading @@ -6,14 +6,14 @@ Creating tables Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Inserting data Time to insert (9768): 3 wallclock secs ( 0.68 usr 0.60 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (9768): 4 wallclock secs ( 0.64 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Retrieving data Time for select_simple_join (500): 2 wallclock secs ( 0.62 usr 0.39 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 12 wallclock secs ( 4.31 usr 3.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 11 wallclock secs ( 1.72 usr 0.95 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 10 wallclock secs ( 1.58 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple_join (500): 1 wallclock secs ( 0.66 usr 0.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 12 wallclock secs ( 4.45 usr 3.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 11 wallclock secs ( 1.77 usr 0.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 10 wallclock secs ( 1.59 usr 0.65 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Removing tables Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 38 wallclock secs ( 8.93 usr 5.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 38 wallclock secs ( 9.13 usr 5.79 sys + 0.00 cusr 0.00 csys = 0.00 CPU) sql-bench/Results/RUN-mysql-Linux_2.2.13_SMP_alpha +76 −76 Original line number Diff line number Diff line Benchmark DBD suite: 2.9 Date of test: 2000-11-18 18:20:34 Benchmark DBD suite: 2.10 Date of test: 2000-11-28 17:24:55 Running tests on: Linux 2.2.13-SMP alpha Arguments: Comments: Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; gcc 2.95.2 + ccc Limits from: Server version: MySQL 3.23.28 gamma Server version: MySQL 3.23.29 gamma ATIS: Total time: 38 wallclock secs ( 8.93 usr 5.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU) alter-table: Total time: 375 wallclock secs ( 0.30 usr 0.15 sys + 0.00 cusr 0.00 csys = 0.00 CPU) big-tables: Total time: 42 wallclock secs ( 9.09 usr 11.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) connect: Total time: 77 wallclock secs (34.21 usr 17.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU) create: Total time: 134 wallclock secs (10.66 usr 4.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU) insert: Total time: 1851 wallclock secs (450.58 usr 224.15 sys + 0.00 cusr 0.00 csys = 0.00 CPU) select: Total time: 1215 wallclock secs (57.43 usr 28.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) wisconsin: Total time: 19 wallclock secs ( 3.77 usr 2.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) ATIS: Total time: 38 wallclock secs ( 9.13 usr 5.79 sys + 0.00 cusr 0.00 csys = 0.00 CPU) alter-table: Total time: 391 wallclock secs ( 0.31 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) big-tables: Total time: 41 wallclock secs ( 8.35 usr 10.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU) connect: Total time: 76 wallclock secs (31.66 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) create: Total time: 133 wallclock secs (10.24 usr 4.48 sys + 0.00 cusr 0.00 csys = 0.00 CPU) insert: Total time: 1821 wallclock secs (430.65 usr 226.65 sys + 0.00 cusr 0.00 csys = 0.00 CPU) select: Total time: 1170 wallclock secs (57.76 usr 27.85 sys + 0.00 cusr 0.00 csys = 0.00 CPU) wisconsin: Total time: 18 wallclock secs ( 3.70 usr 2.82 sys + 0.00 cusr 0.00 csys = 0.00 CPU) All 8 test executed successfully Totals per operation: Operation seconds usr sys cpu tests alter_table_add 205.00 0.17 0.07 0.00 992 alter_table_drop 161.00 0.07 0.03 0.00 496 connect 14.00 8.15 2.36 0.00 10000 connect+select_1_row 17.00 8.55 3.39 0.00 10000 connect+select_simple 16.00 8.31 3.17 0.00 10000 count 49.00 0.03 0.01 0.00 100 count_distinct 86.00 0.71 0.21 0.00 2000 count_distinct_big 140.00 7.24 8.69 0.00 120 count_distinct_group 72.00 1.07 0.63 0.00 1000 count_distinct_group_on_key 42.00 0.45 0.15 0.00 1000 count_distinct_group_on_key_parts 72.00 1.08 0.62 0.00 1000 count_group_on_key_parts 39.00 0.99 0.61 0.00 1000 count_on_key 454.00 15.83 4.45 0.00 50100 create+drop 13.00 2.86 0.85 0.00 10000 create_MANY_tables 91.00 1.85 0.61 0.00 10000 alter_table_add 213.00 0.17 0.07 0.00 992 alter_table_drop 170.00 0.07 0.03 0.00 496 connect 14.00 7.49 2.43 0.00 10000 connect+select_1_row 17.00 7.59 3.33 0.00 10000 connect+select_simple 15.00 7.61 3.24 0.00 10000 count 48.00 0.03 0.01 0.00 100 count_distinct 92.00 0.69 0.21 0.00 2000 count_distinct_big 135.00 7.24 8.53 0.00 120 count_distinct_group 64.00 1.06 0.66 0.00 1000 count_distinct_group_on_key 42.00 0.43 0.14 0.00 1000 count_distinct_group_on_key_parts 63.00 1.10 0.62 0.00 1000 count_group_on_key_parts 40.00 1.00 0.61 0.00 1000 count_on_key 428.00 15.76 4.53 0.00 50100 create+drop 13.00 2.68 1.04 0.00 10000 create_MANY_tables 90.00 1.79 0.64 0.00 10000 create_index 4.00 0.00 0.00 0.00 8 create_key+drop 17.00 4.39 1.33 0.00 10000 create_key+drop 17.00 4.18 1.32 0.00 10000 create_table 0.00 0.00 0.00 0.00 31 delete_all 11.00 0.00 0.00 0.00 12 delete_all_many_keys 49.00 0.01 0.01 0.00 1 delete_all_many_keys 49.00 0.02 0.01 0.00 1 delete_big 0.00 0.00 0.00 0.00 1 delete_big_many_keys 49.00 0.01 0.01 0.00 128 delete_key 4.00 0.65 0.54 0.00 10000 delete_big_many_keys 49.00 0.02 0.01 0.00 128 delete_key 4.00 0.66 0.53 0.00 10000 drop_index 4.00 0.00 0.00 0.00 8 drop_table 0.00 0.00 0.00 0.00 28 drop_table_when_MANY_tables 7.00 0.63 0.62 0.00 10000 insert 137.00 26.71 20.07 0.00 350768 insert_duplicates 39.00 5.58 6.03 0.00 100000 insert_key 93.00 8.08 5.73 0.00 100000 insert_many_fields 14.00 0.34 0.16 0.00 2000 insert_select_1_key 4.00 0.00 0.00 0.00 1 insert_select_2_keys 7.00 0.00 0.00 0.00 1 min_max 21.00 0.02 0.00 0.00 60 min_max_on_key 186.00 25.42 7.61 0.00 85000 multiple_value_insert 7.00 2.19 0.05 0.00 100000 order_by_big 54.00 22.86 21.67 0.00 10 order_by_big_key 37.00 22.01 14.79 0.00 10 order_by_big_key2 37.00 22.02 14.86 0.00 10 order_by_big_key_desc 37.00 22.03 14.87 0.00 10 order_by_big_key_diff 52.00 23.11 21.71 0.00 10 order_by_key 3.00 1.17 0.64 0.00 500 order_by_key2_diff 5.00 2.05 1.25 0.00 500 order_by_range 5.00 1.17 0.65 0.00 500 outer_join 61.00 0.01 0.00 0.00 10 outer_join_found 55.00 0.00 0.00 0.00 10 outer_join_not_found 35.00 0.01 0.00 0.00 500 outer_join_on_key 40.00 0.00 0.00 0.00 10 select_1_row 3.00 0.41 1.01 0.00 10000 select_2_rows 3.00 0.38 0.89 0.00 10000 select_big 57.00 30.30 20.70 0.00 10080 select_column+column 3.00 0.27 0.75 0.00 10000 select_diff_key 154.00 0.23 0.06 0.00 500 select_distinct 11.00 1.72 0.95 0.00 800 select_group 52.00 1.62 0.67 0.00 2911 select_group_when_MANY_tables 6.00 0.92 0.90 0.00 10000 select_join 12.00 4.31 3.11 0.00 200 select_key 137.00 75.62 20.87 0.00 200000 select_key2 144.00 76.78 20.52 0.00 200000 select_key_prefix 144.00 76.89 20.33 0.00 200000 select_many_fields 28.00 8.73 10.85 0.00 2000 select_range 228.00 8.51 5.59 0.00 410 select_range_key2 20.00 6.50 2.29 0.00 25010 select_range_prefix 18.00 6.46 2.33 0.00 25010 select_simple 2.00 0.29 0.75 0.00 10000 select_simple_join 2.00 0.62 0.39 0.00 500 update_big 25.00 0.00 0.00 0.00 10 update_of_key 47.00 3.41 2.97 0.00 50256 update_of_key_big 18.00 0.04 0.04 0.00 501 update_with_key 134.00 21.08 18.70 0.00 300000 wisc_benchmark 4.00 1.92 0.94 0.00 114 TOTALS 3797.00 574.84 294.06 0.00 1946237 drop_table_when_MANY_tables 7.00 0.62 0.61 0.00 10000 insert 137.00 24.96 21.11 0.00 350768 insert_duplicates 38.00 5.63 6.17 0.00 100000 insert_key 94.00 7.67 5.66 0.00 100000 insert_many_fields 14.00 0.35 0.12 0.00 2000 insert_select_1_key 5.00 0.00 0.00 0.00 1 insert_select_2_keys 6.00 0.00 0.00 0.00 1 min_max 20.00 0.02 0.00 0.00 60 min_max_on_key 175.00 25.68 7.59 0.00 85000 multiple_value_insert 7.00 2.15 0.05 0.00 100000 order_by_big 54.00 22.33 21.66 0.00 10 order_by_big_key 36.00 21.23 14.75 0.00 10 order_by_big_key2 37.00 21.94 15.04 0.00 10 order_by_big_key_desc 37.00 21.53 14.74 0.00 10 order_by_big_key_diff 51.00 22.21 21.67 0.00 10 order_by_key 2.00 1.14 0.63 0.00 500 order_by_key2_diff 5.00 1.99 1.23 0.00 500 order_by_range 5.00 1.14 0.64 0.00 500 outer_join 57.00 0.00 0.00 0.00 10 outer_join_found 52.00 0.00 0.00 0.00 10 outer_join_not_found 34.00 0.00 0.00 0.00 500 outer_join_on_key 38.00 0.01 0.00 0.00 10 select_1_row 2.00 0.35 0.95 0.00 10000 select_2_rows 3.00 0.34 1.00 0.00 10000 select_big 56.00 28.86 21.57 0.00 10080 select_column+column 3.00 0.26 0.67 0.00 10000 select_diff_key 148.00 0.21 0.05 0.00 500 select_distinct 11.00 1.77 0.97 0.00 800 select_group 49.00 1.63 0.66 0.00 2911 select_group_when_MANY_tables 6.00 0.96 0.87 0.00 10000 select_join 12.00 4.45 3.14 0.00 200 select_key 137.00 73.10 21.05 0.00 200000 select_key2 142.00 72.16 21.15 0.00 200000 select_key_prefix 143.00 72.60 21.07 0.00 200000 select_many_fields 26.00 7.99 10.11 0.00 2000 select_range 229.00 8.56 5.62 0.00 410 select_range_key2 19.00 6.47 2.33 0.00 25010 select_range_prefix 20.00 6.51 2.25 0.00 25010 select_simple 2.00 0.28 0.77 0.00 10000 select_simple_join 1.00 0.66 0.38 0.00 500 update_big 27.00 0.00 0.00 0.00 10 update_of_key 48.00 3.45 3.04 0.00 50256 update_of_key_big 18.00 0.04 0.03 0.00 501 update_with_key 134.00 18.92 18.69 0.00 300000 wisc_benchmark 4.00 1.88 0.93 0.00 114 TOTALS 3733.00 551.64 296.93 0.00 1946237 Loading
Docs/manual.texi +37 −4 Original line number Diff line number Diff line Loading @@ -27761,6 +27761,7 @@ How big a @code{VARCHAR} column can be * mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables * mysqlimport:: Importing data from text files * mysqlshow:: Showing databases, tables and columns * perror:: Displaying error messages * myisampack:: The @strong{MySQL} compressed read-only table generator @end menu Loading Loading @@ -28559,7 +28560,7 @@ mysqldump --all-databases > all_databases.sql @cindex files, text @cindex text files, importing @cindex @code{mysqlimport} @node mysqlimport, mysqlshow, mysqldump, Tools @node mysqlimport, perror, mysqldump, Tools @section Importing Data from Text Files @code{mysqlimport} provides a command-line interface to the @code{LOAD DATA Loading Loading @@ -28696,12 +28697,34 @@ $ mysql -e 'SELECT * FROM imptest' test +------+---------------+ @end example @cindex error messages, displaying @cindex perror @node perror, mysqlshow, mysqlimport, Tools @section Converting an error code to the corresponding error message @code{perror} can be used to print error message(s). @code{perror} can be invoked like this: @example shell> perror [OPTIONS] [ERRORCODE [ERRORCODE...]] For example: shell> perror 64 79 Error code 64: Machine is not on the network Error code 79: Can not access a needed shared library @end example @code{perror} can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. The error messages are mostly system dependent. @cindex databases, displaying @cindex displaying, database information @cindex tables, displaying @cindex columns, displaying @cindex showing, database information @node mysqlshow, myisampack, mysqlimport, Tools @node mysqlshow, myisampack, perror, Tools @section Showing Databases, Tables, and Columns @code{mysqlshow} can be used to quickly look at which databases exist, Loading Loading @@ -32091,6 +32114,14 @@ tmpdir=C:/temp assuming that the @file{c:\\temp} directory exists. @xref{Option files}. Check also the error code that you get with @code{perror}. One reason may also be a disk full error; @example shell >perror 28 Error code 28: No space left on device @end example @cindex commands out of sync @node Commands out of sync, Ignoring user, Cannot create, Common errors @subsection @code{Commands out of sync} error in client Loading Loading @@ -38932,10 +38963,12 @@ though, so Version 3.23 is not released as a stable version yet. Automatically remove Berkeley DB transaction logs that are no longer in use. @item Added a warning if number of rows changes on @code{REPAIR}/@code{OPTIMIZE}. @item Applied patches for OS2 by @code{Yuri Dario}. @item @code{FLUSH TABLES table_name} didn't always flush table properly to disk; One some cases the index tree wasn't completely written to disk. @code{FLUSH TABLES table_name} didn't always flush the index tree properly to disk. @item @code{--bootstrap} is now run in a separate thread. This fixes the problem that @code{mysql_install_db} core dumped on some Linux machines.
myisam/mi_check.c +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ int chk_status(MI_CHECK *param, register MI_INFO *info) else if (mi_is_crashed(info)) mi_check_print_warning(param, "Table is marked as crashed"); if (share->state.open_count != (info->s->global_changed ? 1 : 0)) if (share->state.open_count != (uint) (info->s->global_changed ? 1 : 0)) { mi_check_print_warning(param, "%d clients is using or hasn't closed the table properly", Loading
scripts/mysqlhotcopy.sh +109 −43 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file my $VERSION = "1.8"; my $VERSION = "1.9"; my $opt_tmpdir= $main::env{TMPDIR}; my $OPTIONS = <<"_OPTIONS"; Loading @@ -50,7 +51,7 @@ Usage: $0 db_name [new_db_name | directory] --allowold don't abort if target already exists (rename it _old) --keepold don't delete previous (now renamed) target when done --indices include index files in copy --noindices don't include full index files in copy --method=# method for copy (only "cp" currently supported) -q, --quiet be silent except for errors Loading @@ -61,6 +62,7 @@ Usage: $0 db_name [new_db_name | directory] --suffix=# suffix for names of copied databases --checkpoint=# insert checkpoint entry into specified db.table --flushlog flush logs once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) Try 'perldoc $0 for more complete documentation' _OPTIONS Loading @@ -71,7 +73,7 @@ sub usage { my %opt = ( user => getpwuid($>), indices => 1, # for safety noindices => 0, allowold => 0, # for safety keepold => 0, method => "cp", Loading @@ -86,7 +88,7 @@ GetOptions( \%opt, "socket|S=s", "allowold!", "keepold!", "indices!", "noindices!", "method=s", "debug", "quiet|q", Loading @@ -95,6 +97,7 @@ GetOptions( \%opt, "suffix=s", "checkpoint=s", "flushlog", "tmpdir|t=s", "dryrun|n", ) or usage("Invalid option"); Loading Loading @@ -133,6 +136,7 @@ else { my $mysqld_help; my %mysqld_vars; my $start_time = time; my $opt_tmpdir= $opt{tempdir} ? $opt{tmpdir} : $main::env{TMPDIR}; $0 = $1 if $0 =~ m:/([^/]+)$:; $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; Loading Loading @@ -238,13 +242,16 @@ foreach my $rdb ( @db_desc ) { my @db_files = sort ( $negated ? grep { $db_files{$_} !~ $t_regex } keys %db_files : grep { $db_files{$_} =~ $t_regex } keys %db_files ); my @index_files=(); ## remove indices unless we're told to keep them unless ($opt{indices}) { if ($opt{noindices}) { @index_files= grep { /\.(ISM|MYI)$/ } @db_files; @db_files = grep { not /\.(ISM|MYI)$/ } @db_files; } $rdb->{files} = [ @db_files ]; $rdb->{index} = [ @index_files ]; my @hc_tables = map { "$db.$_" } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; Loading Loading @@ -369,14 +376,65 @@ else { my @failed = (); foreach my $rdb ( @db_desc ) { foreach my $rdb ( @db_desc ) { my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; next unless @files; eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{index}}; if ($rdb->{index}) { # # Copy only the header of the index file # my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; foreach my $file ($rdb->{index}) { my $from="$datadir/$rdb->{src}/$file"; my $to="$rdb->{target}/$file"; my $buff; open(INPUT, $from) || die "Can't open file $from: $!\n"; my $length=read INPUT, $buff, 2048; die "Can't read index header from $from\n" if ($length <= 1024); close INPUT; if ( $opt{dryrun} ) { print '$opt{method}-header $from $to\n'; } elsif ($opt{method} eq 'cp') { !open(OUTPUT,$to) || die "Can\'t create file $to: $!\n"; if (write(OUTPUT,$buff) != length($buff)) { die "Error when writing data to $to: $!\n"; } close OUTPUT || die "Error on close of $to: $!\n"; } elsif ($opt{method} eq 'scp') { my $tmp=$tmpfile; open(OUTPUT,"$tmp") || die "Can\'t create file $tmp: $!\n"; if (write(OUTPUT,$buff) != length($buff)) { die "Error when writing data to $tmp: $!\n"; } close OUTPUT || die "Error on close of $tmp: $!\n"; safe_system('scp $tmp $to'); } else { die "Can't use unsupported method '$opt{method}'\n"; } } unlink "$opt_tmpdir/mysqlhotcopy$$"; } if ( $opt{checkpoint} ) { my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; Loading Loading @@ -469,13 +527,21 @@ sub copy_files { # add files to copy and the destination directory push @cmd, @$files, $target; } else { else { die "Can't use unsupported method '$method'\n"; } safe_system (@cmd); } if ( $opt{dryrun} ) { sub safe_system { my @cmd=shift; if ( $opt{dryrun} ) { print "@cmd\n"; next; return; } ## for some reason system fails but backticks works ok for scp... Loading @@ -488,6 +554,7 @@ sub copy_files { } } sub retire_directory { my ( @dir ) = @_; Loading Loading @@ -611,9 +678,9 @@ port to use when connecting to local server UNIX domain socket to use when connecting to local server =item --indices =item --noindices include index files in copy don't include index files in copy =item --method=# Loading Loading @@ -677,9 +744,6 @@ Add support for other copy methods (eg tar to single file?). Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. Add option to only copy the first 65KB of index files. That simplifies recovery (recovery with no index file at all is complicated). =head1 AUTHOR Tim Bunce Loading @@ -689,3 +753,5 @@ Martin Waite - added checkpoint, flushlog, regexp and dryrun options Ralph Corderoy - added synonyms for commands Scott Wiersdorf - added table regex and scp support Monty - working --noindex (copy only first 2048 bytes of index file)
sql-bench/Results/ATIS-mysql-Linux_2.2.13_SMP_alpha +7 −7 Original line number Diff line number Diff line Testing server 'MySQL 3.23.28 gamma' at 2000-11-18 15:05:04 Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:24:55 ATIS table test Loading @@ -6,14 +6,14 @@ Creating tables Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Inserting data Time to insert (9768): 3 wallclock secs ( 0.68 usr 0.60 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (9768): 4 wallclock secs ( 0.64 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Retrieving data Time for select_simple_join (500): 2 wallclock secs ( 0.62 usr 0.39 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 12 wallclock secs ( 4.31 usr 3.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 11 wallclock secs ( 1.72 usr 0.95 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 10 wallclock secs ( 1.58 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple_join (500): 1 wallclock secs ( 0.66 usr 0.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 12 wallclock secs ( 4.45 usr 3.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 11 wallclock secs ( 1.77 usr 0.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 10 wallclock secs ( 1.59 usr 0.65 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Removing tables Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 38 wallclock secs ( 8.93 usr 5.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 38 wallclock secs ( 9.13 usr 5.79 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
sql-bench/Results/RUN-mysql-Linux_2.2.13_SMP_alpha +76 −76 Original line number Diff line number Diff line Benchmark DBD suite: 2.9 Date of test: 2000-11-18 18:20:34 Benchmark DBD suite: 2.10 Date of test: 2000-11-28 17:24:55 Running tests on: Linux 2.2.13-SMP alpha Arguments: Comments: Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; gcc 2.95.2 + ccc Limits from: Server version: MySQL 3.23.28 gamma Server version: MySQL 3.23.29 gamma ATIS: Total time: 38 wallclock secs ( 8.93 usr 5.72 sys + 0.00 cusr 0.00 csys = 0.00 CPU) alter-table: Total time: 375 wallclock secs ( 0.30 usr 0.15 sys + 0.00 cusr 0.00 csys = 0.00 CPU) big-tables: Total time: 42 wallclock secs ( 9.09 usr 11.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) connect: Total time: 77 wallclock secs (34.21 usr 17.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU) create: Total time: 134 wallclock secs (10.66 usr 4.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU) insert: Total time: 1851 wallclock secs (450.58 usr 224.15 sys + 0.00 cusr 0.00 csys = 0.00 CPU) select: Total time: 1215 wallclock secs (57.43 usr 28.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) wisconsin: Total time: 19 wallclock secs ( 3.77 usr 2.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) ATIS: Total time: 38 wallclock secs ( 9.13 usr 5.79 sys + 0.00 cusr 0.00 csys = 0.00 CPU) alter-table: Total time: 391 wallclock secs ( 0.31 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) big-tables: Total time: 41 wallclock secs ( 8.35 usr 10.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU) connect: Total time: 76 wallclock secs (31.66 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) create: Total time: 133 wallclock secs (10.24 usr 4.48 sys + 0.00 cusr 0.00 csys = 0.00 CPU) insert: Total time: 1821 wallclock secs (430.65 usr 226.65 sys + 0.00 cusr 0.00 csys = 0.00 CPU) select: Total time: 1170 wallclock secs (57.76 usr 27.85 sys + 0.00 cusr 0.00 csys = 0.00 CPU) wisconsin: Total time: 18 wallclock secs ( 3.70 usr 2.82 sys + 0.00 cusr 0.00 csys = 0.00 CPU) All 8 test executed successfully Totals per operation: Operation seconds usr sys cpu tests alter_table_add 205.00 0.17 0.07 0.00 992 alter_table_drop 161.00 0.07 0.03 0.00 496 connect 14.00 8.15 2.36 0.00 10000 connect+select_1_row 17.00 8.55 3.39 0.00 10000 connect+select_simple 16.00 8.31 3.17 0.00 10000 count 49.00 0.03 0.01 0.00 100 count_distinct 86.00 0.71 0.21 0.00 2000 count_distinct_big 140.00 7.24 8.69 0.00 120 count_distinct_group 72.00 1.07 0.63 0.00 1000 count_distinct_group_on_key 42.00 0.45 0.15 0.00 1000 count_distinct_group_on_key_parts 72.00 1.08 0.62 0.00 1000 count_group_on_key_parts 39.00 0.99 0.61 0.00 1000 count_on_key 454.00 15.83 4.45 0.00 50100 create+drop 13.00 2.86 0.85 0.00 10000 create_MANY_tables 91.00 1.85 0.61 0.00 10000 alter_table_add 213.00 0.17 0.07 0.00 992 alter_table_drop 170.00 0.07 0.03 0.00 496 connect 14.00 7.49 2.43 0.00 10000 connect+select_1_row 17.00 7.59 3.33 0.00 10000 connect+select_simple 15.00 7.61 3.24 0.00 10000 count 48.00 0.03 0.01 0.00 100 count_distinct 92.00 0.69 0.21 0.00 2000 count_distinct_big 135.00 7.24 8.53 0.00 120 count_distinct_group 64.00 1.06 0.66 0.00 1000 count_distinct_group_on_key 42.00 0.43 0.14 0.00 1000 count_distinct_group_on_key_parts 63.00 1.10 0.62 0.00 1000 count_group_on_key_parts 40.00 1.00 0.61 0.00 1000 count_on_key 428.00 15.76 4.53 0.00 50100 create+drop 13.00 2.68 1.04 0.00 10000 create_MANY_tables 90.00 1.79 0.64 0.00 10000 create_index 4.00 0.00 0.00 0.00 8 create_key+drop 17.00 4.39 1.33 0.00 10000 create_key+drop 17.00 4.18 1.32 0.00 10000 create_table 0.00 0.00 0.00 0.00 31 delete_all 11.00 0.00 0.00 0.00 12 delete_all_many_keys 49.00 0.01 0.01 0.00 1 delete_all_many_keys 49.00 0.02 0.01 0.00 1 delete_big 0.00 0.00 0.00 0.00 1 delete_big_many_keys 49.00 0.01 0.01 0.00 128 delete_key 4.00 0.65 0.54 0.00 10000 delete_big_many_keys 49.00 0.02 0.01 0.00 128 delete_key 4.00 0.66 0.53 0.00 10000 drop_index 4.00 0.00 0.00 0.00 8 drop_table 0.00 0.00 0.00 0.00 28 drop_table_when_MANY_tables 7.00 0.63 0.62 0.00 10000 insert 137.00 26.71 20.07 0.00 350768 insert_duplicates 39.00 5.58 6.03 0.00 100000 insert_key 93.00 8.08 5.73 0.00 100000 insert_many_fields 14.00 0.34 0.16 0.00 2000 insert_select_1_key 4.00 0.00 0.00 0.00 1 insert_select_2_keys 7.00 0.00 0.00 0.00 1 min_max 21.00 0.02 0.00 0.00 60 min_max_on_key 186.00 25.42 7.61 0.00 85000 multiple_value_insert 7.00 2.19 0.05 0.00 100000 order_by_big 54.00 22.86 21.67 0.00 10 order_by_big_key 37.00 22.01 14.79 0.00 10 order_by_big_key2 37.00 22.02 14.86 0.00 10 order_by_big_key_desc 37.00 22.03 14.87 0.00 10 order_by_big_key_diff 52.00 23.11 21.71 0.00 10 order_by_key 3.00 1.17 0.64 0.00 500 order_by_key2_diff 5.00 2.05 1.25 0.00 500 order_by_range 5.00 1.17 0.65 0.00 500 outer_join 61.00 0.01 0.00 0.00 10 outer_join_found 55.00 0.00 0.00 0.00 10 outer_join_not_found 35.00 0.01 0.00 0.00 500 outer_join_on_key 40.00 0.00 0.00 0.00 10 select_1_row 3.00 0.41 1.01 0.00 10000 select_2_rows 3.00 0.38 0.89 0.00 10000 select_big 57.00 30.30 20.70 0.00 10080 select_column+column 3.00 0.27 0.75 0.00 10000 select_diff_key 154.00 0.23 0.06 0.00 500 select_distinct 11.00 1.72 0.95 0.00 800 select_group 52.00 1.62 0.67 0.00 2911 select_group_when_MANY_tables 6.00 0.92 0.90 0.00 10000 select_join 12.00 4.31 3.11 0.00 200 select_key 137.00 75.62 20.87 0.00 200000 select_key2 144.00 76.78 20.52 0.00 200000 select_key_prefix 144.00 76.89 20.33 0.00 200000 select_many_fields 28.00 8.73 10.85 0.00 2000 select_range 228.00 8.51 5.59 0.00 410 select_range_key2 20.00 6.50 2.29 0.00 25010 select_range_prefix 18.00 6.46 2.33 0.00 25010 select_simple 2.00 0.29 0.75 0.00 10000 select_simple_join 2.00 0.62 0.39 0.00 500 update_big 25.00 0.00 0.00 0.00 10 update_of_key 47.00 3.41 2.97 0.00 50256 update_of_key_big 18.00 0.04 0.04 0.00 501 update_with_key 134.00 21.08 18.70 0.00 300000 wisc_benchmark 4.00 1.92 0.94 0.00 114 TOTALS 3797.00 574.84 294.06 0.00 1946237 drop_table_when_MANY_tables 7.00 0.62 0.61 0.00 10000 insert 137.00 24.96 21.11 0.00 350768 insert_duplicates 38.00 5.63 6.17 0.00 100000 insert_key 94.00 7.67 5.66 0.00 100000 insert_many_fields 14.00 0.35 0.12 0.00 2000 insert_select_1_key 5.00 0.00 0.00 0.00 1 insert_select_2_keys 6.00 0.00 0.00 0.00 1 min_max 20.00 0.02 0.00 0.00 60 min_max_on_key 175.00 25.68 7.59 0.00 85000 multiple_value_insert 7.00 2.15 0.05 0.00 100000 order_by_big 54.00 22.33 21.66 0.00 10 order_by_big_key 36.00 21.23 14.75 0.00 10 order_by_big_key2 37.00 21.94 15.04 0.00 10 order_by_big_key_desc 37.00 21.53 14.74 0.00 10 order_by_big_key_diff 51.00 22.21 21.67 0.00 10 order_by_key 2.00 1.14 0.63 0.00 500 order_by_key2_diff 5.00 1.99 1.23 0.00 500 order_by_range 5.00 1.14 0.64 0.00 500 outer_join 57.00 0.00 0.00 0.00 10 outer_join_found 52.00 0.00 0.00 0.00 10 outer_join_not_found 34.00 0.00 0.00 0.00 500 outer_join_on_key 38.00 0.01 0.00 0.00 10 select_1_row 2.00 0.35 0.95 0.00 10000 select_2_rows 3.00 0.34 1.00 0.00 10000 select_big 56.00 28.86 21.57 0.00 10080 select_column+column 3.00 0.26 0.67 0.00 10000 select_diff_key 148.00 0.21 0.05 0.00 500 select_distinct 11.00 1.77 0.97 0.00 800 select_group 49.00 1.63 0.66 0.00 2911 select_group_when_MANY_tables 6.00 0.96 0.87 0.00 10000 select_join 12.00 4.45 3.14 0.00 200 select_key 137.00 73.10 21.05 0.00 200000 select_key2 142.00 72.16 21.15 0.00 200000 select_key_prefix 143.00 72.60 21.07 0.00 200000 select_many_fields 26.00 7.99 10.11 0.00 2000 select_range 229.00 8.56 5.62 0.00 410 select_range_key2 19.00 6.47 2.33 0.00 25010 select_range_prefix 20.00 6.51 2.25 0.00 25010 select_simple 2.00 0.28 0.77 0.00 10000 select_simple_join 1.00 0.66 0.38 0.00 500 update_big 27.00 0.00 0.00 0.00 10 update_of_key 48.00 3.45 3.04 0.00 50256 update_of_key_big 18.00 0.04 0.03 0.00 501 update_with_key 134.00 18.92 18.69 0.00 300000 wisc_benchmark 4.00 1.88 0.93 0.00 114 TOTALS 3733.00 551.64 296.93 0.00 1946237