From eee616d122a0f74c161944090ce1db3f4c3ba320 Mon Sep 17 00:00:00 2001
From: "joerg@mysql.com" <>
Date: Wed, 14 Sep 2005 13:12:30 +0200
Subject: [PATCH 1/4] Minor output format change of the Perl test suite script
 (align with the shell script).

---
 mysql-test/lib/mtr_report.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 868653afaa4..6db68524db7 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -74,7 +74,7 @@ sub mtr_show_failed_diff ($) {
 sub mtr_report_test_name ($) {
   my $tinfo= shift;
 
-  printf "%-31s ", $tinfo->{'name'};
+  printf "%-30s ", $tinfo->{'name'};
 }
 
 sub mtr_report_test_skipped ($) {
@@ -122,13 +122,13 @@ sub mtr_report_test_failed ($) {
   # we should write out into $::path_timefile when the error occurs.
   if ( -f $::path_timefile )
   {
-    print "Errors are (from $::path_timefile) :\n";
+    print "\nErrors are (from $::path_timefile) :\n";
     print mtr_fromfile($::path_timefile); # FIXME print_file() instead
     print "\n(the last lines may be the most important ones)\n";
   }
   else
   {
-    print "Unexpected termination, probably when starting mysqld\n";
+    print "\nUnexpected termination, probably when starting mysqld\n";
   }
 }
 

From b4d4e7a3066b75b3b4107fdc258ba2d3425d6fa1 Mon Sep 17 00:00:00 2001
From: "joerg@mysql.com" <>
Date: Wed, 14 Sep 2005 13:55:53 +0200
Subject: [PATCH 2/4] Improve error / process handling in the Perl script to
 run the test suite (patch supplied by Kent).

---
 mysql-test/lib/mtr_process.pl | 10 +++++-----
 mysql-test/lib/mtr_report.pl  |  6 ++++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index bae66353825..9176a246835 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -166,7 +166,7 @@ sub spawn_impl ($$$$$$$$) {
       {
         if ( ! open(STDOUT,$log_file_open_mode,$output) )
         {
-          mtr_error("can't redirect STDOUT to \"$output\": $!");
+          mtr_child_error("can't redirect STDOUT to \"$output\": $!");
         }
       }
 
@@ -176,14 +176,14 @@ sub spawn_impl ($$$$$$$$) {
         {
           if ( ! open(STDERR,">&STDOUT") )
           {
-            mtr_error("can't dup STDOUT: $!");
+            mtr_child_error("can't dup STDOUT: $!");
           }
         }
         else
         {
           if ( ! open(STDERR,$log_file_open_mode,$error) )
           {
-            mtr_error("can't redirect STDERR to \"$error\": $!");
+            mtr_child_error("can't redirect STDERR to \"$error\": $!");
           }
         }
       }
@@ -192,13 +192,13 @@ sub spawn_impl ($$$$$$$$) {
       {
         if ( ! open(STDIN,"<",$input) )
         {
-          mtr_error("can't redirect STDIN to \"$input\": $!");
+          mtr_child_error("can't redirect STDIN to \"$input\": $!");
         }
       }
 
       if ( ! exec($path,@$arg_list_t) )
       {
-        mtr_error("failed to execute \"$path\": $!");
+        mtr_child_error("failed to execute \"$path\": $!");
       }
     }
   }
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 6db68524db7..9002f204602 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -19,6 +19,7 @@ sub mtr_print_header ();
 sub mtr_report (@);
 sub mtr_warning (@);
 sub mtr_error (@);
+sub mtr_child_error (@);
 sub mtr_debug (@);
 
 
@@ -286,6 +287,11 @@ sub mtr_error (@) {
   mtr_exit(1);
 }
 
+sub mtr_child_error (@) {
+  print STDERR "mysql-test-run: *** ERROR(child): ",join(" ", @_),"\n";
+  exit(1);
+}
+
 sub mtr_debug (@) {
   if ( $::opt_script_debug )
   {

From e0b458de91f76ee8603db9f8073571e83d96d1d7 Mon Sep 17 00:00:00 2001
From: "jani@a193-229-222-105.elisa-laajakaista.fi" <>
Date: Wed, 14 Sep 2005 16:10:56 +0300
Subject: [PATCH 3/4] Fix for Metrowerks compiler.

---
 strings/my_strtoll10.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index cca7c8ab396..1f4cf1435fe 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -19,7 +19,13 @@
 #include <m_string.h>
 
 #undef  ULONGLONG_MAX
+/* Needed under MetroWerks Compiler, since MetroWerks compiler does not properly handle a constant expression containing a mod operator */
+#if defined(__NETWARE__) && defined(__MWERKS__) 
+ulonglong tmp;
+#define ULONGLONG_MAX (tmp =(~(ulonglong) 0))
+#else
 #define ULONGLONG_MAX		(~(ulonglong) 0)
+#endif /* __NETWARE__ && __MWERKS__ */
 #define MAX_NEGATIVE_NUMBER	((ulonglong) LL(0x8000000000000000))
 #define INIT_CNT  9
 #define LFACTOR   ULL(1000000000)

From a8eb0f176b3db09d238042467789d9dfca1b3b31 Mon Sep 17 00:00:00 2001
From: "tulin@dl145c.mysql.com" <>
Date: Wed, 14 Sep 2005 15:46:31 +0200
Subject: [PATCH 4/4] enabled mysqldump hex-blob option for bit fields

---
 client/mysqldump.c               |  3 ++-
 mysql-test/r/ndb_bitfield.result | 16 ++++++++--------
 mysql-test/t/ndb_bitfield.test   |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/client/mysqldump.c b/client/mysqldump.c
index be93b48f496..322acbd26c0 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2059,7 +2059,8 @@ static void dump_table(uint numFields, char *table)
 	   we'll dump in hex only BLOB columns.
 	*/
         is_blob= (opt_hex_blob && field->charsetnr == 63 &&
-                  (field->type == MYSQL_TYPE_STRING ||
+                  (field->type == MYSQL_TYPE_BIT ||
+                   field->type == MYSQL_TYPE_STRING ||
                    field->type == MYSQL_TYPE_VAR_STRING ||
                    field->type == MYSQL_TYPE_VARCHAR ||
                    field->type == MYSQL_TYPE_BLOB ||
diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/r/ndb_bitfield.result
index e2326459a8c..bf5a9b1ade1 100644
--- a/mysql-test/r/ndb_bitfield.result
+++ b/mysql-test/r/ndb_bitfield.result
@@ -188,14 +188,14 @@ INSERT INTO `t1` VALUES
 (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','?','>',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','\0','=',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','',';',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','0','7',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'','!','/',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,' ','','',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'\0','','?',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'?','\0','\0',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x01,0x3F,0x3E,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x02,0x00,0x3D,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x04,0x0F,0x3B,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x08,0x30,0x37,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x10,0x21,0x2F,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x20,0x12,0x1F,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x00,0x0C,0x3F,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO `t1` VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x3F,0x00,0x00,4,5,5,5,5,5,5,5,5,5,3,2,1);
 drop table t1;
 create table t1 (
 pk1 bit(9) not null primary key,
diff --git a/mysql-test/t/ndb_bitfield.test b/mysql-test/t/ndb_bitfield.test
index 6b805c2f1cd..0256ecf89ed 100644
--- a/mysql-test/t/ndb_bitfield.test
+++ b/mysql-test/t/ndb_bitfield.test
@@ -96,7 +96,7 @@ INSERT INTO `t1` VALUES
 (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test t1
+--exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
 drop table t1;
 
 --error 1005