List:Commits« Previous MessageNext Message »
From:Alexey Botchkov Date:October 3 2008 9:22am
Subject:bzr commit into mysql-5.1 branch (holyfoot:2751)
View as plain text  
#At file:///home/hf/work/mysql_common/38293/

 2751 Alexey Botchkov	2008-10-03
      2751 Alexey Botchkov   2008-10-01
          Bug #38293 Libmysqld crash in mysql_library_init if language file missing
                  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
modified:
  dbug/dbug.c
  include/my_dbug.h
  libmysqld/examples/CMakeLists.txt
  libmysqld/libmysqld.def

=== modified file 'dbug/dbug.c'
--- a/dbug/dbug.c	2008-05-02 17:42:34 +0000
+++ b/dbug/dbug.c	2008-10-03 09:22:16 +0000
@@ -2407,4 +2407,13 @@ int i_am_a_dummy_function() {
        return 0;
 }
 
+#ifdef __WIN__
+char _db_doprnt_;
+char _db_enter_;
+char _db_pargs_;
+char _db_process_;
+char _db_push_;
+char _db_return_;
+#endif /*__WIN__*/
+
 #endif

=== modified file 'include/my_dbug.h'
--- a/include/my_dbug.h	2008-03-31 07:40:39 +0000
+++ b/include/my_dbug.h	2008-10-03 09:22:16 +0000
@@ -108,6 +108,20 @@ extern FILE *_db_fp_(void);
 #define DBUG_EXPLAIN(buf,len)
 #define DBUG_EXPLAIN_INITIAL(buf,len)
 #define IF_DBUG(A)
+
+#ifdef __WIN__
+/* On windows all the dll export has to be declared in the *.def file */
+/* so as we export these symbols in DEBUG mode we have to export      */
+/* these in the RELEASE mode also. So below are the dummy symbols     */
+/* for the RELEASE export                                             */
+extern  char _db_doprnt_;
+extern  char _db_enter_;
+extern  char _db_pargs_;
+extern  char _db_process_;
+extern  char _db_push_;
+extern  char _db_return_;
+#endif /*__WIN__*/
+
 #endif
 #ifdef	__cplusplus
 }

=== modified file 'libmysqld/examples/CMakeLists.txt'
--- a/libmysqld/examples/CMakeLists.txt	2007-11-02 08:27:38 +0000
+++ b/libmysqld/examples/CMakeLists.txt	2008-10-03 09:22:16 +0000
@@ -29,13 +29,13 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
 ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
                ../../client/mysql.cc ../../client/readline.cc
                ../../client/sql_string.cc)
-TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
+TARGET_LINK_LIBRARIES(mysql_embedded debug wsock32)
 ADD_DEPENDENCIES(mysql_embedded libmysqld)
 
 ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
-TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
+TARGET_LINK_LIBRARIES(mysqltest_embedded debug wsock32)
 ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
 
 ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
-TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug mysys yassl taocrypt zlib strings wsock32)
+TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug wsock32)
 ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)

=== modified file 'libmysqld/libmysqld.def'
--- a/libmysqld/libmysqld.def	2007-11-26 18:10:26 +0000
+++ b/libmysqld/libmysqld.def	2008-10-03 09:22:16 +0000
@@ -2,6 +2,66 @@ LIBRARY		LIBMYSQLD
 DESCRIPTION	'MySQL 5.1 Embedded Server Library'
 VERSION		5.1
 EXPORTS
+	_db_process_
+	_db_enter_
+	_db_return_
+	_db_push_
+	_db_doprnt_
+	_db_pargs_
+	strnmov
+	get_charset
+	my_memmem
+	my_snprintf
+	pthread_exit
+	pthread_cond_signal
+	dynstr_append_mem
+	init_dynamic_string
+	dynstr_free
+	hash_free
+	my_vsnprintf
+	dynstr_append
+	my_close
+	my_open
+	dynstr_set
+	dynstr_append_os_quoted
+	my_delete
+	my_seek
+	my_write
+	create_temp_file
+	fn_format
+	dirname_part
+	my_hash_insert
+	hash_search
+	test_if_hard_path
+	my_copy
+	my_mkdir
+	my_sleep
+	my_strtod
+	pthread_cond_wait
+	my_strnncoll_simple
+	get_dynamic
+	my_regerror
+	init_dynamic_array2
+	pthread_create
+	pthread_cond_init
+	my_regcomp
+	my_regexec
+	my_regex_end
+	my_regfree
+	longlong2str
+	my_set_exception_pointers
+	my_print_stacktrace
+	my_thread_stack_size
+	my_safe_print_str
+	my_stat
+	_hash_init
+	pthread_attr_setstacksize
+	pthread_attr_init
+	my_dirend
+	wild_compare
+	my_dir
+	my_micro_time
+	find_type_or_exit
 	_dig_vec_upper
 	_dig_vec_lower
 	bmove_upp

Thread
bzr commit into mysql-5.1 branch (holyfoot:2751) Alexey Botchkov3 Oct