List:Internals« Previous MessageNext Message »
From:monty Date:June 6 2005 11:32pm
Subject:bk commit into 5.0 tree (monty:1.1925)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty 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.1925 05/06/07 00:31:53 monty@stripped +67 -0
  Merge with 4.1

  sql/sql_select.cc
    1.328 05/06/07 00:31:48 monty@stripped +5 -8
    merge

  sql/sql_parse.cc
    1.447 05/06/07 00:31:47 monty@stripped +11 -14
    merge
    Give better name to goto labels

  sql/opt_range.cc
    1.168 05/06/07 00:31:47 monty@stripped +0 -2
    merge

  sql/mysqld.cc
    1.463 05/06/07 00:31:47 monty@stripped +2 -2
    merge

  sql/item_func.cc
    1.213 05/06/07 00:31:47 monty@stripped +1 -7
    merge

  mysql-test/t/innodb.test
    1.91 05/06/07 00:31:47 monty@stripped +43 -44
    merge & ensure that 4.1 and 5.0 source have tests in same order

  mysql-test/t/func_gconcat.test
    1.28 05/06/07 00:31:47 monty@stripped +18 -8
    merge & ensure that 4.1 and 5.0 source have tests in same order

  mysql-test/r/innodb.result
    1.114 05/06/07 00:31:47 monty@stripped +28 -29
    merge & ensure that 4.1 and 5.0 source have tests in same order

  mysql-test/r/func_gconcat.result
    1.38 05/06/07 00:31:47 monty@stripped +24 -7
    merge & ensure that 4.1 and 5.0 source have tests in same order

  strings/ctype-win1250ch.c
    1.51 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/tztime.cc
    1.24 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/sql_yacc.yy
    1.389 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/examples/ha_tina.cc
    1.10 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/examples/ha_example.cc
    1.13 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/examples/ha_archive.cc
    1.41 05/06/06 21:21:28 monty@stripped +0 -0
    Auto merged

  sql/sql_udf.cc
    1.51 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_table.cc
    1.250 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_string.cc
    1.89 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_repl.cc
    1.139 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_olap.cc
    1.20 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_map.cc
    1.14 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_insert.cc
    1.159 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_handler.cc
    1.68 05/06/06 21:21:27 monty@stripped +0 -0
    Auto merged

  sql/sql_error.cc
    1.33 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/sql_class.cc
    1.183 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/sql_base.cc
    1.252 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/sql_analyse.cc
    1.61 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/sql_acl.cc
    1.156 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/set_var.cc
    1.117 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/protocol_cursor.cc
    1.15 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/protocol.cc
    1.106 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/procedure.cc
    1.11 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/opt_range.h
    1.56 05/06/06 21:21:26 monty@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.308 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/log_event.cc
    1.179 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/lock.cc
    1.68 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_uniq.cc
    1.10 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_timefunc.cc
    1.85 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_sum.cc
    1.149 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_subselect.cc
    1.107 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_strfunc.cc
    1.231 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_geofunc.cc
    1.25 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item_cmpfunc.cc
    1.153 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/item.cc
    1.133 05/06/06 21:21:25 monty@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.173 05/06/06 21:21:24 monty@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.184 05/06/06 21:21:24 monty@stripped +0 -0
    Auto merged

  sql/ha_myisammrg.cc
    1.68 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  sql/ha_myisam.cc
    1.152 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  sql/ha_innodb.cc
    1.217 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  sql/ha_heap.cc
    1.68 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  sql/ha_blackhole.cc
    1.11 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  sql/ha_berkeley.cc
    1.150 05/06/06 21:21:23 monty@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e
    1.25 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e
    1.40 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  sql/field.cc
    1.266 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  scripts/make_binary_distribution.sh
    1.89 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysys/raid.cc
    1.36 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/t/warnings.test
    1.21 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/t/create.test
    1.54 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/r/warnings.result
    1.32 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/r/olap.result
    1.24 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/r/create.result
    1.91 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  mysql-test/mysql-test-run.pl
    1.24 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  include/my_global.h
    1.91 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  configure.in
    1.319 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  client/sql_string.cc
    1.25 05/06/06 21:21:22 monty@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e
    1.15.4.3 05/06/06 21:21:22 monty@stripped +0 -0
    Merge rename: sql/ha_isammrg.cc ->
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e

  BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e
    1.29.4.3 05/06/06 21:21:22 monty@stripped +0 -0
    Merge rename: sql/ha_isam.cc -> BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e

  BitKeeper/etc/logging_ok
    1.321 05/06/06 21:20:47 monty@stripped +0 -0
    auto-union

# 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:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-5.0/RESYNC

--- 1.24/client/sql_string.cc	2005-06-02 08:49:56 +03:00
+++ 1.25/client/sql_string.cc	2005-06-06 21:21:22 +03:00
@@ -16,12 +16,11 @@
 
 /* This file is originally from the mysql distribution. Coded by monty */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
 
+#include <my_global.h>
 #include <my_sys.h>
 #include <m_string.h>
 #include <m_ctype.h>

--- 1.318/configure.in	2005-06-01 16:11:10 +03:00
+++ 1.319/configure.in	2005-06-06 21:21:22 +03:00
@@ -1765,12 +1765,23 @@
 then
   AC_MSG_ERROR("MySQL needs a off_t type.")
 fi
