From 9e2c2fe8d036db7a842363f56871b9fc3f85dcf2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Feb 2003 22:30:47 +0100 Subject: [PATCH 1/8] - removed LIBOBJS hack (no longer required with newer versions of autoconf and actually results in an error with very recent autoconf versions! (see http://www.gnu.org/manual/autoconf/html_node/autoconf_165.html or "AC_LIBOBJ vs. LIBOBJS" in the autoconf documentation) Please merge this into 4.0 as well! --- bdb/dist/configure.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bdb/dist/configure.in b/bdb/dist/configure.in index 6656a588a66..08d60a6c07a 100644 --- a/bdb/dist/configure.in +++ b/bdb/dist/configure.in @@ -463,13 +463,6 @@ dnl deleted getwd(). AC_REPLACE_FUNCS(getcwd getopt memcmp memcpy memmove) AC_REPLACE_FUNCS(raise snprintf strcasecmp strerror vsnprintf) -dnl XXX -dnl Nasty hack. AC_REPLACE_FUNCS added entries of the form xxx.o to the -dnl LIBOBJS variable. They have to be xxx.lo if we are building shared -dnl libraries. Use sed, configure already requires it. -tmp="`echo \"$LIBOBJS\" | sed \"s/\.o/${o}/g\"`" -LIBOBJS="$tmp" - dnl Check for system functions we optionally use. AC_CHECK_FUNCS(getuid pstat_getdynamic sysconf sched_yield strtoul yield) From c942025070c3e43a923132a21778823a5549130c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Feb 2003 01:42:07 +0200 Subject: [PATCH 2/8] ha_innobase.cc: Backport from 4.0: fix potential bug if store_lock is called with TL_IGNORE in the middle of a query sql/ha_innobase.cc: Backport from 4.0: fix potential bug if store_lock is called with TL_IGNORE in the middle of a query --- sql/ha_innobase.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 7045e5c31d5..5b2af70f34e 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -3700,7 +3700,7 @@ ha_innobase::store_lock( binlog) requires the use of a locking read */ prebuilt->select_lock_type = LOCK_S; - } else { + } else if (lock_type != TL_IGNORE) { /* We set possible LOCK_X value in external_lock, not yet here even if this would be SELECT ... FOR UPDATE */ From 9160f2cbb2b8a778d793678652ac0e50dc4bbc47 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Feb 2003 11:49:51 +0100 Subject: [PATCH 3/8] - Yves mail address does not seem to be valid anymore - changed mail address to report bugs to bugs@mysql.com (thanks to Christian Hammers for pointing this out) - please merge this into all other trees! scripts/mysqlaccess.sh: - Yves mail address does not seem to be valid anymore - changed mail address to report bugs to bugs@mysql.com (thanks to Christian Hammers for pointing this out) --- scripts/mysqlaccess.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 824dba7b65a..699e74834e3 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2414,7 +2414,7 @@ sub Print_Header { sub Print_Footer { if ($MySQLaccess::CMD) { #command-line mode print "\n" - ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be\n"; + ."BUGs can be reported by email to bugs\@mysql.com\n"; } if ($MySQLaccess::CGI) { #CGI-BIN mode if ($MySQLaccess::Param{'brief'}) { @@ -2422,7 +2422,7 @@ sub Print_Footer { } print "
\n" ."
\n" - ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be
\n" + ."BUGs can be reported by email to bugs\@mysql.com
\n" # ."Don't forget to mention the version $VERSION!
\n" ."
\n" ."\n" From b7318885f41b8c79a34a88e054b174adbacfdcc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Feb 2003 12:22:28 +0100 Subject: [PATCH 4/8] - added word of warning about providing the password as cleartext using the --password parameter (better add it to my.cnf instead) (Thanks to Christian Hammers for the suggestion) scripts/mysqlhotcopy.sh: - added word of warning about providing the password as cleartext using the --password parameter (better add it to my.cnf instead) --- scripts/mysqlhotcopy.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index b8d4a0a9a38..1a694247461 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -49,8 +49,9 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user - -p, --password=# password to use when connecting to server - -h, --host=# Hostname for local server when connecting over TCP/IP + -p, --password=# password to use when connecting to server (if not set + in my.cnf, which is recommended) + -h, --host=# Hostname for local server when connecting over TCP/IP -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server @@ -893,7 +894,11 @@ user for database login if not current user =item -p, --password=# -password to use when connecting to server +password to use when connecting to the server. Note that you are strongly +encouraged *not* to use this option as every user would be able to see the +password in the process list. Instead use the '[mysqlhotcopy]' section in +one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf. +(See the chapter 'my.cnf Option Files' in the manual) =item -h, -h, --host=# From 98b953fddf64b40369fc8fe6a5223672aed92c98 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Feb 2003 18:02:12 +0100 Subject: [PATCH 5/8] Small enhancements for Do-compile: - add version number to build log files (e.g. Logs/build-4.1-standard.log) - add host name and uname to Subject line of build failure mails (e.g. "Subject: build(Linux): mysql-4.1-standard compilation failed") -> Please merge with all other trees! Build-tools/Do-compile: Small enhancements: - add version number to build log files (e.g. Logs/build-4.1-standard.log) - add host name and uname to Subject line of build failure mails (e.g. "Subject: build(Linux): mysql-4.1-standard compilation failed") --- Build-tools/Do-compile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 6f11745d5b0..9b26a93d100 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -75,13 +75,17 @@ if (@config_env > 0) } chomp($host=`hostname`); +chomp($uname=`uname`); $full_host_name=$host; $connect_option= ($opt_tcpip ? "--host=$host" : ""); $host =~ /^([^.-]*)/; $host=$1 . $opt_suffix; $email="$opt_user\@mysql.com"; -$pwd = `pwd`; chomp($pwd); -$log="$pwd/Logs/$host$opt_version_suffix.log"; +chomp($pwd = `pwd`); +$VER= `basename $opt_distribution`; chop $VER; +$VER=~ /mysql.*-([1-9]\.[0-9]{1,2}\.[0-9]{1,2}.*)\.tar*/; $version=$1; +($major, $minor, $release) = split(/\./,$version); +$log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log"; $opt_distribution =~ /(mysql[^\/]*)\.tar/; $ver=$1; $gcc_version=which("gcc"); @@ -558,9 +562,9 @@ sub abort { $mail_header_file="$opt_tmp/do-command.$$"; open(TMP,">$mail_header_file"); - print TMP "From: mysql\@$full_host_name\n"; + print TMP "From: mysqldev\@$full_host_name\n"; print TMP "To: $email\n"; - print TMP "Subject: $ver$opt_version_suffix compilation failed\n\n"; + print TMP "Subject: $host($uname): $ver$opt_version_suffix compilation failed\n\n"; close TMP; system("tail -n 40 $log > $log.mail"); system("cat $mail_header_file $log.mail | $sendmail -t -f $email"); From 7910884c5cbb59e89041506a12b9a3a567a97067 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Feb 2003 12:01:47 +0100 Subject: [PATCH 6/8] count(distint) on an empty table crash fixed BitKeeper/etc/ignore: Added support-files/MacOSX/Description.plist support-files/MacOSX/Info.plist to the ignore list --- .bzrignore | 2 ++ mysql-test/r/count_distinct.result | 5 +++++ mysql-test/t/count_distinct.test | 9 +++++++++ sql/item_sum.cc | 3 +-- sql/item_sum.h | 6 ++++-- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.bzrignore b/.bzrignore index 1f577634845..302ac6f658c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -523,3 +523,5 @@ vio/test-sslclient vio/test-sslserver vio/viotest-ssl extra/mysql_waitpid +support-files/MacOSX/Description.plist +support-files/MacOSX/Info.plist diff --git a/mysql-test/r/count_distinct.result b/mysql-test/r/count_distinct.result index 81976d268ef..16460580d6c 100644 --- a/mysql-test/r/count_distinct.result +++ b/mysql-test/r/count_distinct.result @@ -48,3 +48,8 @@ select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 o f1 count(distinct t2.f2) count(distinct 1,NULL) 1 0 0 drop table t1,t2; +create table t1 (f int); +select count(distinct f) from t1; +count(distinct f) +0 +drop table t1; diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index f3584686f69..cb84d0211d7 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -43,3 +43,12 @@ insert into t1 values (1); create table t2 (f1 int,f2 int); select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 on t1.f1=t2.f1 group by t1.f1; drop table t1,t2; + + +# +# Empty tables +# +create table t1 (f int); +select count(distinct f) from t1; +drop table t1; + diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 222dd0a3a25..3c5f1a23704 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -918,7 +918,7 @@ int dump_leaf(byte* key, uint32 count __attribute__((unused)), } -Item_sum_count_distinct::~Item_sum_count_distinct() +void Item_sum_count_distinct::no_rows_in_result() { if (table) free_tmp_table(current_thd, table); @@ -927,7 +927,6 @@ Item_sum_count_distinct::~Item_sum_count_distinct() delete_tree(&tree); } - bool Item_sum_count_distinct::fix_fields(THD *thd,TABLE_LIST *tables) { if (Item_sum_num::fix_fields(thd,tables) || diff --git a/sql/item_sum.h b/sql/item_sum.h index 04f95dfd778..62cb5974388 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -185,7 +185,8 @@ class Item_sum_count_distinct :public Item_sum_int :Item_sum_int(list),table(0),used_table_cache(~(table_map) 0), tmp_table_param(0),use_tree(0),always_null(0) { quick_group=0; } - ~Item_sum_count_distinct(); + ~Item_sum_count_distinct() { no_rows_in_result(); } + table_map used_tables() const { return used_table_cache; } enum Sumfunctype sum_func () const { return COUNT_DISTINCT_FUNC; } void reset(); @@ -195,7 +196,8 @@ class Item_sum_count_distinct :public Item_sum_int void update_field(int offset) { return ; } // Never called const char *func_name() const { return "count_distinct"; } bool setup(THD *thd); - unsigned int size_of() { return sizeof(*this);} + void no_rows_in_result(); + unsigned int size_of() { return sizeof(*this);} }; From 556bb7bb3d98188d2243fd39b09e7cd4cfc7bfd2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Feb 2003 14:47:39 +0100 Subject: [PATCH 7/8] error message fixed (new error code will be introduced in 4.1) --- sql/sql_acl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index a752bc7add8..05ec57b134a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -995,7 +995,9 @@ static int replace_user_table(TABLE *table, const LEX_USER &combo, { if (combo.password.length != HASH_PASSWORD_LENGTH) { - my_error(ER_PASSWORD_NO_MATCH,MYF(0)); + my_printf_error(ER_PASSWORD_NO_MATCH, + "Password hash should be a %d-digit hexadecimal number", + MYF(0),HASH_PASSWORD_LENGTH); DBUG_RETURN(-1); } password=combo.password.str; From 03865c5fb1ad3de32dd4fc85acdce48e18df67a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Feb 2003 17:03:27 +0200 Subject: [PATCH 8/8] Better fix for count(distinct) bug include/my_sys.h: Remove compiler warning mysql-test/mysql-test-run.sh: Don't examine log files when you run with --extern --- include/my_sys.h | 2 +- mysql-test/mysql-test-run.sh | 5 ++++- sql/item_sum.cc | 4 ++-- sql/item_sum.h | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index 4bd9f53f7e4..9610033e2a9 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -143,7 +143,7 @@ extern ulonglong safemalloc_mem_limit; #define CALLER_INFO , __FILE__, __LINE__ #define ORIG_CALLER_INFO , sFile, uLine #else -#define my_checkmalloc() (0) +#define my_checkmalloc() #undef TERMINATE #define TERMINATE(A) {} #define QUICK_SAFEMALLOC diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 0f12dd9122a..3e498703ada 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -607,7 +607,9 @@ report_stats () { $ECHO "http://www.mysql.com/doc/M/y/MySQL_test_suite.html" fi - # + if test -z "$USE_RUNNING_SERVER" + then + # Report if there was any fatal warnings/errors in the log files # $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp @@ -630,6 +632,7 @@ report_stats () { echo "WARNING: Got errors/warnings while running tests. Please examine" echo "$MY_LOG_DIR/warnings for details." fi + fi } mysql_install_db () { diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3c5f1a23704..b6bbc12efd6 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000-2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -918,7 +918,7 @@ int dump_leaf(byte* key, uint32 count __attribute__((unused)), } -void Item_sum_count_distinct::no_rows_in_result() +Item_sum_count_distinct::~Item_sum_count_distinct() { if (table) free_tmp_table(current_thd, table); diff --git a/sql/item_sum.h b/sql/item_sum.h index 62cb5974388..29ac1f1d1b1 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -185,7 +185,7 @@ class Item_sum_count_distinct :public Item_sum_int :Item_sum_int(list),table(0),used_table_cache(~(table_map) 0), tmp_table_param(0),use_tree(0),always_null(0) { quick_group=0; } - ~Item_sum_count_distinct() { no_rows_in_result(); } + ~Item_sum_count_distinct(); table_map used_tables() const { return used_table_cache; } enum Sumfunctype sum_func () const { return COUNT_DISTINCT_FUNC; } @@ -196,7 +196,7 @@ class Item_sum_count_distinct :public Item_sum_int void update_field(int offset) { return ; } // Never called const char *func_name() const { return "count_distinct"; } bool setup(THD *thd); - void no_rows_in_result(); + void no_rows_in_result() {} unsigned int size_of() { return sizeof(*this);} };