List:Internals« Previous MessageNext Message »
From:jani Date:September 12 2005 7:19pm
Subject:bk commit into 5.0 tree (jani:1.1967)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jani. When jani 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.1967 05/09/12 20:18:49 jani@stripped +12 -0
  Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
  into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0

  sql/sql_table.cc
    1.270 05/09/12 20:18:43 jani@stripped +2 -5
    Merged from 4.1 to 5.0

  sql/item_cmpfunc.cc
    1.178 05/09/12 20:18:43 jani@stripped +0 -3
    Merged from 4.1 to 5.0

  mysql-test/t/create.test
    1.63 05/09/12 20:18:43 jani@stripped +9 -10
    Merged from 4.1 to 5.0

  mysql-test/r/innodb.result
    1.132 05/09/12 20:18:43 jani@stripped +0 -0
    Merged from 4.1 to 5.0

  mysql-test/r/create.result
    1.100 05/09/12 20:18:43 jani@stripped +2 -5
    Merged from 4.1 to 5.0

  sql/sql_select.cc
    1.371 05/09/12 16:58:29 jani@stripped +0 -0
    Auto merged

  sql/filesort.cc
    1.104 05/09/12 16:58:29 jani@stripped +0 -0
    Auto merged

  mysql-test/t/innodb.test
    1.107 05/09/12 16:58:29 jani@stripped +0 -0
    Auto merged

  client/mysqltest.c
    1.159 05/09/12 16:58:28 jani@stripped +0 -0
    Auto merged

  sql/sql_db.cc
    1.116 05/09/12 16:58:29 jani@stripped +0 -0
    Auto merged

  mysql-test/r/warnings.result
    1.34 05/09/12 16:58:28 jani@stripped +0 -0
    Auto merged

  mysql-test/r/temp_table.result
    1.15 05/09/12 16:58:28 jani@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jani
# Host:	a193-229-222-105.elisa-laajakaista.fi
# Root:	/home/my/bk/mysql-5.0/RESYNC

--- 1.103/sql/filesort.cc	2005-06-21 19:13:36 +03:00
+++ 1.104/sql/filesort.cc	2005-09-12 16:58:29 +03:00
@@ -466,7 +466,7 @@
 	  my_store_ptr(ref_pos,ref_length,record); // Position to row
 	  record+= sort_form->s->db_record_offset;
 	}
-	else
+	else if (!error)
 	  file->position(sort_form->record[0]);
       }
       if (error && error != HA_ERR_RECORD_DELETED)

--- 1.177/sql/item_cmpfunc.cc	2005-09-09 19:16:56 +03:00
+++ 1.178/sql/item_cmpfunc.cc	2005-09-12 20:18:43 +03:00
@@ -1017,8 +1017,8 @@
     1   got error
 */
 
-bool
-Item_func_between::fix_fields(THD *thd, Item **ref)
+bool Item_func_between::fix_fields(THD *thd, struct st_table_list *tables,
+                                   Item **ref)
 {
   if (Item_func_opt_neg::fix_fields(thd, ref))
     return 1;
@@ -1028,8 +1028,9 @@
     return 0;
 
   /* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */
-  not_null_tables_cache= args[0]->not_null_tables() |
-    (args[1]->not_null_tables() & args[2]->not_null_tables());
+  not_null_tables_cache= (args[0]->not_null_tables() |
+                          (args[1]->not_null_tables() &
+                           args[2]->not_null_tables()));
 
   return 0;
 }
@@ -1330,8 +1331,8 @@
   if (Item_func::fix_fields(thd, ref))
     return 1;
 
-  not_null_tables_cache= (args[1]->not_null_tables()
-                        & args[2]->not_null_tables());
+  not_null_tables_cache= (args[1]->not_null_tables() &
+                          args[2]->not_null_tables());
 
   return 0;
 }

--- 1.115/sql/sql_db.cc	2005-08-26 14:28:00 +03:00
+++ 1.116/sql/sql_db.cc	2005-09-12 16:58:29 +03:00
@@ -437,7 +437,11 @@
       error= -1;
       goto exit;
     }
