diff options
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 7 | ||||
-rw-r--r-- | libmysqld/emb_qcache.h | 7 | ||||
-rw-r--r-- | libmysqld/examples/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libmysqld/examples/Makefile.am | 4 | ||||
-rw-r--r-- | libmysqld/examples/builder-sample/emb_sample.bpr | 16 | ||||
-rw-r--r-- | libmysqld/examples/builder-sample/emb_sample.cpp | 16 | ||||
-rw-r--r-- | libmysqld/examples/builder-sample/emb_samples.cpp | 16 | ||||
-rw-r--r-- | libmysqld/examples/builder-sample/emb_samples.h | 16 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 28 | ||||
-rw-r--r-- | libmysqld/libmysqld.c | 7 |
11 files changed, 110 insertions, 13 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 4c6aa2f3a7f..d964def7505 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # 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 diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index ef17a0a6923..7605c33021f 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -1,4 +1,5 @@ -# Copyright (C) 2001-2006 MySQL AB +# Copyright (c) 2001-2008 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -12,8 +13,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA # # This file is public domain and comes with NO WARRANTY of any kind diff --git a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h index ecf91487667..f53d5eb82fb 100644 --- a/libmysqld/emb_qcache.h +++ b/libmysqld/emb_qcache.h @@ -1,4 +1,6 @@ -/* Copyright (C) 2003, 2005 MySQL AB +/* + Copyright (c) 2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc. + Use is subject to license terms. 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 @@ -11,7 +13,8 @@ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ class Querycache_stream { diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index 1f41d608099..e5f6388496b 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # 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 diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index a5ed182507a..6f0111f8bbc 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2000 MySQL AB +# Copyright (c) 2001, 2010, Oracle and/or its affiliates # # 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 @@ -11,7 +11,7 @@ # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_PROGRAMS = mysql bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded diff --git a/libmysqld/examples/builder-sample/emb_sample.bpr b/libmysqld/examples/builder-sample/emb_sample.bpr index 07b39a6832b..100e5b98dfd 100644 --- a/libmysqld/examples/builder-sample/emb_sample.bpr +++ b/libmysqld/examples/builder-sample/emb_sample.bpr @@ -1,3 +1,19 @@ +# Copyright (c) 2002 MySQL AB +# Use is subject to license terms. +# +# 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 + # --------------------------------------------------------------------------- !if !$d(BCB) BCB = $(MAKEDIR)\.. diff --git a/libmysqld/examples/builder-sample/emb_sample.cpp b/libmysqld/examples/builder-sample/emb_sample.cpp index 5ad3bd69319..0c8f4fa0598 100644 --- a/libmysqld/examples/builder-sample/emb_sample.cpp +++ b/libmysqld/examples/builder-sample/emb_sample.cpp @@ -1,3 +1,19 @@ +// Copyright (c) 2002 MySQL AB +// Use is subject to license terms. +// +// 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 <vcl.h> #pragma hdrstop diff --git a/libmysqld/examples/builder-sample/emb_samples.cpp b/libmysqld/examples/builder-sample/emb_samples.cpp index be3f1931af5..aab1385f6e6 100644 --- a/libmysqld/examples/builder-sample/emb_samples.cpp +++ b/libmysqld/examples/builder-sample/emb_samples.cpp @@ -1,3 +1,19 @@ +// Copyright (c) 2002, 2004, 2007 MySQL AB +// Use is subject to license terms. +// +// 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 <vcl.h> #pragma hdrstop diff --git a/libmysqld/examples/builder-sample/emb_samples.h b/libmysqld/examples/builder-sample/emb_samples.h index 0562bc783cd..3024e75d533 100644 --- a/libmysqld/examples/builder-sample/emb_samples.h +++ b/libmysqld/examples/builder-sample/emb_samples.h @@ -1,3 +1,19 @@ +// Copyright (c) 2002 MySQL AB +// Use is subject to license terms. +// +// 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 + //--------------------------------------------------------------------------- #ifndef emb_samplesH #define emb_samplesH diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 627f67cf170..226d49b5154 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -51,6 +51,23 @@ extern "C" void unireg_clear(int exit_code) DBUG_VOID_RETURN; } +/* + Wrapper error handler for embedded server to call client/server error + handler based on whether thread is in client/server context +*/ + +static int embedded_error_handler(uint error, const char *str, myf MyFlags) +{ + DBUG_ENTER("embedded_error_handler"); + + /* + If current_thd is NULL, it means restore_global has been called and + thread is in client context, then call client error handler else call + server error handler. + */ + DBUG_RETURN(current_thd ? my_message_sql(error, str, MyFlags): + my_message_no_curses(error, str, MyFlags)); +} /* Reads error information from the MYSQL_DATA and puts @@ -107,7 +124,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, if (mysql->status != MYSQL_STATUS_READY) { set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); - return 1; + result= 1; + goto end; } /* Clear result variables */ @@ -147,6 +165,9 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) thd->profiling.finish_current_query(); #endif + +end: + thd->restore_globals(); return result; } @@ -524,7 +545,10 @@ int init_embedded_server(int argc, char **argv, char **groups) return 1; } - error_handler_hook = my_message_sql; + /* + set error_handler_hook to embedded_error_handler wrapper. + */ + error_handler_hook= embedded_error_handler; acl_error= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index afb91b7ff81..901decf9dc6 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -1,4 +1,6 @@ -/* Copyright (C) 2000 MySQL AB +/* + Copyright (c) 2001-2008 MySQL AB, 2009 Sun Microsystems, Inc. + Use is subject to license terms. 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 @@ -11,7 +13,8 @@ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #include <my_global.h> #include <mysql.h> |