List:Internals« Previous MessageNext Message »
From:msvensson Date:September 27 2005 4:05pm
Subject:bk commit into 5.0 tree (msvensson:1.2001)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2001 05/09/27 18:05:19 msvensson@neptunus.(none) +18 -0
  Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
  into  neptunus.(none):/home/msvensson/mysql/mysql-5.0

  sql/sql_prepare.cc
    1.157 05/09/27 18:05:15 msvensson@neptunus.(none) +0 -0
    Merge from 4.1 to 5.0

  sql/sql_load.cc
    1.86 05/09/27 18:05:15 msvensson@neptunus.(none) +2 -3
    Merge from 4.1 to 5.0

  sql/sql_lex.cc
    1.170 05/09/27 18:05:15 msvensson@neptunus.(none) +1 -0
    Merge from 4.1 to 5.0

  sql/sql_delete.cc
    1.163 05/09/27 18:05:15 msvensson@neptunus.(none) +0 -5
    Merge from 4.1 to 5.0

  sql/opt_sum.cc
    1.48 05/09/27 18:05:15 msvensson@neptunus.(none) +2 -2
    Merge from 4.1 to 5.0

  sql/item.h
    1.169 05/09/27 18:05:15 msvensson@neptunus.(none) +0 -0
    Merge from 4.1 to 5.0

  sql/ha_ndbcluster.cc
    1.209 05/09/27 18:05:15 msvensson@neptunus.(none) +0 -2
    Merge from 4.1 to 5.0

  ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
    1.11 05/09/27 18:05:15 msvensson@neptunus.(none) +11 -0
    Merge from 4.1 to 5.0

  mysql-test/t/cast.test
    1.25 05/09/27 18:05:15 msvensson@neptunus.(none) +13 -13
    Merge from 4.1 to 5.0

  mysql-test/r/cast.result
    1.32 05/09/27 18:05:15 msvensson@neptunus.(none) +18 -18
    Merge from 4.1 to 5.0

  Makefile.am
    1.78 05/09/27 18:05:15 msvensson@neptunus.(none) +11 -19
    Merge from 4.1 to 5.0

  sql/sql_update.cc
    1.172 05/09/27 17:55:29 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysys/my_init.c
    1.42 05/09/27 17:55:28 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/t/mysqltest.test
    1.18 05/09/27 17:55:28 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/r/mysqltest.result
    1.13 05/09/27 17:55:27 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/mysql-test-run.pl
    1.46 05/09/27 17:55:27 msvensson@neptunus.(none) +0 -0
    Auto merged

  client/mysqltest.c
    1.163 05/09/27 17:55:27 msvensson@neptunus.(none) +0 -0
    Auto merged

  client/mysql.cc
    1.180 05/09/27 17:55:27 msvensson@neptunus.(none) +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysql-5.0/RESYNC

--- 1.77/Makefile.am	2005-09-02 12:18:34 +02:00
+++ 1.78/Makefile.am	2005-09-27 18:05:15 +02:00
@@ -109,13 +109,18 @@
 				--ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
 test:
 	cd mysql-test ; \
-	./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \
-	./mysql-test-run.pl --ps-protocol $(MYSQL_TEST_RUN_ARGS)
+	./mysql-test-run \
+		--manager-port=$(MYSQL_TEST_MANAGER_PORT) \
+		--master_port=$(MYSQL_TEST_MASTER_PORT) \
+		--slave_port=$(MYSQL_TEST_SLAVE_PORT) \
+		--ndbcluster_port=$(MYSQL_TEST_NDB_PORT) && \
+	./mysql-test-run --ps-protocol \
+		--manager-port=$(MYSQL_TEST_MANAGER_PORT) \
+		--master_port=$(MYSQL_TEST_MASTER_PORT) \
+		--slave_port=$(MYSQL_TEST_SLAVE_PORT) \
+		--ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
 
 test-force:
-	cd mysql-test ; \
-	./mysql-test-run --force $(MYSQL_TEST_RUN_ARGS) ; \
-	./mysql-test-run --ps-protocol --force $(MYSQL_TEST_RUN_ARGS)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+	cd mysql-test; \
+	./mysql-test-run --force ;\
+	./mysql-test-run --ps-protocol --force