-    result= 0;
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+                        ER_DB_CREATE_EXISTS, ER(ER_DB_CREATE_EXISTS), db);
+    error= 0;
+    send_ok(thd);
+    goto exit;
   }
   else
   {

--- 1.370/sql/sql_select.cc	2005-09-10 14:32:03 +03:00
+++ 1.371/sql/sql_select.cc	2005-09-12 16:58:29 +03:00
@@ -13073,12 +13073,12 @@
   {
     Name_resolution_context *context= &thd->lex->current_select->context;
     Item **arg,**arg_end;
+    bool arg_changed= FALSE;
     for (arg= expr->arguments(),
          arg_end= expr->arguments()+expr->arg_count;
          arg != arg_end; arg++)
     {
       Item *item= *arg;
-      bool arg_changed= FALSE;
       if (item->type() == Item::FIELD_ITEM || item->type() == Item::REF_ITEM)
       {
         ORDER *group_tmp;
@@ -13100,11 +13100,11 @@
         if (change_group_ref(thd, (Item_func *) item, group_list, &arg_changed))
           return 1;
       }
-      if (arg_changed)
-      {
-        expr->maybe_null= 1;
-        *changed= TRUE;
-      }
+    }
+    if (arg_changed)
+    {
+      expr->maybe_null= 1;
+      *changed= TRUE;
     }
   }
   return 0;

--- 1.269/sql/sql_table.cc	2005-09-01 10:05:39 +03:00
+++ 1.270/sql/sql_table.cc	2005-09-12 20:18:43 +03:00
@@ -1562,6 +1562,9 @@
     if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
     {
       create_info->table_existed= 1;		// Mark that table existed
+      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+                          ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+                          alias);
       DBUG_RETURN(FALSE);
     }
     my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
@@ -1575,12 +1578,8 @@
     if (!access(path,F_OK))
     {
       if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
-      {
-	create_info->table_existed= 1;		// Mark that table existed
-	error= FALSE;
-      }
-      else
-	my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+        goto warn;
+      my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
       goto end;
     }
   }
@@ -1603,12 +1602,8 @@
       DBUG_PRINT("info", ("Table with same name already existed in handler"));
 
       if (create_if_not_exists)
-      {
-        create_info->table_existed= 1;   // Mark that table existed
-        error= FALSE;
-      }
-      else
-       my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+        goto warn;
+      my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
       goto end;
     }
   }
@@ -1641,6 +1636,14 @@
     mysql_bin_log.write(&qinfo);
   }
   error= FALSE;
+  goto end; 
+
+warn:
+  error= 0;
+  push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+                      ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+                      alias);
+  create_info->table_existed= 1;		// Mark that table existed
 
 end:
   VOID(pthread_mutex_unlock(&LOCK_open));

--- 1.99/mysql-test/r/create.result	2005-08-31 21:05:40 +03:00
+++ 1.100/mysql-test/r/create.result	2005-09-12 20:18:43 +03:00
@@ -9,6 +9,8 @@
 drop table if exists t1;
 create table t1 (b char(0) not null);
 create table if not exists t1 (b char(0) not null);
+Warnings:
+Note	1050	Table 't1' already exists
 insert into t1 values (""),(null);
 Warnings:
 Warning	1263	Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
@@ -244,9 +246,13 @@
 drop table t1;
 create table t1 select 1,2,3;
 create table if not exists t1 select 1,2;
+Warnings:
+Note	1050	Table 't1' already exists
 create table if not exists t1 select 1,2,3,4;
 ERROR 21S01: Column count doesn't match value count at row 1
 create table if not exists t1 select 1;
+Warnings:
+Note	1050	Table 't1' already exists
 select * from t1;
 1	2	3
 1	2	3
@@ -255,9 +261,13 @@
 drop table t1;
 create table t1 select 1,2,3;
 create table if not exists t1 select 1,2;
+Warnings:
+Note	1050	Table 't1' already exists
 create table if not exists t1 select 1,2,3,4;
 ERROR 21S01: Column count doesn't match value count at row 1
 create table if not exists t1 select 1;
+Warnings:
+Note	1050	Table 't1' already exists
 select * from t1;
 1	2	3
 1	2	3
@@ -269,6 +279,7 @@
 create table if not exists t1 select 2;
 Warnings:
 Warning	1364	Field 'a' doesn't have a default value
+Note	1050	Table 't1' already exists
 select * from t1;
 a	b
 1	1
