Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps 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.1951 05/12/06 15:50:46 petr@stripped +5 -0
post-merge fixes
sql/table.cc
1.193 05/12/06 15:50:36 petr@stripped +20 -8
post-merge fixes
sql/log.cc
1.180 05/12/06 15:50:36 petr@stripped +48 -13
post-merge fixes: set thd->thread_stack to check for overrun in logging routines.
mysql-test/t/log_tables.test
1.4 05/12/06 15:50:36 petr@stripped +4 -4
post-merge fixes
mysql-test/t/csv.test
1.7 05/12/06 15:50:36 petr@stripped +0 -2
post-merge fixes
mysql-test/r/csv.result
1.6 05/12/06 15:50:36 petr@stripped +17 -17
psot-merge fixes
# 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: petr
# Host: owlet.
# Root: /home/cps/mysql/devel/mysql-5.1-logs-merge
--- 1.179/sql/log.cc 2005-12-05 22:54:16 +03:00
+++ 1.180/sql/log.cc 2005-12-06 15:50:36 +03:00
@@ -155,10 +155,22 @@
DBUG_RETURN(1);
}
- log_thd->store_globals();
+ /*
+ Set THD's thread_stack. This is needed to perform stack overrun
+ check, which is done by some routines (e.g. open_table()).
+ In the case we are called by thread, which already has this parameter
+ set, we use this value. Otherwise we do a wild guess. This won't help
+ to correctly track the stack overrun in these exceptional cases (which
+ could probably happen only during startup and shutdown) but at least
+ lets us to pass asserts.
+ The problem stems from the fact that logger THDs are not real threads.
+ */
+ if (curr)
+ log_thd->thread_stack= curr->thread_stack;
+ else
+ log_thd->thread_stack= (char*) &log_thd;
- log_thd->db= my_strdup("mysql", MYF(0));;
- log_thd->db_length= 5;
+ log_thd->store_globals();
tables->lock_type= TL_WRITE_CONCURRENT_INSERT;
tables->db= log_thd->db;
@@ -674,10 +686,20 @@
general_log_printer >= CSV)
{
if (!general_log_thd)
+ {
general_log_thd= new THD;
+ /* logger thread always works with mysql database */
+ general_log_thd->db= my_strdup("mysql", MYF(0));;
+ general_log_thd->db_length= 5;
+ }
if (!slow_log_thd)
+ {
slow_log_thd= new THD;
+ /* logger thread always works with mysql database */
+ slow_log_thd->db= my_strdup("mysql", MYF(0));;
+ slow_log_thd->db_length= 5;
+ }
if (!is_log_tables_initialized && general_log_thd && slow_log_thd
&&
!open_log_table(LOG_GENERAL) && !open_log_table(LOG_SLOW))
@@ -705,28 +727,41 @@
*/
void close_log_table(uint log_type, bool lock_in_use)
{
- THD *curr= current_thd;
+ THD *log_thd, *curr= current_thd;
+ TABLE_LIST *tables;
if (!logger.is_log_tables_initialized)
return; /* do nothing */
switch (log_type) {
case LOG_GENERAL:
- general_log_thd->store_globals();
- (general_log.table)->file->ha_rnd_end();
- /* discard logger mark before unlock*/
- general_log.table->locked_by_logger= FALSE;
- close_thread_tables(general_log_thd, lock_in_use);
+ log_thd= general_log_thd;
+ tables= &general_log;
break;
case LOG_SLOW:
- slow_log_thd->store_globals();
- (slow_log.table)->file->ha_rnd_end();
- slow_log.table->locked_by_logger= FALSE;
- close_thread_tables(slow_log_thd, lock_in_use);
+ log_thd= slow_log_thd;
+ tables= &slow_log;
break;
default:
DBUG_ASSERT(0);
}
+
+ /*
+ Set thread stack start for the logger thread. See comment in
+ open_log_table() for details.
+ */
+ if (curr)
+ log_thd->thread_stack= curr->thread_stack;
+ else
+ log_thd->thread_stack= (char*) &log_thd;
+
+ /* close the table */
+ log_thd->store_globals();
+ tables->table->file->ha_rnd_end();
+ /* discard logger mark before unlock*/
+ tables->table->locked_by_logger= FALSE;
+ close_thread_tables(log_thd, lock_in_use);
+
if (curr)
curr->store_globals();
else
--- 1.192/sql/table.cc 2005-12-01 00:43:49 +03:00
+++ 1.193/sql/table.cc 2005-12-06 15:50:36 +03:00
@@ -275,15 +275,27 @@
error= open_binary_frm(thd, share, head, file);
*root_ptr= old_root;
- /*
- We can't mark all tables in 'mysql' database as system since we don't
- allow to lock such tables for writing with any other tables (even with
- other system tables) and some privilege tables need this.
- */
if (share->db.length == 5 &&
- !my_strcasecmp(system_charset_info, share->db.str, "mysql") &&
- !my_strcasecmp(system_charset_info, share->table_name.str, "proc"))
- share->system_table= 1;
+ !my_strcasecmp(system_charset_info, share->db.str, "mysql"))
+ {
+ /*
+ We can't mark all tables in 'mysql' database as system since we don't
+ allow to lock such tables for writing with any other tables (even with
+ other system tables) and some privilege tables need this.
+ */
+ if (!my_strcasecmp(system_charset_info, share->table_name.str, "proc"))
+ share->system_table= 1;
+ else
+ {
+ if (!my_strcasecmp(system_charset_info, share->table_name.str,
+ "general_log"))
+ share->log_table= LOG_GENERAL;
+ else
+ if (!my_strcasecmp(system_charset_info, share->table_name.str,
+ "slow_log"))
+ share->log_table= LOG_SLOW;
+ }
+ }
error_given= 1;
}
--- 1.5/mysql-test/r/csv.result 2005-12-06 00:10:37 +03:00
+++ 1.6/mysql-test/r/csv.result 2005-12-06 15:50:36 +03:00
@@ -4929,23 +4929,6 @@
Note 1051 Unknown table 't2'
Note 1051 Unknown table 't3'
Note 1051 Unknown table 't4'
-CREATE TABLE test_concurrent_insert ( val integer ) ENGINE = CSV;
-LOCK TABLES test_concurrent_insert READ LOCAL;
-INSERT INTO test_concurrent_insert VALUES (1);
-SELECT * FROM test_concurrent_insert;
-val
-1
-SELECT * FROM test_concurrent_insert;
-val
-UNLOCK TABLES;
-LOCK TABLES test_concurrent_insert WRITE;
-INSERT INTO test_concurrent_insert VALUES (2);
-SELECT * FROM test_concurrent_insert;
-val
-1
-2
-UNLOCK TABLES;
-DROP TABLE test_concurrent_insert;
DROP TABLE IF EXISTS bug13894;
CREATE TABLE bug13894 ( val integer ) ENGINE = CSV;
INSERT INTO bug13894 VALUES (5);
@@ -4993,6 +4976,23 @@
4
5
DROP TABLE bug14672;
+CREATE TABLE test_concurrent_insert ( val integer ) ENGINE = CSV;
+LOCK TABLES test_concurrent_insert READ LOCAL;
+INSERT INTO test_concurrent_insert VALUES (1);
+SELECT * FROM test_concurrent_insert;
+val
+1
+SELECT * FROM test_concurrent_insert;
+val
+UNLOCK TABLES;
+LOCK TABLES test_concurrent_insert WRITE;
+INSERT INTO test_concurrent_insert VALUES (2);
+SELECT * FROM test_concurrent_insert;
+val
+1
+2
+UNLOCK TABLES;
+DROP TABLE test_concurrent_insert;
create table t1 (a int) engine=csv;
insert t1 values (1);
delete from t1;
--- 1.6/mysql-test/t/csv.test 2005-12-06 00:10:37 +03:00
+++ 1.7/mysql-test/t/csv.test 2005-12-06 15:50:36 +03:00
@@ -1386,8 +1386,6 @@
# cleanup
DROP TABLE test_concurrent_insert;
-disconnect con2;
-disconnect con1;
#
# BUG#13406 - incorrect amount of "records deleted"
--- 1.3/mysql-test/t/log_tables.test 2005-12-05 22:41:04 +03:00
+++ 1.4/mysql-test/t/log_tables.test 2005-12-06 15:50:36 +03:00
@@ -41,10 +41,10 @@
# check locking of the log tables
#
---error 1495
+--error 1499
lock tables mysql.general_log WRITE;
---error 1495
+--error 1499
lock tables mysql.slow_log WRITE;
#
@@ -53,10 +53,10 @@
# opened and locked by the logger.
#
---error 1496
+--error 1500
lock tables mysql.general_log READ;
---error 1496
+--error 1500
lock tables mysql.slow_log READ;
#
| Thread |
|---|
| • bk commit into 5.1 tree (petr:1.1951) | Petr Chardin | 6 Dec |