--- 1.179/client/mysql.cc	2005-09-21 13:19:18 +02:00
+++ 1.180/client/mysql.cc	2005-09-27 17:55:27 +02:00
@@ -1014,13 +1014,13 @@
       unsigned long clen;
       do
       {
-        line= my_cgets(tmpbuf.c_ptr(), tmpbuf.alloced_length(), &clen);
+        line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
         buffer.append(line, clen);
         /* 
            if we got buffer fully filled than there is a chance that
            something else is still in console input buffer
         */
-      } while (tmpbuf.alloced_length() <= clen + 1);
+      } while (tmpbuf.alloced_length() <= clen);
       line= buffer.c_ptr();
 #else /* OS2 */
       buffer.length(0);

--- 1.41/mysys/my_init.c	2005-08-09 15:57:31 +02:00
+++ 1.42/mysys/my_init.c	2005-09-27 17:55:28 +02:00
@@ -127,11 +127,23 @@
 
 void my_end(int infoflag)
 {
-  FILE *info_file;
-  if (!(info_file=DBUG_FILE))
-    info_file=stderr;
-  DBUG_PRINT("info",("Shutting down"));
-  if (infoflag & MY_CHECK_ERROR || info_file != stderr)
+  /*
+    this code is suboptimal to workaround a bug in
+    Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be
+    optimized until this compiler is not in use anymore
+  */
+  FILE *info_file= DBUG_FILE;
+  my_bool print_info= (info_file != stderr);
+  DBUG_ENTER("my_end");
+  if (!info_file)
+  {
+    info_file= stderr;
+    print_info= 0;
+  }
+
+  DBUG_PRINT("info",("Shutting down: print_info: %d", print_info));
+  if ((infoflag & MY_CHECK_ERROR) || print_info)
+
   {					/* Test if some file is left open */
     if (my_file_opened | my_stream_opened)
     {
@@ -141,7 +153,8 @@
     }
   }
   my_once_free();
-  if (infoflag & MY_GIVE_INFO || info_file != stderr)
+
+  if ((infoflag & MY_GIVE_INFO) || print_info)
   {
 #ifdef HAVE_GETRUSAGE
     struct rusage rus;

--- 1.168/sql/item.h	2005-09-08 18:25:37 +02:00
+++ 1.169/sql/item.h	2005-09-27 18:05:15 +02:00
@@ -1502,6 +1502,7 @@
   my_decimal *val_decimal(my_decimal *);
   int save_in_field(Field *field, bool no_conversions);
   enum Item_result result_type () const { return STRING_RESULT; }
+  enum Item_result cast_to_int_type() const { return INT_RESULT; }
   enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
   // to prevent drop fixed flag (no need parent cleanup call)
   void cleanup() {}

--- 1.47/sql/opt_sum.cc	2005-09-23 14:37:18 +02:00
+++ 1.48/sql/opt_sum.cc	2005-09-27 18:05:15 +02:00
@@ -108,7 +108,7 @@
           WHERE t2.field IS NULL;
       */
       if (tl->table->map & where_tables)
-        const_result= 0;
+        return 0;
     }
     else
       used_tables|= tl->table->map;
@@ -119,7 +119,10 @@
       may be used as the real count.
     */
     if (tl->table->file->table_flags() & HA_NOT_EXACT_COUNT)
+    {
       is_exact_count= FALSE;
+      count= 1;                                 // ensure count != 0
+    }
     else
     {
       tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
@@ -127,9 +130,6 @@
     }
   }
 
-  if (!const_result)
-    return 0;
-
   /*
     Iterate through all items in the SELECT clause and replace
     COUNT(), MIN() and MAX() with constants (if possible).
@@ -250,7 +250,7 @@
         }
         if (!count)
         {
-          /* If count != 1, then we know that is_exact_count == TRUE. */
+          /* If count == 0, then we know that is_exact_count == TRUE. */
           ((Item_sum_min*) item_sum)->clear(); /* Set to NULL. */
         }
         else

