- Read plug.in to fid the name of the engine to link with, does not have
to be same as engine dir
- Use engine dir when figuring out which libraries to build limbysqld with
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.
The Debug Sync Facility allows to place synchronization points
in the code:
open_tables(...)
DEBUG_SYNC(thd, "after_open_tables");
lock_tables(...)
When activated, a sync point can
- Send a signal and/or
- Wait for a signal
Nomenclature:
- signal: A value of a global variable that persists
until overwritten by a new signal. The global
variable can also be seen as a "signal post"
or "flag mast". Then the signal is what is
attached to the "signal post" or "flag mast".
- send a signal: Assign the value (the signal) to the global
variable ("set a flag") and broadcast a
global condition to wake those waiting for
a signal.
- wait for a signal: Loop over waiting for the global condition until
the global value matches the wait-for signal.
Please find more information in the top comment in debug_sync.cc
or in the worklog entry.
.bzrignore:
WL#4259 - Debug Sync Facility
Added the symbolic link libmysqld/debug_sync.cc.
CMakeLists.txt:
WL#4259 - Debug Sync Facility
Added definition for ENABLED_DEBUG_SYNC.
configure.in:
WL#4259 - Debug Sync Facility
Added definition for ENABLED_DEBUG_SYNC.
include/my_sys.h:
WL#4259 - Debug Sync Facility
Added definition for the DEBUG_SYNC_C macro.
libmysqld/CMakeLists.txt:
WL#4259 - Debug Sync Facility
Added sql/debug_sync.cc.
libmysqld/Makefile.am:
WL#4259 - Debug Sync Facility
Added sql/debug_sync.cc.
mysql-test/include/have_debug_sync.inc:
WL#4259 - Debug Sync Facility
New include file.
mysql-test/mysql-test-run.pl:
WL#4259 - Debug Sync Facility
Added option --debug_sync_timeout.
mysql-test/r/debug_sync.result:
WL#4259 - Debug Sync Facility
New test result.
mysql-test/r/have_debug_sync.require:
WL#4259 - Debug Sync Facility
New require file.
mysql-test/t/debug_sync.test:
WL#4259 - Debug Sync Facility
New test file.
mysys/my_static.c:
WL#4259 - Debug Sync Facility
Added definition for debug_sync_C_callback_ptr.
mysys/thr_lock.c:
WL#4259 - Debug Sync Facility
Added sync point "wait_for_lock".
sql/CMakeLists.txt:
WL#4259 - Debug Sync Facility
Added debug_sync.cc and debug_sync.h.
sql/Makefile.am:
WL#4259 - Debug Sync Facility
Added debug_sync.cc and debug_sync.h.
sql/debug_sync.cc:
WL#4259 - Debug Sync Facility
New source file.
sql/debug_sync.h:
WL#4259 - Debug Sync Facility
New header file.
sql/mysqld.cc:
WL#4259 - Debug Sync Facility
Added opt_debug_sync_timeout.
Added calls to debug_sync_init() and debug_sync_end().
Fixed a purecov comment (unrelated).
sql/set_var.cc:
WL#4259 - Debug Sync Facility
Added server variable "debug_sync".
sql/set_var.h:
WL#4259 - Debug Sync Facility
Added declaration for server variable "debug_sync".
sql/share/errmsg.txt:
WL#4259 - Debug Sync Facility
Added error messages ER_DEBUG_SYNC_TIMEOUT and ER_DEBUG_SYNC_HIT_LIMIT.
sql/sql_base.cc:
WL#4259 - Debug Sync Facility
Added sync points "after_flush_unlock" and "before_lock_tables_takes_lock".
sql/sql_class.cc:
WL#4259 - Debug Sync Facility
Added initialization for debug_sync_control to THD::THD.
Added calls to debug_sync_init_thread() and debug_sync_end_thread().
sql/sql_class.h:
WL#4259 - Debug Sync Facility
Added element debug_sync_control to THD.
storage/myisam/myisamchk.c:
Fixed a typo in an error message string (unrelated).
Restore a stub of the removed mysql_odbc_escape_string function
to fix a ABI breakage. The function was intended to be private
and used only by Connector/ODBC, but, unfortunately, it was exported
as part of the ABI. Nonetheless, only a stub is restored as the
original function is inherently broken and shouldn't be used.
This restoration only applies to MySQL 5.0. This will be addressed
differently in later versions -- reworked library versioning.
include/mysql.h:
Restore mysql_odbc_escape_string prototype.
include/mysql_h.ic:
Update ABI check.
libmysql/libmysql.c:
Restore a mysql_odbc_escape_string stub.
libmysql/libmysql.def:
Restore mysql_odbc_escape_string.
libmysqld/libmysqld.def:
Restore mysql_odbc_escape_string.
- Define and pass compile time path variables as pre-processor definitions to
mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in
Platform SDK header ObjIdl.h which also defines DATADIR.
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
Remove custom DLL loader code from innodb plugin code, use
symbols exported from mysqld.
storage/innodb_plugin/handler/ha_innodb.cc:
Remove a Win32 workaround for current_thd.
The original problem that innodb plugin used
value of TLS variable across DLL boundaries is
solved in MySQL server (current_thd is a function
not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
Remove custom delay loader
storage/innodb_plugin/plug.in:
Remove commented out MYSQL_PLUGIN_STATIC,
CMake would not parse that correctly
the thread->mysys_var parameter should be empty for the idle
embedded-server threads so that working threads can safely free
this memory.
per-file comments:
libmysqld/lib_sql.cc
Bug#43733 Select on processlist let the embedded server crash (concurrent_innodb_safelog)
set thread->mysys_var= 0 after the query is handled
mysql-test/include/concurrent.inc
Bug#43733 Select on processlist let the embedded server crash (concurrent_innodb_safelog)
enable these for the embedded-server mode
sql/sql_show.cc
Bug#43733 Select on processlist let the embedded server crash (concurrent_innodb_safelog)
show thread lock status in the query result
The reason for the error is incorrectly specified link dependencies
for mysql_embedded, mysqltest_embedded and mysql_client_test_embedded
in CMakeLists.txt (ADD_DEPENDENCIES should be TARGET_LINK_LIBRARIES)
libmysqld/CMakeLists.txt:
changed library type for libmysqld to SHARED instead of
MODULE. MODULE in CMake notation is a shared library that
is used only in dlopen/dlsym/LoadLibrary scenarios.
Hence it was impossible to use TARGET_LINK_LIBRARIES with
a MODULE.
libmysqld/examples/CMakeLists.txt:
Use TARGET_LINK_LIBRARIES (instead of previously incorrectly
used ADD_DEPENDENCIES) to specify link dependency from libmysqld
The problem here is that embedded server starts handle_thread manager
thread on mysql_library_init() does not stop it on mysql_library_end().
At shutdown, my_thread_global_end() waits for thread count to become 0,
but since we did not stop the thread it will give up after 5 seconds.
Solution is to move shutdown for handle_manager thread from kill_server()
(mysqld specific) to clean_up() that is used by both embedded and mysqld.
This patch also contains some refactorings - to avoid duplicate code,
start_handle_manager() and stop_handle_manager() functions are introduced.
Unused variables are eliminated. handle_manager does not rely on global
variable abort_loop anymore to stop (abort_loop is not set for embedded).
Note: Specifically on Windows and when using DBUG version of libmysqld,
the complete solution requires removing obsolete code my_thread_init()
from my_thread_var(). This has a side effect that a DBUG statement
after my_thread_end() can cause thread counter to be incremented, and
embedded will hang for some seconds. Or worse, my_thread_init() will
crash if critical sections have been deleted by the global cleanup
routine that runs in a different thread.
This patch also fixes and revert prior changes for Bug#38293
"Libmysqld crash in mysql_library_init if language file missing".
Root cause of the crash observed in Bug#38293 was bug in my_thread_init()
described above
client/mysql.cc:
sql_protocol_typelib is not exported from libmysqld
(does not make sense either)
thus excluded from embedded client
dbug/dbug.c:
revert changes for Bug#38293
include/my_dbug.h:
revert changes for Bug#38293
libmysql/libmysql.c:
Removed DBUG_POP call, because when called after my_end(), will access
THR_key_mysys that is already deleted. The result of pthread_get_specific
is not predictable in this case and hence DBUG_POP can crash.
libmysqld/examples/CMakeLists.txt:
Revert changes for Bug#38293.
libmysqld/lib_sql.cc:
code to start handle manager is factored out into
start_handle_manager() function
libmysqld/libmysqld.def:
Revert changes for Bug #38293
Remove excessive exports from libmysqld, export what API documents.
mysys/my_thr_init.c:
Remove windows-DLL-specific workaround for something (old code, no documentation for
what specifically). The problem is that even after my_thread_end() is finished,
DBUG statement can initiate my_thread_init(). This does not happen anywhere else and
should not happen on Windows either.
sql/mysql_priv.h:
- new functions start_handle_manager() and stop_handle_manager()
- move manager_thread_in_use variable to sql_manager.cc and made
it static
- remove manager_status, as it is unused
sql/mysqld.cc:
Code to start/stop handle_manager thread is factored out into start_handle_manager()
That's a Win-specific error.
When we create libmysqld.dll we have many libraries like mysys, dbug,
strings, etc linked into that dll, so the application built upon
this library shouldn't link these libraries to itself, rather use
those inside the dll.
Fixed by redirecting calls into the libmysqld.dll
per-file comments:
dbug/dbug.c
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
fake _db_something definitions added
include/my_dbug.h
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
fake _db_something declarations added
libmysqld/examples/CMakeLists.txt
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
superfluous libraries removed from linking
libmysqld/libmysqld.def
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
set of mysys functions added to the export section
GLOBAL STATUS is calculated by studying the list of threads. In the
embedded server threads were not linked to the internal list, so the
calculation always returns 0. Fixed by 'linking' the embedded-server
threads to the same list
per-file comments:
libmysqld/lib_sql.cc
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
Add newly created 'threads' to the internal thread list.
Remove them from the list as they're freed.
mysql-test/r/information_schema.result
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
test result
mysql-test/t/information_schema.test
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
test case added
Several functions (mostly in mysqld.cc) directly call
exit() function in case of errors, which is not a desired
behaviour expecially in the embedded-server library.
Fixed by making these functions return error sign instead
of exiting.
per-file comments:
include/my_getopt.h
Bug#39289 libmysqld.a calls exit() upon error
added 'error' retvalue for my_getopt_register_get_addr
libmysqld/lib_sql.cc
Bug#39289 libmysqld.a calls exit() upon error
unireg_clear() function implemented
mysys/default.c
Bug#39289 libmysqld.a calls exit() upon error
error returned instead of exit() call
mysys/mf_tempdir.c
Bug#39289 libmysqld.a calls exit() upon error
free_tmpdir() - fixed so it's not produce crash on uninitialized
tmpdir structure
mysys/my_getopt.c
Bug#39289 libmysqld.a calls exit() upon error
error returned instead of exit() call
sql/mysql_priv.h
Bug#39289 libmysqld.a calls exit() upon error
unireg_abort definition fixed for the embedded server
sql/mysqld.cc
Bug#39289 libmysqld.a calls exit() upon error
various functions fixed
error returned instead of exit() call
partition is corrupt
Post push fix
an DBUG_ASSERT broke the embedded server, fixed by initializing
it in the embedded version of Protocol_text::prepare_for_resend
libmysqld/lib_sql.cc:
Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt
Post push fix
an DBUG_ASSERT in Protocol_text::store broke the embedded
server, fixed by initializing it in the embedded version
of Protocol_text::prepare_for_resend
The problem was that when a embedded linked version of mysqltest
crashed there was no way to obtain a stack trace if no core file
is available. Another problem is that the embedded version of
libmysql was not behaving (crash) the same as the non-embedded with
respect to sending commands to a explicitly closed connection.
The solution is to generate a mysqltest's stack trace on crash
and to enable "reconnect" if the connection handle was explicitly
closed so the behavior matches the non-embedded one.
client/CMakeLists.txt:
Link mysys to mysqltest.
client/Makefile.am:
Link mysys to mysqltest.
client/mysqltest.c:
Add fatal signal handling with backtracing for Unix and Windows.
configure.in:
Add check for weak symbols support and remove a spurious word.
include/Makefile.am:
Add new header with prototype for stack tracing functions.
include/my_stacktrace.h:
Add new header with prototype for stack tracing functions.
libmysqld/CMakeLists.txt:
stack tracing is now part of mysys.
libmysqld/Makefile.am:
stack tracing is now part of mysys.
libmysqld/lib_sql.cc:
Re-connect if connection was explicitly closed. This is
done to match the behavior of the non-embeded libmysql.
mysql-test/t/sql_low_priority_updates_func.test:
Test expects parallelism between queries that cannot be
guaranteed under embedded.
mysys/CMakeLists.txt:
Add stacktrace to mysys.
mysys/Makefile.am:
Add stacktrace to mysys.
mysys/stacktrace.c:
Move stacktrace to mysys and add weak symbol for the
C++ name de-mangling function so that it can later be
overridden in C++ code. Also add my_ prefix to exported
functions.
sql/CMakeLists.txt:
stacktrace was moved to mysys.
sql/Makefile.am:
stacktrace was moved to mysys.
sql/mysqld.cc:
Add my_ prefix to mysys functions.
into bodhi.(none):/opt/local/work/mysql-5.1-27430
Makefile.am:
Auto merged
include/my_global.h:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
sql/item.cc:
Auto merged
sql/my_decimal.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_yacc.yy:
Auto merged
libmysqld/CMakeLists.txt:
Manual merge.
libmysqld/lib_sql.cc:
Manual merge.
mysql-test/t/disabled.def:
Manual merge.
SHOW commands fail in embedded mode because schema_table array doesn't
correspond to enum_schema_tables.
This patch implements a dummy implementation of the abstract fill_table
function to be used when the event scheduler (or other core feature)
isn't part of the build.
libmysqld/lib_sql.cc:
Fixed type conversion warning.
sql/sql_show.cc:
Leave entry for EVENTS to keep array consistent but set the
fill_table function pointer to a dummy function instead.
- a 64 bit compile warning in embedded
- disabled the new (and failing tests for Bug#36522
libmysqld/lib_sql.cc:
Fixed: win64 warning
mysql-test/t/disabled.def:
Disabled the new (and failing) tests for 36522
The event scheduler was not designed to work in embedded mode. This
patch disables and excludes the event scheduler when the server is
compiled for embedded build.
libmysqld/Makefile.am:
Reduce the amount of event code in an embedded build.
mysql-test/t/events_trans.test:
Disable test if run in embedded mode.
sql/Makefile.am:
Introduce definition HAVE_EVENT_SCHEDULER and one new source file.
sql/event_data_objects.cc:
Refactor Event_parse_data to new file.
sql/event_data_objects.h:
Refactor Event_parse_data to new file.
Move global definitions to new file.
sql/event_queue.cc:
Move all parsed items to Event_parse_data for easier modularization.
sql/events.cc:
Move all parsed items to Event_parse_data for easier modularization.
sql/mysqld.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/set_var.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/set_var.h:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/sql_db.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/sql_parse.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/sql_show.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/sql_test.cc:
Disable the event schedular subsystem if the server is compiled in
embedded mode.
sql/sql_yacc.yy:
Only include event-code needed for parsing to reduce impact on embedded
build.
Move all constants to Event_parse_data class.
mysql-test/r/events_embedded.result:
Add test case to make sure the 'event_scheduler' can't be activated
in embedded mode.
mysql-test/r/is_embedded.require:
Add test case to make sure the 'event_scheduler' can't be activated
in embedded mode.
mysql-test/t/events_embedded.test:
Add test case to make sure the 'event_scheduler' can't be activated
in embedded mode.
sql/event_parse_data.cc:
New file. Extracted Event_parse data into a new file.
sql/event_parse_data.h:
New file. Extracted Event_parse data into a new file.
If excluding Federated, make sure dynamic plugin is not built
Makefile.am:
Only run cluster test when compiled with cluster
lib_sql.cc:
Work around for Visual Studio 2003, that lacks vsnprintf() but has _vsnprintf()
Makefile.am:
Only run cluster test when compiled with cluster
libmysqld/lib_sql.cc:
Work around for Visual Studio 2003, that lacks vsnprintf() but has _vsnprintf()
support-files/mysql.spec.sh:
If excluding Federated, make sure dynamic plugin is not built
Corrects build problems embedded on Windows
Makefile.am:
Install .sym or mysqld-debug if exists
query_cache_debug.test, query_cache_debug.result:
Set more resonable query cache size (bug#35749)
CMakeLists.txt:
Added missing stacktrace.c
mysql-test/r/query_cache_debug.result:
Set more resonable query cache size (bug#35749)
mysql-test/t/query_cache_debug.test:
Set more resonable query cache size (bug#35749)
libmysqld/CMakeLists.txt:
Added missing stacktrace.c
sql/Makefile.am:
Install .sym or mysqld-debug if exists
sql/mysqld.cc:
Corrects build problems embedded on Windows