The problem is that unimplemented WIN32 version of pthread_kill
is returning ESRCH no matter the arguments, causing calls to
mysqld_list_processes to set the procinfo to dead because
pthread_kill returns non zero. The dead procinfo would show
up on a second invocation of show processlist.
include/my_pthread.h:
When unimplemented, pthread_kill must return zero for
any process id other then zero.
binlogging of insert into a autoincrement blackhole table ignored
an explicit set insert_id.
Fixed with refining of the blackhole's insert method to call
update_auto_increment() that prepares binlogging the insert query
with the preceeding set insert_id.
Note, as the engine does not store any actual data one has to explicitly
provide to the server with the value of the autoincrement column via
set insert_id. Otherwise binlogging will happend with the default
set insert_id=1.
mysql-test/r/blackhole.result:
results changed
mysql-test/t/blackhole.test:
a regression test for the bug added
sql/ha_blackhole.cc:
blackhole's insert method is refined to call update_auto_increment()
that prepares binlogging the insert query with the preceeding set insert_id.
When swapping out heap I_S tables to disk, this is done after plan refinement.
Thus, READ_RECORD::file will still point to the (deleted) heap handler at start
of execution. This causes segmentation fault if join buffering is used and the
query is a star query where the result is found to be empty before accessing
some table. In this case that table has not been initialized (i.e. had its
READ_RECORD re-initialized) before the cleanup routine tries to close the handler.
Fixed by updating READ_RECORD::file when changing handler.
mysql-test/r/information_schema.result:
Bug#34529: Test result.
mysql-test/t/information_schema.test:
Bug#34529: Test case.
sql/sql_show.cc:
Bug#34529: The fix.
Before breaking the connection we have to check that there's no query
executing at the moment. Otherwise it can lead to crash in embedded server.
client/mysqltest.c:
Bug #33334 mysqltest_embedded crashes when disconnecting before reap.
Wait until the query thread is finished before we break the connection.
Waiting part moved to a separate wait_query_thread_end() function
mysql-test/r/flush.result:
Bug #33334 mysqltest_embedded crashes when disconnecting before reap.
test result
mysql-test/t/flush.test:
Bug #33334 mysqltest_embedded crashes when disconnecting before reap.
test case
into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged
libmysql/libmysql.c:
Auto merged
sql-common/client.c:
Auto merged
tests/mysql_client_test.c:
Manually merged.
Bug #18453 Warning/error message if there is a mismatch between ...
There were three problems:
1. the reported lack of warnings for the BEFORE syntax of PURGE;
2. the similar lack of warnings for the TO syntax;
3. incompatible behaviour between the two in that the latter blanked out
regardlessly of presence or lack the actual file corresponding to
an index record; the former version gave up at the first mismatch.
fixed with deploying the warning's generation and synronizing logics of
purge_logs() and purge_logs_before_date().
my_stat() is called in either of two branches of purge_logs() (responsible
for the TO syntax of PURGE) similarly to how it has behaved in the BEFORE syntax.
If there is no actual binlog file, my_stat returns NULL and my_delete is
not invoked.
A critical error is reported to the user if a file from the index
could not be retrieved info about or deleted with a system error code
different than ENOENT.
sql/log.cc:
generating warning in two functions.
refining logics to call my_stat() by purge_logs() as it happens
in purge_logs_before_date().
my_delete() is called only if my_stat() ensured existance of the file.
A critical error is reported to the user if a file from the index
could not be my_stat():ed or my_delete():d with an error different
than ENOENT.
sql/share/errmsg.txt:
new error message
mysql-test/include/show_binary_logs.inc:
a new macro - shortcut of show binary logs
mysql-test/r/binlog_index.result:
new results
mysql-test/t/binlog_index.test:
a regression test for the bugs
into stella.local:/home2/mydev/mysql-5.0-axmrg
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
The problem was that the COM_STMT_SEND_LONG_DATA was sending a response
packet if the prepared statement wasn't found in the server (due to
reconnection). The commands COM_STMT_SEND_LONG_DATA and COM_STMT_CLOSE
should not send any packets, even error packets should not be sent since
they are not expected by the client API.
The solution is to clear generated during the execution of the aforementioned
commands and to skip resend of prepared statement commands. Another fix is
that if the connection breaks during the send of prepared statement command,
the command is not sent again since the prepared statement is no longer in the
server.
libmysql/libmysql.c:
The mysql handle might be reset after a reconnection.
Pass the now used stmt argument to cli_advanced_command.
sql-common/client.c:
Don't resend command if the connection broke and it's a prepared
statement command. If the session is broken, prepared statements
on the server are gone, set the error accordanly.
sql/sql_prepare.cc:
Clear any error set during the execution of the request
command.
tests/mysql_client_test.c:
Fix memory leak by freeing result associated with statement.
Remove test case for Bug 29948 because it's not reliable in
5.0 (fixed in 5.1) due to KILL queries sending two packets for
a thread that kills itself.
Queries like:
SELECT ROW(1, 2) IN (SELECT t1.a, 2)
FROM t1 GROUP BY t1.a
or
SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
FROM t1 GROUP BY t1.a
lead to assertion failure in the
Item_in_subselect::row_value_transformer method in debugging
build, or to unexpected error message in release build:
ERROR 1247 (42S22): Reference '<list ref>' not supported (forward
reference in item list)
Unexpected error message and assertion failure have been
eliminated.
mysql-test/r/subselect3.result:
Added test case for bug #34763.
mysql-test/t/subselect3.test:
Added test case for bug #34763.
sql/item.cc:
Fixed bug #34763.
The Item_ref::fix_fields method has been modified to silently
ignore not fixed outer references: by the definition, those
references should be fixed later by the call to the
fix_inner_refs function.
sql/item_subselect.cc:
Fixed bug #34763.
The Item_in_subselect::row_value_transformer method has been
modified to eliminate assertion failure on not fixed outer
references: by the definition those references are allowed in
this context and should be fixed later by the call to the
fix_inner_refs function.
into pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.0
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
When there are no underlying tables specified for a merge table,
SHOW CREATE TABLE outputs a statement that cannot be executed. The
same is true for mysqldump (it generates dumps that cannot be
executed).
This happens because SQL parser does not accept empty UNION() clause.
This patch changes the following:
- it is now possible to execute CREATE/ALTER statement with
empty UNION() clause.
- the same as above, but still worth noting: it is now possible to
remove underlying tables mapping using ALTER TABLE ... UNION=().
- SHOW CREATE TABLE does not output UNION() clause if there are
no underlying tables specified for a merge table. This makes
mysqldump slightly smaller.
mysql-test/r/merge.result:
A test case for BUG#28248.
mysql-test/t/merge.test:
A test case for BUG#28248.
sql/ha_myisammrg.cc:
Do not output UNION clause in SHOW CREATE TABLE, when there are
no underlying tables defined.
sql/sql_yacc.yy:
Make underlying table list for MERGE engine optional.
As for MERGE engine empty underlying tables list is valid, it should
be valid for the parser as well.
This change is mostly needed to restore dumps made by earlier MySQL
versions. Also with this fix it is possible to remove underlying
tables mapping by using ALTER TABLE ... UNION=().
log-slave-updates and circul repl
This is a test case fix for BUG#13861.
mysql-test/r/rpl_dual_pos_advance.result:
Fix for a test case for BUG#13861.
mysql-test/t/rpl_dual_pos_advance.test:
Fix for a test case for BUG#13861.
master_pos_wait() requires slave sql thread running. But it is not
guaranteed for this test case. As we use start slave until it may
execute all events and shutdown before master_pos_wait() is started.
On the other hand it is safe just to wait for slave to stop here,
as start slave returns _after_ sql thread is started.
into stella.local:/home2/mydev/mysql-5.0-axmrg
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
using a trig in SP
For all 5.0 and up to 5.1.12 exclusive, when a stored routine or
trigger caused an INSERT into an AUTO_INCREMENT column, the
generated AUTO_INCREMENT value should not be written into the
binary log, which means if a statement does not generate
AUTO_INCREMENT value itself, there will be no Intvar event (SET
INSERT_ID) associated with it even if one of the stored routine
or trigger caused generation of such a value. And meanwhile, when
executing a stored routine or trigger, it would ignore the
INSERT_ID value even if there is a INSERT_ID value available set
by a SET INSERT_ID statement.
Starting from MySQL 5.1.12, the generated AUTO_INCREMENT value is
written into the binary log, and the value will be used if
available when executing the stored routine or trigger.
Prior fix of this bug in MySQL 5.0 and prior MySQL 5.1.12
(referenced as the buggy versions in the text below), when a
statement that generates AUTO_INCREMENT value by the top
statement was executed in the body of a SP, all statements in the
SP after this statement would be treated as if they had generated
AUTO_INCREMENT by the top statement. When a statement that did
not generate AUTO_INCREMENT value by the top statement but by a
function/trigger called by it, an erroneous Intvar event would be
associated with the statement, this erroneous INSERT_ID value
wouldn't cause problem when replicating between masters and
slaves of 5.0.x or prior 5.1.12, because the erroneous INSERT_ID
value was not used when executing functions/triggers. But when
replicating from buggy versions to 5.1.12 or newer, which will
use the INSERT_ID value in functions/triggers, the erroneous
value will be used, which would cause duplicate entry error and
cause the slave to stop.
The patch for 5.0 fixed it not to generate the erroneous Intvar
event, another patch for 5.1 fixed it to ignore the SET INSERT_ID
value when executing functions/triggers if it is replicating from
a master of buggy versions.
mysql-test/include/show_binlog_events.inc:
add $binlog_start parameter to set the start position when show binlog events, if not set a default value will be used.
mask out column 2(Pos), 4(Server_id), table_id, and file_id
sql/sql_class.cc:
Reset insert_id_used after each query in SP
mysql-test/r/rpl_auto_increment_bug33029.result:
Add test for bug33029, test if the master generate the erroneous event or not
mysql-test/t/rpl_auto_increment_bug33029.test:
Add test for bug33029, test if the master generate the erroneous event or not
When concurrent inserts were disabled, statements after an INSERT
were not put into the query cache. This happened because we do not
save the current data file length at statement start when
concurrent inserts are disabled. But we checked the always zero
local length against the real file length anyway.
Fixed by doing the check only if concurrent inserts are not diabled.
mysql-test/r/query_cache.result:
Bug#33756 - query cache with concurrent_insert=0 appears broken
Added test result.
mysql-test/t/query_cache.test:
Bug#33756 - query cache with concurrent_insert=0 appears broken
Added test.
sql/ha_myisam.cc:
Bug#33756 - query cache with concurrent_insert=0 appears broken
Changed code so that file length check is done only when
concurrent inserts are possible.
Disable test case for bug 29948, which is causing sporadically
failures in other tests inside mysql_client_test.
tests/mysql_client_test.c:
Disable test case.
databases from 4.0 server
mysqldump treated a failure to set the results charset as a severe
error.
Now, don't try to set the charset for the SHOW CREATE TABLE statement,
if remote server's version is earlier than 4.1, which means it
doesn't support changing charsets.
client/mysqldump.c:
Don't set the charset for receiving results if the server doesn't
support it.
The test file tried to use a mysqltest command '--warning'
but there is no such command.
Changed '--warning' to '#--warning'.
mysql-test/t/rpl_transaction.test:
Bug#35247 - rpl_transaction.test produces warnings files
Changed '--warning' to '#--warning'.
In cases when TRUNCATE was executed by invoking mysql_delete() rather
than by table recreation (for example, when TRUNCATE was issued on
InnoDB table with is referenced by foreign key) triggers were invoked.
In debug builds this also led to crash because of an assertion, which
assumes that some preliminary actions take place before trigger
invocation, which doesn't happen in case of TRUNCATE.
The fix is not to execute triggers in mysql_delete() when this
function is used by TRUNCATE.
mysql-test/r/trigger-trans.result:
Update result file.
mysql-test/t/trigger-trans.test:
A test case for Bug#34643: TRUNCATE crash if trigger and foreign key.
sql/sql_delete.cc:
Do not process triggers in TRUNCATE.
into kaamos.(none):/data/src/opt/mysql-5.0-opt
client/mysql.cc:
Auto merged
sql/filesort.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/view.result:
Manual merge.
mysql-test/t/view.test:
Manual merge.
scripts/mysql_config.sh:
Manual merge.
WL#4203 Reorganize and fix the data dictionary tests of
testsuite funcs_1
because the goal to fix
Bug#34532 Some funcs_1 tests do not clean up at end of testing
was partially missed.
Some minor additional modifications are for
WL#4304 Cleanup in funcs_1 tests
BitKeeper/deleted/.del-innodb_triggers.result:
Rename: mysql-test/suite/funcs_1/r/innodb_triggers.result -> BitKeeper/deleted/.del-innodb_triggers.result
BitKeeper/deleted/.del-memory_triggers.result:
Rename: mysql-test/suite/funcs_1/r/memory_triggers.result -> BitKeeper/deleted/.del-memory_triggers.result
BitKeeper/deleted/.del-myisam_triggers.result:
Rename: mysql-test/suite/funcs_1/r/myisam_triggers.result -> BitKeeper/deleted/.del-myisam_triggers.result
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/innodb_storedproc_03.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/innodb_storedproc_07.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/innodb_storedproc_08.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/innodb_storedproc_10.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/memory_storedproc_02.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/memory_storedproc_03.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/memory_storedproc_07.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/memory_storedproc_08.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/memory_storedproc_10.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/myisam_storedproc_03.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/myisam_storedproc_07.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/myisam_storedproc_08.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/r/myisam_storedproc_10.result:
Change mode to -rw-rw-r--
mysql-test/suite/funcs_1/cursors/cursors_master.test:
Backport of file in 5.1
mysql-test/suite/funcs_1/datadict/datadict_load.inc:
Cleanup
mysql-test/suite/funcs_1/r/innodb_views.result:
Updated results
mysql-test/suite/funcs_1/r/is_columns_innodb.result:
Updated results
mysql-test/suite/funcs_1/r/is_columns_memory.result:
Updated results
mysql-test/suite/funcs_1/r/is_columns_myisam.result:
Updated results
mysql-test/suite/funcs_1/r/is_columns_ndb.result:
Updated results
mysql-test/suite/funcs_1/r/is_tables_innodb.result:
Updated results
mysql-test/suite/funcs_1/r/is_tables_memory.result:
Updated results
mysql-test/suite/funcs_1/r/is_tables_myisam.result:
Updated results
mysql-test/suite/funcs_1/r/is_tables_ndb.result:
Updated results
mysql-test/suite/funcs_1/r/memory_views.result:
Updated results
mysql-test/suite/funcs_1/r/myisam_views.result:
Updated results
mysql-test/suite/funcs_1/t/innodb_storedproc.test:
Backport of file in 5.1
mysql-test/suite/funcs_1/t/memory_storedproc.test:
Backport of file in 5.1
mysql-test/suite/funcs_1/t/myisam_storedproc.test:
Backport of file in 5.1
mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test:
Cleanup
mysql-test/suite/funcs_1/views/views_master.inc:
Backport of file in 5.1 which got many fixes for instabilities
and other improvements
Problem: if the IO slave thread is attempting to connect,
STOP SLAVE waits for the attempt to finish.
It may take a long time.
Fix: don't wait, stop the slave immediately.
sql/slave.cc:
Send a SIGALRM signal to the slave thread when stopping it (using
pthread_kill()). This breaks current socket(), connect(), poll() etc.
calls, and makes the subsequent thd->awake() call effective.
Also, move the definition of KICK_SLAVE to slave.cc.
sql/sql_repl.h:
Removed KICK_SLAVE and inlined it in slave.cc because:
- it was only called once, so better to make it local to where it is used
- it needed to include a preprocessor conditional in the middle