--- 1.162/sql/sql_delete.cc	2005-09-20 17:41:42 +02:00
+++ 1.163/sql/sql_delete.cc	2005-09-27 18:05:15 +02:00
@@ -313,6 +313,7 @@
   SELECT_LEX *select_lex= &thd->lex->select_lex;
   DBUG_ENTER("mysql_prepare_delete");
 
+  thd->allow_sum_func= 0;
   if (setup_tables(thd, &thd->lex->select_lex.context,
                    &thd->lex->select_lex.top_join_list,
                    table_list, conds, &select_lex->leaf_tables,
@@ -332,9 +333,6 @@
       update_non_unique_table_error(table_list, "DELETE", duplicate);
       DBUG_RETURN(TRUE);
     }
-  }
-  select_lex->fix_prepare_information(thd, conds);
-  DBUG_RETURN(FALSE);
 }
 
 

--- 1.85/sql/sql_load.cc	2005-09-23 14:37:18 +02:00
+++ 1.86/sql/sql_load.cc	2005-09-27 18:05:15 +02:00
@@ -564,6 +564,8 @@
       {
 	uint length;
 	byte save_chr;
+        if (field == table->next_number_field)
+          table->auto_increment_field_not_null= TRUE;
 	if ((length=(uint) (read_info.row_end-pos)) >
 	    field->field_length)
 	  length=field->field_length;

--- 1.171/sql/sql_update.cc	2005-09-20 17:41:42 +02:00
+++ 1.172/sql/sql_update.cc	2005-09-27 17:55:29 +02:00
@@ -571,6 +571,7 @@
   bzero((char*) &tables,sizeof(tables));	// For ORDER BY
   tables.table= table;
   tables.alias= table_list->alias;
+  thd->allow_sum_func= 0;
 
   if (setup_tables(thd, &select_lex->context, &select_lex->top_join_list,
                    table_list, conds, &select_lex->leaf_tables,

--- 1.45/mysql-test/mysql-test-run.pl	2005-09-21 13:19:19 +02:00
+++ 1.46/mysql-test/mysql-test-run.pl	2005-09-27 17:55:27 +02:00
@@ -2490,7 +2490,7 @@
   $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args);
 
   # ----------------------------------------------------------------------
-  # Add args that should not go into the MYSQL_TEST environment var
+  # Add arguments that should not go into the MYSQL_TEST env var
   # ----------------------------------------------------------------------
 
   mtr_add_arg($args, "-R");

--- 1.12/mysql-test/r/mysqltest.result	2005-09-06 12:33:31 +02:00
+++ 1.13/mysql-test/r/mysqltest.result	2005-09-27 17:55:27 +02:00
@@ -180,6 +180,7 @@
 echo message echo message
 
 mysqltest: At line 1: Empty variable
+mysqltest: At line 1: command "false" failed
 mysqltest: At line 1: Missing argument in exec
 MySQL
 "MySQL"
@@ -301,6 +302,7 @@
 mysqltest: At line 1: End of line junk detected: "1000"
 mysqltest: At line 1: Missing arguments to system, nothing to do!
 mysqltest: At line 1: Missing arguments to system, nothing to do!
+mysqltest: At line 1: system command 'false' failed
 test
 test2
 test3
@@ -344,6 +346,10 @@
 mysqltest: At line 1: Invalid integer argument "10!"
 mysqltest: At line 1: End of line junk detected: "!"
 mysqltest: At line 1: Invalid integer argument "a"
+Output from mysqltest-x.inc
+Output from mysqltest-x.inc
+Output from mysqltest-x.inc
+mysqltest: Could not open ./non_existing_file.inc: errno = 2
 failing_statement;
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
 failing_statement;

--- 1.17/mysql-test/t/mysqltest.test	2005-09-07 09:33:20 +02:00
+++ 1.18/mysql-test/t/mysqltest.test	2005-09-27 17:55:28 +02:00
@@ -428,9 +428,8 @@
 # ----------------------------------------------------------------------------
 
 # Illegal use of exec
-# Disabled, some shells prints the failed command regardless of pipes
-#--error 1
-#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "--exec false" | $MYSQL_TEST 2>&1
 
 --error 1
 --exec echo "--exec " | $MYSQL_TEST 2>&1
@@ -677,9 +676,8 @@
 --exec echo "system;" | $MYSQL_TEST 2>&1
 --error 1
 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
-# Disabled, some shells prints the failed command regardless of pipes
-#--error 1
-#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "system false;" | $MYSQL_TEST 2>&1
 
 --disable_abort_on_error
 system NonExistsinfComamdn;
@@ -814,11 +812,11 @@
 # ----------------------------------------------------------------------------
 
 # -x <file_name>, use the file specified after -x as the test file
-#--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
-#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
-#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
-#--error 1
-#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1
+--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc
+--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc
+--exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc
+--error 1
+--exec $MYSQL_TEST -x non_existing_file.inc 2>&1
 
 
 # ----------------------------------------------------------------------------

--- 1.10/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp	2005-08-18 14:09:06 +02:00
+++ 1.11/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp	2005-09-27 18:05:15 +02:00
@@ -85,8 +85,7 @@
          te.m_tableState != SchemaFile::DROP_TABLE_COMMITTED)) {
       ndbout << "Table " << i << ":"
              << " State = " << te.m_tableState 
-	     << " version = " << table_version_major(te.m_tableVersion) <<
-	     << "(" << table_version_minor(te.m_tableVersion) << ")"
+	     << " version = " << te.m_tableVersion
              << " type = " << te.m_tableType
 	     << " noOfPages = " << te.m_noOfPages
 	     << " gcp: " << te.m_gcp << endl;

--- 1.208/sql/ha_ndbcluster.cc	2005-09-21 13:22:25 +02:00
+++ 1.209/sql/ha_ndbcluster.cc	2005-09-27 18:05:15 +02:00
@@ -711,7 +711,7 @@
       }
 
       DBUG_PRINT("value", ("set blob ptr=%p len=%u",
-                           blob_ptr, blob_len));
+			   blob_ptr, blob_len));
       DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26));
 
       if (set_blob_value)

