List:Commits« Previous MessageNext Message »
From:eugene Date:August 1 2006 4:49am
Subject:bk commit into 5.1 tree (evgen:1.2249)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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@stripped, 2006-08-01 08:49:43+04:00, evgen@stripped +13 -0
  After merge fix

  mysql-test/extra/rpl_tests/rpl_insert_id.test@stripped, 2006-08-01 08:49:38+04:00, evgen@stripped +21 -1
    After merge fix

  mysql-test/r/information_schema.result@stripped, 2006-08-01 08:09:31+04:00, evgen@stripped +14 -0
    After merge fix

  mysql-test/r/rpl_insert_id.result@stripped, 2006-08-01 08:09:30+04:00, evgen@stripped +1 -0
    After merge fix

  mysql-test/r/select.result@stripped, 2006-08-01 08:09:28+04:00, evgen@stripped +1 -1
    After merge fix

  mysql-test/r/union.result@stripped, 2006-08-01 08:09:25+04:00, evgen@stripped +7 -7
    After merge fix

  mysql-test/t/rpl_insert_id.test@stripped, 2006-08-01 08:09:18+04:00, evgen@stripped +0 -21
    After merge fix

  mysql-test/t/select.test@stripped, 2006-08-01 08:09:10+04:00, evgen@stripped +20 -19
    After merge fix

  sql/field.cc@stripped, 2006-08-01 08:09:40+04:00, evgen@stripped +2 -9
    After merge fix

  sql/field.h@stripped, 2006-08-01 08:09:38+04:00, evgen@stripped +3 -4
    After merge fix

  sql/item.cc@stripped, 2006-08-01 08:09:36+04:00, evgen@stripped +5 -4
    After merge fix

  sql/sql_class.cc@stripped, 2006-08-01 08:09:35+04:00, evgen@stripped +1 -0
    After merge fix

  sql/sql_insert.cc@stripped, 2006-08-01 08:48:41+04:00, evgen@stripped +5 -5
    After merge fix

  sql/sql_select.cc@stripped, 2006-08-01 08:09:33+04:00, evgen@stripped +4 -3
    After merge fix

# 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:	sunlight.local
# Root:	/local_work/tmp_merge-5.1-opt-mysql

--- 1.328/sql/field.cc	2006-08-01 08:49:49 +04:00
+++ 1.329/sql/field.cc	2006-08-01 08:49:49 +04:00
@@ -4587,19 +4587,12 @@
 
 Field_timestamp::Field_timestamp(bool maybe_null_arg,
                                  const char *field_name_arg,
-                                 struct st_table *table_arg, CHARSET_INFO *cs)
+                                 CHARSET_INFO *cs)
   :Field_str((char*) 0, 19, maybe_null_arg ? (uchar*) "": 0, 0,
-	     NONE, field_name_arg, table_arg, cs)
+	     NONE, field_name_arg, cs)
 {
   /* For 4.0 MYD and 4.0 InnoDB compatibility */
   flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
-  if (table && !table->timestamp_field &&
-      unireg_check != NONE)
-  {
-    /* This timestamp has auto-update */
-    table->timestamp_field= this;
-    flags|=TIMESTAMP_FLAG;
-  }
 }
 
 

--- 1.194/sql/field.h	2006-08-01 08:49:49 +04:00
+++ 1.195/sql/field.h	2006-08-01 08:49:49 +04:00
@@ -793,10 +793,9 @@
   Field_timestamp(char *ptr_arg, uint32 len_arg,
                   uchar *null_ptr_arg, uchar null_bit_arg,
 		  enum utype unireg_check_arg, const char *field_name_arg,
-		  struct st_table *table_arg,
 		  TABLE_SHARE *share, CHARSET_INFO *cs);
   Field_timestamp(bool maybe_null_arg, const char *field_name_arg,
-		 struct st_table *table_arg, CHARSET_INFO *cs);
+		  CHARSET_INFO *cs);
   enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
   enum Item_result cmp_type () const { return INT_RESULT; }
@@ -1148,9 +1147,9 @@
     flags|= BLOB_FLAG;
   }
   Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
