Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Faustin Lammler
mariadb-10.1
Commits
a6063b4a
Commit
a6063b4a
authored
Mar 14, 2017
by
Otto Kekäläinen
Browse files
Imported Upstream version 10.1.22
parent
9bcaaabc
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 1000+
files are displayed.
Plain diff
Email patch
BUILD/compile-bintar
View file @
a6063b4a
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
02111-130
7,
USA.
# Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA 02111-130
1
USA.
# This script's purpose is to build the binary tarball packages for MariaDB
# This script's purpose is to build the binary tarball packages for MariaDB
...
...
BUILD/compile-pentium64-wsrep
View file @
a6063b4a
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
#
#
# You should have received a copy of the GNU Library General Public
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston,
# Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston,
# MA 02111-130
7
, USA
# MA 02111-130
1
, USA
path
=
`
dirname
$0
`
path
=
`
dirname
$0
`
.
"
$path
/SETUP.sh"
.
"
$path
/SETUP.sh"
...
...
BUILD/util.sh
View file @
a6063b4a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
02111-130
7,
USA.
# Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA 02111-130
1
USA.
# Setting cpu options.
# Setting cpu options.
get_cpuopt
()
{
get_cpuopt
()
{
...
...
CMakeLists.txt
View file @
a6063b4a
...
@@ -328,6 +328,9 @@ SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
...
@@ -328,6 +328,9 @@ SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
# Common defines and includes
# Common defines and includes
ADD_DEFINITIONS
(
-DHAVE_CONFIG_H
)
ADD_DEFINITIONS
(
-DHAVE_CONFIG_H
)
IF
(
_FILE_OFFSET_BITS
)
ADD_DEFINITIONS
(
-D_FILE_OFFSET_BITS=
${
_FILE_OFFSET_BITS
}
)
ENDIF
()
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_BINARY_DIR
}
/include
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_BINARY_DIR
}
/include
)
# Add bundled or system zlib.
# Add bundled or system zlib.
...
...
COPYING.thirdparty
View file @
a6063b4a
...
@@ -1187,7 +1187,7 @@ Use of any of this software is governed by the terms of the license below:
...
@@ -1187,7 +1187,7 @@ Use of any of this software is governed by the terms of the license below:
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 5
9 Temple Place, Suite 330
, Boston, MA 02111-130
7
USA */
Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA 02111-130
1
USA */
/*
/*
* Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan
* Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan
...
...
CREDITS
View file @
a6063b4a
...
@@ -3,16 +3,18 @@ organization registered in the USA.
...
@@ -3,16 +3,18 @@ organization registered in the USA.
The current main sponsors of the MariaDB Foundation are:
The current main sponsors of the MariaDB Foundation are:
Booking.com http://www.booking.com (2013 - 2016)
Alibaba Cloud https://intl.aliyun.com (2017)
Development Bank of Singapore http://dbs.com (2016)
Booking.com https://www.booking.com (2013 - 2017)
MariaDB Corporation https://www.mariadb.com (2013 - 2016)
Development Bank of Singapore https://dbs.com (2016 - 2017)
Visma http://visma.com (2015 - 2016)
MariaDB Corporation https://www.mariadb.com (2013 - 2017)
Acronis http://acronis.com (2016)
Visma https://visma.com (2015 - 2017)
Nexedi https://www.nexedi.com (2016)
Acronis http://acronis.com (2016 - 2017)
Automattic https://automattic.com (2014 - 2016)
Nexedi https://www.nexedi.com (2016 - 2017)
Tencent Game DBA http://tencentdba.com/about (2016)
Automattic https://automattic.com (2014 - 2017)
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2016)
Tencent Game DBA http://tencentdba.com/about (2016 - 2017)
Virtuozzo https://virtuozzo.com (2016)
Tencent TDSQL http://tdsql.org/ (2016 - 2017)
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2017)
Virtuozzo https://virtuozzo.com (2016 - 2017)
For a full list of sponsors, see
For a full list of sponsors, see
https://mariadb.org/about/supporters/
https://mariadb.org/about/supporters/
...
...
Docs/INFO_SRC
View file @
a6063b4a
commit:
f7d030489d2980c9deb733925515099ec256f6d2
commit:
68be011cf2ec96a622db857fe9c418380d106d0d
date: 2017-0
1
-1
7
20:
17:35
+0
1
00
date: 2017-0
3
-1
1
20:
59:52
+0
2
00
build-date: 2017-0
1-17
20:
38
:3
8
+0100
build-date: 2017-0
3-11
20:
09
:3
1
+0100
short:
f7d0304
short:
68be011
branch: HEAD
branch: HEAD
MariaDB source 10.1.2
1
MariaDB source 10.1.2
2
VERSION
View file @
a6063b4a
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=2
1
MYSQL_VERSION_PATCH=2
2
client/mysql.cc
View file @
a6063b4a
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 5
9 Temple Place, Suite 330
, Boston, MA
02111-130
7
USA */
Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA 02111-130
1
USA */
/* mysql command tool
/* mysql command tool
* Commands compatible with mSQL by David J. Hughes
* Commands compatible with mSQL by David J. Hughes
...
...
client/mysql_plugin.c
View file @
a6063b4a
...
@@ -1002,7 +1002,7 @@ static int find_tool(const char *tool_name, char *tool_path)
...
@@ -1002,7 +1002,7 @@ static int find_tool(const char *tool_name, char *tool_path)
static
int
find_plugin
(
char
*
tp_path
)
static
int
find_plugin
(
char
*
tp_path
)
{
{
/* Check for exist
a
nce of plugin */
/* Check for exist
e
nce of plugin */
fn_format
(
tp_path
,
plugin_data
.
so_name
,
opt_plugin_dir
,
""
,
MYF
(
0
));
fn_format
(
tp_path
,
plugin_data
.
so_name
,
opt_plugin_dir
,
""
,
MYF
(
0
));
if
(
!
file_exists
(
tp_path
))
if
(
!
file_exists
(
tp_path
))
{
{
...
...
client/mysql_upgrade.c
View file @
a6063b4a
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#endif
#endif
static
int
phase
=
0
;
static
int
phase
=
0
;
static
int
phases_total
=
6
;
static
const
int
phases_total
=
7
;
static
char
mysql_path
[
FN_REFLEN
];
static
char
mysql_path
[
FN_REFLEN
];
static
char
mysqlcheck_path
[
FN_REFLEN
];
static
char
mysqlcheck_path
[
FN_REFLEN
];
...
@@ -69,6 +69,8 @@ static char **defaults_argv;
...
@@ -69,6 +69,8 @@ static char **defaults_argv;
static
my_bool
not_used
;
/* Can't use GET_BOOL without a value pointer */
static
my_bool
not_used
;
/* Can't use GET_BOOL without a value pointer */
char
upgrade_from_version
[
sizeof
(
"10.20.456-MariaDB"
)
+
1
];
static
my_bool
opt_write_binlog
;
static
my_bool
opt_write_binlog
;
#define OPT_SILENT OPT_MAX_CLIENT_OPTION
#define OPT_SILENT OPT_MAX_CLIENT_OPTION
...
@@ -545,7 +547,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
...
@@ -545,7 +547,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
But mysql_upgrade is tightly bound to a specific server version
But mysql_upgrade is tightly bound to a specific server version
anyway - it was mysql_fix_privilege_tables_sql script embedded
anyway - it was mysql_fix_privilege_tables_sql script embedded
into its binary - so even if it won't assume anything about server
into its binary - so even if it won't assume anything about server
wsrep-ness, it won't be any less server-dependen
d
.
wsrep-ness, it won't be any less server-dependen
t
.
*/
*/
const
uchar
sql_log_bin
[]
=
"SET SQL_LOG_BIN=0, WSREP_ON=OFF;"
;
const
uchar
sql_log_bin
[]
=
"SET SQL_LOG_BIN=0, WSREP_ON=OFF;"
;
#else
#else
...
@@ -675,7 +677,6 @@ static int upgrade_already_done(void)
...
@@ -675,7 +677,6 @@ static int upgrade_already_done(void)
{
{
FILE
*
in
;
FILE
*
in
;
char
upgrade_info_file
[
FN_REFLEN
]
=
{
0
};
char
upgrade_info_file
[
FN_REFLEN
]
=
{
0
};
char
buf
[
sizeof
(
MYSQL_SERVER_VERSION
)
+
1
];
if
(
get_upgrade_info_file_name
(
upgrade_info_file
))
if
(
get_upgrade_info_file_name
(
upgrade_info_file
))
return
0
;
/* Could not get filename => not sure */
return
0
;
/* Could not get filename => not sure */
...
@@ -683,15 +684,15 @@ static int upgrade_already_done(void)
...
@@ -683,15 +684,15 @@ static int upgrade_already_done(void)
if
(
!
(
in
=
my_fopen
(
upgrade_info_file
,
O_RDONLY
,
MYF
(
0
))))
if
(
!
(
in
=
my_fopen
(
upgrade_info_file
,
O_RDONLY
,
MYF
(
0
))))
return
0
;
/* Could not open file => not sure */
return
0
;
/* Could not open file => not sure */
bzero
(
buf
,
sizeof
(
buf
));
bzero
(
upgrade_from_version
,
sizeof
(
upgrade_from_version
));
if
(
!
fgets
(
buf
,
sizeof
(
buf
),
in
))
if
(
!
fgets
(
upgrade_from_version
,
sizeof
(
upgrade_from_version
),
in
))
{
{
/* Ignore, will be detected by strncmp() below */
/* Ignore, will be detected by strncmp() below */
}
}
my_fclose
(
in
,
MYF
(
0
));
my_fclose
(
in
,
MYF
(
0
));
return
(
strncmp
(
buf
,
MYSQL_SERVER_VERSION
,
return
(
strncmp
(
upgrade_from_version
,
MYSQL_SERVER_VERSION
,
sizeof
(
MYSQL_SERVER_VERSION
)
-
1
)
==
0
);
sizeof
(
MYSQL_SERVER_VERSION
)
-
1
)
==
0
);
}
}
...
@@ -756,9 +757,8 @@ static void print_conn_args(const char *tool_name)
...
@@ -756,9 +757,8 @@ static void print_conn_args(const char *tool_name)
verbose
(
"Running '%s with default connection arguments"
,
tool_name
);
verbose
(
"Running '%s with default connection arguments"
,
tool_name
);
}
}
/*
/*
Check and upgrade(if nec
c
essary) all tables
Check and upgrade(if necessary) all tables
in the server using "mysqlcheck --check-upgrade .."
in the server using "mysqlcheck --check-upgrade .."
*/
*/
...
@@ -925,6 +925,80 @@ static void print_line(char* line)
...
@@ -925,6 +925,80 @@ static void print_line(char* line)
fputc
(
'\n'
,
stderr
);
fputc
(
'\n'
,
stderr
);
}
}
static
my_bool
from_before_10_1
()
{
my_bool
ret
=
TRUE
;
DYNAMIC_STRING
ds_events_struct
;
if
(
upgrade_from_version
[
0
])
{
return
upgrade_from_version
[
1
]
==
'.'
||
strncmp
(
upgrade_from_version
,
"10.1."
,
5
)
<
0
;
}
if
(
init_dynamic_string
(
&
ds_events_struct
,
NULL
,
2048
,
2048
))
die
(
"Out of memory"
);
if
(
run_query
(
"show create table mysql.user"
,
&
ds_events_struct
,
FALSE
)
||
strstr
(
ds_events_struct
.
str
,
"default_role"
)
!=
NULL
)
ret
=
FALSE
;
else
verbose
(
"Upgrading from a version before MariaDB-10.1"
);
dynstr_free
(
&
ds_events_struct
);
return
ret
;
}
/*
Check for entries with "Unknown storage engine" in I_S.TABLES,
try to load plugins for these tables if available (MDEV-11942)
*/
static
int
install_used_engines
(
void
)
{
char
buf
[
512
];
DYNAMIC_STRING
ds_result
;
const
char
*
query
=
"SELECT DISTINCT LOWER(engine) FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown storage engine%'"
;
if
(
opt_systables_only
||
!
from_before_10_1
())
{
verbose
(
"Phase %d/%d: Installing used storage engines... Skipped"
,
++
phase
,
phases_total
);
return
0
;
}
verbose
(
"Phase %d/%d: Installing used storage engines"
,
++
phase
,
phases_total
);
if
(
init_dynamic_string
(
&
ds_result
,
""
,
512
,
512
))
die
(
"Out of memory"
);
verbose
(
"Checking for tables with unknown storage engine"
);
run_query
(
query
,
&
ds_result
,
TRUE
);
if
(
ds_result
.
length
)
{
char
*
line
=
ds_result
.
str
,
*
next
=
get_line
(
line
);
do
{
if
(
next
[
-
1
]
==
'\n'
)
next
[
-
1
]
=
0
;
verbose
(
"installing plugin for '%s' storage engine"
,
line
);
// we simply assume soname=ha_enginename
strxnmov
(
buf
,
sizeof
(
buf
)
-
1
,
"install soname 'ha_"
,
line
,
"'"
,
NULL
);
if
(
run_query
(
buf
,
NULL
,
TRUE
))
fprintf
(
stderr
,
"... can't %s
\n
"
,
buf
);
line
=
next
;
next
=
get_line
(
line
);
}
while
(
*
line
);
}
dynstr_free
(
&
ds_result
);
return
0
;
}
/*
/*
Update all system tables in MySQL Server to current
Update all system tables in MySQL Server to current
...
@@ -1132,6 +1206,7 @@ int main(int argc, char **argv)
...
@@ -1132,6 +1206,7 @@ int main(int argc, char **argv)
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
*/
if
(
run_mysqlcheck_upgrade
(
TRUE
)
||
if
(
run_mysqlcheck_upgrade
(
TRUE
)
||
install_used_engines
()
||
run_mysqlcheck_views
()
||
run_mysqlcheck_views
()
||
run_sql_fix_privilege_tables
()
||
run_sql_fix_privilege_tables
()
||
run_mysqlcheck_fixnames
()
||
run_mysqlcheck_fixnames
()
||
...
@@ -1154,4 +1229,3 @@ int main(int argc, char **argv)
...
@@ -1154,4 +1229,3 @@ int main(int argc, char **argv)
my_end
(
my_end_arg
);
my_end
(
my_end_arg
);
exit
(
0
);
exit
(
0
);
}
}
client/mysqladmin.cc
View file @
a6063b4a
...
@@ -38,8 +38,8 @@ char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN];
...
@@ -38,8 +38,8 @@ char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN];
ulonglong
last_values
[
MAX_MYSQL_VAR
];
ulonglong
last_values
[
MAX_MYSQL_VAR
];
static
int
interval
=
0
;
static
int
interval
=
0
;
static
my_bool
option_force
=
0
,
interrupted
=
0
,
new_line
=
0
,
static
my_bool
option_force
=
0
,
interrupted
=
0
,
new_line
=
0
,
opt_compress
=
0
,
opt_relative
=
0
,
opt_verbose
=
0
,
opt_vertical
=
0
,
opt_compress
=
0
,
opt_local
=
0
,
opt_relative
=
0
,
opt_verbose
=
0
,
tty_password
=
0
,
opt_nobeep
;
opt_vertical
=
0
,
tty_password
=
0
,
opt_nobeep
;
static
my_bool
debug_info_flag
=
0
,
debug_check_flag
=
0
;
static
my_bool
debug_info_flag
=
0
,
debug_check_flag
=
0
;
static
uint
tcp_port
=
0
,
option_wait
=
0
,
option_silent
=
0
,
nr_iterations
;
static
uint
tcp_port
=
0
,
option_wait
=
0
,
option_silent
=
0
,
nr_iterations
;
static
uint
opt_count_iterations
=
0
,
my_end_arg
;
static
uint
opt_count_iterations
=
0
,
my_end_arg
;
...
@@ -102,9 +102,12 @@ enum commands {
...
@@ -102,9 +102,12 @@ enum commands {
ADMIN_PING
,
ADMIN_EXTENDED_STATUS
,
ADMIN_FLUSH_STATUS
,
ADMIN_PING
,
ADMIN_EXTENDED_STATUS
,
ADMIN_FLUSH_STATUS
,
ADMIN_FLUSH_PRIVILEGES
,
ADMIN_START_SLAVE
,
ADMIN_STOP_SLAVE
,
ADMIN_FLUSH_PRIVILEGES
,
ADMIN_START_SLAVE
,
ADMIN_STOP_SLAVE
,
ADMIN_START_ALL_SLAVES
,
ADMIN_STOP_ALL_SLAVES
,
ADMIN_START_ALL_SLAVES
,
ADMIN_STOP_ALL_SLAVES
,
ADMIN_FLUSH_THREADS
,
ADMIN_OLD_PASSWORD
,
ADMIN_FLUSH_SLOW_LOG
,
ADMIN_FLUSH_THREADS
,
ADMIN_OLD_PASSWORD
,
ADMIN_FLUSH_BINARY_LOG
,
ADMIN_FLUSH_ENGINE_LOG
,
ADMIN_FLUSH_ERROR_LOG
,
ADMIN_FLUSH_GENERAL_LOG
,
ADMIN_FLUSH_RELAY_LOG
,
ADMIN_FLUSH_SLOW_LOG
,
ADMIN_FLUSH_TABLE_STATISTICS
,
ADMIN_FLUSH_INDEX_STATISTICS
,
ADMIN_FLUSH_TABLE_STATISTICS
,
ADMIN_FLUSH_INDEX_STATISTICS
,
ADMIN_FLUSH_USER_STATISTICS
,
ADMIN_FLUSH_CLIENT_STATISTICS
,
ADMIN_FLUSH_USER_STATISTICS
,
ADMIN_FLUSH_CLIENT_STATISTICS
,
ADMIN_FLUSH_USER_RESOURCES
,
ADMIN_FLUSH_ALL_STATUS
,
ADMIN_FLUSH_ALL_STATISTICS
ADMIN_FLUSH_ALL_STATUS
,
ADMIN_FLUSH_ALL_STATISTICS
};
};
static
const
char
*
command_names
[]
=
{
static
const
char
*
command_names
[]
=
{
...
@@ -116,9 +119,10 @@ static const char *command_names[]= {
...
@@ -116,9 +119,10 @@ static const char *command_names[]= {
"ping"
,
"extended-status"
,
"flush-status"
,
"ping"
,
"extended-status"
,
"flush-status"
,
"flush-privileges"
,
"start-slave"
,
"stop-slave"
,
"flush-privileges"
,
"start-slave"
,
"stop-slave"
,
"start-all-slaves"
,
"stop-all-slaves"
,
"start-all-slaves"
,
"stop-all-slaves"
,
"flush-threads"
,
"old-password"
,
"flush-slow-log"
,
"flush-threads"
,
"old-password"
,
"flush-binary-log"
,
"flush-engine-log"
,
"flush-error-log"
,
"flush-general-log"
,
"flush-relay-log"
,
"flush-slow-log"
,
"flush-table-statistics"
,
"flush-index-statistics"
,
"flush-table-statistics"
,
"flush-index-statistics"
,
"flush-user-statistics"
,
"flush-client-statistics"
,
"flush-user-statistics"
,
"flush-client-statistics"
,
"flush-user-resources"
,
"flush-all-status"
,
"flush-all-statistics"
,
"flush-all-status"
,
"flush-all-statistics"
,
NullS
NullS
};
};
...
@@ -160,6 +164,9 @@ static struct my_option my_long_options[] =
...
@@ -160,6 +164,9 @@ static struct my_option my_long_options[] =
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"host"
,
'h'
,
"Connect to host."
,
&
host
,
&
host
,
0
,
GET_STR
,
{
"host"
,
'h'
,
"Connect to host."
,
&
host
,
&
host
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"local"
,
'l'
,
"Local command, don't write to binlog."
,
&
opt_local
,
&
opt_local
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"no-beep"
,
'b'
,
"Turn off beep on error."
,
&
opt_nobeep
,
{
"no-beep"
,
'b'
,
"Turn off beep on error."
,
&
opt_nobeep
,
&
opt_nobeep
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
&
opt_nobeep
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"password"
,
'p'
,
{
"password"
,
'p'
,
...
@@ -617,6 +624,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
...
@@ -617,6 +624,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
*/
*/
struct
my_rnd_struct
rand_st
;
struct
my_rnd_struct
rand_st
;
char
buff
[
FN_REFLEN
+
20
];
if
(
opt_local
)
{
sprintf
(
buff
,
"set local sql_log_bin=0"
);
if
(
mysql_query
(
mysql
,
buff
))
{
my_printf_error
(
0
,
"SET LOCAL SQL_LOG_BIN=0 failed; error: '%-.200s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
}
for
(;
argc
>
0
;
argv
++
,
argc
--
)
for
(;
argc
>
0
;
argv
++
,
argc
--
)
{
{
...
@@ -624,7 +643,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
...
@@ -624,7 +643,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
switch
((
command
=
find_type
(
argv
[
0
],
&
command_typelib
,
FIND_TYPE_BASIC
)))
{
switch
((
command
=
find_type
(
argv
[
0
],
&
command_typelib
,
FIND_TYPE_BASIC
)))
{
case
ADMIN_CREATE
:
case
ADMIN_CREATE
:
{
{
char
buff
[
FN_REFLEN
+
20
];
if
(
argc
<
2
)
if
(
argc
<
2
)
{
{
my_printf_error
(
0
,
"Too few arguments to create"
,
error_flags
);
my_printf_error
(
0
,
"Too few arguments to create"
,
error_flags
);
...
@@ -899,6 +917,56 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
...
@@ -899,6 +917,56 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
}
break
;
break
;
}
}
case
ADMIN_FLUSH_BINARY_LOG
:
{
if
(
mysql_query
(
mysql
,
"flush binary logs"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_ENGINE_LOG
:
{
if
(
mysql_query
(
mysql
,
"flush engine logs"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_ERROR_LOG
:
{
if
(
mysql_query
(
mysql
,
"flush error logs"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_GENERAL_LOG
:
{
if
(
mysql_query
(
mysql
,
"flush general logs"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_RELAY_LOG
:
{
if
(
mysql_query
(
mysql
,
"flush relay logs"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_SLOW_LOG
:
case
ADMIN_FLUSH_SLOW_LOG
:
{
{
if
(
mysql_query
(
mysql
,
"flush slow logs"
))
if
(
mysql_query
(
mysql
,
"flush slow logs"
))
...
@@ -969,6 +1037,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
...
@@ -969,6 +1037,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
}
break
;
break
;
}
}
case
ADMIN_FLUSH_USER_RESOURCES
:
{
if
(
mysql_query
(
mysql
,
"flush user_resources"
))
{
my_printf_error
(
0
,
"flush failed; error: '%s'"
,
error_flags
,
mysql_error
(
mysql
));
return
-
1
;
}
break
;
}
case
ADMIN_FLUSH_CLIENT_STATISTICS
:
case
ADMIN_FLUSH_CLIENT_STATISTICS
:
{
{
if
(
mysql_query
(
mysql
,
"flush client_statistics"
))
if
(
mysql_query
(
mysql
,
"flush client_statistics"
))
...
@@ -1292,12 +1370,18 @@ static void usage(void)
...
@@ -1292,12 +1370,18 @@ static void usage(void)
flush-index-statistics Flush index statistics
\n
\
flush-index-statistics Flush index statistics
\n
\
flush-logs Flush all logs
\n
\
flush-logs Flush all logs
\n
\
flush-privileges Reload grant tables (same as reload)
\n
\
flush-privileges Reload grant tables (same as reload)
\n
\
flush-binary-log Flush binary log
\n
\
flush-engine-log Flush engine log(s)
\n
\
flush-error-log Flush error log
\n
\
flush-general-log Flush general log
\n
\
flush-relay-log Flush relay log
\n
\
flush-slow-log Flush slow query log
\n
\
flush-slow-log Flush slow query log
\n
\
flush-status
Clear status variables
\n
\
flush-status
Clear status variables
\n
\
flush-table-statistics Clear table statistics
\n
\
flush-table-statistics Clear table statistics
\n
\
flush-tables Flush all tables
\n
\
flush-tables Flush all tables
\n
\
flush-threads Flush the thread cache
\n
\
flush-threads Flush the thread cache
\n
\
flush-user-statistics Flush user statistics
\n
\
flush-user-statistics Flush user statistics
\n
\
flush-user-resources Flush user resources
\n
\
kill id,id,... Kill mysql threads"
);
kill id,id,... Kill mysql threads"
);
#if MYSQL_VERSION_ID >= 32200
#if MYSQL_VERSION_ID >= 32200
puts
(
"\
puts
(
"\
...
...
client/mysqlbinlog.cc
View file @
a6063b4a
...
@@ -110,7 +110,7 @@ static const char* sock= 0;
...
@@ -110,7 +110,7 @@ static const char* sock= 0;
static
char
*
opt_plugindir
=
0
,
*
opt_default_auth
=
0
;
static
char
*
opt_plugindir
=
0
,
*
opt_default_auth
=
0
;
#ifdef HAVE_SMEM
#ifdef HAVE_SMEM
static
char
*
shared_memory_base_name
=
0
;
static
const
char
*
shared_memory_base_name
=
0
;
#endif
#endif
static
char
*
user
=
0
;
static
char
*
user
=
0
;
static
char
*
pass
=
0
;
static
char
*
pass
=
0
;
...
@@ -2542,7 +2542,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
...
@@ -2542,7 +2542,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
/* read from stdin */
/* read from stdin */
/*
/*
Windows opens stdin in text mode by default. Certain characters
Windows opens stdin in text mode by default. Certain characters
such as CTRL-Z are interpeted as events and the read() method
such as CTRL-Z are interp
r
eted as events and the read() method
will stop. CTRL-Z is the EOF marker in Windows. to get past this
will stop. CTRL-Z is the EOF marker in Windows. to get past this
you have to open stdin in binary mode. Setmode() is used to set
you have to open stdin in binary mode. Setmode() is used to set
stdin in binary mode. Errors on setting this mode result in
stdin in binary mode. Errors on setting this mode result in
...
...
client/mysqldump.c
View file @
a6063b4a
...
@@ -700,8 +700,9 @@ static void write_header(FILE *sql_file, char *db_name)
...
@@ -700,8 +700,9 @@ static void write_header(FILE *sql_file, char *db_name)
"-- MySQL dump %s Distrib %s, for %s (%s)
\n
--
\n
"
,
"-- MySQL dump %s Distrib %s, for %s (%s)
\n
--
\n
"
,
DUMP_VERSION
,
MYSQL_SERVER_VERSION
,
SYSTEM_TYPE
,
DUMP_VERSION
,
MYSQL_SERVER_VERSION
,
SYSTEM_TYPE
,
MACHINE_TYPE
);
MACHINE_TYPE
);
print_comment
(
sql_file
,
0
,
"-- Host: %s Database: %s
\n
"
,
print_comment
(
sql_file
,
0
,
"-- Host: %s "
,
fix_for_comment
(
current_host
?
current_host
:
"localhost"
),
fix_for_comment
(
current_host
?
current_host
:
"localhost"
));
print_comment
(
sql_file
,
0
,
"Database: %s
\n
"
,
fix_for_comment
(
db_name
?
db_name
:
""
));
fix_for_comment
(
db_name
?
db_name
:
""
));
print_comment
(
sql_file
,
0
,
print_comment
(
sql_file
,
0
,
"-- ------------------------------------------------------
\n
"
"-- ------------------------------------------------------
\n
"
...
...
client/mysqltest.cc
View file @
a6063b4a
...
@@ -2490,7 +2490,7 @@ VAR *var_obtain(const char *name, int len)
...
@@ -2490,7 +2490,7 @@ VAR *var_obtain(const char *name, int len)
/*
/*
- if variable starts with a $ it is regarded as a local test varable
- if variable starts with a $ it is regarded as a local test var
i
able
- if not it is treated as a environment variable, and the corresponding
- if not it is treated as a environment variable, and the corresponding
environment variable will be updated
environment variable will be updated
*/
*/
...
@@ -3325,7 +3325,7 @@ static int replace(DYNAMIC_STRING *ds_str,
...
@@ -3325,7 +3325,7 @@ static int replace(DYNAMIC_STRING *ds_str,
NOTE
NOTE
Although mysqltest is executed from cygwin shell, the command will be
Although mysqltest is executed from cygwin shell, the command will be
executed in "cmd.exe". Thus commands like "rm" etc can NOT be used, use
executed in "cmd.exe". Thus commands like "rm" etc can NOT be used, use
mysqltest comm
m
and(s) like "remove_file" for that
mysqltest command(s) like "remove_file" for that
*/
*/
void
do_exec
(
struct
st_command
*
command
)
void
do_exec
(
struct
st_command
*
command
)
...
@@ -3339,6 +3339,8 @@ void do_exec(struct st_command *command)
...
@@ -3339,6 +3339,8 @@ void do_exec(struct st_command *command)
DBUG_ENTER
(
"do_exec"
);
DBUG_ENTER
(
"do_exec"
);
DBUG_PRINT
(
"enter"
,
(
"cmd: '%s'"
,
cmd
));
DBUG_PRINT
(
"enter"
,
(
"cmd: '%s'"
,
cmd
));
var_set_int
(
"$sys_errno"
,
0
);
/* Skip leading space */
/* Skip leading space */
while
(
*
cmd
&&
my_isspace
(
charset_info
,
*
cmd
))
while
(
*
cmd
&&
my_isspace
(
charset_info
,
*
cmd
))
cmd
++
;
cmd
++
;
...
@@ -3455,6 +3457,7 @@ void do_exec(struct st_command *command)
...
@@ -3455,6 +3457,7 @@ void do_exec(struct st_command *command)
report_or_die
(
"command
\"
%s
\"
failed with wrong error: %d"
,
report_or_die
(
"command
\"
%s
\"
failed with wrong error: %d"
,
command
->
first_argument
,
status
);
command
->
first_argument
,
status
);
}
}
var_set_int
(
"$sys_errno"
,
status
);
}
}
else
if
(
command
->
expected_errors
.
err
[
0
].
type
==
ERR_ERRNO
&&
else
if
(
command
->
expected_errors
.
err
[
0
].
type
==
ERR_ERRNO
&&
command
->
expected_errors
.
err
[
0
].
code
.
errnum
!=
0
)
command
->
expected_errors
.
err
[
0
].
code
.
errnum
!=
0
)
...
@@ -6551,7 +6554,7 @@ int read_line(char *buf, int size)
...
@@ -6551,7 +6554,7 @@ int read_line(char *buf, int size)
start_lineno
));
start_lineno
));
}
}
/* Skip all space at begining of line */
/* Skip all space at begin
n
ing of line */
skip_char
=
1
;
skip_char
=
1
;
}
}
else
if
(
end_of_query
(
c
))
else
if
(
end_of_query
(
c
))
...
@@ -6563,10 +6566,10 @@ int read_line(char *buf, int size)
...
@@ -6563,10 +6566,10 @@ int read_line(char *buf, int size)
}
}
else
if
(
c
==
'}'
)
else
if
(
c
==
'}'
)
{
{
/* A "}" need to be by itself in the begining of a line to terminate */
/* A "}" need to be by itself in the begin
n
ing of a line to terminate */
*
p
++=
c
;
*
p
++=
c
;
*
p
=
0
;
*
p
=
0
;
DBUG_PRINT
(
"exit"
,
(
"Found '}' in begining of a line at line: %d"
,
DBUG_PRINT
(
"exit"
,
(
"Found '}' in begin
n
ing of a line at line: %d"
,
cur_file
->
lineno
));
cur_file
->
lineno
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
@@ -7928,7 +7931,7 @@ void handle_error(struct st_command *command,
...
@@ -7928,7 +7931,7 @@ void handle_error(struct st_command *command,
{
{
/*
/*
The query after a "--require" failed. This is fine as long the server
The query after a "--require" failed. This is fine as long the server
returned a valid reponse. Don't allow 2013 or 2006 to trigger an
returned a valid re
s
ponse. Don't allow 2013 or 2006 to trigger an
abort_not_supported_test
abort_not_supported_test
*/
*/
if
(
err_errno
==
CR_SERVER_LOST
||
if
(
err_errno
==
CR_SERVER_LOST
||
...
@@ -9009,7 +9012,7 @@ int main(int argc, char **argv)
...
@@ -9009,7 +9012,7 @@ int main(int argc, char **argv)
var_set_string
(
"MYSQLTEST_FILE"
,
cur_file
->
file_name
);
var_set_string
(
"MYSQLTEST_FILE"
,
cur_file
->
file_name
);
init_re
();
init_re
();
/* Cursor protcol implies ps protocol */
/* Cursor prot
o
col implies ps protocol */
if
(
cursor_protocol
)
if
(
cursor_protocol
)
ps_protocol
=
1
;
ps_protocol
=
1
;
...
@@ -9107,7 +9110,7 @@ int main(int argc, char **argv)
...
@@ -9107,7 +9110,7 @@ int main(int argc, char **argv)
abort_on_error
);
abort_on_error
);
/*
/*
some comm
m
ands need to be executed or at least parsed unconditionally,
some commands need to be executed or at least parsed unconditionally,
because they change the grammar.
because they change the grammar.
*/
*/
ok_to_do
=
cur_block
->
ok
||
command
->
type
==
Q_DELIMITER
ok_to_do
=
cur_block
->
ok
||
command
->
type
==
Q_DELIMITER
...
@@ -9539,7 +9542,7 @@ int main(int argc, char **argv)
...
@@ -9539,7 +9542,7 @@ int main(int argc, char **argv)
die
(
"Test ended with parsing disabled"
);
die
(
"Test ended with parsing disabled"
);
/*
/*
The whole test has been executed _sucessfully_.
The whole test has been executed _suc
c
essfully_.
Time to compare result or save it to record file.
Time to compare result or save it to record file.
The entire output from test is in the log file
The entire output from test is in the log file
*/
*/
...
@@ -9585,7 +9588,7 @@ int main(int argc, char **argv)
...
@@ -9585,7 +9588,7 @@ int main(int argc, char **argv)
verbose_msg
(
"Test has succeeded!"
);
verbose_msg
(
"Test has succeeded!"
);
timer_output
();
timer_output
();
/* Yes, if we got this far the test has suceeded! Sakila smiles */
/* Yes, if we got this far the test has suc
c
eeded! Sakila smiles */
cleanup_and_exit
(
0
);
cleanup_and_exit
(
0
);
return
0
;
/* Keep compiler happy too */
return
0
;
/* Keep compiler happy too */
}
}
...
@@ -10080,7 +10083,7 @@ void free_replace_regex()
...
@@ -10080,7 +10083,7 @@ void free_replace_regex()
buf_len_p - result buffer length. Will change if the buffer is reallocated
buf_len_p - result buffer length. Will change if the buffer is reallocated
pattern - regexp pattern to match
pattern - regexp pattern to match
replace - replacement expression
replace - replacement expression
string - the string to perform substituions in
string - the string to perform substitu
t
ions in
icase - flag, if set to 1 the match is case insensitive
icase - flag, if set to 1 the match is case insensitive
*/
*/
int
reg_replace
(
char
**
buf_p
,
int
*
buf_len_p
,
char
*
pattern
,
int
reg_replace
(
char
**
buf_p
,
int
*
buf_len_p
,
char
*
pattern
,
...
...
client/sql_string.cc.dontuse
View file @
a6063b4a
...
@@ -267,7 +267,7 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
...
@@ -267,7 +267,7 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
return copy_aligned(str, arg_length, offset, cs);
return copy_aligned(str, arg_length, offset, cs);
}
}
/* Copy with charset conver
t
ion */
/* Copy with charset conver
s
ion */
bool String::copy(const char *str, uint32 arg_length,
bool String::copy(const char *str, uint32 arg_length,
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
...
...
cmake/os/Windows.cmake
View file @
a6063b4a
...
@@ -50,7 +50,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
...
@@ -50,7 +50,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
ENDIF
()
ENDIF
()
ADD_DEFINITIONS
(
-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE
)
ADD_DEFINITIONS
(
-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE
)
ADD_DEFINITIONS
(
-D_WIN32_WINNT=0x0
501
)
ADD_DEFINITIONS
(
-D_WIN32_WINNT=0x0
600
)
# We do not want the windows.h macros min/max
# We do not want the windows.h macros min/max
ADD_DEFINITIONS
(
-DNOMINMAX
)
ADD_DEFINITIONS
(
-DNOMINMAX
)
# Speed up build process excluding unused header files
# Speed up build process excluding unused header files
...
...
cmake/plugin.cmake
View file @
a6063b4a
...
@@ -186,8 +186,11 @@ MACRO(MYSQL_ADD_PLUGIN)
...
@@ -186,8 +186,11 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_LIBRARY
(
${
target
}
MODULE
${
SOURCES
}
)
ADD_LIBRARY
(
${
target
}
MODULE
${
SOURCES
}
)
DTRACE_INSTRUMENT
(
${
target
}
)
DTRACE_INSTRUMENT
(
${
target
}
)
SET_TARGET_PROPERTIES
(
${
target
}
PROPERTIES PREFIX
""
SET_TARGET_PROPERTIES
(
${
target
}
PROPERTIES PREFIX
""
)
COMPILE_DEFINITIONS
"MYSQL_DYNAMIC_PLUGIN"
)
IF
(
NOT ARG_CLIENT
)
SET_TARGET_PROPERTIES
(
${
target
}
PROPERTIES
COMPILE_DEFINITIONS
"MYSQL_DYNAMIC_PLUGIN"
)
ENDIF
()
TARGET_LINK_LIBRARIES
(
${
target
}
mysqlservices
${
ARG_LINK_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
${
target
}
mysqlservices
${
ARG_LINK_LIBRARIES
}
)
...
...
cmake/systemd.cmake
View file @
a6063b4a
...
@@ -18,7 +18,7 @@ INCLUDE(FindPkgConfig)
...
@@ -18,7 +18,7 @@ INCLUDE(FindPkgConfig)
MACRO
(
CHECK_SYSTEMD
)
MACRO
(
CHECK_SYSTEMD
)
IF
(
UNIX
)
IF
(
UNIX
)
SET
(
WITH_SYSTEMD
"auto"
CACHE STRING
"
Compile with systemd socket activation
and notification"
)
SET
(
WITH_SYSTEMD
"auto"
CACHE STRING
"
Enable systemd scripts
and notification
support
"
)
IF
(
WITH_SYSTEMD STREQUAL
"yes"
OR WITH_SYSTEMD STREQUAL
"auto"
)
IF
(
WITH_SYSTEMD STREQUAL
"yes"
OR WITH_SYSTEMD STREQUAL
"auto"
)
IF
(
PKG_CONFIG_FOUND
)
IF
(
PKG_CONFIG_FOUND
)
IF
(
WITH_SYSTEMD STREQUAL
"yes"
)
IF
(
WITH_SYSTEMD STREQUAL
"yes"
)
...
...
config.h.cmake
View file @
a6063b4a
...
@@ -492,7 +492,6 @@
...
@@ -492,7 +492,6 @@
#cmakedefine _LARGE_FILES 1
#cmakedefine _LARGE_FILES 1
#cmakedefine _LARGEFILE_SOURCE 1
#cmakedefine _LARGEFILE_SOURCE 1
#cmakedefine _LARGEFILE64_SOURCE 1
#cmakedefine _LARGEFILE64_SOURCE 1
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#cmakedefine TIME_WITH_SYS_TIME 1
#cmakedefine TIME_WITH_SYS_TIME 1
...
...
Prev
1
2
3
4
5
…
50
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment