From a41f9de0d270ab416af13744b6aa01746d15c8d1 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Tue, 16 Dec 2003 14:43:34 +0200 Subject: [PATCH 01/11] A new better test case for bug #2128 involving overflow in decimal type with prepended zero's. --- mysql-test/r/type_decimal.result | 195 ++++++++++++++++++++++++++++++- mysql-test/t/type_decimal.test | 15 ++- 2 files changed, 205 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index df5402c89a8..5268ff3696b 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -363,9 +363,198 @@ CREATE TABLE t1 (a_dec DECIMAL(-2,1)); Too big column length for column 'a_dec' (max = 255). Use BLOB instead CREATE TABLE t1 (a_dec DECIMAL(-1,1)); Too big column length for column 'a_dec' (max = 255). Use BLOB instead -create table t1(a decimal(10,4)); -insert into t1 values ("+0000100000000"); +create table t1(a decimal(7,3)); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); select * from t1; a -9999999.9999 +1.000 ++1.000 +-1.000 +00001.000 ++0001.000 +-0001.000 +10.000 ++10.000 +-10.000 +00010.000 ++0010.000 +-0010.000 +100.000 ++100.000 +-100.000 +00100.000 ++0100.000 +-0100.000 +1000.000 ++1000.000 +-1000.000 +01000.000 ++1000.000 +-1000.000 +10000.000 +10000.000 +-9999.999 +10000.000 +10000.000 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +99999.999 +99999.999 +-9999.999 +drop table t1; +create table t1(a decimal(7,3) unsigned); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); +select * from t1; +a +1.000 ++1.000 +0.000 +0001.000 ++001.000 +0.000 +10.000 ++10.000 +0.000 +0010.000 ++010.000 +0.000 +100.000 ++100.000 +0.000 +0100.000 ++100.000 +0.000 +1000.000 +1000.000 +0.000 +1000.000 +1000.000 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +9999.999 +9999.999 +0.000 +drop table t1; +create table t1(a decimal(7,3) zerofill); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); +select * from t1; +a +0001.000 +0001.000 +0000.000 +0001.000 +0001.000 +0000.000 +0010.000 +0010.000 +0000.000 +0010.000 +0010.000 +0000.000 +0100.000 +0100.000 +0000.000 +0100.000 +0100.000 +0000.000 +1000.000 +1000.000 +0000.000 +1000.000 +1000.000 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 +9999.999 +9999.999 +0000.000 drop table t1; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 14d9625710b..82e53e7bde6 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -241,8 +241,19 @@ CREATE TABLE t1 (a_dec DECIMAL(-2,1)); --error 1074 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); +# # Zero prepend overflow bug -create table t1(a decimal(10,4)); -insert into t1 values ("+0000100000000"); +# + +create table t1(a decimal(7,3)); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); +select * from t1; +drop table t1; +create table t1(a decimal(7,3) unsigned); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); +select * from t1; +drop table t1; +create table t1(a decimal(7,3) zerofill); +insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); select * from t1; drop table t1; From 989b4ad241a590f2e141607e15debc520d092e30 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 16 Dec 2003 14:43:34 +0100 Subject: [PATCH 02/11] - Bugfix for Do-rpm (moving of the resulting packages did not work due to a missing space) - Define the subject of the failure mail reports within the calling script instead of logger.pm --- Build-tools/Bootstrap | 2 ++ Build-tools/Do-rpm | 4 +++- Build-tools/logger.pm | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 7d3ac1322f4..930d053b113 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -99,6 +99,8 @@ if (defined $opt_build_command) print_help("") if ($opt_help); defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!"); +$subject= "Bootstrap of $REPO failed" if $opt_mail; + &logger("Starting build"); &abort("The directory \"$REPO\" could not be found!") if (!-d $REPO); &logger("Using $REPO as the BK parent repository"); diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index cedd55d1405..a216a3ba5dc 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -67,6 +67,8 @@ else die "ERROR: $LOGGER cannot be found!\n"; } +$subject= "RPM build for $SPECFILE failed" if $opt_mail; + # Open the spec file and extract the version number open(SPEC, $SPECFILE) or &abort("Unable to open \"$ARGV[0]\": $!"); @spec= ; @@ -192,7 +194,7 @@ $command.= "$SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD"; $command= "mv"; $command.= " -v " if ($opt_verbose); -$command.= "$RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; +$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; &logger("Moving binary RPMs to current dir."); &run_command($command, "Error moving binary RPMs!"); diff --git a/Build-tools/logger.pm b/Build-tools/logger.pm index becde95df18..835d8014aa0 100644 --- a/Build-tools/logger.pm +++ b/Build-tools/logger.pm @@ -53,7 +53,6 @@ sub abort if ($opt_mail && !$opt_dry_run) { $messagefile= "/tmp/message.$$"; - $subject= "Bootstrap of $REPO failed"; open(TMP,">$messagefile"); print TMP "$message\n\n"; close TMP; From 8caa18f9e36898cd15a0e61bbbe3765aeb520e81 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 16 Dec 2003 17:44:51 +0100 Subject: [PATCH 03/11] - bumped up version number to 4.0.18, now that 4.0.17 has been tagged/released - tagged ChangeSet@1.1655.1.3 as mysql-4.0.17 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7260a21428d..fd9f6a4f721 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.0.17) +AM_INIT_AUTOMAKE(mysql, 4.0.18) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From b6e55207f58e3251001ab9d6b4ba81dc72d4443a Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Tue, 16 Dec 2003 21:52:11 +0100 Subject: [PATCH 04/11] Fix for BUG#2121 "Inadequate message "check permissions on master.info"": more general message when slave can't start because of incorrect replication information, the previous one was sometimes a misleading indication (i.e. sometimes the problem had nothing to do with system permissions). The perfect fix would be to report the exact error to the client (instead of pointing the client to the error log); this is a bit of work so it's more a development task: WL#1088 "Move all hardcoded messages of replication to share/errmsg.txt". I was not able to modify the errmsg.txt in these sql/ subdirectories: danish dutch german italian portuguese russian spanish swedish ukrainian --- mysql-test/r/rpl_rotate_logs.result | 6 +++--- sql/share/czech/errmsg.txt | 2 +- sql/share/english/errmsg.txt | 2 +- sql/share/estonian/errmsg.txt | 2 +- sql/share/french/errmsg.txt | 2 +- sql/share/greek/errmsg.txt | 2 +- sql/share/hungarian/errmsg.txt | 2 +- sql/share/japanese/errmsg.txt | 2 +- sql/share/korean/errmsg.txt | 2 +- sql/share/norwegian-ny/errmsg.txt | 2 +- sql/share/norwegian/errmsg.txt | 2 +- sql/share/polish/errmsg.txt | 2 +- sql/share/romanian/errmsg.txt | 2 +- sql/share/slovak/errmsg.txt | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 07490744d81..365ce7d42d3 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -1,11 +1,11 @@ drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4; slave start; -Could not initialize master info structure, check permisions on master.info +Could not initialize master info structure, more error messages can be found in the MySQL error log slave start; -Could not initialize master info structure, check permisions on master.info +Could not initialize master info structure, more error messages can be found in the MySQL error log change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; -Could not initialize master info structure, check permisions on master.info +Could not initialize master info structure, more error messages can be found in the MySQL error log reset slave; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; reset master; diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 72a593cf5f7..069ee4540a3 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -211,7 +211,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 0ce90ac0dab..195ea4b0d00 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -202,7 +202,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 38b45c1443b..6acb6a2ee77 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -207,7 +207,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "Kasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujaga", "Ainult konstantsed suurused on lubatud SET klauslis", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index df2be2803b4..e53352472b9 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -202,7 +202,7 @@ "Cette opération ne peut être réalisée avec un esclave actif, faites SLAVE STOP d'abord", "Cette opération nécessite un esclave actif, configurez les esclaves et faites SLAVE START", "Le server n'est pas configuré comme un esclave, changez le fichier de configuration ou utilisez CHANGE MASTER TO", -"Impossible d'initialiser les structures d'information de maître, vérifiez les permissions sur master.info", +"Impossible d'initialiser les structures d'information de maître, vous trouverez des messages d'erreur supplémentaires dans le journal des erreurs de MySQL", "Impossible de créer une tâche esclave, vérifiez les ressources système", "L'utilisateur %-.64s possède déjà plus de 'max_user_connections' connections actives", "Seules les expressions constantes sont autorisées avec SET", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index e3778aaac10..c7575277508 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -202,7 +202,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 85ea5c2e742..7b65da7a03f 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -204,7 +204,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index f99d262a689..bfd9d607806 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -204,7 +204,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 2a7e03b026d..7a384bb7a6f 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -202,7 +202,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index e6ec84e98a0..1bee058a50b 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -204,7 +204,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index fe379261151..6b92a6da2c4 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -204,7 +204,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index a300dc1e2ab..e963a655245 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -206,7 +206,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index bf1306cd332..436f7395556 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -206,7 +206,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index b9970465871..28e4ca9ddca 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -210,7 +210,7 @@ "This operation cannot be performed with a running slave, run SLAVE STOP first", "This operation requires a running slave, configure slave and do SLAVE START", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, check permisions on master.info", +"Could not initialize master info structure, more error messages can be found in the MySQL error log", "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", From 680b2ee4343bbbf03a490ccf9c97df0a628f2579 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 17 Dec 2003 18:12:59 +0100 Subject: [PATCH 05/11] Fixed typo. Affected INSERT DELAYED ... SELECT commands --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 50e515d7179..5c08127bfdc 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1990,7 +1990,7 @@ mysql_execute_command(void) } /* Fix lock for first table */ if (tables->lock_type == TL_WRITE_DELAYED) - tables->lock_type == TL_WRITE; + tables->lock_type= TL_WRITE; /* Don't unlock tables until command is written to binary log */ select_lex->options|= SELECT_NO_UNLOCK; From 7aad55d97dabef3c35b3028ffc96cca5254d563c Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Wed, 17 Dec 2003 13:15:01 -0400 Subject: [PATCH 06/11] fixed small error in types in sql/field.cc (char * -> const char*) --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index 43244a2f8a6..9d191fb61dc 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4721,7 +4721,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)), { uint tmp=(uint) Field_enum::val_int(); if (!tmp || tmp > typelib->count) - val_ptr->set((char*)"",0); + val_ptr->set((const char*)"",0); else val_ptr->set((const char*) typelib->type_names[tmp-1], (uint) strlen(typelib->type_names[tmp-1])); From 508d5e5b9d31abbdf0e38732b420c293753af3d6 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 17 Dec 2003 23:29:11 +0100 Subject: [PATCH 07/11] Fix for BUG#2145 "mysqld becomes unreliable if unable to create a relay log when replic starts": release the mutex before exiting the function, or it will be kept forever (=> START SLAVE, STOP SLAVE, etc will hang). --- sql/slave.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/slave.cc b/sql/slave.cc index 25eeb34e3a7..116d602b238 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1321,6 +1321,7 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname) 1 /* no auto events */, max_relay_log_size ? max_relay_log_size : max_binlog_size)) { + pthread_mutex_unlock(&rli->data_lock); sql_print_error("Failed in open_log() called from init_relay_log_info()"); DBUG_RETURN(1); } From 6e58a7c49ed39b691bbe6279d7034150f04191b0 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 18 Dec 2003 01:13:52 +0200 Subject: [PATCH 08/11] Code cleanup --- client/mysql.cc | 7 +++++-- sql/field.cc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 370213d4fc4..15770d2eb52 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2228,8 +2228,11 @@ static int sql_real_connect(char *host,char *database,char *user,char *password, uint silent) { - mysql_close(&mysql); - connected= 0; + if (connected) + { + connected= 0; + mysql_close(&mysql); + } mysql_init(&mysql); if (opt_connect_timeout) { diff --git a/sql/field.cc b/sql/field.cc index fd0bea83a05..8bcbf8ecc56 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4721,7 +4721,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)), { uint tmp=(uint) Field_enum::val_int(); if (!tmp || tmp > typelib->count) - val_ptr->set((const char*)"",0); + val_ptr->set("",0); else val_ptr->set((const char*) typelib->type_names[tmp-1], (uint) strlen(typelib->type_names[tmp-1])); From b9d8f108c1ea26889be3076983dc7c4ed7768fbd Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 18 Dec 2003 14:40:19 +0200 Subject: [PATCH 09/11] Simple cleanups --- mysql-test/t/auto_increment.test | 2 +- sql/opt_range.cc | 1 - sql/sql_select.cc | 56 +++++++++++++++----------------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 8c614131684..c26983b5eec 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -82,7 +82,7 @@ insert into t1 values (NULL); select * from t1; drop table t1; -create table t1 (a int not null auto_increment primary key) /*!41002 type=heap */; +create table t1 (a int not null auto_increment primary key) /*!40102 type=heap */; insert into t1 values (NULL); insert into t1 values (-1); select last_insert_id(); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 74e3f855db7..7e5ca50d349 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1076,7 +1076,6 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, all rows between 'X' and 'X ...' */ uint length= uint2korr(str+maybe_null); - char *end; str2= str+ key_part->part_length + maybe_null; /* remove end space */ while (length > 0 && str[length+HA_KEY_BLOB_LENGTH+maybe_null-1] == ' ') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 45defba4a94..1d7187824fe 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1771,41 +1771,37 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, uint tables, COND *cond, table_map normal_tables) { uint and_level,i,found_eq_constant; + KEY_FIELD *key_fields, *end, *field; + if (!(key_fields=(KEY_FIELD*) + thd->alloc(sizeof(key_fields[0])*(thd->cond_count+1)*2))) + return TRUE; /* purecov: inspected */ + and_level=0; field=end=key_fields; + if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64)) + return TRUE; + if (cond) { - KEY_FIELD *key_fields,*end; - KEY_FIELD *field; - - if (!(key_fields=(KEY_FIELD*) - thd->alloc(sizeof(key_fields[0])*(thd->cond_count+1)*2))) - return TRUE; /* purecov: inspected */ - and_level=0; field=end=key_fields; - if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64)) - return TRUE; - if (cond) - { - add_key_fields(join_tab,&end,&and_level,cond,normal_tables); - for (; field != end ; field++) - { - add_key_part(keyuse,field); - /* Mark that we can optimize LEFT JOIN */ - if (field->val->type() == Item::NULL_ITEM && - !field->field->real_maybe_null()) - field->field->table->reginfo.not_exists_optimize=1; - } - } - for (i=0 ; i < tables ; i++) - { - if (join_tab[i].on_expr) - { - add_key_fields(join_tab,&end,&and_level,join_tab[i].on_expr, - join_tab[i].table->map); - } - } - /* fill keyuse with found key parts */ + add_key_fields(join_tab,&end,&and_level,cond,normal_tables); for (; field != end ; field++) + { add_key_part(keyuse,field); + /* Mark that we can optimize LEFT JOIN */ + if (field->val->type() == Item::NULL_ITEM && + !field->field->real_maybe_null()) + field->field->table->reginfo.not_exists_optimize=1; + } } + for (i=0 ; i < tables ; i++) + { + if (join_tab[i].on_expr) + { + add_key_fields(join_tab,&end,&and_level,join_tab[i].on_expr, + join_tab[i].table->map); + } + } + /* fill keyuse with found key parts */ + for (; field != end ; field++) + add_key_part(keyuse,field); if (thd->lex.select->ftfunc_list.elements) { From 1f997d4a701ff5da362e3b584f0e41a326fdd6d4 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 18 Dec 2003 15:24:21 +0200 Subject: [PATCH 10/11] Removed compiler warning Fixed not updated test from last changeset --- mysql-test/r/auto_increment.result | 2 +- sql/mysqld.cc | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index cbd2d48b38d..2d6b058d9c5 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -118,7 +118,7 @@ a 1 2 drop table t1; -create table t1 (a int not null auto_increment primary key) /*!41002 type=heap */; +create table t1 (a int not null auto_increment primary key) /*!40102 type=heap */; insert into t1 values (NULL); insert into t1 values (-1); select last_insert_id(); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index cc17b4e97fd..a4e59c399e5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5136,9 +5136,10 @@ static void create_pid_file() if ((file = my_create(pidfile_name,0664, O_WRONLY | O_TRUNC, MYF(MY_WME))) >= 0) { - char buff[21]; - sprintf(buff,"%lu\n",(ulong) getpid()); - (void) my_write(file, buff,strlen(buff),MYF(MY_WME)); + char buff[21], *end; + end= int2str((long) getpid(), buff, 10); + *end++= '\n'; + (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); (void) my_close(file, MYF(0)); } } From aa3f200c031913313d5373032a03709635bf0227 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 18 Dec 2003 16:50:01 +0200 Subject: [PATCH 11/11] Fixed that lower_case_table_names is set to 1 for case insensitive file systems. --- sql/mysqld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a4e59c399e5..a58f3b973ac 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4955,7 +4955,8 @@ static void fix_paths(void) if (!lower_case_table_names && test_if_case_insensitive(mysql_real_data_home) == 1) { - sql_print_error("Warning: Setting lower_case_table_names=1 becasue file system %s is case insensitve", mysql_real_data_home); + sql_print_error("Warning: Setting lower_case_table_names=1 becasue file system %s is case insensitive", mysql_real_data_home); + lower_case_table_names= 1; } }