diff options
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/CMakeLists.txt | 15 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 37 | ||||
-rw-r--r-- | libmysqld/emb_qcache.cc | 3 | ||||
-rw-r--r-- | libmysqld/emb_qcache.h | 5 | ||||
-rw-r--r-- | libmysqld/embedded_priv.h | 5 | ||||
-rw-r--r-- | libmysqld/examples/CMakeLists.txt | 15 | ||||
-rw-r--r-- | libmysqld/examples/Makefile.am | 3 | ||||
-rwxr-xr-x | libmysqld/examples/test-run | 2 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 13 | ||||
-rw-r--r-- | libmysqld/libmysqld.c | 3 |
10 files changed, 80 insertions, 21 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index c80501c29ca..b0b32fab76b 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -1,3 +1,18 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index cf4f90d99c9..a0a041d2f8d 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -1,9 +1,9 @@ -# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# Copyright (C) 2001-2006 MySQL AB # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. +# License as published by the Free Software Foundation; version 2 +# of the License. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -72,13 +72,15 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ event_queue.cc event_db_repository.cc \ rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \ sql_tablespace.cc \ - rpl_injector.cc my_user.c partition_info.cc + rpl_injector.cc my_user.c partition_info.cc \ + sql_servers.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) libmysqld_a_SOURCES= sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES) storagesources = @condition_dependent_plugin_modules@ +storageobjects = @condition_dependent_plugin_objects@ storagesourceslinks = @condition_dependent_plugin_links@ # automake misses these @@ -109,6 +111,24 @@ ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc handler.o: handler.cc $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< +# We need rules to compile these as no good way +# found to append fileslists that collected by configure +# to the sources list + +ha_federated.o:ha_federated.cc + $(CXXCOMPILE) $(LM_CFLAGS) -c $< + +ha_heap.o:ha_heap.cc + $(CXXCOMPILE) $(LM_CFLAGS) -c $< + +ha_innodb.o:ha_innodb.cc + $(CXXCOMPILE) $(LM_CFLAGS) -c $< + +ha_myisam.o:ha_myisam.cc + $(CXXCOMPILE) $(LM_CFLAGS) -c $< + +ha_myisammrg.o:ha_myisammrg.cc + $(CXXCOMPILE) $(LM_CFLAGS) -c $< # # To make it easy for the end user to use the embedded library we @@ -120,18 +140,18 @@ handler.o: handler.cc # need to add the same file twice to the library, so 'sort -u' save us # some time and spares unnecessary work. -libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) +libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects) if DARWIN_MWCC - mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` + mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects) else -rm -f libmysqld.a if test "$(host_os)" = "netware" ; \ then \ - $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \ + $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \ else \ current_dir=`pwd`; \ rm -rf tmp; mkdir tmp; \ - (for arc in ./libmysqld_int.a $(INC_LIB); do \ + (for arc in $(INC_LIB) ./libmysqld_int.a; do \ arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \ artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \ for F in `$(AR) t $$arc | grep -v SYMDEF`; do \ @@ -142,6 +162,7 @@ else ls $$artmp/* | grep -v SYMDEF; \ continue 2; fi; done; \ done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \ + $(AR) r libmysqld.a $(storageobjects); \ $(RANLIB) libmysqld.a ; \ rm -rf tmp; \ fi diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index 078243a6d5e..e6f35aa33a0 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -2,8 +2,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h index 6201058ce56..5c5209902a1 100644 --- a/libmysqld/emb_qcache.h +++ b/libmysqld/emb_qcache.h @@ -1,9 +1,8 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2003, 2005 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index 5ba6f34a2eb..369b344d4bd 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -1,9 +1,8 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2001-2004, 2006 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index 5c58264a7e7..b33b4740c93 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -1,3 +1,18 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/extra/yassl/include) diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index c705fb1e68d..f8c60ab3694 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -2,8 +2,7 @@ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. +# the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysqld/examples/test-run b/libmysqld/examples/test-run index c7434488259..aea5b13eaba 100755 --- a/libmysqld/examples/test-run +++ b/libmysqld/examples/test-run @@ -10,7 +10,7 @@ top_builddir=../.. mysql_test_dir=$top_builddir/mysql-test examples=$top_builddir/libmysqld/examples -mysqltest=$examples/mysqltest +mysqltest=$examples/mysqltest_embedded datadir=$mysql_test_dir/var/master-data test_data_dir=test gdb=0 diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 9251ddd421a..2853baf2dfe 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -198,6 +198,7 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) stmt->stmt_id= thd->client_stmt_id; stmt->param_count= thd->client_param_count; stmt->field_count= 0; + mysql->warning_count= thd->total_warn_count; if (thd->first_data) { @@ -306,7 +307,11 @@ int emb_read_binary_rows(MYSQL_STMT *stmt) { MYSQL_DATA *data; if (!(data= emb_read_rows(stmt->mysql, 0, 0))) + { + set_stmt_errmsg(stmt, stmt->mysql->net.last_error, + stmt->mysql->net.last_errno, stmt->mysql->net.sqlstate); return 1; + } stmt->result= *data; my_free((char *) data, MYF(0)); set_stmt_errmsg(stmt, stmt->mysql->net.last_error, @@ -542,6 +547,7 @@ int init_embedded_server(int argc, char **argv, char **groups) } } + execute_ddl_log_recovery(); return 0; } @@ -549,6 +555,7 @@ void end_embedded_server() { my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR)); copy_arguments_ptr=0; + release_ddl_log(); clean_up(0); } @@ -586,6 +593,7 @@ void *create_embedded_thd(int client_flag) thd->set_time(); thd->init_for_queries(); thd->client_capabilities= client_flag; + thd->real_id= (pthread_t) thd; thd->db= NULL; thd->db_length= 0; @@ -771,6 +779,8 @@ MYSQL_DATA *THD::alloc_new_dataset() static void write_eof_packet(THD *thd) { + if (!thd->mysql) // bootstrap file handling + return; /* 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 @@ -1030,6 +1040,9 @@ void Protocol_simple::prepare_for_resend() MYSQL_DATA *data= thd->cur_data; DBUG_ENTER("send_data"); + if (!thd->mysql) // bootstrap file handling + DBUG_VOID_RETURN; + data->rows++; if (!(cur= (MYSQL_ROWS *)alloc_root(alloc, sizeof(MYSQL_ROWS)+(field_count + 1) * sizeof(char *)))) { diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 58a22686199..eb47a045669 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -2,8 +2,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |