List:Internals« Previous MessageNext Message »
From:eugene Date:November 1 2005 4:47pm
Subject:bk commit into 5.0 tree (evgen:1.1963)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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.1963 05/11/01 19:47:53 evgen@stripped +13 -0
  Manually merged

  sql/sql_update.cc
    1.178 05/11/01 19:47:51 evgen@stripped +1 -0
    Manually merged

  sql/sql_select.cc
    1.371 05/11/01 19:47:51 evgen@stripped +0 -0
    Manually merged

  sql/item_timefunc.cc
    1.98 05/11/01 19:47:51 evgen@stripped +0 -2
    Manually merged

  sql/item_func.cc
    1.267 05/11/01 19:47:51 evgen@stripped +1 -0
    Manually merged

  mysql-test/r/func_sapdb.result
    1.15 05/11/01 19:47:51 evgen@stripped +0 -2
    Manually merged

  BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003
    1.138 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  sql/sql_select.h
    1.102 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  sql/spatial.cc
    1.24 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  sql/item_timefunc.h
    1.62 05/11/01 19:40:49 evgen@stripped +0 -1
    Auto merged

  mysql-test/t/update.test
    1.26 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  mysql-test/r/update.result
    1.28 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  myisam/mi_check.c
    1.140 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  client/mysqltest.c
    1.176 05/11/01 19:40:49 evgen@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003
    1.123.15.2 05/11/01 19:40:49 evgen@stripped +0 -0
    Merge rename: acinclude.m4 -> BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/14186-bug-5.0-mysql/RESYNC

--- 1.123.15.1/acinclude.m4	2005-10-31 20:35:19 +03:00
+++ 1.138/BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003	2005-11-01 19:40:49 +03:00
@@ -1176,23 +1176,6 @@
 AC_SUBST(orbit_idl)
 ])
 
-AC_DEFUN([MYSQL_CHECK_ISAM], [
-  AC_ARG_WITH([isam], [
-  --with-isam             Enable the ISAM table type],
-    [with_isam="$withval"],
-    [with_isam=no])
-
-  isam_libs=
-  if test X"$with_isam" = X"yes"
-  then
-    AC_DEFINE([HAVE_ISAM], [1], [Using old ISAM tables])
-    isam_libs="\$(top_builddir)/isam/libnisam.a\
- \$(top_builddir)/merge/libmerge.a"
-  fi
-  AC_SUBST(isam_libs)
-])
-
-
 dnl ---------------------------------------------------------------------------
 dnl Macro: MYSQL_CHECK_BDB
 dnl Sets HAVE_BERKELEY_DB if inst library is found

