Skip to content

Commit e409d6f

Browse files
author
Mats Kindahl
committed
WL#5030: Split and remove mysql_priv.h
This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
1 parent 36430c5 commit e409d6f

325 files changed

Lines changed: 13308 additions & 3166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bzrignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ client/rpl_tblmap.cc
394394
client/rpl_utility.h
395395
client/rpl_utility.cc
396396
client/select_test
397+
client/sql_const.h
397398
client/sql_string.cpp
398399
client/ssl_test
399400
client/thimble
@@ -1209,7 +1210,7 @@ libmysqld/stacktrace.c
12091210
libmysqld/strfunc.cc
12101211
libmysqld/table.cc
12111212
libmysqld/thr_malloc.cc
1212-
libmysqld/time.cc
1213+
libmysqld/sql_time.cc
12131214
libmysqld/tztime.cc
12141215
libmysqld/uniques.cc
12151216
libmysqld/unireg.cc
@@ -1414,7 +1415,7 @@ mysql-test/var/*
14141415
mysql-test/windows_sys_vars.inc
14151416
mysql.kdevprj
14161417
mysql.proj
1417-
mysql_priv.h
1418+
sql_priv.h
14181419
mysqlbinlog/*.ds?
14191420
mysqlbinlog/*.vcproj
14201421
mysqlcheck/*.ds?

client/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ DEFS = -DMYSQL_CLIENT_NO_THREADS \
103103
-DDEFAULT_MYSQL_HOME="\"$(prefix)\"" \
104104
-DMYSQL_DATADIR="\"$(localstatedir)\""
105105

106-
sql_src=log_event.h mysql_priv.h rpl_constants.h \
106+
sql_src=log_event.h sql_priv.h rpl_constants.h \
107107
rpl_tblmap.h rpl_tblmap.cc \
108108
log_event.cc my_decimal.h my_decimal.cc \
109109
log_event_old.h log_event_old.cc \
110110
rpl_record_old.h rpl_record_old.cc \
111111
rpl_utility.h rpl_utility.cc \
112-
transaction.h
112+
transaction.h sql_const.h
113113
strings_src=decimal.c dtoa.c
114114

115115
link_sources:

client/client_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <my_sys.h>
2020
#include <m_string.h>
2121
#include <mysql.h>
22-
#include <mysql_embed.h>
2322
#include <errmsg.h>
2423
#include <my_getopt.h>
2524

client/mysqlbinlog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "client_priv.h"
3232
#include <my_time.h>
3333
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
34-
#include "mysql_priv.h"
34+
#include "sql_priv.h"
3535
#include "log_event.h"
3636
#include "sql_common.h"
3737

include/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
3434
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
3535

3636
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
37-
heap.h my_bitmap.h my_uctype.h \
37+
heap.h my_bitmap.h my_uctype.h password.h \
3838
myisam.h myisampack.h myisammrg.h ft_global.h\
3939
mysys_err.h my_base.h help_start.h help_end.h \
4040
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \

include/hash.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717

1818
#ifndef _hash_h
1919
#define _hash_h
20+
21+
#include "my_global.h" /* uchar */
22+
#include "my_sys.h" /* DYNAMIC_ARRAY */
23+
24+
/*
25+
This forward declaration is used from C files where the real
26+
definition is included before. Since C does not allow repeated
27+
typedef declarations, even when identical, the definition may not be
28+
repeated.
29+
*/
30+
#ifndef CHARSET_INFO_DEFINED
31+
#define CHARSET_INFO_DEFINED
32+
typedef struct charset_info_st CHARSET_INFO;
33+
#endif /* CHARSET_INFO_DEFINED */
34+
2035
#ifdef __cplusplus
2136
extern "C" {
2237
#endif

include/keycache.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
#ifndef _keycache_h
1919
#define _keycache_h
20+
21+
#include "my_sys.h" /* flush_type */
22+
2023
C_MODE_START
2124

2225
/* declare structures that is used by st_key_cache */

include/m_ctype.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515

1616
/*
1717
A better inplementation of the UNIX ctype(3) library.
18-
Notes: my_global.h should be included before ctype.h
1918
*/
2019

2120
#ifndef _m_ctype_h
2221
#define _m_ctype_h
2322

2423
#include <my_attribute.h>
24+
#include "my_global.h" /* uint16, uchar */
2525

2626
#ifdef __cplusplus
2727
extern "C" {
@@ -265,6 +265,12 @@ extern MY_CHARSET_HANDLER my_charset_8bit_handler;
265265
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
266266

267267

268+
/*
269+
We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
270+
typedef in hash.c, which will cause a compiler error.
271+
*/
272+
#define CHARSET_INFO_DEFINED
273+
268274
/* See strings/CHARSET_INFO.txt about information on this structure */
269275
typedef struct charset_info_st
270276
{

include/m_string.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
#ifndef _m_string_h
2222
#define _m_string_h
23+
24+
#include "my_global.h" /* HAVE_* */
25+
2326
#ifndef __USE_GNU
2427
#define __USE_GNU /* We want to use stpcpy */
2528
#endif
@@ -266,13 +269,6 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
266269
#endif
267270
#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
268271

269-
/* my_vsnprintf.c */
270-
271-
extern size_t my_vsnprintf(char *str, size_t n,
272-
const char *format, va_list ap);
273-
extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
274-
ATTRIBUTE_FORMAT(printf, 3, 4);
275-
276272
#if defined(__cplusplus)
277273
}
278274
#endif
@@ -365,4 +361,10 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
365361
return (end);
366362
}
367363

364+
static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
365+
{
366+
lex_str->str= (char *) c_str;
367+
lex_str->length= strlen(c_str);
368+
}
369+
368370
#endif

include/my_dbug.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,23 @@ extern const char* _db_get_func_(void);
145145
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
146146

147147
#endif
148-
#ifdef __cplusplus
148+
149+
#ifdef EXTRA_DEBUG
150+
/**
151+
Sync points allow us to force the server to reach a certain line of code
152+
and block there until the client tells the server it is ok to go on.
153+
The client tells the server to block with SELECT GET_LOCK()
154+
and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
155+
concurrency problems
156+
*/
157+
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
158+
debug_sync_point(lock_name,lock_timeout)
159+
void debug_sync_point(const char* lock_name, uint lock_timeout);
160+
#else
161+
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
162+
#endif /* EXTRA_DEBUG */
163+
164+
#ifdef __cplusplus
149165
}
150166
#endif
151167
#endif

0 commit comments

Comments
 (0)