Skip to content

Commit

Permalink
Bug#25304844: REMOVE EMBEDDED_LIBRARY #IFDEF
Browse files Browse the repository at this point in the history
Remove dead code related to embedded server.

Part 4: Remove EMBEDDED_LIBRARY ifdef from libmysql/
libservices/ sql-common/ and testclients/
  • Loading branch information
jhauglid committed Jan 11, 2017
1 parent a4328ac commit 6156540
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 287 deletions.
3 changes: 1 addition & 2 deletions include/mysql.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand Down Expand Up @@ -534,7 +534,6 @@ unsigned long STDCALL mysql_real_escape_string_quote(MYSQL *mysql,
void STDCALL mysql_debug(const char *debug);
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
int STDCALL mysql_reset_connection(MYSQL *mysql);

Expand Down
1 change: 0 additions & 1 deletion include/mysql.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@
void mysql_debug(const char *debug);
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);
my_bool mysql_read_query_result(MYSQL *mysql);
int mysql_reset_connection(MYSQL *mysql);
int mysql_binlog_open(MYSQL *mysql, MYSQL_RPL *rpl);
Expand Down
9 changes: 1 addition & 8 deletions libmysql/client_settings.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand Down Expand Up @@ -68,13 +68,6 @@ const char * cli_read_statistics(MYSQL *mysql);
int cli_read_change_user_result(MYSQL *mysql);
C_MODE_END

#ifdef EMBEDDED_LIBRARY
C_MODE_START
int init_embedded_server(int argc, char **argv, char **groups);
void end_embedded_server();
C_MODE_END
#endif /*EMBEDDED_LIBRARY*/

C_MODE_START
extern int mysql_init_character_set(MYSQL *mysql);
C_MODE_END
16 changes: 0 additions & 16 deletions libmysql/libmysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ int STDCALL mysql_server_init(int argc MY_ATTRIBUTE((unused)),
mysql_debug(NullS);
#if defined(SIGPIPE) && !defined(_WIN32)
(void) signal(SIGPIPE, SIG_IGN);
#endif
#ifdef EMBEDDED_LIBRARY
if (argc > -1)
result= init_embedded_server(argc, argv, groups);
#endif
}
else
Expand Down Expand Up @@ -187,9 +183,6 @@ void STDCALL mysql_server_end()

mysql_client_plugin_deinit();

#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
finish_client_errs();
vio_end();

Expand Down Expand Up @@ -1079,15 +1072,6 @@ uint STDCALL mysql_thread_safe(void)
}


my_bool STDCALL mysql_embedded(void)
{
#ifdef EMBEDDED_LIBRARY
return 1;
#else
return 0;
#endif
}

/****************************************************************************
Some support functions
****************************************************************************/
Expand Down
8 changes: 3 additions & 5 deletions libmysql/mysql_trace.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand Down Expand Up @@ -30,12 +30,10 @@
C_MODE_START

/*
Disable trace hooks if the infrastructure is not enabled or if
libmysql code is used from within the (embedded) server.
Disable trace hooks if the infrastructure is not enabled
*/
#if !defined(CLIENT_PROTOCOL_TRACING) \
|| defined(MYSQL_SERVER) \
|| defined(EMBEDDED_LIBRARY)
|| defined(MYSQL_SERVER)

#define MYSQL_TRACE(E, M, ARGS)
#define MYSQL_TRACE_STAGE(M, S)
Expand Down
5 changes: 2 additions & 3 deletions libservices/service_command.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand All @@ -16,6 +16,5 @@
02110-1301 USA */

#include <service_versions.h>
#ifndef EMBEDDED_LIBRARY

SERVICE_VERSION *command_service= (void*)VERSION_command;
#endif
5 changes: 2 additions & 3 deletions libservices/srv_session_info_service.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand All @@ -16,6 +16,5 @@
02110-1301 USA */

#include <service_versions.h>
#ifndef EMBEDDED_LIBRARY

SERVICE_VERSION *srv_session_info_service= (void*)VERSION_srv_session_info_service;
#endif
5 changes: 2 additions & 3 deletions libservices/srv_session_service.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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
Expand All @@ -16,6 +16,5 @@
02110-1301 USA */

#include <service_versions.h>
#ifndef EMBEDDED_LIBRARY

SERVICE_VERSION *srv_session_service= (void*)VERSION_srv_session_service;
#endif
Loading

0 comments on commit 6156540

Please sign in to comment.