Commit aaca7547 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Merge tag 'upstream/5.5.43' into ubuntu-14.10

Upstream version 5.5.43

Conflicts:
	debian/dist/Ubuntu/mariadb-server-5.5.postinst
	debian/mariadb-server-5.5.install
parents 3ee4d2e6 1d7e28f9
*.c diff=cpp
*.h diff=cpp
*.cc diff=cpp
*.ic diff=cpp
*.cpp diff=cpp
*-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
...@@ -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
......
revision-id: sergii@pisem.net-20141219104403-wo7bvoif9zii3ie5 commit: 4c87f727734955f9e4a0ffde25aae4d43ec0b2a5
date: 2014-12-19 11:44:03 +0100 date: 2015-04-29 16:24:52 +0200
build-date: 2014-12-19 11:57:35 +0100 build-date: 2015-04-29 20:55:40 +0200
revno: 4393 short: 4c87f72
branch-nick: 5.5 branch: HEAD
MySQL source 5.5.41 MySQL source 5.5.43
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5 MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=41 MYSQL_VERSION_PATCH=43
MYSQL_VERSION_EXTRA= MYSQL_VERSION_EXTRA=
...@@ -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");
return run_tool(mysqlcheck_path, retch= 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,
......
...@@ -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)
......
...@@ -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, uint 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, uint 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));
......
...@@ -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;
......
# 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})
......
...@@ -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")
......
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 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
...@@ -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
......
# Copyright (c) 2011, 2012, 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
...@@ -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".
......
# 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.
......
...@@ -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
......
...@@ -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})
......
...@@ -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()
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@
...@@ -12,6 +12,16 @@ before calling SSL_new(); ...@@ -12,6 +12,16 @@ before calling SSL_new();
*** end Note *** *** end Note ***
yaSSL Release notes, version 2.3.7 (12/10/2014)
This release of yaSSL fixes the potential to process duplicate handshake
messages by explicitly marking/checking received handshake messages.
yaSSL Release notes, version 2.3.6 (11/25/2014)
This release of yaSSL fixes some valgrind warnings/errors including
uninitialized reads and off by one index errors induced from fuzzing
the handshake. These were reported by Oracle.
yaSSL Release notes, version 2.3.5 (9/29/2014) yaSSL Release notes, version 2.3.5 (9/29/2014)
This release of yaSSL fixes an RSA Padding check vulnerability reported by This release of yaSSL fixes an RSA Padding check vulnerability reported by
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
/* client.cpp */ /* client.cpp */
// takes an optional command line argument of cipher list to make scripting
// easier
#include "../../testsuite/test.hpp" #include "../../testsuite/test.hpp"
//#define TEST_RESUME //#define TEST_RESUME
...@@ -73,11 +77,16 @@ void client_test(void* args) ...@@ -73,11 +77,16 @@ void client_test(void* args)
#ifdef NON_BLOCKING #ifdef NON_BLOCKING
tcp_set_nonblocking(sockfd); tcp_set_nonblocking(sockfd);
#endif #endif
SSL_METHOD* method = TLSv1_client_method(); SSL_METHOD* method = TLSv1_client_method();
SSL_CTX* ctx = SSL_CTX_new(method); SSL_CTX* ctx = SSL_CTX_new(method);
set_certs(ctx); set_certs(ctx);
if (argc >= 2) {
printf("setting cipher list to %s\n", argv[1]);
if (SSL_CTX_set_cipher_list(ctx, argv[1]) != SSL_SUCCESS) {
ClientError(ctx, NULL, sockfd, "set_cipher_list error\n");
}
}
SSL* ssl = SSL_new(ctx); SSL* ssl = SSL_new(ctx);
SSL_set_fd(ssl, sockfd); SSL_set_fd(ssl, sockfd);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment