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
MariaDB and MySQL Packaging Team
mariadb-5.5
Commits
6c4d1240
Commit
6c4d1240
authored
May 03, 2015
by
Otto Kekäläinen
Browse files
Merged with upstream 5.5.43
parents
df5d5235
1d7e28f9
Changes
348
Hide whitespace changes
Inline
Side-by-side
.gitattributes
0 → 100644
View file @
6c4d1240
*.c diff=cpp
*.h diff=cpp
*.cc diff=cpp
*.ic diff=cpp
*.cpp diff=cpp
.gitignore
0 → 100644
View file @
6c4d1240
*-t
*.a
*.ctest
*.o
*.reject
*.so
*.so.*
*.spec
*~
.*.swp
*.ninja
.ninja_*
.gdb_history
errmsg.sys
typescript
CMakeCache.txt
CMakeFiles/
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
Docs/INFO_BIN
Docs/INFO_SRC
Makefile
TAGS
Testing/
VERSION.dep
configure
client/async_example
client/mysql
client/mysql_plugin
client/mysql_upgrade
client/mysqladmin
client/mysqlbinlog
client/mysqlcheck
client/mysqldump
client/mysqlimport
client/mysqlshow
client/mysqlslap
client/mysqltest
cmake_install.cmake
dbug/*.r
dbug/factorial
dbug/tests
dbug/user.ps
dbug/user.t
extra/comp_err
extra/innochecksum
extra/jemalloc/build/
extra/jemalloc/tmp/
extra/my_print_defaults
extra/mysql_waitpid
extra/perror
extra/replace
extra/resolve_stack_dump
extra/resolveip
import_executables.cmake
include/*.h.tmp
include/config.h
include/my_config.h
include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/sql_state.h
info_macros.cmake
libmysql*/libmysql*_exports_file.cc
libmysql*/merge_archives_mysql*.cmake
libmysql*/mysql*_depends.c
libmysql/libmysql_versions.ld
libmysqld/examples/mysql_client_test_embedded
libmysqld/examples/mysql_embedded
libmysqld/examples/mysqltest_embedded
make_dist.cmake
mariadb-*.*.*.tar.gz
mariadb-*.*.*/
mysql-test/lib/My/SafeProcess/my_safe_process
mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/var
mysys/thr_lock
mysys/thr_timer
packaging/rpm-oel/mysql.spec
packaging/rpm-uln/mysql.10.0.11.spec
packaging/solaris/postinstall-solaris
pcre/config.h
pcre/pcre*test.sh
pcre/pcre.h
pcre/pcre_chartables.c
pcre/pcregrep
pcre/pcretest
pcre/test*grep
scripts/comp_sql
scripts/make_binary_distribution
scripts/msql2mysql
scripts/mysql_config
scripts/mysql_config.pl
scripts/mysql_convert_table_format
scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables_sql.c
scripts/mysql_install_db
scripts/mysql_secure_installation
scripts/mysql_setpermission
scripts/mysql_zap
scripts/mysqlaccess
scripts/mysqlbug
scripts/mysqld_multi
scripts/mysqld_safe
scripts/mysqldumpslow
scripts/mysqlhotcopy
scripts/mytop
scripts/wsrep_sst_common
scripts/wsrep_sst_mysqldump
scripts/wsrep_sst_rsync
scripts/wsrep_sst_xtrabackup
scripts/wsrep_sst_xtrabackup-v2
sql-bench/bench-count-distinct
sql-bench/bench-init.pl
sql-bench/compare-results
sql-bench/copy-db
sql-bench/crash-me
sql-bench/graph-compare-results
sql-bench/innotest1
sql-bench/innotest1a
sql-bench/innotest1b
sql-bench/innotest2
sql-bench/innotest2a
sql-bench/innotest2b
sql-bench/run-all-tests
sql-bench/server-cfg
sql-bench/test-ATIS
sql-bench/test-alter-table
sql-bench/test-big-tables
sql-bench/test-connect
sql-bench/test-create
sql-bench/test-insert
sql-bench/test-select
sql-bench/test-table-elimination
sql-bench/test-transactions
sql-bench/test-wisconsin
sql/gen_lex_hash
sql/lex_hash.h
sql/mysql_tzinfo_to_sql
sql/mysqld
sql/sql_builtin.cc
sql/sql_yacc.cc
sql/sql_yacc.h
storage/heap/hp_test1
storage/heap/hp_test2
storage/maria/aria_chk
storage/maria/aria_dump_log
storage/maria/aria_ftdump
storage/maria/aria_pack
storage/maria/aria_read_log
storage/maria/ma_rt_test
storage/maria/ma_sp_test
storage/maria/ma_test1
storage/maria/ma_test2
storage/maria/ma_test3
storage/myisam/mi_test1
storage/myisam/mi_test2
storage/myisam/mi_test3
storage/myisam/myisam_ftdump
storage/myisam/myisamchk
storage/myisam/myisamlog
storage/myisam/myisampack
storage/myisam/rt_test
storage/myisam/sp_test
storage/perfschema/gen_pfs_lex_token
storage/perfschema/pfs_lex_token.h
storage/tokudb/ft-index/buildheader/db.h
storage/tokudb/ft-index/buildheader/make_tdb
storage/tokudb/ft-index/buildheader/runcat.sh
storage/tokudb/ft-index/ft/log_code.cc
storage/tokudb/ft-index/ft/log_header.h
storage/tokudb/ft-index/ft/log_print.cc
storage/tokudb/ft-index/ft/logformat
storage/tokudb/ft-index/ft/ftverify
storage/tokudb/ft-index/ft/tdb-recover
storage/tokudb/ft-index/ft/tdb_logprint
storage/tokudb/ft-index/ft/tokuftdump
storage/tokudb/ft-index/portability/merge_archives_tokuportability_static.cmake
storage/tokudb/ft-index/portability/toku_config.h
storage/tokudb/ft-index/portability/tokuportability_static_depends.cc
storage/tokudb/ft-index/src/merge_archives_tokufractaltree_static.cmake
storage/tokudb/ft-index/src/tokufractaltree_static_depends.cc
storage/tokudb/ft-index/toku_include/toku_config.h
storage/tokudb/ft-index/tools/ba_replay
storage/tokudb/ft-index/tools/ftverify
storage/tokudb/ft-index/tools/tdb-recover
storage/tokudb/ft-index/tools/tdb_logprint
storage/tokudb/ft-index/tools/tokudb_dump
storage/tokudb/ft-index/tools/tokudb_gen
storage/tokudb/ft-index/tools/tokudb_load
storage/tokudb/ft-index/tools/tokuftdump
storage/tokudb/ft-index/ft/ftverify
storage/tokudb/ft-index/ft/tdb-recover
storage/tokudb/ft-index/ft/tdb_logprint
storage/tokudb/ft-index/ft/tokuftdump
storage/tokudb/ft-index/xz/
support-files/MySQL-shared-compat.spec
support-files/binary-configure
support-files/config.huge.ini
support-files/config.medium.ini
support-files/config.small.ini
support-files/mariadb.pc
support-files/my-huge.cnf
support-files/my-innodb-heavy-4G.cnf
support-files/my-large.cnf
support-files/my-medium.cnf
support-files/my-small.cnf
support-files/mysql-log-rotate
support-files/mysql.10.0.11.spec
support-files/mysql.server
support-files/mysql.spec
support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
tags
tests/async_queries
tests/bug25714
tests/mysql_client_test
storage/mroonga/config.sh
storage/mroonga/mrn_version.h
storage/mroonga/data/install.sql
storage/mroonga/vendor/groonga/config.h
storage/mroonga/vendor/groonga/config.sh
storage/mroonga/vendor/groonga/groonga.pc
storage/mroonga/vendor/groonga/src/grnslap
storage/mroonga/vendor/groonga/src/groonga
storage/mroonga/vendor/groonga/src/groonga-benchmark
storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset
CMakeLists.txt
View file @
6c4d1240
...
@@ -350,6 +350,11 @@ MYSQL_CHECK_READLINE()
...
@@ -350,6 +350,11 @@ MYSQL_CHECK_READLINE()
CHECK_JEMALLOC
()
CHECK_JEMALLOC
()
IF
(
CMAKE_CROSSCOMPILING
)
SET
(
IMPORT_EXECUTABLES
"IMPORTFILE-NOTFOUND"
CACHE FILEPATH
"Path to import_executables.cmake from a native build"
)
INCLUDE
(
${
IMPORT_EXECUTABLES
}
)
ENDIF
()
#
#
# Setup maintainer mode options by the end. Platform checks are
# Setup maintainer mode options by the end. Platform checks are
# not run with the warning options as to not perturb fragile checks
# not run with the warning options as to not perturb fragile checks
...
@@ -428,7 +433,8 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
...
@@ -428,7 +433,8 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
CONFIGURE_FILE
(
${
CMAKE_SOURCE_DIR
}
/sql/sql_builtin.cc.in
CONFIGURE_FILE
(
${
CMAKE_SOURCE_DIR
}
/sql/sql_builtin.cc.in
${
CMAKE_BINARY_DIR
}
/sql/sql_builtin.cc
)
${
CMAKE_BINARY_DIR
}
/sql/sql_builtin.cc
)
CONFIGURE_FILE
(
CONFIGURE_FILE
(
${
CMAKE_SOURCE_DIR
}
/cmake/info_macros.cmake.in
${
CMAKE_BINARY_DIR
}
/info_macros.cmake @ONLY
)
${
CMAKE_SOURCE_DIR
}
/cmake/info_macros.cmake.in
${
CMAKE_BINARY_DIR
}
/info_macros.cmake @ONLY
)
IF
(
DEB
)
IF
(
DEB
)
CONFIGURE_FILE
(
CONFIGURE_FILE
(
...
@@ -440,7 +446,7 @@ ENDIF(DEB)
...
@@ -440,7 +446,7 @@ ENDIF(DEB)
INCLUDE
(
${
CMAKE_BINARY_DIR
}
/info_macros.cmake
)
INCLUDE
(
${
CMAKE_BINARY_DIR
}
/info_macros.cmake
)
# Source: This can be done during the cmake phase, all information is
# Source: This can be done during the cmake phase, all information is
# available, but should be repeated on each "make" just in case someone
# available, but should be repeated on each "make" just in case someone
# does "cmake ; make ;
bzr
pull ; make".
# does "cmake ; make ;
git
pull ; make".
CREATE_INFO_SRC
(
${
CMAKE_BINARY_DIR
}
/Docs
)
CREATE_INFO_SRC
(
${
CMAKE_BINARY_DIR
}
/Docs
)
ADD_CUSTOM_TARGET
(
INFO_SRC ALL
ADD_CUSTOM_TARGET
(
INFO_SRC ALL
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_SOURCE_DIR
}
/cmake/info_src.cmake
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_SOURCE_DIR
}
/cmake/info_src.cmake
...
...
Docs/INFO_SRC
View file @
6c4d1240
revision-id: sergii@pisem.net-20141219104403-wo7bvoif9zii3ie
5
commit: 4c87f727734955f9e4a0ffde25aae4d43ec0b2a
5
date: 201
4-12-19 11:44:03
+0
1
00
date: 201
5-04-29 16:24:52
+0
2
00
build-date: 201
4-12-19 11:57:35
+0
1
00
build-date: 201
5-04-29 20:55:40
+0
2
00
revno: 4393
short: 4c87f72
branch
-nick: 5.5
branch
: HEAD
MySQL source 5.5.4
1
MySQL source 5.5.4
3
VERSION
View file @
6c4d1240
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=4
1
MYSQL_VERSION_PATCH=4
3
MYSQL_VERSION_EXTRA=
MYSQL_VERSION_EXTRA=
client/mysql_upgrade.c
View file @
6c4d1240
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
# endif
# endif
#endif
#endif
static
int
phase
=
1
;
static
int
phases_total
=
4
;
static
char
mysql_path
[
FN_REFLEN
];
static
char
mysql_path
[
FN_REFLEN
];
static
char
mysqlcheck_path
[
FN_REFLEN
];
static
char
mysqlcheck_path
[
FN_REFLEN
];
...
@@ -738,9 +740,16 @@ static void print_conn_args(const char *tool_name)
...
@@ -738,9 +740,16 @@ static void print_conn_args(const char *tool_name)
static
int
run_mysqlcheck_upgrade
(
void
)
static
int
run_mysqlcheck_upgrade
(
void
)
{
{
verbose
(
"Phase 2/3: Checking and upgrading tables"
);
int
retch
;
if
(
opt_systables_only
)
{
verbose
(
"Phase %d/%d: Checking and upgrading tables... Skipped"
,
phase
++
,
phases_total
);
return
0
;
}
verbose
(
"Phase %d/%d: Checking and upgrading tables"
,
phase
++
,
phases_total
);
print_conn_args
(
"mysqlcheck"
);
print_conn_args
(
"mysqlcheck"
);
ret
urn
run_tool
(
mysqlcheck_path
,
ret
ch
=
run_tool
(
mysqlcheck_path
,
NULL
,
/* Send output from mysqlcheck directly to screen */
NULL
,
/* Send output from mysqlcheck directly to screen */
"--no-defaults"
,
"--no-defaults"
,
ds_args
.
str
,
ds_args
.
str
,
...
@@ -752,12 +761,72 @@ static int run_mysqlcheck_upgrade(void)
...
@@ -752,12 +761,72 @@ static int run_mysqlcheck_upgrade(void)
opt_write_binlog
?
"--write-binlog"
:
"--skip-write-binlog"
,
opt_write_binlog
?
"--write-binlog"
:
"--skip-write-binlog"
,
"2>&1"
,
"2>&1"
,
NULL
);
NULL
);
return
retch
;
}
}
#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
)
{
const
char
*
upgrade_views
=
"--process-views=YES"
;
if
(
is_mysql
())
{
upgrade_views
=
"--process-views=UPGRADE_FROM_MYSQL"
;
verbose
(
"Phase %d/%d: Fixing views from mysql"
,
phase
++
,
phases_total
);
}
else
if
(
opt_systables_only
)
{
verbose
(
"Phase %d/%d: Fixing views... Skipped"
,
phase
++
,
phases_total
);
return
0
;
}
else
verbose
(
"Phase %d/%d: Fixing views"
,
phase
++
,
phases_total
);
print_conn_args
(
"mysqlcheck"
);
return
run_tool
(
mysqlcheck_path
,
NULL
,
/* Send output from mysqlcheck directly to screen */
"--no-defaults"
,
ds_args
.
str
,
"--all-databases"
,
"--repair"
,
upgrade_views
,
"--skip-process-tables"
,
opt_verbose
?
"--verbose"
:
""
,
opt_silent
?
"--silent"
:
""
,
opt_write_binlog
?
"--write-binlog"
:
"--skip-write-binlog"
,
"2>&1"
,
NULL
);
}
static
int
run_mysqlcheck_fixnames
(
void
)
static
int
run_mysqlcheck_fixnames
(
void
)
{
{
verbose
(
"Phase 1/3: Fixing table and database names"
);
if
(
opt_systables_only
)
{
verbose
(
"Phase %d/%d: Fixing table and database names ... Skipped"
,
phase
++
,
phases_total
);
return
0
;
}
verbose
(
"Phase %d/%d: Fixing table and database names"
,
phase
++
,
phases_total
);
print_conn_args
(
"mysqlcheck"
);
print_conn_args
(
"mysqlcheck"
);
return
run_tool
(
mysqlcheck_path
,
return
run_tool
(
mysqlcheck_path
,
NULL
,
/* Send output from mysqlcheck directly to screen */
NULL
,
/* Send output from mysqlcheck directly to screen */
...
@@ -838,7 +907,8 @@ static int run_sql_fix_privilege_tables(void)
...
@@ -838,7 +907,8 @@ static int run_sql_fix_privilege_tables(void)
if
(
init_dynamic_string
(
&
ds_result
,
""
,
512
,
512
))
if
(
init_dynamic_string
(
&
ds_result
,
""
,
512
,
512
))
die
(
"Out of memory"
);
die
(
"Out of memory"
);
verbose
(
"Phase 3/3: Running 'mysql_fix_privilege_tables'..."
);
verbose
(
"Phase %d/%d: Running 'mysql_fix_privilege_tables'"
,
phase
++
,
phases_total
);
run_query
(
mysql_fix_privilege_tables
,
run_query
(
mysql_fix_privilege_tables
,
&
ds_result
,
/* Collect result */
&
ds_result
,
/* Collect result */
TRUE
);
TRUE
);
...
@@ -1000,9 +1070,8 @@ int main(int argc, char **argv)
...
@@ -1000,9 +1070,8 @@ int main(int argc, char **argv)
/*
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
*/
if
((
!
opt_systables_only
&&
if
(
run_mysqlcheck_views
()
||
run_mysqlcheck_fixnames
()
||
(
run_mysqlcheck_fixnames
()
||
run_mysqlcheck_upgrade
()))
||
run_mysqlcheck_upgrade
()
||
run_sql_fix_privilege_tables
())
run_sql_fix_privilege_tables
())
{
{
/*
/*
The upgrade failed to complete in some way or another,
The upgrade failed to complete in some way or another,
...
...
client/mysqladmin.cc
View file @
6c4d1240
...
@@ -1198,6 +1198,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
...
@@ -1198,6 +1198,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
static
char
**
mask_password
(
int
argc
,
char
***
argv
)
static
char
**
mask_password
(
int
argc
,
char
***
argv
)
{
{
char
**
temp_argv
;
char
**
temp_argv
;
if
(
!
argc
)
return
NULL
;
temp_argv
=
(
char
**
)(
my_malloc
(
sizeof
(
char
*
)
*
argc
,
MYF
(
MY_WME
)));
temp_argv
=
(
char
**
)(
my_malloc
(
sizeof
(
char
*
)
*
argc
,
MYF
(
MY_WME
)));
argc
--
;
argc
--
;
while
(
argc
>
0
)
while
(
argc
>
0
)
...
...
client/mysqlcheck.c
View file @
6c4d1240
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.7.
1
"
#define CHECK_VERSION "2.7.
2-MariaDB
"
#include
"client_priv.h"
#include
"client_priv.h"
#include
<m_ctype.h>
#include
<m_ctype.h>
...
@@ -42,7 +42,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
...
@@ -42,7 +42,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_medium_check
=
0
,
opt_quick
=
0
,
opt_all_in_1
=
0
,
opt_medium_check
=
0
,
opt_quick
=
0
,
opt_all_in_1
=
0
,
opt_silent
=
0
,
opt_auto_repair
=
0
,
ignore_errors
=
0
,
opt_silent
=
0
,
opt_auto_repair
=
0
,
ignore_errors
=
0
,
tty_password
=
0
,
opt_frm
=
0
,
debug_info_flag
=
0
,
debug_check_flag
=
0
,
tty_password
=
0
,
opt_frm
=
0
,
debug_info_flag
=
0
,
debug_check_flag
=
0
,
opt_fix_table_names
=
0
,
opt_fix_db_names
=
0
,
opt_upgrade
=
0
;
opt_fix_table_names
=
0
,
opt_fix_db_names
=
0
,
opt_upgrade
=
0
,
opt_do_tables
=
1
;
static
my_bool
opt_write_binlog
=
1
,
opt_flush_tables
=
0
;
static
my_bool
opt_write_binlog
=
1
,
opt_flush_tables
=
0
;
static
uint
verbose
=
0
,
opt_mysql_port
=
0
;
static
uint
verbose
=
0
,
opt_mysql_port
=
0
;
static
int
my_end_arg
;
static
int
my_end_arg
;
...
@@ -55,7 +56,17 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
...
@@ -55,7 +56,17 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
static
char
*
shared_memory_base_name
=
0
;
static
char
*
shared_memory_base_name
=
0
;
static
uint
opt_protocol
=
0
;
static
uint
opt_protocol
=
0
;
enum
operations
{
DO_CHECK
=
1
,
DO_REPAIR
,
DO_ANALYZE
,
DO_OPTIMIZE
,
DO_UPGRADE
};
enum
operations
{
DO_CHECK
=
1
,
DO_REPAIR
,
DO_ANALYZE
,
DO_OPTIMIZE
,
DO_FIX_NAMES
};
const
char
*
operation_name
[]
=
{
"???"
,
"check"
,
"repair"
,
"analyze"
,
"optimize"
,
"fix names"
};
typedef
enum
{
DO_VIEWS_NO
,
DO_VIEWS_YES
,
DO_VIEWS_FROM_MYSQL
}
enum_do_views
;
const
char
*
do_views_opts
[]
=
{
"NO"
,
"YES"
,
"UPGRADE_FROM_MYSQL"
,
NullS
};
TYPELIB
do_views_typelib
=
{
array_elements
(
do_views_opts
)
-
1
,
""
,
do_views_opts
,
NULL
};
static
ulong
opt_do_views
=
DO_VIEWS_NO
;
static
struct
my_option
my_long_options
[]
=
static
struct
my_option
my_long_options
[]
=
{
{
...
@@ -196,6 +207,14 @@ static struct my_option my_long_options[] =
...
@@ -196,6 +207,14 @@ static struct my_option my_long_options[] =
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"version"
,
'V'
,
"Output version information and exit."
,
0
,
0
,
0
,
GET_NO_ARG
,
{
"version"
,
'V'
,
"Output version information and exit."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"process-views"
,
0
,
"Perform the requested operation (check or repair) on views. "
"One of: NO, YES (correct the checksum, if necessary, add the "
"mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle "
"the algorithm MERGE<->TEMPTABLE."
,
&
opt_do_views
,
&
opt_do_views
,
&
do_views_typelib
,
GET_ENUM
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"process-tables"
,
0
,
"Perform the requested operation on tables."
,
&
opt_do_tables
,
&
opt_do_tables
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
};
...
@@ -212,7 +231,7 @@ static int process_selected_tables(char *db, char **table_names, int tables);
...
@@ -212,7 +231,7 @@ static int process_selected_tables(char *db, char **table_names, int tables);
static
int
process_all_tables_in_db
(
char
*
database
);
static
int
process_all_tables_in_db
(
char
*
database
);
static
int
process_one_db
(
char
*
database
);
static
int
process_one_db
(
char
*
database
);
static
int
use_db
(
char
*
database
);
static
int
use_db
(
char
*
database
);
static
int
handle_request_for_tables
(
char
*
tables
,
uin
t
length
);
static
int
handle_request_for_tables
(
char
*
tables
,
size_
t
length
,
my_bool
view
);
static
int
dbConnect
(
char
*
host
,
char
*
user
,
char
*
passwd
);
static
int
dbConnect
(
char
*
host
,
char
*
user
,
char
*
passwd
);
static
void
dbDisconnect
(
char
*
host
);
static
void
dbDisconnect
(
char
*
host
);
static
void
DBerror
(
MYSQL
*
mysql
,
const
char
*
when
);
static
void
DBerror
(
MYSQL
*
mysql
,
const
char
*
when
);
...
@@ -287,11 +306,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -287,11 +306,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
what_to_do
=
DO_OPTIMIZE
;
what_to_do
=
DO_OPTIMIZE
;
break
;
break
;
case
OPT_FIX_DB_NAMES
:
case
OPT_FIX_DB_NAMES
:
what_to_do
=
DO_
UPGRADE
;
what_to_do
=
DO_
FIX_NAMES
;
opt_databases
=
1
;
opt_databases
=
1
;
break
;
break
;
case
OPT_FIX_TABLE_NAMES
:
case
OPT_FIX_TABLE_NAMES
:
what_to_do
=
DO_
UPGRADE
;
what_to_do
=
DO_
FIX_NAMES
;
break
;
break
;
case
'p'
:
case
'p'
:
if
(
argument
==
disabled_my_option
)
if
(
argument
==
disabled_my_option
)
...
@@ -332,7 +351,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -332,7 +351,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
'v'
:
case
'v'
:
verbose
++
;
verbose
++
;
break
;
break
;
case
'V'
:
print_version
();
exit
(
0
);
case
'V'
:
print_version
();
exit
(
0
);
break
;
case
OPT_MYSQL_PROTOCOL
:
case
OPT_MYSQL_PROTOCOL
:
opt_protocol
=
find_type_or_exit
(
argument
,
&
sql_protocol_typelib
,
opt_protocol
=
find_type_or_exit
(
argument
,
&
sql_protocol_typelib
,
opt
->
name
);
opt
->
name
);
...
@@ -341,7 +362,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -341,7 +362,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if
(
orig_what_to_do
&&
(
what_to_do
!=
orig_what_to_do
))
if
(
orig_what_to_do
&&
(
what_to_do
!=
orig_what_to_do
))
{
{
fprintf
(
stderr
,
"Error:
%s doesn't support multiple contradicting commands.
\n
"
,
fprintf
(
stderr
,
"Error: %s doesn't support multiple contradicting commands.
\n
"
,
my_progname
);
my_progname
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
@@ -363,6 +384,12 @@ static int get_options(int *argc, char ***argv)
...
@@ -363,6 +384,12 @@ static int get_options(int *argc, char ***argv)
if
((
ho_error
=
handle_options
(
argc
,
argv
,
my_long_options
,
get_one_option
)))
if
((
ho_error
=
handle_options
(
argc
,
argv
,
my_long_options
,
get_one_option
)))
exit
(
ho_error
);
exit
(
ho_error
);
if
(
what_to_do
==
DO_REPAIR
&&
!
opt_do_views
&&
!
opt_do_tables
)
{
fprintf
(
stderr
,
"Error: Nothing to repair when both "
"--process-tables=NO and --process-views=NO
\n
"
);
exit
(
1
);
}
if
(
!
what_to_do
)
if
(
!
what_to_do
)
{
{
size_t
pnlen
=
strlen
(
my_progname
);
size_t
pnlen
=
strlen
(
my_progname
);
...
@@ -379,6 +406,13 @@ static int get_options(int *argc, char ***argv)
...
@@ -379,6 +406,13 @@ static int get_options(int *argc, char ***argv)
what_to_do
=
DO_CHECK
;
what_to_do
=
DO_CHECK
;
}
}
if
(
opt_do_views
&&
what_to_do
!=
DO_REPAIR
&&
what_to_do
!=
DO_CHECK
)
{
fprintf
(
stderr
,
"Error: %s doesn't support %s for views.
\n
"
,
my_progname
,
operation_name
[
what_to_do
]);
exit
(
1
);
}
/*
/*
If there's no --default-character-set option given with
If there's no --default-character-set option given with
--fix-table-name or --fix-db-name set the default character set to "utf8".
--fix-table-name or --fix-db-name set the default character set to "utf8".
...
@@ -463,13 +497,41 @@ static int process_databases(char **db_names)
...
@@ -463,13 +497,41 @@ static int process_databases(char **db_names)
}
/* process_databases */
}
/* process_databases */
/* returns: -1 for error, 1 for view, 0 for table */
static
int
is_view
(
const
char
*
table
)
{
char
query
[
1024
];
MYSQL_RES
*
res
;
MYSQL_FIELD
*
field
;
int
view
;
DBUG_ENTER
(
"is_view"
);
my_snprintf
(
query
,
sizeof
(
query
),
"SHOW CREATE TABLE %`s"
,
table
);
if
(
mysql_query
(
sock
,
query
))
{
fprintf
(
stderr
,
"Failed to %s
\n
"
,
query
);
fprintf
(
stderr
,
"Error: %s
\n
"
,
mysql_error
(
sock
));
my_free
(
query
);
DBUG_RETURN
(
-
1
);
}
res
=
mysql_store_result
(
sock
);
field
=
mysql_fetch_field
(
res
);
view
=
(
strcmp
(
field
->
name
,
"View"
)
==
0
)
?
1
:
0
;
mysql_free_result
(
res
);
DBUG_RETURN
(
view
);
}
static
int
process_selected_tables
(
char
*
db
,
char
**
table_names
,
int
tables
)
static
int
process_selected_tables
(
char
*
db
,
char
**
table_names
,
int
tables
)
{
{
int
view
;
char
*
table
;
uint
table_len
;
DBUG_ENTER
(
"process_selected_tables"
);
DBUG_ENTER
(
"process_selected_tables"
);
if
(
use_db
(
db
))
if
(
use_db
(
db
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
if
(
opt_all_in_1
&&
what_to_do
!=
DO_
UPGRADE
)
if
(
opt_all_in_1
&&
what_to_do
!=
DO_
FIX_NAMES
)
{
{
/*
/*
We need table list in form `a`, `b`, `c`
We need table list in form `a`, `b`, `c`
...
@@ -480,6 +542,15 @@ static int process_selected_tables(char *db, char **table_names, int tables)
...
@@ -480,6 +542,15 @@ static int process_selected_tables(char *db, char **table_names, int tables)
size_t
tot_length
=
0
;
size_t
tot_length
=
0
;
int
i
=
0
;
int
i
=
0
;
if
(
opt_do_tables
&&
opt_do_views
)
{
fprintf
(
stderr
,
"Error: %s cannot process both tables and views "
"in one command (--process-tables=YES "
"--process-views=YES --all-in-1).
\n
"
,
my_progname
);
DBUG_RETURN
(
1
);
}
for
(
i
=
0
;
i
<
tables
;
i
++
)
for
(
i
=
0
;
i
<
tables
;
i
++
)
tot_length
+=
fixed_name_length
(
*
(
table_names
+
i
))
+
2
;
tot_length
+=
fixed_name_length
(
*
(
table_names
+
i
))
+
2
;
...
@@ -494,12 +565,20 @@ static int process_selected_tables(char *db, char **table_names, int tables)
...
@@ -494,12 +565,20 @@ static int process_selected_tables(char *db, char **table_names, int tables)
*
end
++=
','
;
*
end
++=
','
;
}
}
*--
end
=
0
;
*--
end
=
0
;
handle_request_for_tables
(
table_names_comma_sep
+
1
,
(
uint
)
(
tot_length
-
1
));
handle_request_for_tables
(
table_names_comma_sep
+
1
,
tot_length
-
1
,
opt_do_views
!=
0
);
my_free
(
table_names_comma_sep
);
my_free
(
table_names_comma_sep
);
}
}
else
else
for
(;
tables
>
0
;
tables
--
,
table_names
++
)
for
(;
tables
>
0
;
tables
--
,
table_names
++
)
handle_request_for_tables
(
*
table_names
,
fixed_name_length
(
*
table_names
));
{
table
=
*
table_names
;
table_len
=
fixed_name_length
(
*
table_names
);
view
=
is_view
(
table
);
if
(
view
<
0
)
continue
;
handle_request_for_tables
(
table
,
table_len
,
(
view
==
1
));
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
/* process_selected_tables */
}
/* process_selected_tables */
...
@@ -514,9 +593,6 @@ static uint fixed_name_length(const char *name)
...
@@ -514,9 +593,6 @@ static uint fixed_name_length(const char *name)
{
{
if
(
*
p
==
'`'
)
if
(
*
p
==
'`'
)
extra_length
++
;
extra_length
++
;
else
if
(
*
p
==
'.'
)
extra_length
+=
2
;
}
}
DBUG_RETURN
((
uint
)
((
p
-
name
)
+
extra_length
));
DBUG_RETURN
((
uint
)
((
p
-
name
)
+
extra_length
));
}
}
...
@@ -530,11 +606,6 @@ static char *fix_table_name(char *dest, char *src)
...
@@ -530,11 +606,6 @@ static char *fix_table_name(char *dest, char *src)
for
(;
*
src
;
src
++
)
for
(;
*
src
;
src
++
)
{
{
switch
(
*
src
)
{
switch
(
*
src
)
{
case
'.'
:
/* add backticks around '.' */
*
dest
++=
'`'
;
*
dest
++=
'.'
;
*
dest
++=
'`'
;
break
;
case
'`'
:
/* escape backtick character */
case
'`'
:
/* escape backtick character */
*
dest
++=
'`'
;
*
dest
++=
'`'
;
/* fall through */
/* fall through */
...
@@ -554,6 +625,7 @@ static int process_all_tables_in_db(char *database)
...
@@ -554,6 +625,7 @@ static int process_all_tables_in_db(char *database)
MYSQL_ROW
row
;
MYSQL_ROW
row
;
uint
num_columns
;
uint
num_columns
;
my_bool
system_database
=
0
;
my_bool
system_database
=
0
;
my_bool
view
=
FALSE
;
DBUG_ENTER
(
"process_all_tables_in_db"
);
DBUG_ENTER
(
"process_all_tables_in_db"
);
if
(
use_db
(
database
))
if
(
use_db
(
database
))
...
@@ -572,7 +644,7 @@ static int process_all_tables_in_db(char *database)
...
@@ -572,7 +644,7 @@ static int process_all_tables_in_db(char *database)
num_columns
=
mysql_num_fields
(
res
);
num_columns
=
mysql_num_fields
(
res
);
if
(
opt_all_in_1
&&
what_to_do
!=
DO_
UPGRADE
)
if
(
opt_all_in_1
&&
what_to_do
!=
DO_
FIX_NAMES
)
{
{
/*
/*
We need table list in form `a`, `b`, `c`
We need table list in form `a`, `b`, `c`
...
@@ -583,8 +655,17 @@ static int process_all_tables_in_db(char *database)
...
@@ -583,8 +655,17 @@ static int process_all_tables_in_db(char *database)
char
*
tables
,
*
end
;
char
*
tables
,
*
end
;
uint
tot_length
=
0
;
uint
tot_length
=
0
;
char
*
views
,
*
views_end
;
uint
tot_views_length
=
0
;
while
((
row
=
mysql_fetch_row
(
res
)))
while
((
row
=
mysql_fetch_row
(
res
)))
tot_length
+=
fixed_name_length
(
row
[
0
])
+
2
;
{
if
((
num_columns
==
2
)
&&
(
strcmp
(
row
[
1
],
"VIEW"
)
==
0
)
&&
opt_do_views
)
tot_views_length
+=
fixed_name_length
(
row
[
0
])
+
2
;
else
if
(
opt_do_tables
)
tot_length
+=
fixed_name_length
(
row
[
0
])
+
2
;
}
mysql_data_seek
(
res
,
0
);
mysql_data_seek
(
res
,
0
);
if
(
!
(
tables
=
(
char
*
)
my_malloc
(
sizeof
(
char
)
*
tot_length
+
4
,
MYF
(
MY_WME
))))
if
(
!
(
tables
=
(
char
*
)
my_malloc
(
sizeof
(
char
)
*
tot_length
+
4
,
MYF
(
MY_WME
))))
...
@@ -592,32 +673,62 @@ static int process_all_tables_in_db(char *database)
...
@@ -592,32 +673,62 @@ static int process_all_tables_in_db(char *database)
mysql_free_result
(
res
);
mysql_free_result
(
res
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
for
(
end
=
tables
+
1
;
(
row
=
mysql_fetch_row
(
res
))
;
)
if
(
!
(
views
=
(
char
*
)
my_malloc
(
sizeof
(
char
)
*
tot_views_length
+
4
,
MYF
(
MY_WME
)))
)
{
{
if
((
num_columns
==
2
)
&&
(
strcmp
(
row
[
1
],
"VIEW"
)
==
0
))
my_free
(
tables
);
continue
;
mysql_free_result
(
res
);
DBUG_RETURN
(
1
);
}
end
=
fix_table_name
(
end
,
row
[
0
]);
for
(
end
=
tables
+
1
,
views_end
=
views
+
1
;
(
row
=
mysql_fetch_row
(
res
))
;)
*
end
++=
','
;
{
if
((
num_columns
==
2
)
&&
(
strcmp
(
row
[
1
],
"VIEW"
)
==
0
))
{
if
(
!
opt_do_views
)
continue
;
views_end
=
fix_table_name
(
views_end
,
row
[
0
]);
*
views_end
++=
','
;
}
else
{
if
(
!
opt_do_tables
)
continue
;
end
=
fix_table_name
(
end
,
row
[
0
]);
*
end
++=
','
;
}
}
}
*--
end
=
0
;
*--
end
=
0
;
*--
views_end
=
0
;
if
(
tot_length
)
if
(
tot_length
)
handle_request_for_tables
(
tables
+
1
,
tot_length
-
1
);
handle_request_for_tables
(
tables
+
1
,
tot_length
-
1
,
FALSE
);
if
(
tot_views_length
)
handle_request_for_tables
(
views
+
1
,
tot_views_length
-
1
,
TRUE
);
my_free
(
tables
);
my_free
(
tables
);
my_free
(
views
);
}
}
else
else
{
{
while
((
row
=
mysql_fetch_row
(
res
)))
while
((
row
=
mysql_fetch_row
(
res
)))
{
{
/* Skip views if we don't perform renaming. */
/* Skip views if we don't perform renaming. */
if
((
what_to_do
!=
DO_UPGRADE
)
&&
(
num_columns
==
2
)
&&
(
strcmp
(
row
[
1
],
"VIEW"
)
==
0
))
if
((
what_to_do
!=
DO_FIX_NAMES
)
&&
(
num_columns
==
2
)
&&
(
strcmp
(
row
[
1
],
"VIEW"
)
==
0
))
continue
;
{
if
(
!
opt_do_views
)
continue
;
view
=
TRUE
;
}
else
{
if
(
!
opt_do_tables
)
continue
;
view
=
FALSE
;
}
if
(
system_database
&&
if
(
system_database
&&
(
!
strcmp
(
row
[
0
],
"general_log"
)
||
(
!
strcmp
(
row
[
0
],
"general_log"
)
||
!
strcmp
(
row
[
0
],
"slow_log"
)))
!
strcmp
(
row
[
0
],
"slow_log"
)))
continue
;
/* Skip logging tables */
continue
;
/* Skip logging tables */
handle_request_for_tables
(
row
[
0
],
fixed_name_length
(
row
[
0
]));
handle_request_for_tables
(
row
[
0
],
fixed_name_length
(
row
[
0
])
,
view
);
}
}
}
}
mysql_free_result
(
res
);
mysql_free_result
(
res
);
...
@@ -696,7 +807,7 @@ static int process_one_db(char *database)
...
@@ -696,7 +807,7 @@ static int process_one_db(char *database)
if
(
verbose
)
if
(
verbose
)
puts
(
database
);
puts
(
database
);
if
(
what_to_do
==
DO_
UPGRADE
)
if
(
what_to_do
==
DO_
FIX_NAMES
)
{
{
int
rc
=
0
;
int
rc
=
0
;
if
(
opt_fix_db_names
&&
!
strncmp
(
database
,
"#mysql50#"
,
9
))
if
(
opt_fix_db_names
&&
!
strncmp
(
database
,
"#mysql50#"
,
9
))
...
@@ -735,15 +846,17 @@ static int disable_binlog()
...
@@ -735,15 +846,17 @@ static int disable_binlog()
return
run_query
(
stmt
);
return
run_query
(
stmt
);
}
}
static
int
handle_request_for_tables
(
char
*
tables
,
uin
t
length
)
static
int
handle_request_for_tables
(
char
*
tables
,
size_
t
length
,
my_bool
view
)
{
{
char
*
query
,
*
end
,
options
[
100
],
message
[
100
];
char
*
query
,
*
end
,
options
[
100
],
message
[
100
];
char
table_name_buff
[
NAME_CHAR_LEN
*
2
*
2
+
1
],
*
table_name
;
char
table_name_buff
[
NAME_CHAR_LEN
*
2
*
2
+
1
],
*
table_name
;
uint
query_length
=
0
;
uint
query_length
=
0
;
const
char
*
op
=
0
;
const
char
*
op
=
0
;
const
char
*
tab_view
;
DBUG_ENTER
(
"handle_request_for_tables"
);
DBUG_ENTER
(
"handle_request_for_tables"
);
options
[
0
]
=
0
;
options
[
0
]
=
0
;
tab_view
=
view
?
" VIEW "
:
" TABLE "
;
end
=
options
;
end
=
options
;
switch
(
what_to_do
)
{
switch
(
what_to_do
)
{
case
DO_CHECK
:
case
DO_CHECK
:
...
@@ -756,18 +869,28 @@ static int handle_request_for_tables(char *tables, uint length)
...
@@ -756,18 +869,28 @@ static int handle_request_for_tables(char *tables, uint length)
if
(
opt_upgrade
)
end
=
strmov
(
end
,
" FOR UPGRADE"
);
if
(
opt_upgrade
)
end
=
strmov
(
end
,
" FOR UPGRADE"
);
break
;
break
;
case
DO_REPAIR
:
case
DO_REPAIR
:
op
=
(
opt_write_binlog
)
?
"REPAIR"
:
"REPAIR NO_WRITE_TO_BINLOG"
;
op
=
opt_write_binlog
?
"REPAIR"
:
"REPAIR NO_WRITE_TO_BINLOG"
;
if
(
opt_quick
)
end
=
strmov
(
end
,
" QUICK"
);
if
(
view
)
if
(
opt_extended
)
end
=
strmov
(
end
,
" EXTENDED"
);
{
if
(
opt_frm
)
end
=
strmov
(
end
,
" USE_FRM"
);
if
(
opt_do_views
==
DO_VIEWS_FROM_MYSQL
)
end
=
strmov
(
end
,
" FROM MYSQL"
);
}
else
{
if
(
opt_quick
)
end
=
strmov
(
end
,
" QUICK"
);
if
(
opt_extended
)
end
=
strmov
(
end
,
" EXTENDED"
);
if
(
opt_frm
)
end
=
strmov
(
end
,
" USE_FRM"
);
}
break
;
break
;
case
DO_ANALYZE
:
case
DO_ANALYZE
:
DBUG_ASSERT
(
!
view
);
op
=
(
opt_write_binlog
)
?
"ANALYZE"
:
"ANALYZE NO_WRITE_TO_BINLOG"
;
op
=
(
opt_write_binlog
)
?
"ANALYZE"
:
"ANALYZE NO_WRITE_TO_BINLOG"
;
break
;
break
;
case
DO_OPTIMIZE
:
case
DO_OPTIMIZE
:
DBUG_ASSERT
(
!
view
);
op
=
(
opt_write_binlog
)
?
"OPTIMIZE"
:
"OPTIMIZE NO_WRITE_TO_BINLOG"
;
op
=
(
opt_write_binlog
)
?
"OPTIMIZE"
:
"OPTIMIZE NO_WRITE_TO_BINLOG"
;
break
;
break
;
case
DO_UPGRADE
:
case
DO_FIX_NAMES
:
DBUG_ASSERT
(
!
view
);
DBUG_RETURN
(
fix_table_storage_name
(
tables
));
DBUG_RETURN
(
fix_table_storage_name
(
tables
));
}
}
...
@@ -776,14 +899,15 @@ static int handle_request_for_tables(char *tables, uint length)
...
@@ -776,14 +899,15 @@ static int handle_request_for_tables(char *tables, uint length)
if
(
opt_all_in_1
)
if
(
opt_all_in_1
)
{
{
/* No backticks here as we added them before */
/* No backticks here as we added them before */
query_length
=
sprintf
(
query
,
"%s TABLE %s %s"
,
op
,
tables
,
options
);
query_length
=
sprintf
(
query
,
"%s%s%s %s"
,
op
,
tab_view
,
tables
,
options
);
table_name
=
tables
;
table_name
=
tables
;
}
}
else
else
{
{
char
*
ptr
,
*
org
;
char
*
ptr
,
*
org
;
org
=
ptr
=
strmov
(
strmov
(
query
,
op
),
" TABLE "
);
org
=
ptr
=
strmov
(
strmov
(
query
,
op
),
tab_view
);
ptr
=
fix_table_name
(
ptr
,
tables
);
ptr
=
fix_table_name
(
ptr
,
tables
);
strmake
(
table_name_buff
,
org
,
min
((
int
)
sizeof
(
table_name_buff
)
-
1
,
strmake
(
table_name_buff
,
org
,
min
((
int
)
sizeof
(
table_name_buff
)
-
1
,
(
int
)
(
ptr
-
org
)));
(
int
)
(
ptr
-
org
)));
...
@@ -793,7 +917,7 @@ static int handle_request_for_tables(char *tables, uint length)
...
@@ -793,7 +917,7 @@ static int handle_request_for_tables(char *tables, uint length)
}
}
if
(
mysql_real_query
(
sock
,
query
,
query_length
))
if
(
mysql_real_query
(
sock
,
query
,
query_length
))
{
{
sprintf
(
message
,
"when executing '%s
TABLE
... %s'"
,
op
,
options
);
sprintf
(
message
,
"when executing '%s
%s
... %s'"
,
op
,
tab_view
,
options
);
DBerror
(
sock
,
message
);
DBerror
(
sock
,
message
);
my_free
(
query
);
my_free
(
query
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
@@ -818,13 +942,17 @@ static void print_result()
...
@@ -818,13 +942,17 @@ static void print_result()
{
{
MYSQL_RES
*
res
;
MYSQL_RES
*
res
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
char
prev
[(
NAME_LEN
+
9
)
*
2
+
2
];
char
prev
[(
NAME_LEN
+
9
)
*
3
+
2
];
char
prev_alter
[
MAX_ALTER_STR_SIZE
];
char
prev_alter
[
MAX_ALTER_STR_SIZE
];
char
*
db_name
;
uint
length_of_db
;
uint
i
;
uint
i
;
my_bool
found_error
=
0
,
table_rebuild
=
0
;
my_bool
found_error
=
0
,
table_rebuild
=
0
;
DBUG_ENTER
(
"print_result"
);
DBUG_ENTER
(
"print_result"
);
res
=
mysql_use_result
(
sock
);
res
=
mysql_use_result
(
sock
);
db_name
=
sock
->
db
;
length_of_db
=
strlen
(
db_name
);
prev
[
0
]
=
'\0'
;
prev
[
0
]
=
'\0'
;
prev_alter
[
0
]
=
0
;
prev_alter
[
0
]
=
0
;
...
@@ -848,10 +976,16 @@ static void print_result()
...
@@ -848,10 +976,16 @@ static void print_result()
if
(
prev_alter
[
0
])
if
(
prev_alter
[
0
])
insert_dynamic
(
&
alter_table_cmds
,
(
uchar
*
)
prev_alter
);
insert_dynamic
(
&
alter_table_cmds
,
(
uchar
*
)
prev_alter
);
else
else
insert_dynamic
(
&
tables4rebuild
,
(
uchar
*
)
prev
);
{
char
*
table_name
=
prev
+
(
length_of_db
+
1
);
insert_dynamic
(
&
tables4rebuild
,
(
uchar
*
)
table_name
);
}
}
}
else
else
insert_dynamic
(
&
tables4repair
,
(
uchar
*
)
prev
);
{
char
*
table_name
=
prev
+
(
length_of_db
+
1
);
insert_dynamic
(
&
tables4repair
,
(
uchar
*
)
table_name
);
}
}
}
found_error
=
0
;
found_error
=
0
;
table_rebuild
=
0
;
table_rebuild
=
0
;
...
@@ -911,10 +1045,16 @@ static void print_result()
...
@@ -911,10 +1045,16 @@ static void print_result()
if
(
prev_alter
[
0
])
if
(
prev_alter
[
0
])
insert_dynamic
(
&
alter_table_cmds
,
(
uchar
*
)
prev_alter
);
insert_dynamic
(
&
alter_table_cmds
,
(
uchar
*
)
prev_alter
);
else
else
insert_dynamic
(
&
tables4rebuild
,
(
uchar
*
)
prev
);
{
char
*
table_name
=
prev
+
(
length_of_db
+
1
);
insert_dynamic
(
&
tables4rebuild
,
(
uchar
*
)
table_name
);
}
}
}
else
else
insert_dynamic
(
&
tables4repair
,
(
uchar
*
)
prev
);
{
char
*
table_name
=
prev
+
(
length_of_db
+
1
);
insert_dynamic
(
&
tables4repair
,
(
uchar
*
)
table_name
);
}
}
}
mysql_free_result
(
res
);
mysql_free_result
(
res
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1047,7 +1187,7 @@ int main(int argc, char **argv)
...
@@ -1047,7 +1187,7 @@ int main(int argc, char **argv)
for
(
i
=
0
;
i
<
tables4repair
.
elements
;
i
++
)
for
(
i
=
0
;
i
<
tables4repair
.
elements
;
i
++
)
{
{
char
*
name
=
(
char
*
)
dynamic_array_ptr
(
&
tables4repair
,
i
);
char
*
name
=
(
char
*
)
dynamic_array_ptr
(
&
tables4repair
,
i
);
handle_request_for_tables
(
name
,
fixed_name_length
(
name
));
handle_request_for_tables
(
name
,
fixed_name_length
(
name
)
,
FALSE
);
}
}
for
(
i
=
0
;
i
<
tables4rebuild
.
elements
;
i
++
)
for
(
i
=
0
;
i
<
tables4rebuild
.
elements
;
i
++
)
rebuild_table
((
char
*
)
dynamic_array_ptr
(
&
tables4rebuild
,
i
));
rebuild_table
((
char
*
)
dynamic_array_ptr
(
&
tables4rebuild
,
i
));
...
...
client/mysqltest.cc
View file @
6c4d1240
...
@@ -5883,7 +5883,7 @@ void do_connect(struct st_command *command)
...
@@ -5883,7 +5883,7 @@ void do_connect(struct st_command *command)
{
{
int con_port= opt_port;
int con_port= opt_port;
char *con_options;
char *con_options;
char
*
ssl_cipher
=
0
;
char *ssl_cipher
__attribute__((unused))
= 0;
my_bool con_ssl= 0, con_compress= 0;
my_bool con_ssl= 0, con_compress= 0;
my_bool con_pipe= 0;
my_bool con_pipe= 0;
my_bool con_shm __attribute__ ((unused))= 0;
my_bool con_shm __attribute__ ((unused))= 0;
...
...
cmake/compile_flags.cmake
View file @
6c4d1240
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014,
2015,
Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -18,11 +18,11 @@
...
@@ -18,11 +18,11 @@
MACRO
(
ADD_COMPILE_FLAGS
)
MACRO
(
ADD_COMPILE_FLAGS
)
SET
(
FILES
""
)
SET
(
FILES
""
)
SET
(
FLAGS
""
)
SET
(
FLAGS
""
)
SET
(
COMPILE_FLAGS
)
SET
(
COMPILE_FLAGS
_SEEN
)
FOREACH
(
ARG
${
ARGV
}
)
FOREACH
(
ARG
${
ARGV
}
)
IF
(
ARG STREQUAL
"COMPILE_FLAGS"
)
IF
(
ARG STREQUAL
"COMPILE_FLAGS"
)
SET
(
COMPILE_FLAGS
"COMPILE_FLAGS"
)
SET
(
COMPILE_FLAGS
_SEEN 1
)
ELSEIF
(
COMPILE_FLAGS
)
ELSEIF
(
COMPILE_FLAGS
_SEEN
)
LIST
(
APPEND FLAGS
${
ARG
}
)
LIST
(
APPEND FLAGS
${
ARG
}
)
ELSE
()
ELSE
()
LIST
(
APPEND FILES
${
ARG
}
)
LIST
(
APPEND FILES
${
ARG
}
)
...
...
cmake/cpack_rpm.cmake
View file @
6c4d1240
...
@@ -188,6 +188,7 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
...
@@ -188,6 +188,7 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
ALTERNATIVE_NAME
(
"client"
"mysql"
)
ALTERNATIVE_NAME
(
"client"
"mysql"
)
ALTERNATIVE_NAME
(
"devel"
"mariadb-devel"
)
ALTERNATIVE_NAME
(
"devel"
"mariadb-devel"
)
ALTERNATIVE_NAME
(
"server"
"mariadb-server"
)
ALTERNATIVE_NAME
(
"server"
"mariadb-server"
)
ALTERNATIVE_NAME
(
"server"
"mysql-compat-server"
)
ALTERNATIVE_NAME
(
"shared"
"mariadb-libs"
)
ALTERNATIVE_NAME
(
"shared"
"mariadb-libs"
)
ALTERNATIVE_NAME
(
"shared"
"mysql-libs"
)
ALTERNATIVE_NAME
(
"shared"
"mysql-libs"
)
ALTERNATIVE_NAME
(
"test"
"mariadb-test"
)
ALTERNATIVE_NAME
(
"test"
"mariadb-test"
)
...
...
cmake/cpack_source_ignore_files.cmake
View file @
6c4d1240
# Copyright (c) 2009, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 201
4
, Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -14,9 +14,6 @@
...
@@ -14,9 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET
(
CPACK_SOURCE_IGNORE_FILES
SET
(
CPACK_SOURCE_IGNORE_FILES
\\\\.bzr/
\\\\.bzr-mysql
\\\\.bzrignore
CMakeCache\\\\.txt
CMakeCache\\\\.txt
cmake_dist\\\\.cmake
cmake_dist\\\\.cmake
CPackSourceConfig\\\\.cmake
CPackSourceConfig\\\\.cmake
...
...
cmake/info_macros.cmake.in
View file @
6c4d1240
# Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 201
4
, Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -23,11 +23,14 @@
...
@@ -23,11 +23,14 @@
# If further variables are used in this file, add them to this list.
# If further variables are used in this file, add them to this list.
SET(VERSION "@VERSION@")
SET(VERSION "@VERSION@")
SET(MAJOR_VERSION "@MAJOR_VERSION@")
SET(MINOR_VERSION "@MINOR_VERSION@")
SET(PATCH_VERSION "@PATCH_VERSION@")
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
SET(
BZR
_EXECUTABLE "@
BZR
_EXECUTABLE@")
SET(
GIT
_EXECUTABLE "@
GIT
_EXECUTABLE@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
...
@@ -36,27 +39,51 @@ SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
...
@@ -36,27 +39,51 @@ SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
# Create an "INFO_SRC" file with information about the source (only).
# Create an "INFO_SRC" file with information about the source (only).
# We use "
bzr version-info
", if possible, and the "VERSION" contents.
# We use "
git log
", if possible, and the "VERSION" contents.
#
#
# Outside development (
BZR
tree), the "INFO_SRC" file will not be modified
# Outside development (
git
tree), the "INFO_SRC" file will not be modified
# provided it exists (from "make dist" or a source tarball creation).
# provided it exists (from "make dist" or a source tarball creation).
MACRO(CREATE_INFO_SRC target_dir)
MACRO(CREATE_INFO_SRC target_dir)
SET(INFO_SRC "${target_dir}/INFO_SRC")
SET(INFO_SRC "${target_dir}/INFO_SRC")
IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
SET(PERLSCRIPT
# Sources are in a BZR repository: Always update.
"use warnings; use POSIX qw(strftime); "
"print strftime \"%F %T %z\", localtime;")
EXECUTE_PROCESS(
COMMAND perl -e "${PERLSCRIPT}"
RESULT_VARIABLE result
OUTPUT_VARIABLE bdate
ERROR_VARIABLE error
)
IF(error)
MESSAGE(STATUS "Could not determine build-date: <${error}>")
ENDIF()
IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
# Sources are in a GIT repository: Always update.
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE bname
)
EXECUTE_PROCESS(
EXECUTE_PROCESS(
COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} log -1
--pretty="commit: %H%ndate: %ci%nbuild-date: ${bdate} %nshort: %h%nbranch: ${bname}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_INFO
OUTPUT_VARIABLE VERSION_INFO
RESULT_VARIABLE RESULT
)
)
## Output from git is quoted with "", remove them.
STRING(REPLACE "\"" "" VERSION_INFO "${VERSION_INFO}")
FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
# to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
# to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
# For better readability ...
# For better readability ...
FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
FILE(APPEND ${INFO_SRC}
"MySQL source ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}\n")
ELSEIF(EXISTS ${INFO_SRC})
ELSEIF(EXISTS ${INFO_SRC})
# Outside a
BZR
tree, there is no need to change an existing "INFO_SRC",
# Outside a
git
tree, there is no need to change an existing "INFO_SRC",
# it cannot be improved.
# it cannot be improved.
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
# If we are building from a source distribution, it also contains "INFO_SRC".
# If we are building from a source distribution, it also contains "INFO_SRC".
...
...
cmake/info_src.cmake
View file @
6c4d1240
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011,
2014,
Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -16,11 +16,11 @@
...
@@ -16,11 +16,11 @@
# The sole purpose of this cmake control file is to create the "INFO_SRC" file.
# The sole purpose of this cmake control file is to create the "INFO_SRC" file.
# As long as and "
bzr
pull" (or "
bzr
commit") is followed by a "cmake",
# As long as and "
git
pull" (or "
git
commit") is followed by a "cmake",
# the call in top level "CMakeLists.txt" is sufficient.
# the call in top level "CMakeLists.txt" is sufficient.
# This file is to provide a separate target for the "make" phase,
# This file is to provide a separate target for the "make" phase,
# to ensure the
BZR revision-id
is correct even after a sequence
# to ensure the
git commit hash
is correct even after a sequence
# cmake ; make ;
bzr
pull ; make
# cmake ; make ;
git
pull ; make
# Get the macros which handle the "INFO_*" files.
# Get the macros which handle the "INFO_*" files.
...
...
cmake/maintainer.cmake
View file @
6c4d1240
...
@@ -36,8 +36,8 @@ ENDIF()
...
@@ -36,8 +36,8 @@ ENDIF()
# Turn on Werror (warning => error) when using maintainer mode.
# Turn on Werror (warning => error) when using maintainer mode.
IF
(
MYSQL_MAINTAINER_MODE MATCHES
"ON"
)
IF
(
MYSQL_MAINTAINER_MODE MATCHES
"ON"
)
SET
(
MY_C_WARNING_FLAGS
"
${
MY_C_WARNING_FLAGS
}
-Werror"
)
SET
(
MY_C_WARNING_FLAGS
"
${
MY_C_WARNING_FLAGS
}
-DFORCE_INIT_OF_VARS
-Werror"
)
SET
(
MY_CXX_WARNING_FLAGS
"
${
MY_CXX_WARNING_FLAGS
}
-Werror"
)
SET
(
MY_CXX_WARNING_FLAGS
"
${
MY_CXX_WARNING_FLAGS
}
-DFORCE_INIT_OF_VARS
-Werror"
)
ENDIF
()
ENDIF
()
# Set warning flags for GCC/Clang
# Set warning flags for GCC/Clang
...
...
cmake/make_dist.cmake.in
View file @
6c4d1240
...
@@ -22,13 +22,12 @@ SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
...
@@ -22,13 +22,12 @@ SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
SET(
BZR
_EXECUTABLE "@
BZR
_EXECUTABLE@")
SET(
GIT
_EXECUTABLE "@
GIT
_EXECUTABLE@")
SET(GTAR_EXECUTABLE "@GTAR_EXECUTABLE@")
SET(GTAR_EXECUTABLE "@GTAR_EXECUTABLE@")
SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(PLUGIN_REPOS "@PLUGIN_REPOS@")
SET(VERSION "@VERSION@")
SET(VERSION "@VERSION@")
...
@@ -40,38 +39,21 @@ SET(PACKAGE_DIR ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
...
@@ -40,38 +39,21 @@ SET(PACKAGE_DIR ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
FILE(REMOVE_RECURSE ${PACKAGE_DIR})
FILE(REMOVE_RECURSE ${PACKAGE_DIR})
FILE(REMOVE ${PACKAGE_DIR}.tar.gz )
FILE(REMOVE ${PACKAGE_DIR}.tar.gz )
IF(
BZR
_EXECUTABLE)
IF(
GIT
_EXECUTABLE)
MESSAGE(STATUS "Running
bzr export
")
MESSAGE(STATUS "Running
git checkout-index
")
EXECUTE_PROCESS(
EXECUTE_PROCESS(
COMMAND "${BZR_EXECUTABLE}" export
COMMAND "${GIT_EXECUTABLE}" checkout-index --all --prefix=${PACKAGE_DIR}/
${PACKAGE_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RESULT
RESULT_VARIABLE RESULT
)
)
IF(NOT RESULT EQUAL 0)
IF(NOT RESULT EQUAL 0)
SET(
BZR
_EXECUTABLE)
SET(
GIT
_EXECUTABLE)
ENDIF()
ENDIF()
ENDIF()
ENDIF()
IF(BZR_EXECUTABLE)
IF(NOT GIT_EXECUTABLE)
FOREACH(REPO ${PLUGIN_REPOS})
MESSAGE(STATUS "git not found or source dir is not a repo, use CPack")
GET_FILENAME_COMPONENT(PLUGIN_NAME ${REPO} NAME)
SET(DEST ${PACKAGE_DIR}/plugin/${PLUGIN_NAME})
MESSAGE(STATUS "Running bzr export for plugin/${PLUGIN_NAME}")
EXECUTE_PROCESS(
COMMAND "${BZR_EXECUTABLE}" export ${DEST}
WORKING_DIRECTORY ${REPO}
RESULT_VARIABLE RESULT
)
IF(NOT RESULT EQUAL 0)
MESSAGE(STATUS "bzr export failed")
ENDIF()
ENDFOREACH()
ENDIF()
IF(NOT BZR_EXECUTABLE)
MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
# In-source build is the worst option, we have to cleanup source tree.
# In-source build is the worst option, we have to cleanup source tree.
...
@@ -119,15 +101,6 @@ CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
...
@@ -119,15 +101,6 @@ CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
# Copy spec files
SET(SPECFILENAME "mysql.${VERSION}.spec")
IF("${VERSION}" MATCHES "-ndb-")
STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
ENDIF()
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/${SPECFILENAME}
${PACKAGE_DIR}/support-files/${SPECFILENAME} COPYONLY)
# Add documentation, if user has specified where to find them
# Add documentation, if user has specified where to find them
IF(MYSQL_DOCS_LOCATION)
IF(MYSQL_DOCS_LOCATION)
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
...
...
cmake/plugin.cmake
View file @
6c4d1240
...
@@ -237,11 +237,4 @@ MACRO(CONFIGURE_PLUGINS)
...
@@ -237,11 +237,4 @@ MACRO(CONFIGURE_PLUGINS)
ADD_SUBDIRECTORY
(
${
dir
}
)
ADD_SUBDIRECTORY
(
${
dir
}
)
ENDIF
()
ENDIF
()
ENDFOREACH
()
ENDFOREACH
()
FOREACH
(
dir
${
dirs_plugin
}
)
IF
(
EXISTS
${
dir
}
/.bzr
)
MESSAGE
(
STATUS
"Found repo
${
dir
}
/.bzr"
)
LIST
(
APPEND PLUGIN_BZR_REPOS
"
${
dir
}
"
)
ENDIF
()
ENDFOREACH
()
SET
(
PLUGIN_REPOS
"
${
PLUGIN_BZR_REPOS
}
"
CACHE INTERNAL
""
)
ENDMACRO
()
ENDMACRO
()
debian/changelog
View file @
6c4d1240
mariadb-5.5 (5.5.43-1) unstable; urgency=low
* New upstream release. Fixes to the following security issues:
- CVE-2015-0501
- CVE-2015-2571
- CVE-2015-0505
- CVE-2015-0499
-- Otto Kekäläinen <otto@seravo.fi> Sun, 03 May 2015 23:21:11 +0300
mariadb-5.5 (5.5.41-2) unstable; urgency=low
mariadb-5.5 (5.5.41-2) unstable; urgency=low
* Critical backport from 10.0 (commit 439123d):
* Critical backport from 10.0 (commit 439123d):
...
...
debian/dist/Ubuntu/mariadb-server-5.5.files.in
View file @
6c4d1240
usr/lib/mysql/plugin/ha_innodb.so
usr/lib/mysql/plugin/ha_innodb.so
usr/lib/mysql/plugin/ha_oqgraph.so
usr/lib/mysql/plugin/sphinx.so
usr/lib/mysql/plugin/sphinx.so
usr/lib/mysql/plugin/auth_socket.so
usr/lib/mysql/plugin/auth_socket.so
usr/lib/mysql/plugin/auth_pam.so
usr/lib/mysql/plugin/auth_pam.so
...
@@ -75,3 +74,4 @@ usr/share/mysql/mysql_system_tables.sql
...
@@ -75,3 +74,4 @@ usr/share/mysql/mysql_system_tables.sql
usr/share/mysql/mysql_performance_tables.sql
usr/share/mysql/mysql_performance_tables.sql
usr/share/mysql/mysql_test_data_timezone.sql
usr/share/mysql/mysql_test_data_timezone.sql
@TOKUDB_DEB_FILES@
@TOKUDB_DEB_FILES@
@OQGRAPH_DEB_FILES@
debian/dist/Ubuntu/mariadb-server-5.5.postinst
0 → 100644
View file @
6c4d1240
#!/bin/bash -e
.
/usr/share/debconf/confmodule
if
[
-n
"
$DEBIAN_SCRIPT_DEBUG
"
]
;
then
set
-v
-x
;
DEBIAN_SCRIPT_TRACE
=
1
;
fi
${
DEBIAN_SCRIPT_TRACE
:+
echo
"#42#DEBUG# RUNNING
$0
$*
"
1>&2
}
export
PATH
=
$PATH
:/sbin:/usr/sbin:/bin:/usr/bin
# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
ERR_LOGGER
=
"logger -p daemon.err -t mysqld_safe -i"
# This will make an error in a logged command immediately apparent by aborting
# the install, rather than failing silently and leaving a broken install.
set
-o
pipefail
invoke
()
{
if
[
-x
/usr/sbin/invoke-rc.d
]
;
then
invoke-rc.d mysql
$1
else
/etc/init.d/mysql
$1
fi
}
MYSQL_BOOTSTRAP
=
"/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam"
test_mysql_access
()
{
mysql
--no-defaults
-u
root
-h
localhost </dev/null
>
/dev/null 2>&1
}
# call with $1 = "online" to connect to the server, otherwise it bootstraps
set_mysql_rootpw
()
{
# forget we ever saw the password. don't use reset to keep the seen status
db_set mysql-server/root_password
""
db_set mysql-server/root_password_again
""
tfile
=
`
mktemp
`
if
[
!
-f
"
$tfile
"
]
;
then
return
1
fi
# this avoids us having to call "test" or "[" on $rootpw
cat
<<
EOF
>
$tfile
USE mysql;
UPDATE user SET password=PASSWORD("
$rootpw
") WHERE user='root';
FLUSH PRIVILEGES;
EOF
if
grep
-q
'PASSWORD("")'
$tfile
;
then
retval
=
0
elif
[
"
$1
"
=
"online"
]
;
then
mysql
--no-defaults
-u
root
-h
localhost <
$tfile
>
/dev/null
retval
=
$?
else
$MYSQL_BOOTSTRAP
<
$tfile
retval
=
$?
fi
rm
-f
$tfile
return
$retval
}
# This is necessary because mysql_install_db removes the pid file in /var/run
# and because changed configuration options should take effect immediately.
# In case the server wasn't running at all it should be ok if the stop
# script fails. I can't tell at this point because of the cleaned /var/run.
set
+e
;
invoke stop
;
set
-e
case
"
$1
"
in
configure
)
mysql_datadir
=
/usr/share/mysql
mysql_statedir
=
/var/lib/mysql
mysql_rundir
=
/var/run/mysqld
mysql_logdir
=
/var/log
mysql_cfgdir
=
/etc/mysql
mysql_newlogdir
=
/var/log/mysql
mysql_upgradedir
=
/var/lib/mysql-upgrade
# first things first, if the following symlink exists, it is a preserved
# copy the old data dir from a mysql upgrade that would have otherwise
# been replaced by an empty mysql dir. this should restore it.
for
dir
in
DATADIR LOGDIR
;
do
if
[
"
$dir
"
=
"DATADIR"
]
;
then
targetdir
=
$mysql_statedir
;
else
targetdir
=
$mysql_newlogdir
;
fi
savelink
=
"
$mysql_upgradedir
/
$dir
.link"
if
[
-L
"
$savelink
"
]
;
then
# If the targetdir was a symlink before we upgraded it is supposed
# to be either still be present or not existing anymore now.
if
[
-L
"
$targetdir
"
]
;
then
rm
"
$savelink
"
elif
[
!
-d
"
$targetdir
"
]
;
then
mv
"
$savelink
"
"
$targetdir
"
else
# this should never even happen, but just in case...
mysql_tmp
=
`
mktemp
-d
-t
mysql-symlink-restore-XXXXXX
`
echo
"this is very strange! see
$mysql_tmp
/README..."
>
&2
mv
"
$targetdir
"
"
$mysql_tmp
"
cat
<<
EOF
> "
$mysql_tmp
/README"
if you're reading this, it's most likely because you had replaced /var/lib/mysql
with a symlink, then upgraded to a new version of mysql, and then dpkg
removed your symlink (see #182747 and others). the mysql packages noticed
that this happened, and as a workaround have restored it. however, because
/var/lib/mysql seems to have been re-created in the meantime, and because
we don't want to rm -rf something we don't know as much about, we're going
to leave this unexpected directory here. if your database looks normal,
and this is not a symlink to your database, you should be able to blow
this all away.
EOF
fi
fi
rmdir
$mysql_upgradedir
2>/dev/null
||
true
done
# Ensure the existence and right permissions for the database and
# log files.
if
[
!
-d
"
$mysql_statedir
"
-a
!
-L
"
$mysql_statedir
"
]
;
then
mkdir
"
$mysql_statedir
"
;
fi
if
[
!
-d
"
$mysql_statedir
/mysql"
-a
!
-L
"
$mysql_statedir
/mysql"
]
;
then
mkdir
"
$mysql_statedir
/mysql"
;
fi
if
[
!
-d
"
$mysql_newlogdir
"
-a
!
-L
"
$mysql_newlogdir
"
]
;
then
mkdir
"
$mysql_newlogdir
"
;
fi
# When creating an ext3 jounal on an already mounted filesystem like e.g.
# /var/lib/mysql, you get a .journal file that is not modifyable by chown.
# The mysql_datadir must not be writable by the mysql user under any
# circumstances as it contains scripts that are executed by root.
set
+e
chown
-R
0:0
$mysql_datadir
chown
-R
mysql
$mysql_statedir
chown
-R
mysql
$mysql_rundir
chown
-R
mysql:adm
$mysql_newlogdir
;
chmod
2750
$mysql_newlogdir
;
for
i
in
log err
;
do
touch
$mysql_logdir
/mysql.
$i
chown
mysql:adm
$mysql_logdir
/mysql.
$i
chmod
0640
$mysql_logdir
/mysql.
$i
done
set
-e
# This is important to avoid dataloss when there is a removed
# mysql-server version from Woody lying around which used the same
# data directory and then somewhen gets purged by the admin.
db_set mysql-server/postrm_remove_database
false
||
true
# To avoid downgrades.
touch
$mysql_statedir
/debian-5.5.flag
# initiate databases. Output is not allowed by debconf :-(
# This will fail if we are upgrading an existing database; in this case
# mysql_upgrade, called from the /etc/init.d/mysql start script, will
# handle things.
# Debian: beware of the bashisms...
# Debian: can safely run on upgrades with existing databases
set
+e
/bin/bash /usr/bin/mysql_install_db
--rpm
--user
=
mysql 2>&1 |
$ERR_LOGGER
set
-e
## On every reconfiguration the maintenance user is recreated.
#
# - It is easier to regenerate the password every time but as people
# use fancy rsync scripts and file alteration monitors, the existing
# password is used and existing files not touched.
# - The mysqld statement is like that in mysql_install_db because the
# server is not already running. This has some implications:
# - The amount of newlines and semicolons in the query is important!
# - GRANT is not possible with --skip-grant-tables and "INSERT
# (user,host..) VALUES" is not --ansi compliant
# - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo.
# - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv
# may not be present as old Woody 3.23 databases did not have it and the
# admin might not already have run mysql_upgrade which adds them.
# As the binlog cron scripts to need at least the Super_priv, I do first
# the old query which always succeeds and then the new which may or may not.
# recreate the credentials file if not present or without mysql_upgrade stanza
dc
=
$mysql_cfgdir
/debian.cnf
;
if
[
-e
"
$dc
"
-a
-n
"
`
fgrep mysql_upgrade
$dc
2>/dev/null
`
"
]
;
then
pass
=
"
`
sed
-n
's/^[ ]*password *= *// p'
$dc
|
head
-n
1
`
"
else
pass
=
`
perl
-e
'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'
`
;
if
[
!
-d
"
$mysql_cfgdir
"
]
;
then
install
-o
0
-g
0
-m
0755
-d
$mysql_cfgdir
;
fi
cat
/dev/null
>
$dc
echo
"# Automatically generated for Debian scripts. DO NOT TOUCH!"
>>
$dc
echo
"[client]"
>>
$dc
echo
"host = localhost"
>>
$dc
echo
"user = debian-sys-maint"
>>
$dc
echo
"password =
$pass
"
>>
$dc
echo
"socket =
$mysql_rundir
/mysqld.sock"
>>
$dc
echo
"[mysql_upgrade]"
>>
$dc
echo
"host = localhost"
>>
$dc
echo
"user = debian-sys-maint"
>>
$dc
echo
"password =
$pass
"
>>
$dc
echo
"socket =
$mysql_rundir
/mysqld.sock"
>>
$dc
echo
"basedir = /usr"
>>
$dc
fi
# If this dir chmod go+w then the admin did it. But this file should not.
chown
0:0
$dc
chmod
0600
$dc
# update privilege tables
password_column_fix_query
=
`
/bin/echo
-e
\
"USE mysql
\n
"
\
"ALTER TABLE user CHANGE Password Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL"
`
;
replace_query
=
`
/bin/echo
-e
\
"USE mysql
\n
"
\
"SET sql_mode='';
\n
"
\
"REPLACE INTO user SET "
\
" host='localhost', user='debian-sys-maint', password=password('
$pass
'), "
\
" Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', "
\
" Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', "
\
" Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', "
\
" Index_priv='Y', Alter_priv='Y', Super_priv='Y', Show_db_priv='Y', "
\
" Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', "
\
" Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', "
\
" Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "
\
" Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y',"
\
" ssl_cipher='', x509_issuer='', x509_subject='';"
`
;
# Engines supported by etch should be installed per default. The query sequence is supposed
# to be aborted if the CREATE TABLE fails due to an already existent table in which case the
# admin might already have chosen to remove one or more plugins. Newlines are necessary.
install_plugins
=
`
/bin/echo
-e
\
"USE mysql;
\n
"
\
"CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', "
\
" dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', "
\
" PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';"
`
# Upgrade password column format before the root password gets set.
echo
"
$password_column_fix_query
"
|
$MYSQL_BOOTSTRAP
2>&1 |
$ERR_LOGGER
db_get mysql-server/root_password
&&
rootpw
=
"
$RET
"
if
!
set_mysql_rootpw
;
then
password_error
=
"yes"
fi
set
+e
echo
"
$replace_query
"
|
$MYSQL_BOOTSTRAP
2>&1 |
$ERR_LOGGER
echo
"
$install_plugins
"
|
$MYSQL_BOOTSTRAP
2>&1 |
$ERR_LOGGER
set
-e
# If there is a real AppArmor profile, we reload it.
# If the default empty profile is installed, then we remove any old
# profile that may be loaded.
# This allows upgrade from old versions (that have an apparmor profile
# on by default) to work both to disable a default profile, and to keep
# any profile installed and maintained by users themselves.
profile
=
"/etc/apparmor.d/usr.sbin.mysqld"
if
[
-f
"
$profile
"
]
&&
aa-status
--enabled
2>/dev/null
;
then
if
grep
-q
/usr/sbin/mysqld
"
$profile
"
2>/dev/null
;
then
apparmor_parser
-r
"
$profile
"
||
true
else
echo
"/usr/sbin/mysqld { }"
| apparmor_parser
--remove
2>/dev/null
||
true
fi
fi
;;
abort-upgrade|abort-remove|abort-configure
)
;;
*
)
echo
"postinst called with unknown argument '
$1
'"
1>&2
exit
1
;;
esac
# here we check to see if we can connect as root without a password
# this should catch upgrades from previous versions where the root
# password wasn't set. if there is a password, or if the connection
# fails for any other reason, nothing happens.
if
[
"
$1
"
=
"configure"
]
;
then
if
test_mysql_access
;
then
db_input medium mysql-server/root_password
||
true
db_go
db_get mysql-server/root_password
&&
rootpw
=
"
$RET
"
if
!
set_mysql_rootpw
"online"
;
then
password_error
=
"yes"
fi
fi
if
[
"
$password_error
"
=
"yes"
]
;
then
db_input high mysql-server/error_setting_password
||
true
db_go
fi
fi
db_stop
# in case invoke failes
#DEBHELPER#
exit
0
Prev
1
2
3
4
5
…
18
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