--- 1.31/mysql-test/r/cast.result	2005-06-15 17:38:54 +02:00
+++ 1.32/mysql-test/r/cast.result	2005-09-27 18:05:15 +02:00
@@ -72,6 +72,18 @@
 select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
 CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
 2004
+select CAST(0xb3 as signed);
+CAST(0xb3 as signed)
+179
+select CAST(0x8fffffffffffffff as signed);
+CAST(0x8fffffffffffffff as signed)
+-8070450532247928833
+select CAST(0xffffffffffffffff as unsigned);
+CAST(0xffffffffffffffff as unsigned)
+18446744073709551615
+select CAST(0xfffffffffffffffe as signed);
+CAST(0xfffffffffffffffe as signed)
+-2
 Warnings:
 Warning	1292	Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
 select cast('-10a' as signed integer);
@@ -138,10 +150,10 @@
 select cast(_latin1'test' as char character set latin2);
 cast(_latin1'test' as char character set latin2)
 test
+select cast(_koi8r'ÔÅÓÔ' as char character set cp1251);
+cast(_koi8r'ÔÅÓÔ' as char character set cp1251)
+òåñò
+create table t1 select cast(_koi8r'ÔÅÓÔ' as char character set cp1251) as t;
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -187,22 +199,22 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 select
+cast(_koi8r'ÆÇ'  AS nchar)    as c1,
+cast(_koi8r'Æ '  AS nchar)    as c2,
+cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3,
+cast(_koi8r'Æ  ' AS nchar(2)) as c4,
+cast(_koi8r'Æ'   AS nchar(2)) as c5;
 c1	c2	c3	c4	c5
 фг	ф 	фг	ф 	ф
 Warnings:
 Warning	1292	Truncated incorrect CHAR(4) value: 'фгх'
 Warning	1292	Truncated incorrect CHAR(3) value: 'ф  '
 create table t1 select
+cast(_koi8r'ÆÇ'  AS nchar)    as c1,
+cast(_koi8r'Æ '  AS nchar)    as c2,
+cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3,
+cast(_koi8r'Æ  ' AS nchar(2)) as c4,
+cast(_koi8r'Æ'   AS nchar(2)) as c5;
 Warnings:
 Warning	1292	Truncated incorrect CHAR(4) value: 'фгх'
 Warning	1292	Truncated incorrect CHAR(3) value: 'ф  '
