Skip to content

Commit fd66395

Browse files
Sunny BainsSunny Bains
Sunny Bains
authored and
Sunny Bains
committed
WL#6835 - Merge from mysql-trunk
2 parents 46b0b0b + 0a27b72 commit fd66395

File tree

159 files changed

+5530
-1199
lines changed

Some content is hidden

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

159 files changed

+5530
-1199
lines changed

client/base/abstract_program.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,8 @@ void Abstract_program::aggregate_options()
143143
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0};
144144
this->m_options.push_back(sentinel);
145145
}
146+
147+
void Mysql::Tools::Base::Abstract_program::print_usage()
148+
{
149+
this->m_help_options.print_usage();
150+
}

client/base/abstract_program.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ class Abstract_program : public Options::Composite_options_provider
8080
*/
8181
virtual int execute(vector<string> positional_options)= 0;
8282

83+
/**
84+
Prints usage message. Does not end the program execution.
85+
*/
86+
void print_usage();
87+
8388
protected:
8489
Abstract_program();
8590

client/base/help_options.cc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ void Help_options::create_options()
3838
}
3939

4040
void Help_options::help_callback(char* argument __attribute__((unused)))
41+
{
42+
this->print_usage();
43+
exit(0);
44+
}
45+
46+
void Mysql::Tools::Base::Options::Help_options::print_usage()
4147
{
4248
std::string first_year_str=
4349
(static_cast<std::ostringstream*>(&(
44-
std::ostringstream() << this->m_program->get_first_release_year()) )
50+
std::ostringstream() << this->m_program->get_first_release_year()))
4551
->str());
4652
string copyright;
4753

@@ -60,11 +66,10 @@ void Help_options::help_callback(char* argument __attribute__((unused)))
6066
}
6167

6268
printf("%s Ver %s Distrib %s, for %s (%s)\n%s\n%s\n",
63-
this->m_program->get_name().c_str(),
64-
this->m_program->get_version().c_str(),
65-
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,
66-
copyright.c_str(),
67-
this->m_program->get_description().c_str());
69+
this->m_program->get_name().c_str(),
70+
this->m_program->get_version().c_str(),
71+
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,
72+
copyright.c_str(),
73+
this->m_program->get_description().c_str());
6874
my_print_help(this->m_program->get_options_array());
69-
exit(0);
7075
}

client/base/help_options.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class Help_options : public Abstract_options_provider
4545
Implementation of Abstract_options_provider virtual method.
4646
*/
4747
virtual void create_options();
48+
/**
49+
Prints program usage message.
50+
*/
51+
virtual void print_usage();
4852

4953
private:
5054
void help_callback(char* argument __attribute__((unused)));

client/base/mysql_connection_options.cc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ void Mysql_connection_options::create_options()
101101
"The socket file to use for connection.")
102102
->set_short_character('S');
103103
this->create_new_option(&this->m_secure_auth, "secure-auth",
104-
"Refuse client connecting to server if it uses old (pre-4.1.1) protocol.");
104+
"Refuse client connecting to server if it uses old (pre-4.1.1) protocol. Deprecated. Always TRUE")
105+
->add_callback(new Instance_callback<void, char*, Mysql_connection_options>
106+
(this, &Mysql_connection_options::secure_auth_callback));
105107
this->create_new_option(&this->m_user, "user",
106108
"User for login if not current user.")
107109
->set_short_character('u');
@@ -202,7 +204,18 @@ void Mysql_connection_options::protocol_callback(
202204
{
203205
this->m_protocol=
204206
find_type_or_exit(this->m_protocol_string.value().c_str(), &sql_protocol_typelib,
205-
"protocol");
207+
"protocol");
208+
}
209+
210+
void Mysql_connection_options::secure_auth_callback(
211+
char* not_used __attribute__((unused)))
212+
{
213+
CLIENT_WARN_DEPRECATED_NO_REPLACEMENT("--secure-auth");
214+
if (!this->m_secure_auth)
215+
{
216+
this->m_program->print_usage();
217+
exit(1);
218+
}
206219
}
207220

208221

client/base/mysql_connection_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class Mysql_connection_options
9696
void pipe_protocol_callback(char* not_used __attribute__((unused)));
9797
#endif
9898
void protocol_callback(char* not_used __attribute__((unused)));
99+
void secure_auth_callback(char* argument __attribute__((unused)));
99100

100101
static bool mysql_inited;
101102

cmake/dtrace.cmake

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,13 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

16-
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCXX
17-
AND CMAKE_SIZEOF_VOID_P EQUAL 4)
18-
IF(NOT DEFINED BUGGY_GCC_NO_DTRACE_MODULES)
19-
EXECUTE_PROCESS(
20-
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version
21-
OUTPUT_VARIABLE out)
22-
IF(out MATCHES "3.4.6")
23-
# This gcc causes crashes in dlopen() for dtraced shared libs,
24-
# while standard shipped with Solaris10 3.4.3 is ok
25-
SET(BUGGY_GCC_NO_DTRACE_MODULES 1 CACHE INTERNAL "")
26-
ELSE()
27-
SET(BUGGY_GCC_NO_DTRACE_MODULES 0 CACHE INTERNAL "")
28-
ENDIF()
29-
ENDIF()
30-
ENDIF()
31-
3216
# Check if OS supports DTrace
3317
MACRO(CHECK_DTRACE)
3418
FIND_PROGRAM(DTRACE dtrace)
3519
MARK_AS_ADVANCED(DTRACE)
3620

