Below is the list of changes that have just been committed into a local
5.1 repository of emurphy. When emurphy 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.2211 06/06/23 17:27:54 elliot@stripped +5 -0
Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge
into mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
sql/ha_innodb.cc
1.281 06/06/23 17:27:51 elliot@stripped +14 -14
manual merge
mysql-test/t/lock_multi.test
1.19 06/06/23 17:27:51 elliot@stripped +30 -1
manual merge
mysql-test/r/lock_multi.result
1.21 06/06/23 17:27:51 elliot@stripped +6 -6
manual merge
sql/item_cmpfunc.cc
1.208 06/06/23 17:24:11 elliot@scared.(none) +0 -0
Auto merged
mysql-test/r/func_time.result
1.56 06/06/23 17:24:11 elliot@scared.(none) +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: elliot
# Host: scared.(none)
# Root: /home/emurphy/src/bk-clean/mysql-5.1/RESYNC
--- 1.207/sql/item_cmpfunc.cc 2006-06-18 19:56:42 -04:00
+++ 1.208/sql/item_cmpfunc.cc 2006-06-23 17:24:11 -04:00
@@ -80,9 +80,6 @@ static void agg_result_type(Item_result
NOTES
Aggregation rules:
- If all items are constants the type will be aggregated from all items.
- If there are some non-constant items then only types of non-constant
- items will be used for aggregation.
If there are DATE/TIME fields/functions in the list and no string
fields/functions in the list then:
The INT_RESULT type will be used for aggregation instead of original
@@ -169,34 +166,29 @@ static void agg_cmp_type(THD *thd, Item_
}
}
}
- /* Reset to 0 on first occurence of non-const item. 1 otherwise */
- bool is_const= items[0]->const_item();
/*
If the first item is a date/time function then its result should be
compared as int
*/
if (field)
- {
- /* Suppose we are comparing dates and some non-constant items are present. */
+ /* Suppose we are comparing dates */
type[0]= INT_RESULT;
- is_const= 0;
- }
else
type[0]= items[0]->result_type();
for (i= 0; i < nitems ; i++)
{
- if (!items[i]->const_item())
- {
- Item_result result= field && items[i]->result_as_longlong() ?
- INT_RESULT : items[i]->result_type();
- type[0]= is_const ? result : item_cmp_type(type[0], result);
- is_const= 0;
- }
- else if (is_const)
- type[0]= item_cmp_type(type[0], items[i]->result_type());
- else if (field)
- convert_constant_item(thd, field, &items[i]);
+ Item_result result= items[i]->result_type();
+ /*
+ Use INT_RESULT as result type for DATE/TIME fields/functions and
+ for constants successfully converted to DATE/TIME
+ */
+ if (field &&
+ ((!items[i]->const_item() && items[i]->result_as_longlong()) ||
+ (items[i]->const_item() && convert_constant_item(thd, field,
+ &items[i]))))
+ result= INT_RESULT;
+ type[0]= item_cmp_type(type[0], result);
}
if (res == Item::FUNC_ITEM && field)
--- 1.55/mysql-test/r/func_time.result 2006-06-18 06:20:26 -04:00
+++ 1.56/mysql-test/r/func_time.result 2006-06-23 17:24:11 -04:00
@@ -785,8 +785,8 @@ select f1 from t1 where "2006-1-1" betwe
f1
Warnings:
Warning 1292 Incorrect date value: 'zzz' for column 'f1' at row 1
-Warning 1292 Truncated incorrect INTEGER value: 'zzz'
-Warning 1292 Truncated incorrect INTEGER value: 'zzz'
+Warning 1292 Truncated incorrect DOUBLE value: 'zzz'
+Warning 1292 Truncated incorrect DOUBLE value: 'zzz'
select f1 from t1 where makedate(2006,1) between date(f1) and date(f3);
f1
2006-01-01
--- 1.280/sql/ha_innodb.cc 2006-06-15 18:49:47 -04:00
+++ 1.281/sql/ha_innodb.cc 2006-06-23 17:27:51 -04:00
@@ -6910,17 +6910,28 @@ ha_innobase::store_lock(
stored function call (MySQL does have thd->in_lock_tables
TRUE there). */
- if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
- && lock_type <= TL_WRITE)
- && !(thd->in_lock_tables
- && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
- && !thd->tablespace_op
- && thd->lex->sql_command != SQLCOM_TRUNCATE
- && thd->lex->sql_command != SQLCOM_OPTIMIZE
- && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
+ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
+ && lock_type <= TL_WRITE)
+ && !(thd->in_lock_tables
+ && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
+ && !thd->tablespace_op
+ && thd->lex->sql_command != SQLCOM_TRUNCATE
+ && thd->lex->sql_command != SQLCOM_OPTIMIZE
+#ifdef __WIN__
+ /*
+ for alter table on win32 for succesfull operation
+ completion it is used TL_WRITE(=10) lock instead of
+ TL_WRITE_ALLOW_READ(=6), however here in innodb handler
+ TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes
+ race condition when several clients do alter table
+ simultaneously (bug #17264). This fix avoids the problem.
+ */
+ && thd->lex->sql_command != SQLCOM_ALTER_TABLE
+#endif
+ && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
- }
+ }
/* In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
MySQL would use the lock TL_READ_NO_INSERT on t2, and that
--- 1.20/mysql-test/r/lock_multi.result 2006-06-15 04:52:08 -04:00
+++ 1.21/mysql-test/r/lock_multi.result 2006-06-23 17:27:51 -04:00
@@ -74,3 +74,9 @@ ERROR HY000: Can't execute the query bec
UNLOCK TABLES;
DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
+create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
+lock tables t1 write;
+ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+unlock tables;
+drop table t1;
--- 1.18/mysql-test/t/lock_multi.test 2006-06-15 04:57:57 -04:00
+++ 1.19/mysql-test/t/lock_multi.test 2006-06-23 17:27:51 -04:00
@@ -191,4 +191,59 @@ disconnect con2;
--error ER_DB_DROP_EXISTS
DROP DATABASE mysqltest_1;
+#
+# Bug #17264: MySQL Server freeze
+#
+connection locker;
+create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
+lock tables t1 write;
+connection writer;
+--sleep 2
+delimiter //;
+send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+delimiter ;//
+connection reader;
+--sleep 2
+delimiter //;
+send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+delimiter ;//
+connection locker;
+--sleep 2
+unlock tables;
+connection writer;
+reap;
+connection reader;
+reap;
+connection locker;
+drop table t1;
+
# End of 5.0 tests
+# Bug#16986 - Deadlock condition with MyISAM tables
+#
+connection locker;
+use mysql;
+LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
+FLUSH TABLES;
+--sleep 1
+#
+connection reader;
+use mysql;
+#NOTE: This must be a multi-table select, otherwise the deadlock will not occur
+send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
+--sleep 1
+#
+connection locker;
+# Make test case independent from earlier grants.
+--replace_result "Table is already up to date" "OK"
+OPTIMIZE TABLES columns_priv, db, host, user;
+UNLOCK TABLES;
+#
+connection reader;
+reap;
+use test;
+#
+connection locker;
+use test;
+#
+connection default;
+
| Thread |
|---|
| • bk commit into 5.1 tree (elliot:1.2211) | Elliot Murphy | 23 Jun |