+
+# do we need #pragma interface/#pragma implementation ?
+# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
+AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
+# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
+# follow any standard), we'll use well-defined preprocessor macros:
+AC_TRY_CPP([
+#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) &&
defined(__GNUC__) && (__GNUC__ < 3)
+#error USE_PRAGMA_IMPLEMENTATION
+#endif
+],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS
-DUSE_PRAGMA_IMPLEMENTATION")
+
 # This always gives a warning. Ignore it unless you are cross compiling
 AC_C_BIGENDIAN
 #---START: Used in for client configure
 # Check base type of last arg to accept
 MYSQL_TYPE_ACCEPT
-
 #---END:
 # Figure out what type of struct rlimit to use with setrlimit
 MYSQL_TYPE_STRUCT_RLIMIT

--- 1.35/mysys/raid.cc	2005-06-02 08:49:56 +03:00
+++ 1.36/mysys/raid.cc	2005-06-06 21:21:22 +03:00
@@ -70,8 +70,6 @@
    tonu@stripped & monty@stripped
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION 
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.265/sql/field.cc	2005-06-06 09:30:12 +03:00
+++ 1.266/sql/field.cc	2005-06-06 21:21:22 +03:00
@@ -19,8 +19,6 @@
 ** This file implements classes defined in field.h
 *****************************************************************************/
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.149/sql/ha_berkeley.cc	2005-06-02 08:49:56 +03:00
+++ 1.150/sql/ha_berkeley.cc	2005-06-06 21:21:23 +03:00
@@ -47,13 +47,12 @@
 */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"
+
 #ifdef HAVE_BERKELEY_DB
 #include <m_ctype.h>
 #include <myisampack.h>

--- 1.67/sql/ha_heap.cc	2005-06-02 08:49:56 +03:00
+++ 1.68/sql/ha_heap.cc	2005-06-06 21:21:23 +03:00
@@ -15,8 +15,6 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.29.4.2/sql/ha_isam.cc	2005-06-05 20:38:39 +03:00
+++ 1.40/BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e	2005-06-06 21:21:22 +03:00
@@ -68,7 +68,7 @@
 
 int ha_isam::write_row(byte * buf)
 {
-  statistic_increment(ha_write_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
     table->timestamp_field->set_time();
   if (table->next_number_field && buf == table->record[0])
@@ -78,7 +78,7 @@
 
 int ha_isam::update_row(const byte * old_data, byte * new_data)
 {
-  statistic_increment(ha_update_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_update_count, &LOCK_status);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
     table->timestamp_field->set_time();
   return !nisam_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
@@ -86,14 +86,15 @@
 
 int ha_isam::delete_row(const byte * buf)
 {
-  statistic_increment(ha_delete_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
   return !nisam_delete(file,buf) ? 0 : my_errno ? my_errno : -1;
 }
 
 int ha_isam::index_read(byte * buf, const byte * key,
 			uint key_len, enum ha_rkey_function find_flag)
 {
-  statistic_increment(ha_read_key_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_key_count,
+		      &LOCK_status);
   int error=nisam_rkey(file, buf, active_index, key, key_len, find_flag);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
@@ -102,7 +103,8 @@
 int ha_isam::index_read_idx(byte * buf, uint index, const byte * key,
 			    uint key_len, enum ha_rkey_function find_flag)
 {
-  statistic_increment(ha_read_key_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_key_count,
+		      &LOCK_status);
   int error=nisam_rkey(file, buf, index, key, key_len, find_flag);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
@@ -110,7 +112,8 @@
 
 int ha_isam::index_read_last(byte * buf, const byte * key, uint key_len)
 {
-  statistic_increment(ha_read_key_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_key_count,
+		      &LOCK_status);
   int error=nisam_rkey(file, buf, active_index, key, key_len,
 		       HA_READ_PREFIX_LAST);
   table->status=error ? STATUS_NOT_FOUND: 0;
@@ -119,7 +122,8 @@
 
 int ha_isam::index_next(byte * buf)
 {
-  statistic_increment(ha_read_next_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_next_count,
+		      &LOCK_status);
   int error=nisam_rnext(file,buf,active_index);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -127,7 +131,8 @@
 
 int ha_isam::index_prev(byte * buf)
 {
-  statistic_increment(ha_read_prev_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_prev_count,
+		      &LOCK_status);
   int error=nisam_rprev(file,buf, active_index);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -135,7 +140,8 @@
 
 int ha_isam::index_first(byte * buf)
 {
-  statistic_increment(ha_read_first_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_first_count,
+		      &LOCK_status);
   int error=nisam_rfirst(file, buf, active_index);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -143,7 +149,8 @@
 
 int ha_isam::index_last(byte * buf)
 {
-  statistic_increment(ha_read_last_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_last_count,
+		      &LOCK_status);
   int error=nisam_rlast(file, buf, active_index);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -156,7 +163,8 @@
 
 int ha_isam::rnd_next(byte *buf)
 {
-  statistic_increment(ha_read_rnd_next_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
+		      &LOCK_status);
   int error=nisam_rrnd(file, buf, NI_POS_ERROR);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
@@ -164,8 +172,9 @@
 
 int ha_isam::rnd_pos(byte * buf, byte *pos)
 {
-  statistic_increment(ha_read_rnd_count,&LOCK_status);
-  int error=nisam_rrnd(file, buf, (ulong) ha_get_ptr(pos,ref_length));
+  statistic_increment(table->in_use->status_var.ha_read_rnd_count,
+		      &LOCK_status);
+  int error=nisam_rrnd(file, buf, (ulong) my_get_ptr(pos,ref_length));
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
 }
@@ -175,7 +184,7 @@
   my_off_t position=nisam_position(file);
   if (position == (my_off_t) ~ (ulong) 0)
     position=HA_OFFSET_ERROR;
-  ha_store_ptr(ref, ref_length, position);
+  my_store_ptr(ref, ref_length, position);
 }
 
 void ha_isam::info(uint flag)
@@ -220,7 +229,7 @@
   if (flag & HA_STATUS_ERRKEY)
   {
     errkey  = info.errkey;
-    ha_store_ptr(dupp_ref, ref_length, info.dupp_key_pos);
+    my_store_ptr(dupp_ref, ref_length, info.dupp_key_pos);
   }
   if (flag & HA_STATUS_TIME)
     update_time = info.update_time;
@@ -329,7 +338,7 @@
 	}
       }
     }
-    DBUG_PRINT("loop",("found: %lx  recpos: %d  minpos: %d  length: %d",
+    DBUG_PRINT("loop",("found: 0x%lx  recpos: %d  minpos: %d  length: %d",
 		       found,recpos,minpos,length));
     if (recpos != minpos)
     {						// Reserved space (Null bits?)

--- 1.15.4.2/sql/ha_isammrg.cc	2005-06-05 20:38:39 +03:00
+++ 1.25/BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e	2005-06-06 21:21:22 +03:00
@@ -77,7 +77,7 @@
 
 int ha_isammrg::update_row(const byte * old_data, byte * new_data)
 {
-  statistic_increment(ha_update_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_update_count, &LOCK_status);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
     table->timestamp_field->set_time();
   return !mrg_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
@@ -85,7 +85,7 @@
 
 int ha_isammrg::delete_row(const byte * buf)
 {
-  statistic_increment(ha_delete_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
   return !mrg_delete(file,buf) ? 0 : my_errno ? my_errno : -1;
 }
 
@@ -128,7 +128,8 @@
 
 int ha_isammrg::rnd_next(byte *buf)
 {
-  statistic_increment(ha_read_rnd_next_count,&LOCK_status);
+  statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
+		      &LOCK_status);
   int error=mrg_rrnd(file, buf, ~(mrg_off_t) 0);
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
@@ -136,8 +137,9 @@
 
 int ha_isammrg::rnd_pos(byte * buf, byte *pos)
 {
-  statistic_increment(ha_read_rnd_count,&LOCK_status);
-  int error=mrg_rrnd(file, buf, (ulong) ha_get_ptr(pos,ref_length));
+  statistic_increment(table->in_use->status_var.ha_read_rnd_count,
+		      &LOCK_status);
+  int error=mrg_rrnd(file, buf, (ulong) my_get_ptr(pos,ref_length));
   table->status=error ? STATUS_NOT_FOUND: 0;
   return !error ? 0 : my_errno ? my_errno : -1;
 }
@@ -145,7 +147,7 @@
 void ha_isammrg::position(const byte *record)
 {
   ulong position= mrg_position(file);
-  ha_store_ptr(ref, ref_length, (my_off_t) position);
+  my_store_ptr(ref, ref_length, (my_off_t) position);
 }
 
 

--- 1.151/sql/ha_myisam.cc	2005-06-02 08:49:56 +03:00
+++ 1.152/sql/ha_myisam.cc	2005-06-06 21:21:23 +03:00
@@ -15,8 +15,6 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.67/sql/ha_myisammrg.cc	2005-06-02 08:49:56 +03:00
+++ 1.68/sql/ha_myisammrg.cc	2005-06-06 21:21:23 +03:00
@@ -15,8 +15,6 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.172/sql/handler.cc	2005-06-02 08:49:57 +03:00
+++ 1.173/sql/handler.cc	2005-06-06 21:21:24 +03:00
@@ -17,8 +17,6 @@
 
 /* Handler-calling-functions */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.132/sql/item.cc	2005-06-05 17:08:41 +03:00
+++ 1.133/sql/item.cc	2005-06-06 21:21:25 +03:00
@@ -15,12 +15,9 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
-
 #include "mysql_priv.h"
 #include <m_ctype.h>
 #include "my_dir.h"

--- 1.152/sql/item_cmpfunc.cc	2005-06-02 17:33:19 +03:00
+++ 1.153/sql/item_cmpfunc.cc	2005-06-06 21:21:25 +03:00
@@ -17,8 +17,6 @@
 
 /* This file defines all compare functions */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.212/sql/item_func.cc	2005-06-06 19:43:05 +03:00
+++ 1.213/sql/item_func.cc	2005-06-07 00:31:47 +03:00
@@ -17,8 +17,6 @@
 
 /* This file defines all numerical functions */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
@@ -2373,7 +2371,7 @@
       return 0;
     for (uint i=1; i < arg_count ; i++)
     {
-      if (!args[i]->is_null() && val == args[i]->val_int())
+      if (val == args[i]->val_int() && !args[i]->null_value)
         return (longlong) (i);
     }
   }
@@ -2386,7 +2384,7 @@
     for (uint i=1; i < arg_count; i++)
     {
       dec_arg= args[i]->val_decimal(&dec_arg_buf);
-      if (!args[i]->is_null() && !my_decimal_cmp(dec_arg, dec))
+      if (!args[i]->null_value && !my_decimal_cmp(dec_arg, dec))
         return (longlong) (i);
     }
   }
@@ -2397,7 +2395,7 @@
       return 0;
     for (uint i=1; i < arg_count ; i++)
     {
-      if (!args[i]->is_null() && val == args[i]->val_real())
+      if (val == args[i]->val() && !args[i]->null_value)
         return (longlong) (i);
     }
   }

--- 1.230/sql/item_strfunc.cc	2005-06-06 14:49:16 +03:00
+++ 1.231/sql/item_strfunc.cc	2005-06-06 21:21:25 +03:00
@@ -20,8 +20,6 @@
 ** (This shouldn't be needed)
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.148/sql/item_sum.cc	2005-06-05 17:08:43 +03:00
+++ 1.149/sql/item_sum.cc	2005-06-06 21:21:25 +03:00
@@ -17,8 +17,6 @@
 
 /* Sum functions (COUNT, MIN...) */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.84/sql/item_timefunc.cc	2005-06-06 08:35:24 +03:00
+++ 1.85/sql/item_timefunc.cc	2005-06-06 21:21:25 +03:00
@@ -17,8 +17,6 @@
 
 /* This file defines all time functions */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.9/sql/item_uniq.cc	2005-06-02 08:49:57 +03:00
+++ 1.10/sql/item_uniq.cc	2005-06-06 21:21:25 +03:00
@@ -16,10 +16,8 @@
 
 /* Compability file */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation
+#pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"

--- 1.178/sql/log_event.cc	2005-06-02 08:49:57 +03:00
+++ 1.179/sql/log_event.cc	2005-06-06 21:21:25 +03:00
@@ -17,11 +17,10 @@
 
 #ifndef MYSQL_CLIENT
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
+
 #include  "mysql_priv.h"
 #include "slave.h"
 #include <my_dir.h>

--- 1.307/sql/mysql_priv.h	2005-06-06 16:54:54 +03:00
+++ 1.308/sql/mysql_priv.h	2005-06-06 21:21:25 +03:00
@@ -53,7 +53,7 @@
 
 /* useful constants */
 extern const key_map key_map_empty;
-extern const key_map key_map_full;
+extern key_map key_map_full;          /* Should be threaded as const */
 extern const char *primary_key_name;
 
 #include "mysql_com.h"

--- 1.462/sql/mysqld.cc	2005-06-02 07:56:26 +03:00
+++ 1.463/sql/mysqld.cc	2005-06-07 00:31:47 +03:00
@@ -381,6 +381,9 @@
      *opt_init_file, *opt_tc_log_file,
      def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
 
+const key_map key_map_empty(0);
+key_map key_map_full(0);                        // Will be initialized later
+
 const char *opt_date_time_formats[3];
 
 char *mysql_data_home= mysql_real_data_home;
@@ -5931,7 +5934,8 @@
   bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
   bzero((char *) &global_status_var, sizeof(global_status_var));
   opt_large_pages= 0;
-  
+  key_map_full.set_all();
+
   /* Character sets */
   system_charset_info= &my_charset_utf8_general_ci;
   files_charset_info= &my_charset_utf8_general_ci;

--- 1.105/sql/protocol.cc	2005-06-02 08:49:57 +03:00
+++ 1.106/sql/protocol.cc	2005-06-06 21:21:26 +03:00
@@ -19,8 +19,6 @@
   The actual communction is handled by the net_xxx functions in net_serv.cc
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.167/sql/opt_range.cc	2005-06-05 17:08:44 +03:00
+++ 1.168/sql/opt_range.cc	2005-06-07 00:31:47 +03:00
@@ -36,8 +36,6 @@
      QUICK_RANGEs are also created in this step.
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.55/sql/opt_range.h	2005-06-02 07:15:15 +03:00
+++ 1.56/sql/opt_range.h	2005-06-06 21:21:26 +03:00
@@ -691,10 +691,14 @@
   ~SQL_SELECT();
   void cleanup();
   bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
-  { return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0;
}
+  {
+    key_map tmp;
+    tmp.set_all();
+    return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 0;
+  }
   inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
   int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
-			ha_rows limit, bool force_quick_range=0);
+			ha_rows limit, bool force_quick_range);
 };
 
 

--- 1.10/sql/procedure.cc	2005-06-02 08:49:57 +03:00
+++ 1.11/sql/procedure.cc	2005-06-06 21:21:26 +03:00
@@ -17,8 +17,6 @@
 
 /* Procedures (functions with changes output of select) */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.60/sql/sql_analyse.cc	2005-06-02 08:49:57 +03:00
+++ 1.61/sql/sql_analyse.cc	2005-06-06 21:21:26 +03:00
@@ -23,8 +23,6 @@
 **	 - type set is out of optimization yet
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.251/sql/sql_base.cc	2005-06-05 17:08:44 +03:00
+++ 1.252/sql/sql_base.cc	2005-06-06 21:21:26 +03:00
@@ -2096,7 +2096,7 @@
   SYNOPSIS
     open_normal_and_derived_tables
     thd		- thread handler
-    tables	- list of tables for open&locking
+    tables	- list of tables for open
 
   RETURN
     FALSE - ok

--- 1.182/sql/sql_class.cc	2005-06-02 08:49:58 +03:00
+++ 1.183/sql/sql_class.cc	2005-06-06 21:21:26 +03:00
@@ -22,8 +22,6 @@
 **
 *****************************************************************************/
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.158/sql/sql_insert.cc	2005-06-06 20:41:49 +03:00
+++ 1.159/sql/sql_insert.cc	2005-06-06 21:21:27 +03:00
@@ -1094,7 +1094,7 @@
   volatile bool status,dead;
   COPY_INFO info;
   I_List<delayed_row> rows;
-  uint group_count;
+  ulong group_count;
   TABLE_LIST table_list;			// Argument
 
   delayed_insert()
@@ -1766,7 +1766,7 @@
 bool delayed_insert::handle_inserts(void)
 {
   int error;
-  uint max_rows;
+  ulong max_rows;
   bool using_ignore=0, using_bin_log=mysql_bin_log.is_open();
   delayed_row *row;
   DBUG_ENTER("handle_inserts");
@@ -1785,11 +1785,11 @@
   }
 
   thd.proc_info="insert";
-  max_rows=delayed_insert_limit;
+  max_rows= delayed_insert_limit;
   if (thd.killed || table->s->version != refresh_version)
   {
     thd.killed= THD::KILL_CONNECTION;
-    max_rows= ~(uint)0;				// Do as much as possible
+    max_rows= ~(ulong)0;                        // Do as much as possible
   }
 
   /*

--- 1.13/sql/sql_map.cc	2005-06-02 08:49:58 +03:00
+++ 1.14/sql/sql_map.cc	2005-06-06 21:21:27 +03:00
@@ -15,8 +15,6 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.446/sql/sql_parse.cc	2005-06-05 17:08:46 +03:00
+++ 1.447/sql/sql_parse.cc	2005-06-07 00:31:47 +03:00
@@ -2747,7 +2747,7 @@
     TABLE_LIST *select_tables= lex->query_tables;
 
     if ((res= create_table_precheck(thd, select_tables, create_table)))
-      goto unsent_create_error;
+      goto end_with_restore_list;
 
 #ifndef HAVE_READLINK
     lex->create_info.data_file_name=lex->create_info.index_file_name=0;
@@ -2757,7 +2757,7 @@
 			   create_table->table_name) ||
 	append_file_to_dir(thd, &lex->create_info.index_file_name,
 			   create_table->table_name))
-      goto unsent_create_error;
+      goto end_with_restore_list;
 #endif
     /*
       If we are using SET CHARSET without DEFAULT, add an implicit
@@ -2787,8 +2787,8 @@
     */
     if (wait_if_global_read_lock(thd, 0, 1))
     {
-      res= -1;
-      goto unsent_create_error;
+      res= 1;
+      goto end_with_restore_list;
     }
     if (select_lex->item_list.elements)		// With select
     {
@@ -2807,7 +2807,8 @@
             unique_table(create_table, select_tables))
         {
           my_error(ER_UPDATE_TABLE_USED, MYF(0), create_table->table_name);
-          goto unsent_create_error1;
+          res= 1;
+          goto end_with_restart_wait;
         }
         /* If we create merge table, we have to test tables in merge, too */
         if (lex->create_info.used_fields & HA_CREATE_USED_UNION)
@@ -2820,7 +2821,8 @@
             if (unique_table(tab, select_tables))
             {
               my_error(ER_UPDATE_TABLE_USED, MYF(0), tab->table_name);
-              goto unsent_create_error1;
+              res= 1;
+              goto end_with_restart_wait;
             }
           }
         }
@@ -2863,15 +2865,8 @@
       if (!res)
 	send_ok(thd);
     }
-    /*
-      Release the protection against the global read lock and wake
-      everyone, who might want to set a global read lock.
-    */
-    start_waiting_global_read_lock(thd);
-    lex->link_first_table_back(create_table, link_to_local);
-    break;
 
-unsent_create_error1:
+end_with_restart_wait:
     /*
       Release the protection against the global read lock and wake
       everyone, who might want to set a global read lock.
@@ -2879,9 +2874,9 @@
     start_waiting_global_read_lock(thd);
 
     /* put tables back for PS rexecuting */
-unsent_create_error:
+end_with_restore_list:
     lex->link_first_table_back(create_table, link_to_local);
-    goto error;
+    break;
   }
   case SQLCOM_CREATE_INDEX:
     DBUG_ASSERT(first_table == all_tables && first_table != 0);

--- 1.327/sql/sql_select.cc	2005-06-06 19:43:05 +03:00
+++ 1.328/sql/sql_select.cc	2005-06-07 00:31:48 +03:00
@@ -17,8 +17,6 @@
 
 /* mysql_select and join optimization */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
@@ -36,9 +34,6 @@
                               "index_merge"
 };
 
-const key_map key_map_empty(0);
-const key_map key_map_full(~(uint)0);
-
 static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
 static bool make_join_statistics(JOIN *join, TABLE_LIST *leaves, COND *conds,
 				 DYNAMIC_ARRAY *keyuse);
@@ -88,7 +83,7 @@
 static void update_depend_map(JOIN *join);
 static void update_depend_map(JOIN *join, ORDER *order);
 static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond,
-			   bool *simple_order);
+			   bool change_list, bool *simple_order);
 static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
 			    List<Item> &fields, bool send_row,
 			    uint select_options, const char *info,
@@ -749,7 +744,7 @@
   /* Optimize distinct away if possible */
   {
     ORDER *org_order= order;
-    order=remove_const(this, order,conds,&simple_order);
+    order=remove_const(this, order,conds,1, &simple_order);
     /*
       If we are using ORDER BY NULL or ORDER BY const_expression,
       return result in any order (even if we are using a GROUP BY)
@@ -817,8 +812,9 @@
       DBUG_RETURN(1);
   }
   simple_group= 0;
-  if (rollup.state == ROLLUP::STATE_NONE)
-    group_list= remove_const(this, group_list, conds, &simple_group);
+  group_list= remove_const(this, group_list, conds,
+                           rollup.state == ROLLUP::STATE_NONE,
+                           &simple_group);
   if (!group_list && group)
   {
     order=0;					// The output has only one row
@@ -830,7 +826,7 @@
   if (procedure && procedure->group)
   {
     group_list= procedure->group= remove_const(this, procedure->group, conds,
-					       &simple_group);
+					       1, &simple_group);
     calc_group_buffer(this, group_list);
   }
 
@@ -2088,8 +2084,8 @@
   {
     select->head=table;
     table->reginfo.impossible_range=0;
-    if ((error=select->test_quick_select(thd, *(key_map *)keys,(table_map) 0,
-					 limit)) == 1)
+    if ((error= select->test_quick_select(thd, *(key_map *)keys,(table_map) 0,
+                                          limit, 0)) == 1)
       DBUG_RETURN(select->quick->records);
     if (error == -1)
     {
@@ -5091,7 +5087,8 @@
   join_tab->select_cond=0;
   join_tab->quick=0;
   join_tab->type= JT_ALL;			/* Map through all records */
-  join_tab->keys.init(~(uint)0);                /* test everything in quick */
+  join_tab->keys.init();
+  join_tab->keys.set_all();                     /* test everything in quick */
   join_tab->info=0;
   join_tab->on_expr_ref=0;
   join_tab->last_inner= 0;
@@ -5540,7 +5537,7 @@
 				       (join->select_options &
 					OPTION_FOUND_ROWS ?
 					HA_POS_ERROR :
-					join->unit->select_limit_cnt)) < 0)
+					join->unit->select_limit_cnt), 0) < 0)
             {
 	      /*
 		Before reporting "Impossible WHERE" for the whole query
@@ -5553,7 +5550,7 @@
                                          (join->select_options &
                                           OPTION_FOUND_ROWS ?
                                           HA_POS_ERROR :
-                                          join->unit->select_limit_cnt)) < 0)
+                                          join->unit->select_limit_cnt),0) < 0)
 		DBUG_RETURN(1);			// Impossible WHERE
             }
             else
@@ -6122,20 +6119,39 @@
 
 
 /*
-  simple_order is set to 1 if sort_order only uses fields from head table
-  and the head table is not a LEFT JOIN table
+  Remove all constants and check if ORDER only contains simple expressions
+
+  SYNOPSIS
+   remove_const()
+   join			Join handler
+   first_order		List of SORT or GROUP order
+   cond			WHERE statement
+   change_list		Set to 1 if we should remove things from list
+			If this is not set, then only simple_order is
+                        calculated   
+   simple_order		Set to 1 if we are only using simple expressions
+
+  RETURN
+    Returns new sort order
+
+    simple_order is set to 1 if sort_order only uses fields from head table
+    and the head table is not a LEFT JOIN table
+
 */
 
 static ORDER *
-remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
+remove_const(JOIN *join,ORDER *first_order, COND *cond,
+             bool change_list, bool *simple_order)
 {
   if (join->tables == join->const_tables)
-    return 0;					// No need to sort
-  DBUG_ENTER("remove_const");
+    return change_list ? 0 : first_order;		// No need to sort
+
   ORDER *order,**prev_ptr;
   table_map first_table= join->join_tab[join->const_tables].table->map;
   table_map not_const_tables= ~join->const_table_map;
   table_map ref;
+  DBUG_ENTER("remove_const");
+
   prev_ptr= &first_order;
   *simple_order= *join->join_tab[join->const_tables].on_expr_ref ? 0 : 1;
 
@@ -6166,7 +6182,8 @@
 	}
 	if ((ref=order_tables & (not_const_tables ^ first_table)))
 	{
-	  if (!(order_tables & first_table) &&
only_eq_ref_tables(join,first_order,ref))
+	  if (!(order_tables & first_table) &&
+              only_eq_ref_tables(join,first_order, ref))
 	  {
 	    DBUG_PRINT("info",("removing: %s", order->item[0]->full_name()));
 	    continue;
@@ -6175,11 +6192,13 @@
 	}
       }
     }