3721
# On FreeBSD, dtrace does not handle userland tracing yet
38-
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
39-
AND NOT BUGGY_GCC_NO_DTRACE_MODULES)
22+
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
4023
SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
4124
ENDIF()
4225
SET(HAVE_DTRACE ${ENABLE_DTRACE})
@@ -91,12 +74,6 @@ IF(ENABLE_DTRACE)
9174
ENDIF()
9275

9376
FUNCTION(DTRACE_INSTRUMENT target)
94-
IF(BUGGY_GCC_NO_DTRACE_MODULES)
95-
GET_TARGET_PROPERTY(target_type ${target} TYPE)
96-
IF(target_type MATCHES "MODULE_LIBRARY")
97-
RETURN()
98-
ENDIF()
99-
ENDIF()
10077
IF(ENABLE_DTRACE)
10178
ADD_DEPENDENCIES(${target} gen_dtrace_header)
10279

cmake/os/WindowsCache.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ SET(HAVE_IEEEFP_H CACHE INTERNAL "")
4747
SET(HAVE_LANGINFO_H CACHE INTERNAL "")
4848
SET(HAVE_MALLOC_H 1 CACHE INTERNAL "")
4949
SET(HAVE_NETINET_IN_H CACHE INTERNAL "")
50-
SET(HAVE_PATHS_H CACHE INTERNAL "")
5150
SET(HAVE_POLL_H CACHE INTERNAL "")
5251
SET(HAVE_PWD_H CACHE INTERNAL "")
5352
SET(HAVE_STRINGS_H CACHE INTERNAL "")

config.h.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#cmakedefine HAVE_LANGINFO_H 1
4646
#cmakedefine HAVE_MALLOC_H 1
4747
#cmakedefine HAVE_NETINET_IN_H 1
48-
#cmakedefine HAVE_PATHS_H 1
4948
#cmakedefine HAVE_POLL_H 1
5049
#cmakedefine HAVE_PWD_H 1
5150
#cmakedefine HAVE_STRINGS_H 1
@@ -193,7 +192,6 @@
193192
#cmakedefine HAVE_UINT 1
194193
#cmakedefine HAVE_ULONG 1
195194
#cmakedefine HAVE_U_INT32_T 1
196-
#cmakedefine HAVE_FP_EXCEPT 1
197195

198196
/* Code tests*/
199197
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@

configure.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H)
373373
CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H)
374374
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
375375
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
376-
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
377376
CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H)
378377
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
379378
CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H)

include/keycache.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ typedef struct st_key_cache
110110
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
111111

112112
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
113-
size_t use_mem, uint division_limit,
114-
uint age_threshold);
113+
size_t use_mem, ulonglong division_limit,
114+
ulonglong age_threshold);
115115
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
116-
size_t use_mem, uint division_limit,
117-
uint age_threshold);
118-
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
119-
uint age_threshold);
116+
size_t use_mem, ulonglong division_limit,
117+
ulonglong age_threshold);
118+
extern void change_key_cache_param(KEY_CACHE *keycache, ulonglong division_limit,
119+
ulonglong age_threshold);
120120
extern uchar *key_cache_read(KEY_CACHE *keycache,
121121
File file, my_off_t filepos, int level,
122122
uchar *buff, uint length,

include/my_compiler.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@
4040
# define MY_GNUC_PREREQ(maj, min) (0)
4141
#endif
4242

43+
/*
44+
The macros below are borrowed from include/linux/compiler.h in the
45+
Linux kernel. Use them to indicate the likelyhood of the truthfulness
46+
of a condition. This serves two purposes - newer versions of gcc will be
47+
able to optimize for branch predication, which could yield siginficant
48+
performance gains in frequently executed sections of the code, and the
49+
other reason to use them is for documentation
50+
*/
51+
#ifdef HAVE_BUILTIN_EXPECT
52+
# define likely(x) __builtin_expect((x),1)
53+
# define unlikely(x) __builtin_expect((x),0)
54+
#else
55+
# define likely(x) (x)
56+
# define unlikely(x) (x)
57+
#endif
58+
4359
/* Comunicate to the compiler the unreachability of the code. */
4460
#ifdef HAVE_BUILTIN_UNREACHABLE
4561
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
@@ -66,6 +82,11 @@
6682
# define inline __inline
6783
#endif
6884

85+
/* Provide __func__ macro definition for Visual Studio. */
86+
#if defined(_MSC_VER)
87+
# define __func__ __FUNCTION__
88+
#endif
89+
6990
/**
7091
C++ Type Traits
7192
*/

0 commit comments

Comments
 (0)