Below is the list of changes that have just been committed into a local
5.0 repository of mydev. When mydev 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.1913 05/08/30 12:35:37 ingo@stripped +4 -0
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-5000
sql/sql_delete.cc
1.160 05/08/30 12:35:32 ingo@stripped +1 -2
After merge fix.
sql/sql_parse.cc
1.479 05/08/30 12:25:03 ingo@stripped +0 -0
Auto merged
mysql-test/t/innodb.test
1.103 05/08/30 12:25:02 ingo@stripped +0 -0
Auto merged
mysql-test/r/innodb.result
1.130 05/08/30 12:25:02 ingo@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: ingo
# Host: chilla.local
# Root: /home/mydev/mysql-5.0-5000/RESYNC
--- 1.159/sql/sql_delete.cc 2005-08-30 11:39:17 +02:00
+++ 1.160/sql/sql_delete.cc 2005-08-30 12:35:32 +02:00
@@ -791,6 +791,8 @@
TABLE *table= *table_ptr;
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
db_type table_type= table->s->db_type;
+ if (!ha_supports_generate(table_type))
+ goto trunc_by_del;
strmov(path, table->s->path);
*table_ptr= table->next; // Unlink table from list
close_temporary(table,0);
@@ -809,7 +811,7 @@
(void) sprintf(path,"%s/%s/%s%s",mysql_data_home,table_list->db,
table_list->table_name,reg_ext);
- fn_format(path,path,"","",4);
+ fn_format(path, path, "", "", MY_UNPACK_FILENAME);
if (!dont_send_ok)
{
@@ -821,19 +823,7 @@
DBUG_RETURN(TRUE);
}
if (!ha_supports_generate(table_type) || thd->lex->sphead)
- {
- /* Probably InnoDB table */
- ulong save_options= thd->options;
- table_list->lock_type= TL_WRITE;
- thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
- ha_enable_transaction(thd, FALSE);
- mysql_init_select(thd->lex);
- error= mysql_delete(thd, table_list, (COND*) 0, (SQL_LIST*) 0,
- HA_POS_ERROR, LL(0), TRUE);
- ha_enable_transaction(thd, TRUE);
- thd->options= save_options;
- DBUG_RETURN(error);
- }
+ goto trunc_by_del;
if (lock_and_wait_for_table_name(thd, table_list))
DBUG_RETURN(TRUE);
}
@@ -866,5 +856,18 @@
unlock_table_name(thd, table_list);
VOID(pthread_mutex_unlock(&LOCK_open));
}
+ DBUG_RETURN(error);
+
+ trunc_by_del:
+ /* Probably InnoDB table */
+ ulong save_options= thd->options;
+ table_list->lock_type= TL_WRITE;
+ thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
+ ha_enable_transaction(thd, FALSE);
+ mysql_init_select(thd->lex);
+ error= mysql_delete(thd, table_list, (COND*) 0, (SQL_LIST*) 0,
+ HA_POS_ERROR, LL(0), TRUE);
+ ha_enable_transaction(thd, TRUE);
+ thd->options= save_options;
DBUG_RETURN(error);
}
--- 1.478/sql/sql_parse.cc 2005-08-29 18:41:33 +02:00
+++ 1.479/sql/sql_parse.cc 2005-08-30 12:25:03 +02:00
@@ -3338,7 +3338,8 @@
unit->set_limit(select_lex);
res = mysql_delete(thd, all_tables, select_lex->where,
&select_lex->order_list,
- unit->select_limit_cnt, select_lex->options);
+ unit->select_limit_cnt, select_lex->options,
+ FALSE);
break;
}
case SQLCOM_DELETE_MULTI:
--- 1.129/mysql-test/r/innodb.result 2005-08-24 08:25:27 +02:00
+++ 1.130/mysql-test/r/innodb.result 2005-08-30 12:25:02 +02:00
@@ -1703,6 +1703,22 @@
3 NULL
DROP TABLE t2;
DROP TABLE t1;
+create temporary table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+a
+42
+drop table t1;
+create table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+a
+42
+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;
@@ -1749,7 +1765,7 @@
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 31718
+Innodb_rows_inserted 31722
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
--- 1.102/mysql-test/t/innodb.test 2005-08-24 08:25:27 +02:00
+++ 1.103/mysql-test/t/innodb.test 2005-08-30 12:25:02 +02:00
@@ -1231,6 +1231,24 @@
DROP TABLE t2;
DROP TABLE t1;
+#
+# Bug#11816 - Truncate table doesn't work with temporary innodb tables
+# This is not an innodb bug, but we test it using innodb.
+#
+create temporary table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+drop table t1;
+# Show that it works with permanent tables too.
+create table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+drop table t1;
+
# End of 4.1 tests
#
| Thread |
|---|
| • bk commit into 5.0 tree (ingo:1.1913) | ingo | 30 Aug |