-    *prev_ptr= order;				// use this entry
+    if (change_list)
+      *prev_ptr= order;				// use this entry
     prev_ptr= &order->next;
   }
-  *prev_ptr=0;
-  if (!first_order)				// Nothing to sort/group
+  if (change_list)
+    *prev_ptr=0;
+  if (prev_ptr == &first_order)			// Nothing to sort/group
     *simple_order=1;
   DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order));
   DBUG_RETURN(first_order);
@@ -9829,7 +9848,7 @@
   delete tab->select->quick;
   tab->select->quick=0;
   return tab->select->test_quick_select(tab->join->thd, tab->keys,
-					(table_map) 0, HA_POS_ERROR);
+					(table_map) 0, HA_POS_ERROR, 0);
 }
 
 
@@ -10865,12 +10884,15 @@
             parameres are set correctly by the range optimizer.
            */
           key_map new_ref_key_map;
-          new_ref_key_map.clear_all();  /* Force the creation of quick select */
-          new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key.      */
+          new_ref_key_map.clear_all();  // Force the creation of quick select
+          new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key.
 
           if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0,
-                                        (tab->join->select_options &
OPTION_FOUND_ROWS) ?
-                                        HA_POS_ERROR :
tab->join->unit->select_limit_cnt) <= 0)
+                                        (tab->join->select_options &
+                                         OPTION_FOUND_ROWS) ?
+                                        HA_POS_ERROR :
+                                        tab->join->unit->select_limit_cnt,0)
<=
+              0)
             DBUG_RETURN(0);
 	}
         ref_key= new_ref_key;
