Below is the list of changes that have just been committed into a local
5.0 repository of tomash. When tomash 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-07-20 15:46:15+04:00, kroki@stripped +1 -0
Bug#16581: deadlock: server and client both read from connection in
'conc_sys' test
The problem was that for the first query of a join there was a race
between select from I_S.TABLES and DROP DATABASE, and the error was
prepared to be send to the client, but the join processing was
continued. On second query to I_S.COLUMNS there was a race with
DROP TABLE, but this error (no such table) was downgraded to warning,
as thd->net.report_error was reset. And so neither result nor error
was sent to the client.
The solution is to stop join processing once it is clear we are going
to report a error, and also to downgrade to warnings file system errors
like 'no such database' (unless we are in the 'SHOW' command), because
I_S is designed not to use locks and the query to I_S should not abort
if something is dropped in the middle.
No test case is provided since this bug is a result of a race, and is
timing dependant.
sql/sql_show.cc@stripped, 2006-07-20 15:46:10+04:00, kroki@stripped +27 -4
Make mysql_find_files() return -2 on file system error.
Downgrade error to warning in get_all_tables() if it is a file system
error, and we are not in the 'SHOW' command.
Once 'result' is set to 1 in get_schema_tables_result(), there's no
need in continuing iterations, as we are about to return a error.
# 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: kroki
# Host: moonlight.intranet
# Root: /home/tomash/src/mysql_ab/mysql-5.0-bug16581
--- 1.323/sql/sql_show.cc 2006-07-20 15:46:21 +04:00
+++ 1.324/sql/sql_show.cc 2006-07-20 15:46:21 +04:00
@@ -275,7 +275,7 @@
my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), db);
else
my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), path, my_errno);
- DBUG_RETURN(-1);
+ DBUG_RETURN(-2);
}
for (i=0 ; i < (uint) dirp->number_off_files ; i++)
@@ -2204,9 +2204,26 @@
strxmov(path, mysql_data_home, "/", base_name, NullS);
end= path + (len= unpack_dirname(path,path));
len= FN_LEN - len;
- if (mysql_find_files(thd, &files, base_name,
- path, idx_field_vals.table_value, 0))
- goto err;
+ int res= mysql_find_files(thd, &files, base_name,
+ path, idx_field_vals.table_value, 0);
+ if (res != 0)
+ {
+ /*
+ Downgrade file system errors to warnings if this is not a
+ 'SHOW' command.
+ */
+ if (res == -2 && lex->orig_sql_command == SQLCOM_END)
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ thd->net.last_errno, thd->net.last_error);
+ thd->clear_error();
+ continue;
+ }
+ else
+ {
+ goto err;
+ }
+ }
if (lower_case_table_names)
orig_base_name= thd->strdup(base_name);
}
@@ -3969,7 +3986,13 @@
if (table_list->schema_table->fill_table(thd, table_list,
tab->select_cond))
+ {
+ DBUG_ASSERT(thd->net.report_error);
result= 1;
+ join->error= 1;
+ table_list->is_schema_table_processed= TRUE;
+ break;
+ }
table_list->is_schema_table_processed= TRUE;
}
}
| Thread |
|---|
| • bk commit into 5.0 tree (kroki:1.2237) BUG#16581 | kroki | 20 Jul |