List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:February 2 2011 1:41pm
Subject:bzr push into mysql-trunk branch (tor.didriksen:3592 to 3593) Bug#36022
View as plain text  
 3593 Tor Didriksen	2011-02-02 [merge]
      Merge Bug #36022 from 5.5

    modified:
      include/my_sys.h
      mysql-test/include/mtr_warnings.sql
      mysql-test/include/order_by.inc
      mysql-test/r/filesort_debug.result
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      mysql-test/t/filesort_debug.test
      sql/filesort.cc
      sql/protocol.cc
      sql/share/errmsg-utf8.txt
      sql/unireg.h
 3592 Jorgen Loland	2011-02-02 [merge]
      Automerge opt-team -> trunk. No conflicts

    modified:
      mysql-test/include/subquery_sj.inc
      mysql-test/include/subquery_sj_innodb.inc
      mysql-test/r/func_in_all.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/optimizer_switch.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_jcl6.result
      mysql-test/r/subquery_nomat_nosj_jcl6.result
      mysql-test/r/subquery_none_jcl6.result
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_jcl6.result
      mysql-test/r/subquery_sj_all_jcl7.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_jcl6.result
      mysql-test/r/subquery_sj_dupsweed_jcl7.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_jcl6.result
      mysql-test/r/subquery_sj_firstmatch_jcl7.result
      mysql-test/r/subquery_sj_innodb_all.result
      mysql-test/r/subquery_sj_innodb_all_jcl6.result
      mysql-test/r/subquery_sj_innodb_all_jcl7.result
      mysql-test/r/subquery_sj_innodb_none.result
      mysql-test/r/subquery_sj_innodb_none_jcl6.result
      mysql-test/r/subquery_sj_innodb_none_jcl7.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_jcl6.result
      mysql-test/r/subquery_sj_loosescan_jcl7.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_jcl6.result
      mysql-test/r/subquery_sj_mat_jcl7.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_jcl6.result
      mysql-test/r/subquery_sj_none_jcl7.result
      mysql-test/t/optimizer_switch.test
      sql/item.cc
      sql/item.h
      sql/item_subselect.h
      sql/sql_select.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2011-01-17 09:52:59 +0000