@@ -12528,6 +12550,8 @@
     for (uint i=0 ; i <= send_group_parts ;i++)
       sum_funcs_end[i]= func;
   }
+  else if (rollup.state == ROLLUP::STATE_READY)
+    DBUG_RETURN(FALSE);                         // Don't put end marker
   *func=0;					// End marker
   DBUG_RETURN(FALSE);
 }
@@ -13070,12 +13094,12 @@
 	      This is an element that is used by the GROUP BY and should be
 	      set to NULL in this level
 	    */
+            Item_null_result *null_item;
 	    item->maybe_null= 1;		// Value will be null sometimes
             null_item= rollup.null_items[i];
             DBUG_ASSERT(null_item->result_field == 0 ||
-                        null_item->result_field ==
-                        ((Item_field *) item)->result_field);
-            null_item->result_field= ((Item_field *) item)->result_field;
+                        null_item->result_field == item->get_tmp_table_field());
+            null_item->result_field= item->get_tmp_table_field();
             item= null_item;
 	    break;
 	  }

--- 1.88/sql/sql_string.cc	2005-06-02 08:49:58 +03:00
+++ 1.89/sql/sql_string.cc	2005-06-06 21:21:27 +03:00
@@ -16,12 +16,11 @@
 
 /* This file is originally from the mysql distribution. Coded by monty */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
 