-	     struct st_table *table_arg, CHARSET_INFO *cs, bool set_packlength)
+	     CHARSET_INFO *cs, bool set_packlength)
     :Field_longstr((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
-                   NONE, field_name_arg, table_arg, cs)
+                   NONE, field_name_arg, cs)
   {
     flags|= BLOB_FLAG;
     packlength= 4;

--- 1.202/sql/item.cc	2006-08-01 08:49:49 +04:00
+++ 1.203/sql/item.cc	2006-08-01 08:49:49 +04:00
@@ -4037,7 +4037,8 @@
     field= new Field_time(maybe_null, name, &my_charset_bin);
     break;
   case MYSQL_TYPE_TIMESTAMP:
-    return new Field_timestamp(maybe_null, name, table, &my_charset_bin);
+    field= new Field_timestamp(maybe_null, name, &my_charset_bin);
+    break;
   case MYSQL_TYPE_DATETIME:
     field= new Field_datetime(maybe_null, name, &my_charset_bin);
     break;
@@ -4072,10 +4073,10 @@
   case MYSQL_TYPE_BLOB:
   case MYSQL_TYPE_GEOMETRY:
     if (this->type() == Item::TYPE_HOLDER)
-      field= new Field_blob(max_length, maybe_null, name, table,
-                            collation.collation, 1);
+      field= new Field_blob(max_length, maybe_null, name, collation.collation,
+                            1);
     else
-      field= new Field_blob(max_length, maybe_null, name, table, collation.collation);
+      field= new Field_blob(max_length, maybe_null, name, collation.collation);
     break;					// Blob handled outside of case
   }
   if (field)

--- 1.279/sql/sql_class.cc	2006-08-01 08:49:49 +04:00
+++ 1.280/sql/sql_class.cc	2006-08-01 08:49:49 +04:00
@@ -639,6 +639,7 @@
     first_successful_insert_id_in_prev_stmt= 
       first_successful_insert_id_in_cur_stmt;
     first_successful_insert_id_in_cur_stmt= 0;
+    substitute_null_with_insert_id= TRUE;
   }
   arg_of_last_insert_id_function= 0;
   /* Free Items that were created during this execution */

--- 1.215/sql/sql_insert.cc	2006-08-01 08:49:49 +04:00
+++ 1.216/sql/sql_insert.cc	2006-08-01 08:49:49 +04:00
@@ -730,7 +730,7 @@
   uint used_fields_buff_size= bitmap_buffer_size(table->s->fields);
   uint32 *used_fields_buff= (uint32*)thd->alloc(used_fields_buff_size);
   MY_BITMAP used_fields;
-  bool save_set_query_id= thd->set_query_id;
+  enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
   DBUG_ENTER("check_key_in_view");
 
   if (!used_fields_buff)
@@ -746,20 +746,20 @@
     we must not set query_id for fields as they're not 
     really used in this context
   */
-  thd->set_query_id= 0;
+  thd->mark_used_columns= MARK_COLUMNS_NONE;
   /* check simplicity and prepare unique test of view */
   for (trans= trans_start; trans != trans_end; trans++)
   {
     if (!trans->item->fixed && trans->item->fix_fields(thd, &trans->item))
     {
-      thd->set_query_id= save_set_query_id;
+      thd->mark_used_columns= save_mark_used_columns;
       DBUG_RETURN(TRUE);
     }
     Item_field *field;
     /* simple SELECT list entry (field without expression) */
     if (!(field= trans->item->filed_for_view_update()))
     {
-      thd->set_query_id= save_set_query_id;
+      thd->mark_used_columns= save_mark_used_columns;
       DBUG_RETURN(TRUE);
     }
     if (field->field->unireg_check == Field::NEXT_NUMBER)
@@ -771,7 +771,7 @@
     */
     trans->item= field;
   }
