From 31b79618e34a36ff24d2e1a6186258dc18e12aa5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 10 Jun 2009 10:59:49 +0200 Subject: Backport WL#3653 to 5.1 to enable bundled innodb plugin. Remove custom DLL loader code from innodb plugin code, use symbols exported from mysqld. --- libmysqld/CMakeLists.txt | 59 +++++------------------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) (limited to 'libmysqld') diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 1c8f80768d4..8500d73863a 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -87,63 +87,16 @@ FOREACH(rpath ${VIO_SOURCES}) SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath}) ENDFOREACH(rpath) -# Engines -INCLUDE(${CMAKE_SOURCE_DIR}/storage/heap/CMakeLists.txt) -FOREACH(rpath ${HEAP_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/heap/${rpath}) -ENDFOREACH(rpath) - -INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisam/CMakeLists.txt) -FOREACH(rpath ${MYISAM_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisam/${rpath}) -ENDFOREACH(rpath) -INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisammrg/CMakeLists.txt) -FOREACH(rpath ${MYISAMMRG_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisammrg/${rpath}) -ENDFOREACH(rpath) -IF(WITH_ARCHIVE_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/archive/CMakeLists.txt) - FOREACH(rpath ${ARCHIVE_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/archive/${rpath}) +FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS}) + INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/CMakeLists.txt) + STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER) + FOREACH(rpath ${${ENGINE_LIB_UPPER}_SOURCES}) + SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/${rpath}) ENDFOREACH(rpath) -ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) +ENDFOREACH(ENGINE_LIB) -IF(WITH_BLACKHOLE_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/blackhole/CMakeLists.txt) - FOREACH(rpath ${BLACKHOLE_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/blackhole/${rpath}) - ENDFOREACH(rpath) -ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) - -IF(WITH_EXAMPLE_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/example/CMakeLists.txt) - FOREACH(rpath ${EXAMPLE_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/example/${rpath}) - ENDFOREACH(rpath) -ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) - -IF(WITH_FEDERATED_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/federated/CMakeLists.txt) - FOREACH(rpath ${FEDERATED_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/federated/${rpath}) - ENDFOREACH(rpath) -ENDIF(WITH_FEDERATED_STORAGE_ENGINE) - -IF(WITH_INNOBASE_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/CMakeLists.txt) - FOREACH(rpath ${INNOBASE_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/innobase/${rpath}) - ENDFOREACH(rpath) -ENDIF(WITH_INNOBASE_STORAGE_ENGINE) - -IF(WITH_CSV_STORAGE_ENGINE) - INCLUDE(${CMAKE_SOURCE_DIR}/storage/csv/CMakeLists.txt) - FOREACH(rpath ${CSV_SOURCES}) - SET(LIB_SOURCES ${LIB_SOURCES} ../storage/csv/${rpath}) - ENDFOREACH(rpath) -ENDIF(WITH_CSV_STORAGE_ENGINE) SET(SOURCE_SUBLIBS FALSE) -- cgit v1.2.1 From 0ddefa603a654560dc3e703f3c7ed9242303fee4 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 27 Jul 2009 16:03:48 -0300 Subject: Post-merge fix for Bug#43587: Handle failures to execute a statement during bootstrap on a embedded server. --- libmysqld/lib_sql.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libmysqld') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index d644c45a66a..ec108bf372e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1078,9 +1078,19 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count) void net_send_error_packet(THD *thd, uint sql_errno, const char *err) { - MYSQL_DATA *data= thd->cur_data ? thd->cur_data : thd->alloc_new_dataset(); - struct embedded_query_result *ei= data->embedded_info; + MYSQL_DATA *data= thd->cur_data; + struct embedded_query_result *ei; + + if (!thd->mysql) // bootstrap file handling + { + fprintf(stderr, "ERROR: %d %s\n", sql_errno, err); + return; + } + + if (!data) + data= thd->alloc_new_dataset(); + ei= data->embedded_info; ei->last_errno= sql_errno; strmake(ei->info, err, sizeof(ei->info)-1); strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno)); -- cgit v1.2.1 From d480b64f5bece952455318a58cd410c5ff02344b Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Wed, 29 Jul 2009 22:07:08 +0200 Subject: Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause 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 | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'libmysqld') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ec108bf372e..d4a200c07b2 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -803,11 +803,11 @@ MYSQL_DATA *THD::alloc_new_dataset() */ static -void +bool write_eof_packet(THD *thd, uint server_status, uint total_warn_count) { if (!thd->mysql) // bootstrap file handling - return; + return FALSE; /* The following test should never be true, but it's better to do it because if 'is_fatal_error' is set the server is not going to execute @@ -822,6 +822,7 @@ write_eof_packet(THD *thd, uint server_status, uint total_warn_count) */ thd->cur_data->embedded_info->warning_count= (thd->spcont ? 0 : min(total_warn_count, 65535)); + return FALSE; } @@ -1032,31 +1033,34 @@ bool Protocol_binary::write() @sa Server implementation of net_send_ok in protocol.cc for description of the arguments. - @return The function does not return errors. + @return + @retval TRUE An error occurred + @retval FALSE Success */ -void +bool net_send_ok(THD *thd, uint server_status, uint total_warn_count, ha_rows affected_rows, ulonglong id, const char *message) { DBUG_ENTER("emb_net_send_ok"); MYSQL_DATA *data; + bool error; MYSQL *mysql= thd->mysql; if (!mysql) // bootstrap file handling - DBUG_VOID_RETURN; + DBUG_RETURN(FALSE); if (!(data= thd->alloc_new_dataset())) - return; + return TRUE; data->embedded_info->affected_rows= affected_rows; data->embedded_info->insert_id= id; if (message) strmake(data->embedded_info->info, message, sizeof(data->embedded_info->info)-1); - write_eof_packet(thd, server_status, total_warn_count); + error= write_eof_packet(thd, server_status, total_warn_count); thd->cur_data= 0; - DBUG_VOID_RETURN; + DBUG_RETURN(error); } @@ -1065,18 +1069,21 @@ net_send_ok(THD *thd, @sa net_send_ok - @return This function does not return errors. + @return + @retval TRUE An error occurred + @retval FALSE Success */ -void +bool net_send_eof(THD *thd, uint server_status, uint total_warn_count) { - write_eof_packet(thd, server_status, total_warn_count); + bool error= write_eof_packet(thd, server_status, total_warn_count); thd->cur_data= 0; + return error; } -void net_send_error_packet(THD *thd, uint sql_errno, const char *err) +bool net_send_error_packet(THD *thd, uint sql_errno, const char *err) { MYSQL_DATA *data= thd->cur_data; struct embedded_query_result *ei; @@ -1084,7 +1091,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err) if (!thd->mysql) // bootstrap file handling { fprintf(stderr, "ERROR: %d %s\n", sql_errno, err); - return; + return TRUE; } if (!data) @@ -1096,6 +1103,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err) strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno)); ei->server_status= thd->server_status; thd->cur_data= 0; + return FALSE; } -- cgit v1.2.1 From 7c6ed98f6a55dbc2442e6479d74388cfb946555d Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 30 Jul 2009 00:44:04 +0200 Subject: Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al. Fixed wrong prototype declaration which cased build failure on solaris. --- libmysqld/emb_qcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysqld') diff --git a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h index 67413739f2c..ecf91487667 100644 --- a/libmysqld/emb_qcache.h +++ b/libmysqld/emb_qcache.h @@ -79,4 +79,4 @@ public: uint emb_count_querycache_size(THD *thd); int emb_load_querycache_result(THD *thd, Querycache_stream *src); void emb_store_querycache_result(Querycache_stream *dst, THD* thd); -void net_send_eof(THD *thd, uint server_status, uint total_warn_count); +bool net_send_eof(THD *thd, uint server_status, uint total_warn_count); -- cgit v1.2.1 From 6df2af22ceda4a59fc43a661f6ecfac362e9783a Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Fri, 31 Jul 2009 15:22:02 -0400 Subject: Bug#17270 - mysql client tool could not find ../share/charsets folder and fails. - 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. --- libmysqld/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysqld') diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 17e308b3324..fd2609d026e 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -23,7 +23,7 @@ MYSQLBASEdir= $(prefix) DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ - -DDATADIR="\"$(MYSQLDATAdir)\"" \ + -DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \ -I$(top_builddir)/include -I$(top_srcdir)/include \ -- cgit v1.2.1 From 63212b164363569a51106c3f516b53d4df745a28 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 11 Sep 2009 15:52:08 +0300 Subject: Bug #45159 : some tests in suite "jp" fail in embedded server (use LOAD DATA) Initialize correctly client flags for the embedded client Test cases in jp updated to work correctly with embedded server. --- libmysqld/libmysqld.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libmysqld') diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index eb47a045669..969ea442622 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -164,6 +164,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, port=0; unix_socket=0; + client_flag|=mysql->options.client_flag; /* Send client information for access check */ client_flag|=CLIENT_CAPABILITIES; if (client_flag & CLIENT_MULTI_STATEMENTS) -- cgit v1.2.1