+#include <my_global.h>
 #include <my_sys.h>
 #include <m_string.h>
 #include <m_ctype.h>

--- 1.249/sql/sql_table.cc	2005-06-02 02:13:05 +03:00
+++ 1.250/sql/sql_table.cc	2005-06-06 21:21:27 +03:00
@@ -346,7 +346,7 @@
   build_table_path(path, sizeof(path), db, table_name, reg_ext);
   if (my_delete(path,MYF(0)))
     error=1; /* purecov: inspected */
-  build_table_path(path, sizeof(path), db, table_name, "");
+  *fn_ext(path)= 0;                             // Remove reg_ext
   return ha_delete_table(current_thd, base, path, table_name, 0) || error;
 }
 
@@ -1556,7 +1556,7 @@
       /* Check if table exists */
   if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
   {
-    char tmp_table_name[NAME_LEN+1];
+    char tmp_table_name[tmp_file_prefix_length+22+22+22+3];
     my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x",
 		tmp_file_prefix, current_pid, thd->thread_id,
 		thd->tmp_table++);
@@ -2909,7 +2909,7 @@
         build_table_path(path, sizeof(path), table_list->db,
                          (lower_case_table_names == 2) ?
                          table_list->alias : table_list->table_name,
-                         reg_ext) != 0 ||
+                         reg_ext) == 0 ||
 	mysql_create_frm(thd, path, &create_info,
 			 fields, key_count, key_info_buffer, table->file))
       /* don't need to free((gptr) key_info_buffer);*/
@@ -3010,7 +3010,7 @@
         build_table_path(path, sizeof(path), table_list->db,
                          (lower_case_table_names == 2) ?
                          table_list->alias : table_list->table_name,
-                         reg_ext) != 0 ||
+                         reg_ext) == 0 ||
 	mysql_create_frm(thd, path, &create_info,
 			 fields, key_count, key_info_buffer, table->file))
       /*don't need to free((gptr) key_numbers);*/

--- 1.50/sql/sql_udf.cc	2005-06-02 08:49:58 +03:00
+++ 1.51/sql/sql_udf.cc	2005-06-06 21:21:27 +03:00
@@ -28,10 +28,8 @@
    dynamic functions, so this shouldn't be a real problem.
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation				// gcc: implement sql_udf.h
+#pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"

--- 1.23/mysql-test/r/olap.result	2005-05-31 15:55:45 +03:00
+++ 1.24/mysql-test/r/olap.result	2005-06-06 21:21:22 +03:00
@@ -88,7 +88,7 @@
 NULL	NULL	NULL	7785
 explain extended select product, country_id , year, sum(profit) from t1 group by product,
country_id, year with rollup;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	15	Using temporary; Using filesort
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	15	Using filesort
 Warnings:
 Note	1003	select `test`.`t1`.`product` AS `product`,`test`.`t1`.`country_id` AS
`country_id`,`test`.`t1`.`year` AS `year`,sum(`test`.`t1`.`profit`) AS `sum(profit)` from
`test`.`t1` group by `test`.`t1`.`product`,`test`.`t1`.`country_id`,`test`.`t1`.`year`
with rollup
 select product, country_id , sum(profit) from t1 group by product desc, country_id with
rollup;

--- 1.19/sql/sql_olap.cc	2005-06-02 08:49:58 +03:00
+++ 1.20/sql/sql_olap.cc	2005-06-06 21:21:27 +03:00
@@ -28,8 +28,6 @@
 
 #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.50/strings/ctype-win1250ch.c	2005-06-06 14:48:58 +03:00
+++ 1.51/strings/ctype-win1250ch.c	2005-06-06 21:21:28 +03:00
@@ -552,7 +552,7 @@
 240, 242, 242, 245, 245, 245, 245, 247, 248, 251, 251, 251, 251, 253, 254, 255,
 };
 
-#define min_sort_char '\x00'
+#define min_sort_char '\x20'
 #define max_sort_char '\xff'
 
 /*

--- 1.106/sql/item_subselect.cc	2005-06-05 17:08:42 +03:00
+++ 1.107/sql/item_subselect.cc	2005-06-06 21:21:25 +03:00
@@ -22,8 +22,6 @@
      (sql_select.h/sql_select.cc)
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.40/sql/examples/ha_archive.cc	2005-06-02 08:49:58 +03:00
+++ 1.41/sql/examples/ha_archive.cc	2005-06-06 21:21:28 +03:00
@@ -14,8 +14,6 @@
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation        // gcc: Class implementation
 #endif

--- 1.9/sql/examples/ha_tina.cc	2005-06-02 08:49:58 +03:00
+++ 1.10/sql/examples/ha_tina.cc	2005-06-06 21:21:28 +03:00
@@ -38,8 +38,6 @@
  -Brian
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation        // gcc: Class implementation
 #endif

--- 1.12/sql/examples/ha_example.cc	2005-06-02 08:49:58 +03:00
+++ 1.13/sql/examples/ha_example.cc	2005-06-06 21:21:28 +03:00
@@ -63,8 +63,6 @@
     -Brian
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation        // gcc: Class implementation
 #endif

--- 1.10/sql/ha_blackhole.cc	2005-06-02 08:49:56 +03:00
+++ 1.11/sql/ha_blackhole.cc	2005-06-06 21:21:23 +03:00
@@ -15,14 +15,11 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation        // gcc: Class implementation
+#pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"
-
 #ifdef HAVE_BLACKHOLE_DB
 #include "ha_blackhole.h"
 

--- 1.23/sql/tztime.cc	2005-06-02 08:49:58 +03:00
+++ 1.24/sql/tztime.cc	2005-06-06 21:21:28 +03:00
@@ -25,12 +25,11 @@
   it creates unsolved link dependencies on some platforms.
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
 
+#include <my_global.h>
 #if !defined(TZINFO2SQL) && !defined(TESTTIME)
 #include "mysql_priv.h"
 #else

--- 1.14/sql/protocol_cursor.cc	2005-06-02 08:49:57 +03:00
+++ 1.15/sql/protocol_cursor.cc	2005-06-06 21:21:26 +03:00
@@ -19,8 +19,6 @@
   The actual communction is handled by the net_xxx functions in net_serv.cc
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.23/mysql-test/mysql-test-run.pl	2005-05-15 21:52:58 +03:00
+++ 1.24/mysql-test/mysql-test-run.pl	2005-06-06 21:21:22 +03:00
@@ -398,7 +398,7 @@
     }
   }
 
-  exit(0);
+  mtr_exit(0);
 }
 
 ##############################################################################
@@ -568,7 +568,9 @@
     $opt_vardir= "$glob_mysql_test_dir/var";
   }
 
-  if ( $opt_vardir !~ m,^/, )
+  # We make the path absolute, as the server will do a chdir() before usage
+  unless ( $opt_vardir =~ m,^/, or
+           ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
   {
     # Make absolute path, relative test dir
     $opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
@@ -1292,9 +1294,9 @@
   mtr_report("Installing \u$type Databases");
 
   open(IN, $init_db_sql)
-    or error("Can't open $init_db_sql: $!");
+    or mtr_error("Can't open $init_db_sql: $!");
   open(OUT, ">", $init_db_sql_tmp)
-    or error("Can't write to $init_db_sql_tmp: $!");
+    or mtr_error("Can't write to $init_db_sql_tmp: $!");
   while (<IN>)
   {
     chomp;
@@ -1568,7 +1570,7 @@
     {
       stop_masters_slaves();
     }
-    exit(1);
+    mtr_exit(1);
   }
 
   # FIXME always terminate on failure?!
@@ -2267,5 +2269,5 @@
   with-openssl          
 
 HERE
-  exit(1);
+  mtr_exit(1);
 }

--- 1.183/sql/ha_ndbcluster.cc	2005-06-05 17:08:40 +03:00
+++ 1.184/sql/ha_ndbcluster.cc	2005-06-06 21:21:24 +03:00
@@ -20,10 +20,8 @@
   NDB Cluster
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation                          // gcc: Class implementation
+#pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"

--- 1.90/mysql-test/r/create.result	2005-06-01 11:52:57 +03:00
+++ 1.91/mysql-test/r/create.result	2005-06-06 21:21:22 +03:00
@@ -513,9 +513,9 @@
 select database();
 database()
 NULL
-select database();
-database()
-NULL
+select database(), user();
+database()	user()
+NULL	mysqltest_1@localhost
 use test;
 create table t1 (a int, index `primary` (a));
 ERROR 42000: Incorrect index name 'primary'
@@ -579,7 +579,6 @@
 b
 1
 drop table t1,t2;
-use test;
 create table t1 (a int);
 create table t1 select * from t1;
 ERROR HY000: You can't specify target table 't1' for update in FROM clause

--- 1.113/mysql-test/r/innodb.result	2005-06-06 20:41:49 +03:00
+++ 1.114/mysql-test/r/innodb.result	2005-06-07 00:31:47 +03:00
@@ -931,7 +931,6 @@
 1
 2
 truncate table t1;
-truncate table t1;
 insert into t1 values(1),(2);
 delete from t1;
 select * from t1;
@@ -1654,6 +1653,46 @@
 Variable_name	Value
 Binlog_cache_disk_use	1
 drop table t1;
+create table t1 (c char(10), index (c,c)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c'
+create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10)) engine=innodb;
+alter table t1 add key (c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c2,c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c2,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c1,c2);
+ERROR 42S21: Duplicate column name 'c1'
+drop table t1;
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+concat(a, b)
+11113333
+drop table t1;
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+ERROR HY000: The used table type doesn't support FULLTEXT indexes
+DROP TABLE t1;
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB
DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default
'0', PRIMARY KEY  (b_id), KEY  (b_a), 
+CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO
ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT
JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+a_id	b_list
+1	1,2,3
+2	4,5
+3	NULL
+DROP TABLE t2;
+DROP TABLE t1;
 create table t1 (x bigint unsigned not null primary key) engine=innodb;
 insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
 select * from t1;
@@ -1688,24 +1727,6 @@
 count(*)
 1
 drop table t1;
-create table t1 (c char(10), index (c,c)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c'
-create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10)) engine=innodb;
-alter table t1 add key (c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c2,c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c2,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c1,c2);
-ERROR 42S21: Duplicate column name 'c1'
-drop table t1;
 show status like "Innodb_buffer_pool_pages_total";
 Variable_name	Value
 Innodb_buffer_pool_pages_total	512
@@ -2391,16 +2412,6 @@
 set storage_engine=MyISAM;
 create table t1 (v varchar(16384)) engine=innodb;
 drop table t1;
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-concat(a, b)
-11113333
-drop table t1;
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-ERROR HY000: The used table type doesn't support FULLTEXT indexes
-DROP TABLE t1;
 create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
 insert into t1 values ('8', '6'), ('4', '7');
 select min(a) from t1;

--- 1.53/mysql-test/t/create.test	2005-06-01 11:52:58 +03:00
+++ 1.54/mysql-test/t/create.test	2005-06-06 21:21:22 +03:00
@@ -414,14 +414,17 @@
 select database();
 
 # Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*);
-select database();
+connect (user1,localhost,mysqltest_1,,*NO-ONE*);
+connection user1;
+select database(), user();
+connection default;
+disconnect user1;
+use test;
 
 #
 # Test for Bug 856 'Naming a key "Primary" causes trouble'
 #
 
-use test;
 --error 1280
 create table t1 (a int, index `primary` (a));
 --error 1280
@@ -478,8 +481,6 @@
 # This tests two additional possible errors and a hang if 
 # an improper fix is present.
 #
-connection default;
-use test;
 create table t1 (a int);
 --error 1093
 create table t1 select * from t1;
@@ -501,3 +502,4 @@
 create table t1(t1.name int);
 create table t2(test.t2.name int);
 drop table t1,t2;
+

--- 1.90/mysql-test/t/innodb.test	2005-06-06 20:41:49 +03:00
+++ 1.91/mysql-test/t/innodb.test	2005-06-07 00:31:47 +03:00
@@ -615,7 +615,6 @@
 insert into t1 values(1),(2);
 select * from t1;
 truncate table t1;
-truncate table t1;
 insert into t1 values(1),(2);
 delete from t1;
 select * from t1;
@@ -1056,8 +1055,8 @@
 insert t2 select * from t1;
 insert t3 select * from t1;
 checksum table t1, t2, t3, t4 quick;
-checksum table t1, t2, t3;
-checksum table t1, t2, t3 extended;
+checksum table t1, t2, t3, t4;
+checksum table t1, t2, t3, t4 extended;
 #show table status;
 drop table t1,t2,t3;
 
@@ -1177,28 +1176,6 @@
 drop table t1;
 
 #
-# range optimizer problem
-#
-
-create table t1 (x bigint unsigned not null primary key) engine=innodb;
-insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
-select * from t1;
-select count(*) from t1 where x>0;
-select count(*) from t1 where x=0;
-select count(*) from t1 where x<0;
-select count(*) from t1 where x < -16;
-select count(*) from t1 where x = -16;
-explain select count(*) from t1 where x > -16;
-
-# The following result should be (2). To be fixed when we add 'unsigned flag' to
-# Field::store(longlong)
-select count(*) from t1 where x > -16;
-select * from t1 where x > -16;
-select count(*) from t1 where x = 18446744073709551601;
-
-drop table t1;
-
-#
 # Bug #6126: Duplicate columns in keys gives misleading error message
 #
 --error 1060
@@ -1220,6 +1197,62 @@
 alter table t1 add key (c1,c1,c2);
 drop table t1;
 
+#
+# Bug #4082: integer truncation
+#
+
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+drop table t1;
+
+#
+# BUG#7709 test case - Boolean fulltext query against unsupported 
+#                      engines does not fail
+#
+
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+--error 1214;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+DROP TABLE t1;
+
+#
+# check null values #1
+#
+
+--disable_warnings
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB
DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default
'0', PRIMARY KEY  (b_id), KEY  (b_a), 
+                CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE
CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT
JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# range optimizer problem
+#
+
+create table t1 (x bigint unsigned not null primary key) engine=innodb;
+insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
+select * from t1;
+select count(*) from t1 where x>0;
+select count(*) from t1 where x=0;
+select count(*) from t1 where x<0;
+select count(*) from t1 where x < -16;
+select count(*) from t1 where x = -16;
+explain select count(*) from t1 where x > -16;
+
+# The following result should be (2). To be fixed when we add 'unsigned flag' to
+# Field::store(longlong)
+select count(*) from t1 where x > -16;
+select * from t1 where x > -16;
+select count(*) from t1 where x = 18446744073709551601;
+drop table t1;
+
+
 # Test for testable InnoDB status variables. This test
 # uses previous ones(pages_created, rows_deleted, ...).
 show status like "Innodb_buffer_pool_pages_total";
@@ -1300,25 +1333,6 @@
 # InnoDB specific varchar tests
 create table t1 (v varchar(16384)) engine=innodb;
 drop table t1;
-
-#
-# Bug #4082: integer truncation
-#
-
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-drop table t1;
-
-#
-# BUG#7709 test case - Boolean fulltext query against unsupported 
-#                      engines does not fail
-#
-
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
---error 1214;
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-DROP TABLE t1;
 
 #
 # BUG#11039 Wrong key length in min()

--- 1.20/mysql-test/t/warnings.test	2005-03-23 14:25:29 +02:00
+++ 1.21/mysql-test/t/warnings.test	2005-06-06 21:21:22 +03:00
@@ -129,3 +129,25 @@
 # Test for deprecated table_type variable
 #
 set table_type=MYISAM;
+
+#
+# Tests for show warnings limit a, b
+#
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# should generate 10 warnings
+update t1 set a='abc';
+show warnings limit 2, 1;
+show warnings limit 0, 10;
+show warnings limit 9, 1;
+show warnings limit 10, 1;
+show warnings limit 9, 2;
+show warnings limit 0, 0;
+show warnings limit 1;
+show warnings limit 0;
+show warnings limit 1, 0;
+# make sure behaviour is consistent with select ... limit
+select * from t1 limit 0;
+select * from t1 limit 1, 0;
+select * from t1 limit 0, 0;
+drop table t1;

--- 1.216/sql/ha_innodb.cc	2005-06-02 18:10:09 +03:00
+++ 1.217/sql/ha_innodb.cc	2005-06-06 21:21:23 +03:00
@@ -27,8 +27,6 @@
     in Windows?
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.90/include/my_global.h	2005-05-26 20:54:23 +03:00
+++ 1.91/include/my_global.h	2005-06-06 21:21:22 +03:00
@@ -43,16 +43,11 @@
 #define HAVE_ERRNO_AS_DEFINE
 #endif /* __CYGWIN__ */
 