@@ -276,6 +287,7 @@
 create table if not exists t1 select 3 as 'a',4 as 'b';
 Warnings:
 Warning	1364	Field 'a' doesn't have a default value
+Note	1050	Table 't1' already exists
 create table if not exists t1 select 3 as 'a',3 as 'b';
 ERROR 23000: Duplicate entry '3' for key 1
 select * from t1;
@@ -609,6 +621,19 @@
 ERROR 42000: Incorrect database name 'NULL'
 drop table if exists test.t1;
 create database mysqltest;
+create database if not exists mysqltest character set latin2;
+Warnings:
+Note	1007	Can't create database 'mysqltest'; database exists
+show create database mysqltest;
+Database	Create Database
+mysqltest	CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
+drop database mysqltest;
+use test;
+create table t1 (a int);
+create table if not exists t1 (a int);
+Warnings:
+Note	1050	Table 't1' already exists
+drop table t1;
 use mysqltest;
 create view v1 as select 'foo' from dual;
 create table t1 like v1;

--- 1.131/mysql-test/r/innodb.result	2005-09-06 16:08:02 +03:00
+++ 1.132/mysql-test/r/innodb.result	2005-09-12 20:18:43 +03:00
@@ -1719,6 +1719,17 @@
 a
 42
 drop table t1;
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int,
primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+a	b	c	d	e
+1	1	a	1	1
+2	2	b	2	2
+3	3	ab	3	3
+explain select * from t1 order by a,b,c,d;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using filesort
+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;

--- 1.14/mysql-test/r/temp_table.result	2005-05-07 15:00:58 +03:00
+++ 1.15/mysql-test/r/temp_table.result	2005-09-12 16:58:28 +03:00
@@ -23,6 +23,8 @@
 6	g
 create TEMPORARY TABLE t2 engine=heap select * from t1;
 create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
+Warnings:
+Note	1050	Table 't2' already exists
 CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
 ERROR 42S01: Table 't1' already exists
 ALTER TABLE t1 RENAME t2;

--- 1.62/mysql-test/t/create.test	2005-09-01 18:26:59 +03:00
+++ 1.63/mysql-test/t/create.test	2005-09-12 20:18:43 +03:00
@@ -533,4 +533,16 @@
 create table t1 like v1;
 drop view v1;
 drop database mysqltest;
+# Bug #6008 MySQL does not create warnings when
+# creating database and using IF NOT EXISTS
+#
+create database mysqltest;
+create database if not exists mysqltest character set latin2;
+show create database mysqltest;
+drop database mysqltest;
+use test;
+create table t1 (a int);
+create table if not exists t1 (a int);
+drop table t1;
+
 # End of 4.1 tests

--- 1.106/mysql-test/t/innodb.test	2005-09-06 16:08:02 +03:00
+++ 1.107/mysql-test/t/innodb.test	2005-09-12 16:58:29 +03:00
@@ -1249,6 +1249,16 @@
 select * from t1;
 drop table t1;
 
+#
+# Bug #13025  Server crash during filesort	
+#
+
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int,
primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+explain select * from t1 order by a,b,c,d;
+drop table t1;
+
 # End of 4.1 tests
 
 #

--- 1.158/client/mysqltest.c	2005-09-07 10:35:43 +03:00
+++ 1.159/client/mysqltest.c	2005-09-12 16:58:28 +03:00
@@ -2382,7 +2382,8 @@
     if (feof(cur_file->file))
     {
   found_eof:
-      if (cur_file->file != stdin){
+      if (cur_file->file != stdin)
+      {
 	my_fclose(cur_file->file, MYF(0));
         cur_file->file= 0;
       }

--- 1.33/mysql-test/r/warnings.result	2005-06-07 05:43:54 +03:00
+++ 1.34/mysql-test/r/warnings.result	2005-09-12 16:58:28 +03:00
@@ -63,9 +63,11 @@
 1
 create table t1(id int);
 create table if not exists t1(id int);
+Warnings:
+Note	1050	Table 't1' already exists
 select @@warning_count;
 @@warning_count
-0
+1
 drop table t1;
 create table t1(a tinyint, b int not null, c date, d char(5));
 load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated
by ',';
Thread
bk commit into 5.0 tree (jani:1.1967)jani12 Sep