From def55c5219244d4fe47e6d84dba3084fddb1af2a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jul 2006 18:12:57 +0200 Subject: [PATCH 1/5] Bug#21218 Test "mysqlbinlog" fails to execute another program on Windows - Send confusing output to /dev/null mysql-test/t/mysqlbinlog.test: Send confusing error messages to /dev/null so they don't appear in erro log if test case fails --- mysql-test/t/mysqlbinlog.test | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 0e4d16efb64..9df9edb5487 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -43,21 +43,21 @@ select "--- Local --" as ""; # --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001 # this should not fail but shouldn't produce any working statements --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002 2> /dev/null # this should show almost nothing --disable_query_log select "--- --database --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001 2> /dev/null # this test for position option --disable_query_log @@ -82,14 +82,14 @@ select "--- Remote --" as ""; select "--- Broken LOAD DATA --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 2> /dev/null # And this too ! (altough it is documented) --disable_query_log select "--- --database --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 2> /dev/null # Strangely but this works --disable_query_log @@ -130,3 +130,4 @@ select * from t5 /* must be (1),(1) */; drop table t1, t2, t03, t04, t3, t4, t5; # End of 4.1 tests + From 35945019ea8d0b1141b11dff6f4798878271bc4a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jul 2006 16:23:07 +0400 Subject: [PATCH 2/5] BUG#21206: memory corruption when too many cursors are opened at once Too many cursors (more than 1024) could lead to memory corruption. This affects both, stored routines and C API cursors, and the threshold is per-server, not per-connection. Similarly, the corruption could happen when the server was under heavy load (executing more than 1024 simultaneous complex queries), and this is the reason why this bug is fixed in 4.1, which doesn't support cursors. The corruption was caused by a bug in the temporary tables code, when an attempt to create a table could lead to a write beyond allocated space. Note, that only internal tables were affected (the tables created internally by the server to resolve the query), not tables created with CREATE TEMPORARY TABLE. Another pre-condition for the bug is TRUE value of --temp-pool startup option, which, however, is a default. The cause of a bug was that random memory was overwritten in bitmap_set_next() due to out-of-bound memory access. mysys/my_bitmap.c: Local 'bitmap_size' is measured in bytes, no need to multiply it by 8. sql/sql_select.cc: Clear the temp_pool_slot bit only if we have set it previously. --- mysys/my_bitmap.c | 2 +- sql/sql_select.cc | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index f0d3339535d..2af4edbf1a5 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -110,7 +110,7 @@ uint bitmap_set_next(MY_BITMAP *map) { uchar *bitmap=map->bitmap; uint bit_found = MY_BIT_NONE; - uint bitmap_size=map->bitmap_size*8; + uint bitmap_size=map->bitmap_size; uint i; DBUG_ASSERT(map->bitmap); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fd8a5149edd..9e3883e87e0 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5240,12 +5240,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, param->group_length : 0, NullS)) { - bitmap_clear_bit(&temp_pool, temp_pool_slot); + if (temp_pool_slot != MY_BIT_NONE) + bitmap_clear_bit(&temp_pool, temp_pool_slot); DBUG_RETURN(NULL); /* purecov: inspected */ } if (!(param->copy_field=copy=new Copy_field[field_count])) { - bitmap_clear_bit(&temp_pool, temp_pool_slot); + if (temp_pool_slot != MY_BIT_NONE) + bitmap_clear_bit(&temp_pool, temp_pool_slot); my_free((gptr) table,MYF(0)); /* purecov: inspected */ DBUG_RETURN(NULL); /* purecov: inspected */ } @@ -5668,7 +5670,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, */ *table->blob_field= 0; free_tmp_table(thd,table); /* purecov: inspected */ - bitmap_clear_bit(&temp_pool, temp_pool_slot); + if (temp_pool_slot != MY_BIT_NONE) + bitmap_clear_bit(&temp_pool, temp_pool_slot); DBUG_RETURN(NULL); /* purecov: inspected */ } @@ -5831,7 +5834,8 @@ free_tmp_table(THD *thd, TABLE *entry) my_free((gptr) entry->record[0],MYF(0)); free_io_cache(entry); - bitmap_clear_bit(&temp_pool, entry->temp_pool_slot); + if (entry->temp_pool_slot != MY_BIT_NONE) + bitmap_clear_bit(&temp_pool, entry->temp_pool_slot); my_free((gptr) entry,MYF(0)); thd->proc_info=save_proc_info; From a811cc0a88f4c1a336e68564008a0b4b9a7076d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jul 2006 22:57:57 +0200 Subject: [PATCH 3/5] mysql.spec.sh: Man page for "mysqld" command move to section 8 (bug#21220) support-files/mysql.spec.sh: Man page for "mysqld" command move to section 8 (bug#21220) --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 5796e776b83..2958e857049 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -444,7 +444,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1* %doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1* %doc %attr(644, root, man) %{_mandir}/man1/myisampack.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqld.1* +%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* From 6f65bffebd8dafaf7a38d2e44ec42f2c3de1b851 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jul 2006 23:06:49 +0200 Subject: [PATCH 4/5] make_binary_distribution.sh: Man page for "mysqld" command move to section 8 (bug#21220) scripts/make_binary_distribution.sh: Man page for "mysqld" command move to section 8 (bug#21220) --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 396c4f83bac..ae24752d290 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -70,7 +70,7 @@ mkdir $BASE $BASE/bin $BASE/docs \ if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test + $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test chmod o-rwx $BASE/data $BASE/data/* fi @@ -198,6 +198,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 + $CP man/*.8 $BASE/man/man8 fi fi @@ -255,7 +256,6 @@ else fi # Make safe_mysqld a symlink to mysqld_safe for backwards portability -# To be removed in MySQL 4.1 (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) # Clean up if we did this from a bk tree From d1fde0f7f5139e28731f1138c7473c8686ee9a45 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jul 2006 23:12:40 +0200 Subject: [PATCH 5/5] Makefile.am, configure.in: Man page for mysqld command move to section 8 (bug#21220) configure.in: Man page for mysqld command move to section 8 (bug#21220) man/Makefile.am: Man page for mysqld command move to section 8 (bug#21220) --- configure.in | 4 ++++ man/Makefile.am | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 376cf48c476..57993fa29a1 100644 --- a/configure.in +++ b/configure.in @@ -2218,12 +2218,16 @@ then man_dirs="man" man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'` man1_files=`echo $man1_files` + man8_files=`ls -8 $srcdir/man/*.8 | sed -e 's;^.*man/;;'` + man8_files=`echo $man8_files` else man_dirs="" man1_files="" + man8_files="" fi AC_SUBST(man_dirs) AC_SUBST(man1_files) +AC_SUBST(man8_files) # Shall we build the bench code? AC_ARG_WITH(bench, diff --git a/man/Makefile.am b/man/Makefile.am index 9702c4b2ace..5753259fd3d 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -18,7 +18,8 @@ ## Process this file with automake to create Makefile.in man1_MANS = @man1_files@ -EXTRA_DIST = $(man1_MANS) +man8_MANS = @man8_files@ +EXTRA_DIST = $(man1_MANS) $(man8_MANS) # Don't update the files from bitkeeper %::SCCS/s.%