Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ebd3c6cc
Commit
ebd3c6cc
authored
Apr 12, 2015
by
Daniel Black
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mysql-upgrade / skip-mysql-upgrade options from mysql-upgrade.c
parent
87f5bae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
49 deletions
+24
-49
client/mysql_upgrade.c
client/mysql_upgrade.c
+24
-49
No files found.
client/mysql_upgrade.c
View file @
ebd3c6cc
...
...
@@ -40,8 +40,7 @@ static char mysql_path[FN_REFLEN];
static
char
mysqlcheck_path
[
FN_REFLEN
];
static
my_bool
opt_force
,
opt_verbose
,
debug_info_flag
,
debug_check_flag
,
opt_systables_only
,
opt_version_check
,
opt_mysql_upgrade
=
0
,
opt_skip_mysql_upgrade
=
0
;
opt_systables_only
,
opt_version_check
;
static
my_bool
opt_not_used
,
opt_silent
;
static
uint
my_end_arg
=
0
;
static
char
*
opt_user
=
(
char
*
)
"root"
;
...
...
@@ -151,14 +150,6 @@ static struct my_option my_long_options[]=
&
opt_not_used
,
&
opt_not_used
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
{
"version"
,
'V'
,
"Output version information and exit."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"mysql-upgrade"
,
'y'
,
"Skip automatic detection MySQL and assume that we upgrade it"
,
&
opt_mysql_upgrade
,
&
opt_mysql_upgrade
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"skip-mysql-upgrade"
,
'Y'
,
"Skip view algorithm upgrade from MySQL"
,
&
opt_skip_mysql_upgrade
,
&
opt_skip_mysql_upgrade
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"version-check"
,
'k'
,
"Run this program only if its
\'
server version
\'
"
"matches the version of the server to which it's connecting, (enabled by "
"default); use --skip-version-check to avoid this check. Note: the
\'
server "
...
...
@@ -353,14 +344,6 @@ get_one_option(int optid, const struct my_option *opt,
case
OPT_DEFAULT_AUTH
:
/* --default-auth */
add_one_option
(
&
conn_args
,
opt
,
argument
);
break
;
case
'y'
:
opt_mysql_upgrade
=
1
;
add_option
=
FALSE
;
break
;
case
'Y'
:
opt_skip_mysql_upgrade
=
1
;
add_option
=
FALSE
;
break
;
}
if
(
add_option
)
...
...
@@ -771,9 +754,31 @@ static int run_mysqlcheck_upgrade(void)
NULL
);
}
#define EVENTS_STRUCT_LEN 7000
static
my_bool
is_mysql
()
{
my_bool
ret
=
TRUE
;
DYNAMIC_STRING
ds_events_struct
;
if
(
init_dynamic_string
(
&
ds_events_struct
,
NULL
,
EVENTS_STRUCT_LEN
,
EVENTS_STRUCT_LEN
))
die
(
"Out of memory"
);
if
(
run_query
(
"show create table mysql.event"
,
&
ds_events_struct
,
FALSE
)
||
strstr
(
ds_events_struct
.
str
,
"IGNORE_BAD_TABLE_OPTIONS"
)
!=
NULL
)
ret
=
FALSE
;
else
verbose
(
"MySQL upgrade detected"
);
dynstr_free
(
&
ds_events_struct
);
return
(
ret
);
}
static
int
run_mysqlcheck_views
(
void
)
{
if
(
!
opt_mysql_upgrade
)
if
(
!
is_mysql
()
)
return
0
;
verbose
(
"Phase 0: Fixing views"
);
print_conn_args
(
"mysqlcheck"
);
...
...
@@ -962,28 +967,6 @@ static int check_version_match(void)
return
0
;
}
#define EVENTS_STRUCT_LEN 7000
my_bool
is_mysql
()
{
my_bool
ret
=
TRUE
;
DYNAMIC_STRING
ds_events_struct
;
if
(
init_dynamic_string
(
&
ds_events_struct
,
NULL
,
EVENTS_STRUCT_LEN
,
EVENTS_STRUCT_LEN
))
die
(
"Out of memory"
);
if
(
run_query
(
"show create table mysql.event"
,
&
ds_events_struct
,
FALSE
)
||
strstr
(
ds_events_struct
.
str
,
"IGNORE_BAD_TABLE_OPTIONS"
)
!=
NULL
)
ret
=
FALSE
;
else
verbose
(
"MySQL upgrade detected"
);
dynstr_free
(
&
ds_events_struct
);
return
(
ret
);
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -1053,14 +1036,6 @@ int main(int argc, char **argv)
if
(
opt_version_check
&&
check_version_match
())
die
(
"Upgrade failed"
);
if
(
!
opt_systables_only
&&
!
opt_skip_mysql_upgrade
)
{
if
(
!
opt_mysql_upgrade
)
opt_mysql_upgrade
=
is_mysql
();
}
else
opt_mysql_upgrade
=
0
;
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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