-/* Determine when to use "#pragma interface" */
-#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) &&
defined(__GNUC__) && (__GNUC__ < 3)
+/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */
+#ifdef USE_PRAGMA_IMPLEMENTATION
 #define USE_PRAGMA_INTERFACE
 #endif
 
-/* Determine when to use "#pragma implementation" */
-#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
-#define USE_PRAGMA_IMPLEMENTATION
-#endif
-
 #if defined(i386) && !defined(__i386__)
 #define __i386__
 #endif
@@ -306,13 +301,6 @@
 #include <alloca.h>
 #endif
 #ifdef HAVE_ATOMIC_ADD
-#define __SMP__
-#ifdef HAVE_LINUX_CONFIG_H
-#include <linux/config.h>	/* May define CONFIG_SMP */
-#endif
-#ifndef CONFIG_SMP
-#define CONFIG_SMP
-#endif
 #if defined(__ia64__)
 #define new my_arg_new
 #define need_to_restore_new 1

--- 1.116/sql/set_var.cc	2005-06-02 15:13:34 +03:00
+++ 1.117/sql/set_var.cc	2005-06-06 21:21:26 +03:00
@@ -48,8 +48,6 @@
       new attribute.
 */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif

--- 1.24/sql/item_geofunc.cc	2005-06-02 08:49:57 +03:00
+++ 1.25/sql/item_geofunc.cc	2005-06-06 21:21:25 +03:00
@@ -17,14 +17,11 @@
 
 /* This file defines all spatial functions */
 
-#include <my_global.h>
-
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation				// gcc: Class implementation
 #endif
 
 #include "mysql_priv.h"
-
 #ifdef HAVE_SPATIAL
 #include <m_ctype.h>
 