--- 1.139/myisam/mi_check.c	2005-10-27 21:04:31 +04:00
+++ 1.140/myisam/mi_check.c	2005-11-01 19:40:49 +03:00
@@ -1848,7 +1848,7 @@
 	if (sort_one_index(param,info,keyinfo,next_page,new_file))
 	{
 	  DBUG_PRINT("error",
-		     ("From page: %ld, keyoffset: 0x%lx  used_length: %d",
+		     ("From page: %ld, keyoffset: %lu  used_length: %d",
 		      (ulong) pagepos, (ulong) (keypos - buff),
 		      (int) used_length));
 	  DBUG_DUMP("buff",(byte*) buff,used_length);

--- 1.266/sql/item_func.cc	2005-11-01 16:54:16 +03:00
+++ 1.267/sql/item_func.cc	2005-11-01 19:47:51 +03:00
@@ -1378,6 +1378,7 @@
 void Item_func_abs::fix_length_and_dec()
 {
   Item_func_num1::fix_length_and_dec();
+  maybe_null= 1;
 }
 
 

--- 1.97/sql/item_timefunc.cc	2005-10-28 03:35:59 +04:00
+++ 1.98/sql/item_timefunc.cc	2005-11-01 19:47:51 +03:00
@@ -2504,6 +2504,7 @@
   enum_field_types arg0_field_type;
   decimals=0;
   max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+  maybe_null= 1;
 
   /*
     The field type for the result of an Item_func_add_time function is defined

--- 1.370/sql/sql_select.cc	2005-11-01 16:54:16 +03:00
+++ 1.371/sql/sql_select.cc	2005-11-01 19:47:51 +03:00
@@ -102,8 +102,6 @@
                            List<TABLE_LIST> *join_list,
 			   Item::cond_result *cond_value);
 static bool resolve_nested_join (TABLE_LIST *table);
-static COND *remove_eq_conds(THD *thd, COND *cond, 
-			     Item::cond_result *cond_value);
 static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
 static bool open_tmp_table(TABLE *table);
 static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
@@ -7474,7 +7472,7 @@
   COND_FALSE always false	( 1 = 2 )
 */
 
-static COND *
+COND *
 remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
 {
   if (cond->type() == Item::COND_ITEM)

--- 1.101/sql/sql_select.h	2005-10-28 23:13:57 +04:00
+++ 1.102/sql/sql_select.h	2005-11-01 19:40:49 +03:00
@@ -524,3 +524,4 @@
 bool error_if_full_join(JOIN *join);
 int report_error(TABLE *table, int error);
 int safe_index_read(JOIN_TAB *tab);
+COND *remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value);

--- 1.177/sql/sql_update.cc	2005-10-28 22:31:07 +04:00
+++ 1.178/sql/sql_update.cc	2005-11-01 19:47:51 +03:00
@@ -132,7 +132,7 @@
   ha_rows	updated, found;
   key_map	old_used_keys;
   TABLE		*table;
-  SQL_SELECT	*select;
+  SQL_SELECT	*select= 0;
   READ_RECORD	info;
   SELECT_LEX    *select_lex= &thd->lex->select_lex;
   bool need_reopen;
@@ -228,11 +228,20 @@
     DBUG_RETURN(1);				/* purecov: inspected */
   }
 
+  if (conds)
+  {
+    Item::cond_result cond_value;
+    conds= remove_eq_conds(thd, conds, &cond_value);
+    if (cond_value == Item::COND_FALSE)
+      limit= 0;                                   // Impossible WHERE
+  }
   // Don't count on usage of 'only index' when calculating which key to use
   table->used_keys.clear_all();
   select= make_select(table, 0, 0, conds, 0, &error);
-  if (error ||
-      (select && select->check_quick(thd, safe_update, limit)) || !limit)
+  if (limit)
+    select=make_select(table,0,0,conds,&error);
+  if (error || !limit ||
+      (select && select->check_quick(thd, safe_update, limit)))
   {
     delete select;
     free_underlaid_joins(thd, select_lex);

--- 1.23/sql/spatial.cc	2005-10-31 12:42:28 +03:00
+++ 1.24/sql/spatial.cc	2005-11-01 19:40:49 +03:00
@@ -129,15 +129,14 @@
   Geometry *result;
   char byte_order;
 
-  if (data_len < SRID_SIZE + 1 + 4)
+  if (data_len < SRID_SIZE + WKB_HEADER_SIZE)   // < 4 + (1 + 4)
     return NULL;
   byte_order= data[SRID_SIZE];
   geom_type= uint4korr(data + SRID_SIZE + 1);
-  data+= SRID_SIZE + WKB_HEADER_SIZE;
   if (!(result= create_by_typeid(buffer, (int) geom_type)))
     return NULL;
-  result->m_data= data;
-  result->m_data_end= data + (data_len - (SRID_SIZE + WKB_HEADER_SIZE));
+  result->m_data= data+ SRID_SIZE + WKB_HEADER_SIZE;
+  result->m_data_end= data + data_len;
   return result;
 }
 
@@ -739,7 +738,7 @@
     wkb+= ls_len;
   }
 
-  return wkb - wkb_orig;
+  return (uint) (wkb - wkb_orig);
 }
 
 
@@ -1184,7 +1183,8 @@
     return 0;
   res->q_append(n_line_strings);
   
-  for (wkb+=4; n_line_strings; n_line_strings--)
+  wkb+= 4;
+  while (n_line_strings--)
   {
     Gis_line_string ls;
     int ls_len;
@@ -1199,10 +1199,11 @@
     if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
                                    (wkbByteOrder) wkb[0], res)))
       return 0;
