diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2009-09-29 17:49:36 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2009-09-29 17:49:36 +0500 |
commit | dfd8880de84ddf10339b0ab0e6af1bdc0a6c4f44 (patch) | |
tree | 4f8703aec195c605079ee82c9a810dcc9462d375 /libmysqld | |
parent | 173802140785148cc9e68cb149d9d6501b54a04f (diff) | |
parent | 8d3d35ea5715739ac94785b8c9ff1a185699a84a (diff) | |
download | mariadb-git-dfd8880de84ddf10339b0ab0e6af1bdc0a6c4f44.tar.gz |
merging
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/CMakeLists.txt | 59 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 2 | ||||
-rw-r--r-- | libmysqld/emb_qcache.h | 2 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 46 | ||||
-rw-r--r-- | libmysqld/libmysqld.c | 1 |
5 files changed, 41 insertions, 69 deletions
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) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index ef2fab2da6d..a9bd8d9e17c 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -26,7 +26,7 @@ pkgplugindir = $(pkglibdir)/plugin EXTRA_DIST = libmysqld.def CMakeLists.txt DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ - -DDATADIR="\"$(MYSQLDATAdir)\"" \ + -DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DPLUGINDIR="\"$(pkgplugindir)\"" INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \ 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); diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 4fd5cf19812..778d4874ad4 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -806,11 +806,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 @@ -825,6 +825,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; } @@ -1035,31 +1036,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); } @@ -1068,27 +1072,41 @@ 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 ? 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 TRUE; + } + + 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)); ei->server_status= thd->server_status; thd->cur_data= 0; + return FALSE; } diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index aff9391e015..0c20b35236d 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) |