The problem is that since MyISAM's concurrent_insert is on by
default some concurrent SELECT statements might not see changes
made by INSERT statements in other connections, even if the
INSERT statement has returned.
The solution is to disable concurrent_insert so that INSERT
statements returns after the data is actually visible to other
statements.
mysql-test/r/flush_read_lock_kill.result:
Restore old value of @@global.concurrent_insert
mysql-test/r/kill.result:
Restore old value of @@global.concurrent_insert
mysql-test/r/sp_notembedded.result:
Update test case result
mysql-test/t/flush_read_lock_kill.test:
Restore old value of @@global.concurrent_insert so it
doesn't affect other tests.
mysql-test/t/kill.test:
Restore old value of @@global.concurrent_insert so it
doesn't affect other tests.
mysql-test/t/sp_notembedded.test:
Disable and restore concurrent_insert value at the end of the
test case. The test case for Bug 29936 requires that the inserted
rows need to be visible before a SELECT statement is queued in
another connection.
Remove sleep at the start of the test, it's not necessary to log
the result of the processlist command, showing the warnings has
the same end result.
mysql-test/r/kill.result:
Update test case result.
mysql-test/t/disabled.def:
Re-enable kill test, bug was closed.
mysql-test/t/kill.test:
Disable concurrent inserts for the kill test.
different error code depending on platform.
On Mac OS X, KILL statement issued to kill the current
connection would return a different error code and message than on
other platforms ('MySQL server has gone away' instead of 'Shutdown
in progress').
The reason for this difference was that on Mac OS X we have macro
SIGNAL_WITH_VIO_CLOSE defined. This macro forces KILL
implementation to close the communication socket of the thread
that is being killed. SIGNAL_WITH_VIO_CLOSE macro is defined on
platforms where just sending a signal is not a reliable mechanism
to interrupt the thread from sleeping on a blocking system call.
In a nutshell, closing the socket is a hack to work around an
operating system bug and awake the blocked thread no matter what.
However, if the thread that is being killed is the same
thread that issued KILL statement, closing the socket leads to a
prematurely lost connection. At the same time it is not necessary
to close the socket in this case, since the thread in question
is not inside a blocking system call.
The fix, therefore, is to not close the socket if the thread that
is being killed is the same that issued KILL statement, even with
defined SIGNAL_WITH_VIO_CLOSE.
mysql-test/r/kill.result:
Update result file.
mysql-test/t/kill.test:
Added a test case for BUG#19723: kill of active connection yields
different error code depending on platform.
sql/sql_class.cc:
Call close_active_vio() only if we're killing another thread.
into damien-katzs-computer.local:/Users/dkatz/mysql51
mysql-test/r/kill.result:
Auto merged
mysql-test/t/kill.test:
Auto merged
storage/myisam/sort.c:
Auto merged
The reason the "reap;" succeeds unexpectedly is because the query was completing(almost always) and the network buffer was big enough to store the query result (sometimes) on Windows, meaning the response was completely sent before the server thread could be killed.
Therefore we use a much longer running query that doesn't have a chance to fully complete before the reap happens, testing the kill properly.
mysql-test/r/kill.result:
We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
mysql-test/t/kill.test:
We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
mysql-test/r/auto_increment.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/insert.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/insert_update.result:
Auto merged
mysql-test/r/key.result:
Auto merged
mysql-test/r/kill.result:
Auto merged
mysql-test/r/null.result:
Auto merged
mysql-test/r/null_key.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/kill.test:
Auto merged
mysql-test/t/strict.test:
Auto merged
sql/field.cc:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item_func.cc:
Auto merged
mysql-test/r/type_enum.result:
merging
mysql-test/r/warnings.result:
merging
mysql-test/t/type_enum.test:
merging
sql/sql_select.cc:
merging
mysqld crashed when a long-running explain query was killed from
another connection.
When the current thread caught a kill signal executing the function
best_extension_by_limited_search it just silently returned to
the calling function greedy_search without initializing elements of
the join->best_positions array.
However, the greedy_search function ignored thd->killed status
after a calls to the best_extension_by_limited_search function, and
after several calls the greedy_search function used an uninitialized
data from the join->best_positions[idx] to search position in the
join->best_ref array.
That search failed, and greedy_search tried to call swap_variables
function with NULL argument - that caused a crash.
sql/sql_select.cc:
Fixed bug #28598.
choose_plan(), greedy_search(), best_extension_by_limited_search()
and find_best() functions have been changed to return TRUE in case
of fatal error.
mysql-test/t/kill.test:
Updated test case for bug #28598.
mysql-test/r/kill.result:
Updated test case for bug #28598.
into gleb.loc:/home/uchum/work/bk/mysql-5.1-opt
client/mysqldump.c:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/kill.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
mysql-test/t/kill.test:
Auto merged
sql/field.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
mysql-test/r/mysqldump.result:
Merge with 5.0-opt
mysql-test/t/mysqldump.test:
Merge with 5.0-opt
mysql-test/t/view.test:
Merge with 5.0-opt
sql/sql_select.cc:
Merge with 5.0-opt
If a stored function or a trigger was killed it had aborted but no error
was thrown. This allows the caller statement to continue without a notice.
This may lead to a wrong data being inserted/updated to/deleted as in such
cases the correct result of a stored function isn't guaranteed. In the case
of triggers it allows the caller statement to ignore kill signal and to
waste time because of re-evaluation of triggers that always will fail
because thd->killed flag is still on.
Now the Item_func_sp::execute() and the sp_head::execute_trigger() functions
check whether a function or a trigger were killed during execution and
throws an appropriate error if so.
Now the fill_record() function stops filling record if an error was reported
through thd->net.report_error.
sql/item_func.cc:
Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
Now the Item_func_sp::execute() function checks whether a trigger was killed
during execution and throws an appropriate error if so.
sql/sp_head.cc:
Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
Now the sp_head::execute_trigger() function checks whether a function was
killed during execution and throws an appropriate error if so.
sql/sql_base.cc:
Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
Now the fill_record() function stops filling record if an error was reported
through thd->net.report_error.
mysql-test/r/kill.result:
Added a test case for the bug#27563: Stored functions and triggers wasn't
throwing an error when killed.
mysql-test/t/kill.test:
Added a test case for the bug#27563: Stored functions and triggers wasn't
throwing an error when killed.
into alik.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged-2
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/kill.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/rename.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/Makefile.am:
Auto merged
sql/handler.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/lex.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql-common/my_time.c:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/time.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/mysql-test-run.pl:
Manually merged.
sql/sql_parse.cc:
Manually merged.
Events: crash with procedure which alters events with function
Post-review CS
This fix also changes the handling of KILL command combined with
subquery. It changes the error message given back to "not supported",
from parse error. The error for CREATE|ALTER EVENT has also been changed
to generate "not supported yet" instead of parse error.
In case of a SP call, the error is "not supported yet". This change
cleans the parser from code which should not belong to there. Still
LEX::expr_allows_subselect is existant because it simplifies the handling
of SQLCOM_HA_READ which forbids subselects.
mysql-test/r/events_bugs.result:
update resut
mysql-test/r/events_grant.result:
update result
mysql-test/r/kill.result:
the error message has been changed for KILL
mysql-test/t/events_bugs.test:
Update old tests with the new emitted error
Add a test case for
BUG#22830 Events: crash with procedure which alters events with function
mysql-test/t/events_grant.test:
add ORDER BY clause to keep the result deterministic.
mysql-test/t/kill.test:
use name of the error, and change the error
from parse error, to not supported
sql/sql_lex.cc:
Add an auxiliary function that checks whether SP and/or
tables are used in the statement. This function is helpful for
statements that cannot handle subqueries ans SP calls. Adding out
of the parser cleans the latter of handling of special cases and
letting it do its job of parsing.
sql/sql_lex.h:
helper function to check whether a table or SP was used
sql/sql_parse.cc:
Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT
and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is
not needed.
sql/sql_yacc.yy:
Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT
and KILL. There is only one left occurence - SQLCOM_HAREAD, but it
adds one table to the list of tables
mysql-test/r/csv.result:
Update after add of missing semicolon
mysql-test/r/drop.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush_block_commit.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush_read_lock_kill.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/grant2.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/handler.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/innodb_notembedded.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/kill.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/lock_multi.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/multi_update.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/mysqltest.result:
Update result
mysql-test/r/query_cache.result:
Update after add of missing semicolon
mysql-test/r/query_cache_notembedded.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/sp-threads.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/sp_notembedded.result:
Update after add of missing semicolon
mysql-test/r/type_blob.result:
Remove extra drop table
mysql-test/t/csv.test:
Add missing semicolon
mysql-test/t/query_cache.test:
Add missing semicolon
mysql-test/t/sp-error.test:
Remove "tab" from end of error declaration
mysql-test/t/sp.test:
Wrong delimiter, used ; instead of |
mysql-test/t/sp_notembedded.test:
Wrong delimiter, used ; instead of |
mysql-test/t/view_grant.test:
An incomplete error name specification was used.
mysql-test/r/kill.result:
This result chenged because of the correspondent test change.
mysql-test/t/kill.test:
This test fixed for kill on Mac OS X (which do not send OK)
mysql-test/r/kill.result:
BUG#14851 test
mysql-test/t/kill.test:
BUG#14851 test
sql/sql_class.cc:
Debug prints are added.
sql/sql_select.cc:
Allocation of tmp_join fixed to involve constructor (it is not related to the bug directly but might cause other problems).
Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
sql/sql_select.h:
JOINs constructor added, initialization of them fixed (it is not related to the bug directly but might cause other problems).
- Fixed tests
- Optimized new code
- Fixed some unlikely core dumps
- Better bug fixes for:
- #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
- #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null
mysql-test/r/create.result:
Update results after removing wrong warnings for CREATE ... SELECT
New tests
mysql-test/r/handler.result:
Drop used tables
mysql-test/r/kill.result:
Make test portable
mysql-test/r/mysqlshow.result:
Drop tables used by previous test
mysql-test/r/trigger.result:
Reuse old procedure name
mysql-test/r/view.result:
Extra tests
mysql-test/t/create.test:
New tests to test fix of removing wrong warnings for CREATE ... SELECT
mysql-test/t/disabled.def:
Enable 'kill' test (should now be portable)
mysql-test/t/handler.test:
Drop used tables
mysql-test/t/kill.test:
Make test portable even if kill doesn't work at once
mysql-test/t/mysqlshow.test:
Drop tables used by previous test
mysql-test/t/trigger.test:
Reuse old procedure name
mysql-test/t/view.test:
Extra tests
sql/field.cc:
Removed compiler warning
sql/ha_federated.cc:
my_snprintf -> strmake()
(Simple optimization)
sql/ha_ndbcluster.cc:
Indentation cleanups and trival optimization
sql/item.cc:
Moved save_org_in_field() to item.cc to make it easier to test
Remove setting of null_value as this is not needed
sql/item.h:
Moved save_org_in_field() to item.cc to make it easier to test
sql/log_event.cc:
Remove inline of slave_load_file_stem()
Added 'extension' parameter to slave_load_file_stem() to get smaller code
Removed not critical (or needed) DBUG_ASSERT()'s
Cleaned up usage of slave_load_file_stem() to not depend on constant string lengths
Indentation fixes
sql/opt_range.cc:
Moved code from declaration to function body
(To make it more readable)
sql/parse_file.cc:
Fixed DBUG_PRINT
sql/sp.cc:
Simple cleanups
- Removed not needed {} level
- Ensure saved variables starts with old_
sql/sp_head.cc:
Indentation fixes
Remove core dump when using --debug when m_next_cached_sp == 0
Fixed compiler warnings
Trivial optimizations
sql/sp_head.h:
Changed argument to set_definer() to const
Added THD argument to recursion_level_error() to avoid call to current_thd
sql/sql_acl.cc:
Removed not needed test (first_not_own_table is the guard)
sql/sql_base.cc:
Removed extra empty line
sql/sql_handler.cc:
Don't test table version in mysql_ha_read() as this is already tested in lock_tables()
Moved call to insert_fields to be after lock_table() to guard aganst reopen of tables
(Better fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash)
sql/sql_insert.cc:
Mark fields that are set in CREATE ... SELECT as used
(Removed wrong warnings about field not having a default value)
sql/sql_parse.cc:
Removed not needed test of 'tables' (first_not_own_table is the guard)
Simplify code
sql/sql_select.cc:
Use group->field to check if value is null instead of item called by 'save_org_in_field'
This is a better bug fix for #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null)
sql/sql_trigger.cc:
Move sql_modes_parameters outside of function
Indentation fixes
Fixed compiler warning
Ensure that thd->lex->query_tables_own_last is set properly before calling check_table_access()
(This allows us to remove the extra test in check_grant() and check_table_access())
mysql-test/r/drop.result:
Made error message smaller to not get into trouble with clients with smaller error buffers
The proper way to fix this is to generate a separate warning for each not found table if there was more than one table in the DROP
but
mysql-test/r/kill.result:
Portablity fix
mysql-test/t/kill.test:
Portablity fix
mysys/my_sync.c:
Fixed possible compiler warning
sql/records.cc:
Fixed possible compiler warning
sql/share/errmsg.txt:
Made error message smaller to not get into trouble with clients with smaller error buffers
sql/sql_class.cc:
Don't put code in comments
sql/sql_show.cc:
Cleanup
--disable_reconnect and --enable_reconnect to mysqltest
so that it can be tested properly. (Bug #8866)
client/mysqltest.c:
Add support for --disable_reconnect and --enable_reconnect
mysql-test/r/kill.result:
Update results
mysql-test/t/kill.test:
Fix test to actually verify that killing a connection is working,
and that automatic reconnect is working as desired.
sql-common/client.c:
Clean up MYSQL->stmts on reconnect by invalidating statements
not in the MYSQL_STMT_INIT_DONE state, and reconnecting others
to the new MYSQL object.
been killed.
mysql-test/r/kill.result:
Update results
mysql-test/t/kill.test:
Fix 'ping' to be '--ping' and make test that this is a new
connection actually test that.
include/mysql_com.h:
Flag which prevent sending error after EOF or OK sent
mysql-test/r/kill.result:
test of blocking of sending ERROR after OK or EOF
mysql-test/t/kill.test:
test of blocking of sending ERROR after OK or EOF
sql/item_func.cc:
typo fixed
sql/net_serv.cc:
initialization of flag
sql/protocol.cc:
check and set of flag no_send_error
sql/sql_parse.cc:
droping flag no_send_error before new command/query execution
added support for kill expr
fixed coredump in set @a := foo;
added testcase for user_var
added testcase for kill
sql/slave.cc:
fd -> vio
sql/sql_class.cc:
fd->vio, fixed coredump on set @a := foo;
sql/sql_class.h:
fd -> vio
sql/sql_repl.cc:
fd -> vio
sql/sql_yacc.yy:
added support for kill expr - needed this for a clean test case of kill