@@ -220,18 +232,18 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (a binary(10), b char(10) character set koi8r);
+insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
 select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
 a	b	cast(a as char character set cp1251)	cast(b as binary)
+ÔÅÓÔ	ÔÅÓÔ	ÔÅÓÔ	ÔÅÓÔ
 set names koi8r;
 select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
 a	b	cast(a as char character set cp1251)	cast(b as binary)
+ÔÅÓÔ	ÔÅÓÔ	æåõæ	ÔÅÓÔ
 set names cp1251;
 select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
 a	b	cast(a as char character set cp1251)	cast(b as binary)
+ÔÅÓÔ	òåñò	ÔÅÓÔ	ÔÅÓÔ
 drop table t1;
 set names binary;
 select cast("2001-1-1" as date) = "2001-01-01";

--- 1.24/mysql-test/t/cast.test	2005-09-15 21:17:37 +02:00
+++ 1.25/mysql-test/t/cast.test	2005-09-27 18:05:15 +02:00
@@ -27,6 +27,10 @@
 select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
 select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
 select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
+select CAST(0xb3 as signed);
+select CAST(0x8fffffffffffffff as signed);
+select CAST(0xffffffffffffffff as unsigned);
+select CAST(0xfffffffffffffffe as signed);
 select cast('-10a' as signed integer);
 select cast('a10' as unsigned integer);
 select 10+'a';
@@ -47,8 +51,8 @@
 #
 set names binary;
 select cast(_latin1'test' as char character set latin2);
+select cast(_koi8r'ÔÅÓÔ' as char character set cp1251);
+create table t1 select cast(_koi8r'ÔÅÓÔ' as char character set cp1251) as t;
 show create table t1;
 drop table t1;
 
@@ -77,18 +81,18 @@
 # CAST to NCHAR with/without length
 #
 select
+  cast(_koi8r'ÆÇ'  AS nchar)    as c1,
+  cast(_koi8r'Æ '  AS nchar)    as c2,
+  cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3,
+  cast(_koi8r'Æ  ' AS nchar(2)) as c4,
+  cast(_koi8r'Æ'   AS nchar(2)) as c5;
 
 create table t1 select
+  cast(_koi8r'ÆÇ'  AS nchar)    as c1,
+  cast(_koi8r'Æ '  AS nchar)    as c2,
+  cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3,
+  cast(_koi8r'Æ  ' AS nchar(2)) as c4,
+  cast(_koi8r'Æ'   AS nchar(2)) as c5;
 select * from t1;
 show create table t1;
 drop table t1;
@@ -98,7 +102,7 @@
 # CAST from BINARY to non-BINARY and from non-BINARY to BINARY
 #
 create table t1 (a binary(10), b char(10) character set koi8r);
+insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
 select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
 set names koi8r;
 select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;

--- 1.162/client/mysqltest.c	2005-09-23 09:12:05 +02:00
+++ 1.163/client/mysqltest.c	2005-09-27 17:55:27 +02:00
@@ -64,7 +64,11 @@
 #include <sys/wait.h>
 #endif
 #ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# ifdef __WIN__
+#  define WEXITSTATUS(stat_val) (stat_val)
+# else
+#  define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# endif
 #endif
 /* MAX_QUERY is 256K -- there is a test in sp-big that is >128K */
 #define MAX_QUERY     (256*1024)
@@ -609,7 +613,8 @@
     if (cur_file && cur_file != file_stack)
       fprintf(stderr, "In included file \"%s\": ",
               cur_file->file_name);
-    fprintf(stderr, "At line %u: ", start_lineno);
+    if (start_lineno != 0)
+      fprintf(stderr, "At line %u: ", start_lineno);
     vfprintf(stderr, fmt, args);
     fprintf(stderr, "\n");
     fflush(stderr);
@@ -642,7 +647,9 @@
 
   va_start(args, fmt);
 