--- 1.31/mysql-test/r/warnings.result	2005-04-06 05:45:08 +03:00
+++ 1.32/mysql-test/r/warnings.result	2005-06-06 21:21:22 +03:00
@@ -181,3 +181,56 @@
 set table_type=MYISAM;
 Warnings:
 Warning	1287	'table_type' is deprecated; use 'storage_engine' instead
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+update t1 set a='abc';
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+Warning	1265	Data truncated for column 'a' at row 2
+Warning	1265	Data truncated for column 'a' at row 3
+Warning	1265	Data truncated for column 'a' at row 4
+Warning	1265	Data truncated for column 'a' at row 5
+Warning	1265	Data truncated for column 'a' at row 6
+Warning	1265	Data truncated for column 'a' at row 7
+Warning	1265	Data truncated for column 'a' at row 8
+Warning	1265	Data truncated for column 'a' at row 9
+Warning	1265	Data truncated for column 'a' at row 10
+show warnings limit 2, 1;
+Level	Code	Message
+Warning	1265	Data truncated for column 'a' at row 3
+show warnings limit 0, 10;
+Level	Code	Message
+Warning	1265	Data truncated for column 'a' at row 1
+Warning	1265	Data truncated for column 'a' at row 2
+Warning	1265	Data truncated for column 'a' at row 3
+Warning	1265	Data truncated for column 'a' at row 4
+Warning	1265	Data truncated for column 'a' at row 5
+Warning	1265	Data truncated for column 'a' at row 6
+Warning	1265	Data truncated for column 'a' at row 7
+Warning	1265	Data truncated for column 'a' at row 8
+Warning	1265	Data truncated for column 'a' at row 9
+Warning	1265	Data truncated for column 'a' at row 10
+show warnings limit 9, 1;
+Level	Code	Message
+Warning	1265	Data truncated for column 'a' at row 10
+show warnings limit 10, 1;
+Level	Code	Message
+show warnings limit 9, 2;
+Level	Code	Message
+Warning	1265	Data truncated for column 'a' at row 10
+show warnings limit 0, 0;
+Level	Code	Message
+show warnings limit 1;
+Level	Code	Message
+Warning	1265	Data truncated for column 'a' at row 1
+show warnings limit 0;
+Level	Code	Message
+show warnings limit 1, 0;
+Level	Code	Message
+select * from t1 limit 0;
+a
+select * from t1 limit 1, 0;
+a
+select * from t1 limit 0, 0;
+a
+drop table t1;

--- 1.138/sql/sql_repl.cc	2005-06-02 07:15:16 +03:00
+++ 1.139/sql/sql_repl.cc	2005-06-06 21:21:27 +03:00
@@ -84,7 +84,7 @@
   char fname[FN_REFLEN+1];
   const char *errmsg = 0;
   int old_timeout;
-  uint packet_len;
+  unsigned long packet_len;
   char buf[IO_SIZE];				// It's safe to alloc this
   DBUG_ENTER("send_file");
 

--- 1.32/sql/sql_error.cc	2005-04-22 13:53:42 +03:00
+++ 1.33/sql/sql_error.cc	2005-06-06 21:21:26 +03:00
@@ -239,6 +239,8 @@
       offset--;
       continue;
     }
+    if (limit-- == 0)
+      break;
     protocol->prepare_for_resend();
     protocol->store(warning_level_names[err->level],
 		    warning_level_length[err->level], system_charset_info);
@@ -246,8 +248,6 @@
     protocol->store(err->msg, strlen(err->msg), system_charset_info);
     if (protocol->write())
       DBUG_RETURN(TRUE);
-    if (!--limit)
-      break;
   }
   send_eof(thd);
   DBUG_RETURN(FALSE);

--- 1.37/mysql-test/r/func_gconcat.result	2005-06-01 09:10:24 +03:00
+++ 1.38/mysql-test/r/func_gconcat.result	2005-06-07 00:31:47 +03:00
@@ -343,18 +343,6 @@
 First Row
 Second Row
 DROP TABLE t1;
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default
'0', PRIMARY KEY  (b_id), KEY  (b_a), 
-CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO
ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT
JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-a_id	b_list
-1	1,2,3
-2	4,5
-3	NULL
-DROP TABLE t2;
-DROP TABLE t1;
 CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
 INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
 CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
@@ -462,6 +450,49 @@
 gc
 NULL
 DROP TABLE t1;
+create table t2 (a int, b int);
+insert into t2 values (1,1), (2,2);
+select  b x, (select group_concat(x) from t2) from  t2;
+x	(select group_concat(x) from t2)
+1	1,1
+2	2,2
+drop table t2;
+create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
+insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
+select d,a,b from t1 order by a;
+d	a	b
+1	1	3
+2	1	4
+3	1	2
+5	1	1
+6	1	2
+4	2	7
+7	2	3
+8	2	3
+explain select a, group_concat(b) from t1 group by a with rollup;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	8	Using filesort
+select a, group_concat(b) from t1 group by a with rollup;
+a	group_concat(b)
+1	3,4,2,1,2
+2	7,3,3
+NULL	3,4,2,1,2,7,3,3
+select a, group_concat(distinct b) from t1 group by a with rollup;
+a	group_concat(distinct b)
+1	3,4,2,1
+2	7,3
+NULL	3,4,2,1,7
+select a, group_concat(b order by b) from t1 group by a with rollup;
+a	group_concat(b order by b)
+1	1,2,2,3,4
+2	3,3,7
+NULL	1,2,2,3,3,3,4,7
+select a, group_concat(distinct b order by b) from t1 group by a with rollup;
+a	group_concat(distinct b order by b)
+1	1,2,3,4
+2	3,7
+NULL	1,2,3,4,7
+drop table t1;
 create table t1 (a char(3), b char(20), primary key (a, b));
 insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
 select group_concat(a) from t1 group by b;
@@ -469,10 +500,3 @@
 ABW
 ABW
 drop table t1;
-create table r2 (a int, b int);
-insert into r2 values (1,1), (2,2);
-select  b x, (select group_concat(x) from r2) from  r2;
-x	(select group_concat(x) from r2)
-1	1,1
-2	2,2
-drop table r2;

--- 1.27/mysql-test/t/func_gconcat.test	2005-06-01 09:10:24 +03:00
+++ 1.28/mysql-test/t/func_gconcat.test	2005-06-07 00:31:47 +03:00
@@ -214,21 +214,6 @@
 DROP TABLE t1;
 
 #
-# check null values #1
-#
-
---disable_warnings
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default
'0', PRIMARY KEY  (b_id), KEY  (b_a), 
-                CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE
CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT
JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-DROP TABLE t2;
-DROP TABLE t1;
-
-#
 # check null values #2
 #
 
@@ -286,18 +271,31 @@
 DROP TABLE t1;
 
 #
+# Bug #8656: Crash with group_concat on alias in outer table
+#
+create table t2 (a int, b int);
+insert into t2 values (1,1), (2,2);
+select  b x, (select group_concat(x) from t2) from  t2;
+drop table t2;
+
+#
+# Bug #7405: problems with rollup
+#
+
+create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
+insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
+select d,a,b from t1 order by a;
+explain select a, group_concat(b) from t1 group by a with rollup;
+select a, group_concat(b) from t1 group by a with rollup;
+select a, group_concat(distinct b) from t1 group by a with rollup;
+select a, group_concat(b order by b) from t1 group by a with rollup;
+select a, group_concat(distinct b order by b) from t1 group by a with rollup;
+drop table t1;
+
+#
 # Bug #6475
 #
 create table t1 (a char(3), b char(20), primary key (a, b));
 insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
 select group_concat(a) from t1 group by b;
 drop table t1;
-
-#
-# Bug #8656: Crash with group_concat on alias in outer table
-#
-create table r2 (a int, b int);
-insert into r2 values (1,1), (2,2);
-select  b x, (select group_concat(x) from r2) from  r2;
-drop table r2;
-
Thread
bk commit into 5.0 tree (monty:1.1925)monty6 Jun