-    wkb+= (ls_len + WKB_HEADER_SIZE);
-    len-= (ls_len + WKB_HEADER_SIZE);
+    ls_len+= WKB_HEADER_SIZE;;
+    wkb+= ls_len;
+    len-= ls_len;
   }
-  return wkb-wkb_orig;
+  return (uint) (wkb - wkb_orig);
 }
 
 
@@ -1436,7 +1437,8 @@
     return 0;
   res->q_append(n_poly);
   
-  for (wkb+=4; n_poly; n_poly--)
+  wkb+=4;
+  while (n_poly--)
   {
     Gis_polygon p;
     int p_len;
@@ -1450,10 +1452,11 @@
     if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
                                  (wkbByteOrder) wkb[0], res)))
       return 0;
-    wkb+= (p_len + WKB_HEADER_SIZE);
-    len-= (p_len + WKB_HEADER_SIZE);
+    p_len+= WKB_HEADER_SIZE;
+    wkb+= p_len;
+    len-= p_len;
   }
-  return wkb-wkb_orig;
+  return (uint) (wkb - wkb_orig);
 }
 
 
@@ -1733,7 +1736,8 @@
     return 0;
   res->q_append(n_geom);
   
-  for (wkb+=4; n_geom; n_geom--)
+  wkb+= 4;
+  while (n_geom--)
   {
     Geometry_buffer buffer;
     Geometry *geom;
@@ -1752,10 +1756,11 @@
         !(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len,
                                      (wkbByteOrder)  wkb[0], res)))
       return 0;
-    wkb+= (g_len + WKB_HEADER_SIZE);
-    len-= (g_len + WKB_HEADER_SIZE);
+    g_len+= WKB_HEADER_SIZE;
+    wkb+= g_len;
+    len-= g_len;
   }
-  return wkb-wkb_orig;
+  return (uint) (wkb - wkb_orig);
 }
 
 

--- 1.27/mysql-test/r/update.result	2005-10-27 21:04:32 +04:00
+++ 1.28/mysql-test/r/update.result	2005-11-01 19:40:49 +03:00
@@ -337,3 +337,11 @@
 22	3
 23	3
 drop table t1;
+create table t1 (f1 date not null);
+insert into t1 values('2000-01-01'),('0000-00-00');
+update t1 set f1='2002-02-02' where f1 is null;
+select * from t1;
+f1
+2000-01-01
+2002-02-02
+drop table t1;

--- 1.25/mysql-test/t/update.test	2005-10-27 21:04:32 +04:00
+++ 1.26/mysql-test/t/update.test	2005-11-01 19:40:49 +03:00
@@ -261,4 +261,13 @@
 select * from t1 order by a;
 
 drop table t1;
+
+#
+# Bug#14186 select datefield is null not updated
+#
+create table t1 (f1 date not null);
+insert into t1 values('2000-01-01'),('0000-00-00');
+update t1 set f1='2002-02-02' where f1 is null;
+select * from t1;
+drop table t1;
 # End of 4.1 tests

--- 1.175/client/mysqltest.c	2005-10-31 21:30:52 +03:00
+++ 1.176/client/mysqltest.c	2005-11-01 19:40:49 +03:00
@@ -3616,18 +3616,23 @@
         /* Read result from each column */
         for (col_idx= 0; col_idx < num_fields; col_idx++)
         {
-          /* FIXME is string terminated? */
-          const char *val= (const char *)bind[col_idx].buffer;
-          ulonglong len= *bind[col_idx].length;
+          const char *val;
+          ulonglong len;
           if (col_idx < max_replace_column && replace_column[col_idx])
           {
             val= replace_column[col_idx];
             len= strlen(val);
           }
-          if (*bind[col_idx].is_null)
+          else if (*bind[col_idx].is_null)
           {
             val= "NULL";
             len= 4;
+          }
+          else
+          {
+            /* FIXME is string terminated? */
+            val= (const char *) bind[col_idx].buffer;
+            len= *bind[col_idx].length;
           }
           if (!display_result_vertically)
           {
Thread
bk commit into 5.0 tree (evgen:1.1963)eugene1 Nov