+++ b/include/my_sys.h	2011-02-02 13:41:10 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -104,7 +104,7 @@ typedef struct my_aio_result {
 #define ME_HOLDTANG	8	/* Don't delete last keys */
 #define ME_WAITTOT	16	/* Wait for errtime secs of for a action */
 #define ME_WAITTANG	32	/* Wait for a user action  */
-#define ME_NOREFRESH	64	/* Dont refresh screen */
+#define ME_NOREFRESH	64	/* Write the error message to error log */
 #define ME_NOINPUT	128	/* Dont use the input libary */
 #define ME_COLOUR1	((1 << ME_HIGHBYTE))	/* Possibly error-colours */
 #define ME_COLOUR2	((2 << ME_HIGHBYTE))

=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql	2010-11-29 11:28:55 +0000
+++ b/mysql-test/include/mtr_warnings.sql	2011-02-02 13:41:10 +0000
@@ -188,9 +188,6 @@ INSERT INTO global_suppressions VALUES
  /*It will print a warning if a new UUID of server is generated.*/
  ("No existing UUID has been found, so we assume that this is the first time that this server has been started.*"),
 
- /* Test case for Bug#31590 in order_by.test produces the following error */
- ("Out of sort memory; increase server sort buffer size"),
-
  /* Special case for Bug #26402 in show_check.test
     - Question marks are not valid file name parts on Windows. Ignore
       this error message.

=== modified file 'mysql-test/include/order_by.inc'
--- a/mysql-test/include/order_by.inc	2010-12-17 09:41:21 +0000
+++ b/mysql-test/include/order_by.inc	2011-02-02 13:41:10 +0000
@@ -843,7 +843,8 @@ create table t1(a int, b tinytext);
 insert into t1 values (1,2),(3,2);
 set session sort_buffer_size= 30000;
 set session max_sort_length= 2180;
---error 1038
+CALL mtr.add_suppression("Out of sort memory");
+--error ER_OUT_OF_SORTMEMORY
 select * from t1 order by b;
 drop table t1;
 

=== modified file 'mysql-test/r/filesort_debug.result'
--- a/mysql-test/r/filesort_debug.result	2011-01-10 13:23:11 +0000
+++ b/mysql-test/r/filesort_debug.result	2011-02-02 13:41:10 +0000
@@ -1,3 +1,4 @@
+SET @old_debug= @@session.debug;
 #
 # Bug#59331 filesort with priority queue: handling of out-of-memory
 #
@@ -8,4 +9,20 @@ INSERT INTO t1(f1, f2) VALUES 
 set debug= '+d,bounded_queue_init_fail';
 SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 1;
 ERROR HY000: Out of memory (Needed NN bytes)
+SET session debug= @old_debug;
 DROP TABLE t1;
+#
+# Bug#36022 please log more information about "Sort aborted" queries
+#
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+SET session debug= '+d,make_char_array_fail';
+CALL mtr.add_suppression("Out of sort memory");
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
+SET session debug= @old_debug;
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
+ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
+DROP TABLE t1;
+DROP FUNCTION f1;

=== modified file 'mysql-test/r/order_by_all.result'
--- a/mysql-test/r/order_by_all.result	2010-12-20 14:21:44 +0000
+++ b/mysql-test/r/order_by_all.result	2011-02-02 13:41:10 +0000
@@ -1426,8 +1426,9 @@ set session sort_buffer_size= 30000;
 Warnings:
 Warning	1292	Truncated incorrect sort_buffer_size value: '30000'
 set session max_sort_length= 2180;
+CALL mtr.add_suppression("Out of sort memory");
 select * from t1 order by b;
-ERROR HY001: Out of sort memory; increase server sort buffer size
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
 drop table t1;
 #
 # Bug #39844: Query Crash Mysql Server 5.0.67

=== modified file 'mysql-test/r/order_by_icp_mrr.result'
--- a/mysql-test/r/order_by_icp_mrr.result	2010-12-17 09:41:21 +0000
+++ b/mysql-test/r/order_by_icp_mrr.result	2011-02-02 13:41:10 +0000
@@ -1426,8 +1426,9 @@ set session sort_buffer_size= 30000;
 Warnings:
 Warning	1292	Truncated incorrect sort_buffer_size value: '30000'
 set session max_sort_length= 2180;
+CALL mtr.add_suppression("Out of sort memory");
 select * from t1 order by b;
-ERROR HY001: Out of sort memory; increase server sort buffer size
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
 drop table t1;
 #
 # Bug #39844: Query Crash Mysql Server 5.0.67

=== modified file 'mysql-test/r/order_by_none.result'
--- a/mysql-test/r/order_by_none.result	2010-12-17 09:41:21 +0000
+++ b/mysql-test/r/order_by_none.result	2011-02-02 13:41:10 +0000
@@ -1425,8 +1425,9 @@ set session sort_buffer_size= 30000;
 Warnings:
 Warning	1292	Truncated incorrect sort_buffer_size value: '30000'
 set session max_sort_length= 2180;
+CALL mtr.add_suppression("Out of sort memory");
 select * from t1 order by b;
-ERROR HY001: Out of sort memory; increase server sort buffer size
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
 drop table t1;
 #
 # Bug #39844: Query Crash Mysql Server 5.0.67

=== modified file 'mysql-test/t/filesort_debug.test'
--- a/mysql-test/t/filesort_debug.test	2011-01-10 13:23:11 +0000
+++ b/mysql-test/t/filesort_debug.test	2011-02-02 13:41:10 +0000
@@ -1,5 +1,7 @@
 --source include/have_debug.inc
 
+SET @old_debug= @@session.debug;
+
 --echo #
 --echo # Bug#59331 filesort with priority queue: handling of out-of-memory
 --echo #
@@ -13,5 +15,26 @@ set debug= '+d,bounded_queue_init_fail';
 --replace_regex /Needed [0-9]* bytes/Needed NN bytes/
 --error 5
 SELECT * FROM t1 ORDER BY f1 ASC, f0 LIMIT 1;
+SET session debug= @old_debug;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#36022 please log more information about "Sort aborted" queries
+--echo #
+
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+
+SET session debug= '+d,make_char_array_fail';
+CALL mtr.add_suppression("Out of sort memory");
+--error ER_OUT_OF_SORTMEMORY
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+SET session debug= @old_debug;
+
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+--error ER_SP_WRONG_NO_OF_ARGS
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
 
 DROP TABLE t1;
+DROP FUNCTION f1;

=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2011-01-11 09:09:21 +0000
+++ b/sql/filesort.cc	2011-02-02 13:41:10 +0000
@@ -356,8 +356,24 @@ ha_rows filesort(THD *thd, TABLE *table,
     }
   }
   if (error)
-    my_message(ER_FILSORT_ABORT, ER(ER_FILSORT_ABORT),
-               MYF(ME_ERROR+ME_WAITTANG));
+  {
+    DBUG_ASSERT(thd->is_error());
+    my_printf_error(ER_FILSORT_ABORT,
+                    "%s: %s",
+                    MYF(ME_ERROR + ME_WAITTANG),
+                    ER_THD(thd, ER_FILSORT_ABORT),
+                    thd->stmt_da->message());
+                    
+    if (global_system_variables.log_warnings > 1)
+    {
+      sql_print_warning("%s, host: %s, user: %s, thread: %lu, query: %-.4096s",
+                        ER_THD(thd, ER_FILSORT_ABORT),
+                        thd->security_ctx->host_or_ip,
+                        &thd->security_ctx->priv_user[0],
+                        (ulong) thd->thread_id,
+                        thd->query());
+    }
+  }
   else
     statistic_add(thd->status_var.filesort_rows,
                   (ulong) num_rows, &LOCK_status);
@@ -408,6 +424,9 @@ static void make_char_array(FILESORT_INF
 
   DBUG_PRINT("info", ("num_records %u length %u", num_records, length));
 
+  DBUG_EXECUTE_IF("make_char_array_fail",
+                  DBUG_SET("+d,simulate_out_of_memory"););
+
   if (!info->sort_keys)
     info->sort_keys= 
       (uchar**) my_malloc(num_records * (length + sizeof(uchar*)), MYF(0));

=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2010-12-21 12:23:49 +0000
+++ b/sql/protocol.cc	2011-02-02 13:41:10 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -543,9 +543,10 @@ bool Protocol::send_ok(uint server_statu
                        const char *message)
 {
   DBUG_ENTER("Protocol::send_ok");
-
-  DBUG_RETURN(net_send_ok(thd, server_status, statement_warn_count,
-                          affected_rows, last_insert_id, message));
+  const bool retval= 
+    net_send_ok(thd, server_status, statement_warn_count,
+                affected_rows, last_insert_id, message);
+  DBUG_RETURN(retval);
 }
 
 
@@ -558,8 +559,8 @@ bool Protocol::send_ok(uint server_statu
 bool Protocol::send_eof(uint server_status, uint statement_warn_count)
 {
   DBUG_ENTER("Protocol::send_eof");
-
-  DBUG_RETURN(net_send_eof(thd, server_status, statement_warn_count));
+  const bool retval= net_send_eof(thd, server_status, statement_warn_count);
+  DBUG_RETURN(retval);
 }
 
 
@@ -573,8 +574,8 @@ bool Protocol::send_error(uint sql_errno
                           const char *sql_state)
 {
   DBUG_ENTER("Protocol::send_error");
-
-  DBUG_RETURN(net_send_error_packet(thd, sql_errno, err_msg, sql_state));
+  const bool retval= net_send_error_packet(thd, sql_errno, err_msg, sql_state);
+  DBUG_RETURN(retval);
 }
 
 

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2010-12-05 22:51:49 +0000
+++ b/sql/share/errmsg-utf8.txt	2011-02-02 13:41:10 +0000
@@ -897,7 +897,7 @@ ER_OUT_OF_SORTMEMORY HY001 S1001
         cze "M-Bálo paměti pro třídění. Zvyšte velikost třídícího bufferu"
         dan "Ikke mere sorteringshukommelse. Øg sorteringshukommelse (sort buffer size) for serveren"
         nla "Geen geheugen om te sorteren. Verhoog de server sort buffer size"
-        eng "Out of sort memory; increase server sort buffer size"
+        eng "Out of sort memory, consider increasing server sort buffer size"
         jps "Out of sort memory. sort buffer size が足りないようです.",
         est "Mälu sai sorteerimisel otsa. Suurenda MySQL-i sorteerimispuhvrit"
         fre "Manque de mémoire pour le tri. Augmentez-la."
@@ -907,10 +907,10 @@ ER_OUT_OF_SORTMEMORY HY001 S1001
         ita "Memoria per gli ordinamenti esaurita. Incrementare il 'sort_buffer' al demone"
         jpn "Out of sort memory. sort buffer size が足りないよuffer의 크기를 증가시키세요"
-        nor "Ikke mer sorteringsminne. Øk sorteringsminnet (sort buffer size) for tjenesten"
-        norwegian-ny "Ikkje meir sorteringsminne. Auk sorteringsminnet (sorteringsbffer storleik) for tenesten"
+        nor "Ikke mer sorteringsminne. Vurder å øke sorteringsminnet (sort buffer size) for tjenesten"
+        norwegian-ny "Ikkje meir sorteringsminne. Vurder å auke sorteringsminnet (sorteringsbuffer storleik) for tenesten"
         pol "Zbyt mało pamięci dla sortowania. Zwiększ wielko?ć bufora demona dla sortowania"
-        por "Sem memória para ordenação. Aumente tamanho do 'buffer' de ordenação"
+        por "Não há memória suficiente para ordenação. Considere aumentar o tamanho do retentor (buffer) de ordenação."
         rum "Out of memory pentru sortare. Largeste marimea buffer-ului pentru sortare in daemon (sort buffer size)"
         rus "Недостаточно памяти дл      serbian "Nema memorije za sortiranje. Povećajte veličinu sort buffer-a MySQL server-u"

=== modified file 'sql/unireg.h'
--- a/sql/unireg.h	2010-07-16 21:00:50 +0000
+++ b/sql/unireg.h	2011-02-02 13:41:10 +0000
@@ -1,7 +1,7 @@
 #ifndef UNIREG_INCLUDED
 #define UNIREG_INCLUDED
 
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -56,8 +56,6 @@ typedef struct st_ha_create_information 
 #define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, X) : ER_DEFAULT(X))
 
 
-#define ERRMAPP 1				/* Errormap f|r my_error */
-
 #define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH)
 #define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
 #define MYF_RW MYF(MY_WME+MY_NABP)		/* Vid my_read & my_write */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3592 to 3593) Bug#36022Tor Didriksen2 Feb