-  fprintf(stderr, "mysqltest: At line %u: ", start_lineno);
+  fprintf(stderr, "mysqltest: ");
+  if (start_lineno > 0)
+    fprintf(stderr, "At line %u: ", start_lineno);
   vfprintf(stderr, fmt, args);
   fprintf(stderr, "\n");
   va_end(args);
@@ -1097,8 +1104,8 @@
           (query->expected_errno[i].code.errnum == status))
       {
         ok= 1;
-        verbose_msg("command \"%s\" failed with expected error: %d",
-                    cmd, status);
+        DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d",
+                            cmd, status));
       }
     }
     if (!ok)
@@ -1383,9 +1390,7 @@
   int rpl_parse;
 
   if (!master_pos.file[0])
-  {
-    die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno);
-  }
+    die("Calling 'sync_with_master' without calling 'save_master_pos'");
   rpl_parse= mysql_rpl_parse_enabled(mysql);
   mysql_disable_rpl_parse(mysql);
 
@@ -1395,14 +1400,13 @@
 wait_for_position:
 
   if (mysql_query(mysql, query_buf))
-    die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
-	mysql_errno(mysql), mysql_error(mysql));
+    die("failed in %s: %d: %s", query_buf, mysql_errno(mysql),
+        mysql_error(mysql));
 
   if (!(last_result= res= mysql_store_result(mysql)))
-    die("line %u: mysql_store_result() returned NULL for '%s'", start_lineno,
-	query_buf);
+    die("mysql_store_result() returned NULL for '%s'", query_buf);
   if (!(row= mysql_fetch_row(res)))
-    die("line %u: empty result in %s", start_lineno, query_buf);
+    die("empty result in %s", query_buf);
   if (!row[0])
   {
     /*
@@ -1410,10 +1414,7 @@
       SLAVE has been issued ?
     */
     if (tries++ == 3)
-    {
-      die("line %u: could not sync with master ('%s' returned NULL)", 
-          start_lineno, query_buf);
-    }
+      die("could not sync with master ('%s' returned NULL)", query_buf);
     sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
     mysql_free_result(res);
     goto wait_for_position;
@@ -1459,10 +1460,9 @@
 	mysql_errno(mysql), mysql_error(mysql));
 
   if (!(last_result =res = mysql_store_result(mysql)))
-    die("line %u: mysql_store_result() retuned NULL for '%s'", start_lineno,
-	query);
+    die("mysql_store_result() retuned NULL for '%s'", query);
   if (!(row = mysql_fetch_row(res)))
-    die("line %u: empty result in show master status", start_lineno);
+    die("empty result in show master status");
   strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
   master_pos.pos = strtoul(row[1], (char**) 0, 10);
   mysql_free_result(res); last_result=0;
@@ -2768,7 +2768,7 @@
       fn_format(buff, argument, "", "", 4);
       DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
       if (!(cur_file->file=
-            my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
+            my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
 	die("Could not open %s: errno = %d", buff, errno);
       cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
       break;
@@ -2874,7 +2874,7 @@
     fname=buff;
   }
   fn_format(buff,fname,"","",4);
-
+  
   if ((fd = my_open(buff, O_WRONLY | O_CREAT | O_TRUNC,
 		    MYF(MY_WME | MY_FFNF))) < 0)
     die("Could not open %s: errno = %d", buff, errno);
@@ -4304,12 +4304,20 @@
     if (res_info.st_size)
       error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH);
   }
-  if (result_file && ds_res.length && !error)
+  if (ds_res.length && !error)
   {
-    if (!record)
-      error |= check_result(&ds_res, result_file, q->require_file);
+    if (result_file)
+    {
+      if (!record)
+        error |= check_result(&ds_res, result_file, q->require_file);
+      else
+        str_to_file(result_file, ds_res.str, ds_res.length);
+    }
     else
-      str_to_file(result_file, ds_res.str, ds_res.length);
+    {
+      // Print the result to stdout
+      printf("%s", ds_res.str);
+    }
   }
   dynstr_free(&ds_res);
 
Thread
bk commit into 5.0 tree (msvensson:1.2001)msvensson27 Sep