Skip to content

Commit da60d37

Browse files
author
Tor Didriksen
committed
Bug#20308296 CLEANUP #INCLUDE OF PLUGIN CODE IN M_STRING.H
In m_string.h we currently do #include of plugin.h This effectively makes *all* other code dependent on plugin declarations. Fix: In m_string: only include the declaration of st_mysql_lex_string, and my_snprintf/my_vsnprintf
1 parent bcc66fd commit da60d37

31 files changed

+92
-46
lines changed

include/m_string.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -27,6 +27,8 @@
2727
#define strmov please_use_my_stpcpy_or_my_stpmov_rather_than_strmov
2828
#define strnmov please_use_my_stpncpy_or_my_stpnmov_rather_than_strnmov
2929

30+
#include "mysql/service_my_snprintf.h"
31+
3032
#if defined(__cplusplus)
3133
extern "C" {
3234
#endif
@@ -228,7 +230,7 @@ extern char *longlong10_to_str(longlong val,char *dst,int radix);
228230
(it's part of the plugin API as a MYSQL_LEX_STRING)
229231
*/
230232

231-
#include <mysql/plugin.h>
233+
#include <mysql/mysql_lex_string.h>
232234
typedef struct st_mysql_lex_string LEX_STRING;
233235

234236
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))

include/myisam.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
2323
#include "m_ctype.h"
2424
#include "keycache.h"
2525
#include "my_compare.h"
26-
#include "mysql/plugin.h"
2726
#include "my_check_opt.h"
2827
#include "m_string.h"
2928

include/mysql/mysql_lex_string.h

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation; version 2 of the License.
6+
7+
This program is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
GNU General Public License for more details.
11+
12+
You should have received a copy of the GNU General Public License
13+
along with this program; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15+
16+
#ifndef MYSQL_LEX_STRING_INCLUDED
17+
#define MYSQL_LEX_STRING_INCLUDED
18+
19+
struct st_mysql_lex_string
20+
{
21+
char *str;
22+
size_t length;
23+
};
24+
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
25+
26+
#endif // MYSQL_LEX_STRING_INCLUDED

include/mysql/plugin_audit.h.pp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
1010
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
1111
#include <mysql/service_thd_alloc.h>
12+
#include <mysql/mysql_lex_string.h>
1213
struct st_mysql_lex_string
1314
{
1415
char *str;

include/mysql/plugin_auth.h.pp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
1010
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
1111
#include <mysql/service_thd_alloc.h>
12+
#include <mysql/mysql_lex_string.h>
1213
struct st_mysql_lex_string
1314
{
1415
char *str;

include/mysql/plugin_ftparser.h.pp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
1010
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
1111
#include <mysql/service_thd_alloc.h>
12+
#include <mysql/mysql_lex_string.h>
1213
struct st_mysql_lex_string
1314
{
1415
char *str;

include/mysql/service_thd_alloc.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED
2-
/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
2+
/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -35,12 +35,7 @@
3535
extern "C" {
3636
#endif
3737

38-
struct st_mysql_lex_string
39-
{
40-
char *str;
41-
size_t length;
42-
};
43-
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
38+
#include <mysql/mysql_lex_string.h>
4439

4540
extern struct thd_alloc_service_st {
4641
void *(*thd_alloc_func)(MYSQL_THD, size_t);

sql-common/client_authentication.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
3434
#include <openssl/applink.c>
3535
#endif
3636
#endif
37-
#include "mysql/service_my_plugin_log.h"
37+
#include "mysql/plugin.h"
3838

3939
#define MAX_CIPHER_LENGTH 1024
4040

sql/event_data_objects.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _EVENT_DATA_OBJECTS_H_
22
#define _EVENT_DATA_OBJECTS_H_
3-
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
3+
/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
2626
#include "thr_lock.h" /* thr_lock_type */
2727

2828
class Field;
29+
class String;
2930
class THD;
3031
class Time_zone;
3132
struct TABLE;

sql/event_queue.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _EVENT_QUEUE_H_
22
#define _EVENT_QUEUE_H_
3-
/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
3+
/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
2626
*/
2727

2828
#include "my_global.h" // uint
29-
#include "sql_string.h" /* LEX_STRING */
29+
#include "mysql/mysql_lex_string.h" // LEX_STRING
3030
#include "my_time.h" /* my_time_t, interval_type */
3131
#include "my_pthread.h" // mysql_mutex_t
3232

sql/events.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _EVENT_H_
22
#define _EVENT_H_
3-
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
3+
/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -38,16 +38,19 @@ extern PSI_stage_info stage_waiting_on_empty_queue;
3838
extern PSI_stage_info stage_waiting_for_next_activation;
3939
extern PSI_stage_info stage_waiting_for_scheduler_to_stop;
4040

41-
#include "sql_string.h" /* LEX_STRING */
41+
#include "mysql/mysql_lex_string.h" // LEX_STRING
4242
#include "my_time.h" /* interval_type */
4343

4444
class Event_db_repository;
4545
class Event_parse_data;
4646
class Event_queue;
4747
class Event_scheduler;
48+
class Item;
49+
class String;
4850
struct TABLE_LIST;
4951
class THD;
5052
typedef struct charset_info_st CHARSET_INFO;
53+
typedef struct st_mysql_lex_string LEX_STRING;
5154

5255
int
5356
sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);

sql/gcalc_tools.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
1818
#define GCALC_TOOLS_INCLUDED
1919

2020
#include "gcalc_slicescan.h"
21-
21+
#include "sql_string.h" // String
2222

2323
/*
2424
The Gcalc_function class objects are used to check for a binary relation.

sql/gstream.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
1919
*/
2020

2121
#include "gstream.h"
22-
#include "m_string.h" // LEX_STRING
22+
#include "mysql/mysql_lex_string.h" // LEX_STRING
2323
/* key_memory_Gis_read_stream_err_msg */
2424
#include "mysqld.h"
2525

sql/item_create.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
#ifndef ITEM_CREATE_H
1919
#define ITEM_CREATE_H
2020

21-
#include "m_string.h" // LEX_STRING
22-
#include "item_func.h" // Cast_target
21+
#include "my_global.h"
22+
#include "mysql/mysql_lex_string.h" // LEX_STRING
23+
#include "item_func.h" // Cast_target
2324

2425
class Item;
2526
class PT_item_list;

sql/ndb_thd_ndb.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
1616
*/
1717

1818
#include "ndb_thd_ndb.h"
19+
#include "mysql/plugin.h" // thd_get_thread_id
1920

2021
/*
2122
Default value for max number of transactions createable against NDB from

sql/opt_trace.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@ class sp_head;
2828
class sp_printable;
2929
class set_var_base;
3030
class Cost_estimate;
31+
class Item;
3132

3233
/**
3334
@file

sql/parse_file.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -*- C++ -*- */
2-
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
2+
/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -17,8 +17,8 @@
1717
#ifndef _PARSE_FILE_H_
1818
#define _PARSE_FILE_H_
1919

20-
#include "my_global.h" // uchar
21-
#include "sql_string.h" // LEX_STRING
20+
#include "my_global.h" // uchar
21+
#include "mysql/mysql_lex_string.h" // LEX_STRING
2222
#include "sql_alloc.h"
2323

2424
class THD;

sql/protocol.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef PROTOCOL_INCLUDED
22
#define PROTOCOL_INCLUDED
33

4-
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@ class i_string;
2323
class Field;
2424
class THD;
2525
class Item_param;
26+
class Item;
2627
typedef struct st_mysql_field MYSQL_FIELD;
2728
typedef struct st_mysql_rows MYSQL_ROWS;
2829

sql/rpl_filter.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
2626

2727
class String;
2828
struct TABLE_LIST;
29+
class Item;
2930

3031
typedef struct st_table_rule_ent
3132
{

sql/sp_pcontext.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -*- C++ -*- */
2-
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
2+
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,8 @@
1717
#ifndef _SP_PCONTEXT_H_
1818
#define _SP_PCONTEXT_H_
1919

20-
#include "sql_string.h" // LEX_STRING
20+
#include "my_global.h"
21+
#include "mysql/mysql_lex_string.h" // LEX_STRING
2122
#include "mysql_com.h" // enum_field_types
2223
#include "field.h" // Create_field
2324
#include "mem_root_array.h" // Mem_root_array

sql/spatial.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
#ifndef SPATIAL_INCLUDED
1717
#define SPATIAL_INCLUDED
1818

19-
#include "sql_string.h" /* String, LEX_STRING */
20-
#include <my_compiler.h>
19+
#include "my_global.h"
20+
#include "mysql/mysql_lex_string.h" // LEX_STRING
2121
#include "gcalc_tools.h"
2222
#include "mysqld.h"
23+
#include "sql_string.h" // String
2324

2425
#include <vector>
2526
#include <algorithm>

sql/sql_alter.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "sql_list.h" // List
2121

2222
class Create_field;
23+
class Item;
2324
class Key;
2425
class String;
2526
struct TABLE_LIST;

sql/sql_data_change.h

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "sql_alloc.h" // Sql_alloc
2929

3030
struct TABLE;
31+
class Item;
3132
template <class T> class List;
3233

3334
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };

sql/sql_error.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -17,13 +17,13 @@
1717
#define SQL_ERROR_H
1818

1919
#include "sql_list.h"
20-
#include "m_string.h" /* LEX_STRING */
2120
#include "sql_string.h" /* String */
2221
#include "sql_plist.h" /* I_P_List */
2322
#include "mysql_com.h" /* MYSQL_ERRMSG_SIZE */
2423

2524
class THD;
2625
class my_decimal;
26+
typedef struct st_mysql_lex_string LEX_STRING;
2727

2828
///////////////////////////////////////////////////////////////////////////
2929

sql/sql_plugin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
2121

2222
#include <mysql/plugin.h>
2323

24-
#include "m_string.h" /* LEX_STRING */
24+
#include "mysql/mysql_lex_string.h" // LEX_STRING
2525
#include "my_alloc.h" /* MEM_ROOT */
2626
#include "my_getopt.h" /* my_option */
2727

0 commit comments

Comments
 (0)