-  thd->set_query_id= save_set_query_id;
+  thd->mark_used_columns= save_mark_used_columns;
   /* unique test */
   for (trans= trans_start; trans != trans_end; trans++)
   {

--- 1.426/sql/sql_select.cc	2006-08-01 08:49:49 +04:00
+++ 1.427/sql/sql_select.cc	2006-08-01 08:49:49 +04:00
@@ -1095,7 +1095,7 @@
       for (ORDER *tmp_order= order; tmp_order ; tmp_order=tmp_order->next)
       {
         Item *item= *tmp_order->item;
-        if (item->walk(&Item::is_expensive_processor,(byte*)0))
+        if (item->walk(&Item::is_expensive_processor, 0, (byte*)0))
         {
           /* Force tmp table without sort */
           need_tmp=1; simple_order=simple_group=0;
@@ -7963,7 +7963,8 @@
       Field *field=((Item_field*) args[0])->field;
       if (field->flags & AUTO_INCREMENT_FLAG && !field->table->maybe_null &&
 	  (thd->options & OPTION_AUTO_IS_NULL) &&
-	  (thd->first_successful_insert_id_in_prev_stmt > 0))
+	  (thd->first_successful_insert_id_in_prev_stmt > 0 &&
+           thd->substitute_null_with_insert_id))
       {
 #ifdef HAVE_QUERY_CACHE
 	query_cache_abort(&thd->net);
@@ -7986,7 +7987,7 @@
           IS NULL should be mapped to LAST_INSERT_ID only for first row, so
           clear for next row
         */
-	thd->first_successful_insert_id_in_prev_stmt= 0;
+        thd->substitute_null_with_insert_id= FALSE;
       }
       /* fix to replace 'NULL' dates with '0' (shreeve@stripped) */
       else if (((field->type() == FIELD_TYPE_DATE) ||

--- 1.86/mysql-test/r/union.result	2006-08-01 08:49:49 +04:00
+++ 1.87/mysql-test/r/union.result	2006-08-01 08:49:49 +04:00
@@ -1311,14 +1311,14 @@
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `f1` char(1) default NULL,
-  `f2` char(5) default NULL,
-  `f3` binary(1) default NULL,
-  `f4` binary(5) default NULL,
-  `f5` timestamp NOT NULL default '0000-00-00 00:00:00',
-  `f6` varchar(1) character set utf8 default NULL,
+  `f1` char(1) DEFAULT NULL,
+  `f2` char(5) DEFAULT NULL,
+  `f3` binary(1) DEFAULT NULL,
+  `f4` binary(5) DEFAULT NULL,
+  `f5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `f6` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
   `f7` text,
-  `f8` text character set utf8
+  `f8` text CHARACTER SET utf8
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1, t2;
 (select avg(1)) union (select avg(1)) union (select avg(1)) union

--- 1.131/mysql-test/r/information_schema.result	2006-08-01 08:49:49 +04:00
+++ 1.132/mysql-test/r/information_schema.result	2006-08-01 08:49:49 +04:00
@@ -1238,7 +1238,14 @@
 COLLATION_CHARACTER_SET_APPLICABILITY	COLLATION_NAME
 COLUMNS	TABLE_SCHEMA
 COLUMN_PRIVILEGES	TABLE_SCHEMA
+ENGINES	ENGINE
+EVENTS	EVENT_SCHEMA
+FILES	TABLE_SCHEMA
 KEY_COLUMN_USAGE	CONSTRAINT_SCHEMA
+PARTITIONS	TABLE_SCHEMA
+PLUGINS	PLUGIN_NAME
+PROCESSLIST	ID
+REFERENTIAL_CONSTRAINTS	CONSTRAINT_SCHEMA
 ROUTINES	ROUTINE_SCHEMA
 SCHEMATA	SCHEMA_NAME
 SCHEMA_PRIVILEGES	TABLE_SCHEMA
@@ -1269,7 +1276,14 @@
 COLLATION_CHARACTER_SET_APPLICABILITY	COLLATION_NAME
 COLUMNS	TABLE_SCHEMA
 COLUMN_PRIVILEGES	TABLE_SCHEMA
+ENGINES	ENGINE
+EVENTS	EVENT_SCHEMA
+FILES	TABLE_SCHEMA
 KEY_COLUMN_USAGE	CONSTRAINT_SCHEMA
+PARTITIONS	TABLE_SCHEMA
+PLUGINS	PLUGIN_NAME
+PROCESSLIST	ID
+REFERENTIAL_CONSTRAINTS	CONSTRAINT_SCHEMA
 ROUTINES	ROUTINE_SCHEMA
 SCHEMATA	SCHEMA_NAME
 SCHEMA_PRIVILEGES	TABLE_SCHEMA

--- 1.9/mysql-test/extra/rpl_tests/rpl_insert_id.test	2006-08-01 08:49:49 +04:00
+++ 1.10/mysql-test/extra/rpl_tests/rpl_insert_id.test	2006-08-01 08:49:49 +04:00
@@ -84,9 +84,28 @@
 --error 1022, 1062
 INSERT INTO t1 VALUES (1),(1);
 sync_slave_with_master;
+connection master;
+drop table t1;
+sync_slave_with_master;
 
 # End of 4.1 tests
-
+ 
+#
+# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
+#
+connection master;
+create table t1(a int auto_increment, key(a));
+create table t2(a int);
+insert into t1 (a) values (null);
+insert into t2 (a) select a from t1 where a is null;
+insert into t2 (a) select a from t1 where a is null;
+select * from t2;
+sync_slave_with_master;
+connection slave;
+select * from t2;
+connection master;
+drop table t1;
+drop table t2;
 
 #
 # BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
@@ -274,3 +293,4 @@
 drop function insid;
 
 sync_slave_with_master;
+

--- 1.134/mysql-test/r/select.result	2006-08-01 08:49:49 +04:00
+++ 1.135/mysql-test/r/select.result	2006-08-01 08:49:49 +04:00
@@ -3475,7 +3475,7 @@
 0.9998769417899202067879
 prepare stmt from 'select 1 as " a "';
 Warnings:
-Warning	1466	Leading spaces are removed from name ' a '
+Warning	1546	Leading spaces are removed from name ' a '
 execute stmt;
 a 
 1

--- 1.107/mysql-test/t/select.test	2006-08-01 08:49:49 +04:00
+++ 1.108/mysql-test/t/select.test	2006-08-01 08:49:49 +04:00
@@ -2286,25 +2286,6 @@
 DROP TABLE t1;
 
 #
-# Bug #18759 "Incorrect string to numeric conversion"
-#
-# This test is here so that the behavior will not be changed to 4.1
-# and not to 5.0 either. In 4.1 and 5.0 sending an integer as a string
-# will be converted internally to real (double) value and it is not
-# as accurate as bigint (longlong) for integers. Thus the results may
-# vary. In 5.1 internally it is decimal, which is a string type and
-# will be more accurate. Due to rather big changes needed to fix this
-# in 4.1 or 5.0 it is not desired to do it in the stable versions.
-#
-# This test is here only to make sure that behavior is not changed in
-# 4.1 and 5.0
-#
-CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
-INSERT INTO t1 VALUES (10);
-SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1;
-DROP TABLE t1;
-
-#
 # Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
 #
 CREATE TABLE t1 (a int, b int);
@@ -2319,6 +2300,7 @@
 EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
 SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
 DROP TABLE IF EXISTS t1,t2;
+
 #
 # Bug #20954 "avg(keyval) retuns 0.38 but max(keyval) returns an empty set"
 #
@@ -2348,6 +2330,25 @@
 
 DROP TABLE t1,t2;
 --enable_ps_protocol
+
+#
+# Bug #18759 "Incorrect string to numeric conversion"
+#
+# This test is here so that the behavior will not be changed to 4.1
+# and not to 5.0 either. In 4.1 and 5.0 sending an integer as a string
+# will be converted internally to real (double) value and it is not
+# as accurate as bigint (longlong) for integers. Thus the results may
+# vary. In 5.1 internally it is decimal, which is a string type and
+# will be more accurate. Due to rather big changes needed to fix this
+# in 4.1 or 5.0 it is not desired to do it in the stable versions.
+#
+# This test is here only to make sure that behavior is not changed in
+# 4.1 and 5.0
+#
+CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
+INSERT INTO t1 VALUES (10);
+SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1;
+DROP TABLE t1;
 
 # End of 4.1 tests
 

--- 1.19/mysql-test/r/rpl_insert_id.result	2006-08-01 08:49:49 +04:00
+++ 1.20/mysql-test/r/rpl_insert_id.result	2006-08-01 08:49:49 +04:00
@@ -73,6 +73,7 @@
 SET FOREIGN_KEY_CHECKS=0;
 INSERT INTO t1 VALUES (1),(1);
 Got one of the listed errors
+drop table t1;
 create table t1(a int auto_increment, key(a));
 create table t2(a int);
 insert into t1 (a) values (null);

--- 1.20/mysql-test/t/rpl_insert_id.test	2006-08-01 08:49:49 +04:00
+++ 1.21/mysql-test/t/rpl_insert_id.test	2006-08-01 08:49:49 +04:00
@@ -9,24 +9,3 @@
 -- source include/have_innodb.inc
 let $engine_type=innodb;
 -- source extra/rpl_tests/rpl_insert_id.test
-
-connection master;
-drop table t1;
-sync_slave_with_master;
- 
-#
-# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
-#
-connection master;
-create table t1(a int auto_increment, key(a));
-create table t2(a int);
-insert into t1 (a) values (null);
-insert into t2 (a) select a from t1 where a is null;
-insert into t2 (a) select a from t1 where a is null;
-select * from t2;
-sync_slave_with_master;
-connection slave;
-select * from t2;
-connection master;
-drop table t1;
-drop table t2;
Thread
bk commit into 5.1 tree (evgen:1.2249)eugene1 Aug