Skip to content

Commit

Permalink
merge 5.5 => 5.5-mtr
Browse files Browse the repository at this point in the history
--BZR--
revision-id: [email protected]
property-branch-nick: mtr-55
testament3-sha1: 7d612b6778f112d46bc3a2e5f3862d790029fe4f
  • Loading branch information
bjornmu committed Jan 3, 2012
2 parents aae63fd + b54f035 commit d55ebbb
Show file tree
Hide file tree
Showing 187 changed files with 8,262 additions and 1,540 deletions.
Binary file modified .bzrfileids
Binary file not shown.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=19
MYSQL_VERSION_PATCH=21
MYSQL_VERSION_EXTRA=
10 changes: 5 additions & 5 deletions client/mysql_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,19 +929,19 @@ static int check_access()
opt_datadir);
goto exit;
}
if ((error= my_access(opt_plugin_ini, F_OK)))
if (opt_plugin_ini && (error= my_access(opt_plugin_ini, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access plugin config file at '%s'.\n",
opt_plugin_ini);
goto exit;
}
if ((error= my_access(opt_mysqld, F_OK)))
if (opt_mysqld && (error= my_access(opt_mysqld, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access mysqld path '%s'.\n",
opt_mysqld);
goto exit;
}
if ((error= my_access(opt_my_print_defaults, F_OK)))
if (opt_my_print_defaults && (error= my_access(opt_my_print_defaults, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access my-print-defaults path '%s'.\n",
opt_my_print_defaults);
Expand All @@ -967,7 +967,7 @@ static int find_tool(const char *tool_name, char *tool_path)
int i= 0;

const char *paths[]= {
opt_basedir, opt_mysqld, opt_my_print_defaults, "/usr",
opt_mysqld, opt_basedir, opt_my_print_defaults, "/usr",
"/usr/local/mysql", "/usr/sbin", "/usr/share", "/extra", "/extra/debug",
"/extra/release", "/bin", "/usr/bin", "/mysql/bin"
};
Expand Down Expand Up @@ -1124,7 +1124,7 @@ static int dump_bootstrap_file(char *bootstrap_file)
error= 1;
goto exit;
}
printf("# Query: %s", query_str);
printf("# Query: %s\n", query_str);

exit:
if (file)
Expand Down
3 changes: 2 additions & 1 deletion client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ get_one_option(int optid, const struct my_option *opt,
switch (optid) {

case '?':
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
Expand Down Expand Up @@ -286,6 +285,8 @@ get_one_option(int optid, const struct my_option *opt,

case 'v': /* --verbose */
case 'f': /* --force */
case 's': /* --upgrade-system-tables */
case OPT_WRITE_BINLOG: /* --write-binlog */
add_option= FALSE;
break;

Expand Down
44 changes: 34 additions & 10 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ static void verbose_msg(const char *fmt, ...)
vfprintf(stderr, fmt, args);
va_end(args);

fflush(stderr);

DBUG_VOID_RETURN;
}

Expand Down Expand Up @@ -4079,6 +4081,8 @@ static int dump_all_tables_in_db(char *database)
if (mysql_refresh(mysql, REFRESH_LOG))
DB_error(mysql, "when doing refresh");
/* We shall continue here, if --force was given */
else
verbose_msg("-- dump_all_tables_in_db : logs flushed successfully!\n");
}
while ((table= getTableName(0)))
{
Expand Down Expand Up @@ -4179,6 +4183,8 @@ static my_bool dump_all_views_in_db(char *database)
if (mysql_refresh(mysql, REFRESH_LOG))
DB_error(mysql, "when doing refresh");
/* We shall continue here, if --force was given */
else
verbose_msg("-- dump_all_views_in_db : logs flushed successfully!\n");
}
while ((table= getTableName(0)))
{
Expand Down Expand Up @@ -4317,6 +4323,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
DB_error(mysql, "when doing refresh");
}
/* We shall countinue here, if --force was given */
else
verbose_msg("-- dump_selected_tables : logs flushed successfully!\n");
}
if (opt_xml)
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
Expand Down Expand Up @@ -4600,6 +4608,7 @@ static int purge_bin_logs_to(MYSQL *mysql_con, char* log_name)

static int start_transaction(MYSQL *mysql_con)
{
verbose_msg("-- Starting transaction...\n");
/*
We use BEGIN for old servers. --single-transaction --master-data will fail
on old servers, but that's ok as it was already silently broken (it didn't
Expand Down Expand Up @@ -5199,24 +5208,39 @@ int main(int argc, char **argv)
if (opt_slave_data && do_stop_slave_sql(mysql))
goto err;

if ((opt_lock_all_tables || opt_master_data) &&
if ((opt_lock_all_tables || opt_master_data ||
(opt_single_transaction && flush_logs)) &&
do_flush_tables_read_lock(mysql))
goto err;
if (opt_single_transaction && start_transaction(mysql))
goto err;
if (opt_delete_master_logs)

/*
Flush logs before starting transaction since
this causes implicit commit starting mysql-5.5.
*/
if (opt_lock_all_tables || opt_master_data ||
(opt_single_transaction && flush_logs) ||
opt_delete_master_logs)
{
if (mysql_refresh(mysql, REFRESH_LOG) ||
get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
goto err;
if (flush_logs || opt_delete_master_logs)
{
if (mysql_refresh(mysql, REFRESH_LOG))
goto err;
verbose_msg("-- main : logs flushed successfully!\n");
}

/* Not anymore! That would not be sensible. */
flush_logs= 0;
}
if (opt_lock_all_tables || opt_master_data)

if (opt_delete_master_logs)
{
if (flush_logs && mysql_refresh(mysql, REFRESH_LOG))
if (get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
goto err;
flush_logs= 0; /* not anymore; that would not be sensible */
}

if (opt_single_transaction && start_transaction(mysql))
goto err;

/* Add 'STOP SLAVE to beginning of dump */
if (opt_slave_apply && add_stop_slave())
goto err;
Expand Down
1 change: 0 additions & 1 deletion cmake/install_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ FUNCTION(INSTALL_MANPAGE file)
ELSE()
SET(SECTION man8)
ENDIF()
MESSAGE("huj!")
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}"
COMPONENT ManPages)
ENDIF()
Expand Down
5 changes: 5 additions & 0 deletions cmd-line-utils/libedit/histedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
#define LIBEDIT_MAJOR 2
#define LIBEDIT_MINOR 11

/* XXXMYSQL : stdint.h might not be available on older Solaris platforms. */
#if defined(__sun) || defined(__sun__)
#include <sys/inttypes.h>
#else
#include <stdint.h>
#endif

#include <sys/types.h>
#include <stdio.h>
Expand Down
15 changes: 11 additions & 4 deletions cmd-line-utils/libedit/np/unvis.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,21 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";

#include <assert.h>
#include <ctype.h>

/* XXXMYSQL : stdint.h might not be available on older Solaris platforms. */
#if defined(__sun) || defined(__sun__)
#include <sys/inttypes.h>
#else
#include <stdint.h>
#endif

#include <stdio.h>
#include <errno.h>
#ifdef HAVE_VIS_H
#include <vis.h>
#else
/*
XXXMYSQL : Due to different versions of vis.h available,
use the one bundled with libedit.
*/
#include "np/vis.h"
#endif

#ifdef __weak_alias
__weak_alias(strnunvisx,_strnunvisx)
Expand Down
8 changes: 4 additions & 4 deletions cmd-line-utils/libedit/np/vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
#include <sys/types.h>

#include <assert.h>
#ifdef HAVE_VIS_H
#include <vis.h>
#else
/*
XXXMYSQL : Due to different versions of vis.h available,
use the one bundled with libedit.
*/
#include "np/vis.h"
#endif
#include <errno.h>
#include <stdlib.h>

Expand Down
2 changes: 1 addition & 1 deletion cmd-line-utils/libedit/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ memset(&state, 0, sizeof(mbstate_t));

#ifdef WIDECHAR
++cbp;
if (cbp > MB_CUR_MAX) { /* "shouldn't happen" */
if (cbp > (size_t) MB_CUR_MAX) { /* "shouldn't happen" */
*cp = '\0';
return (-1);
}
Expand Down
65 changes: 64 additions & 1 deletion include/my_stacktrace.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
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
Expand Down Expand Up @@ -59,6 +59,69 @@ void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
void my_write_core(int sig);
#endif



/**
Async-signal-safe utility functions used by signal handler routines.
Declared here in order to unit-test them.
These are not general-purpose, but tailored to the signal handling routines.
*/
/**
Converts a longlong value to string.
@param base 10 for decimal, 16 for hex values (0..9a..f)
@param val The value to convert
@param buf Assumed to point to the *end* of the buffer.
@returns Pointer to the first character of the converted string.
Negative values:
for base-10 the return string will be prepended with '-'
for base-16 the return string will contain 16 characters
Implemented with simplicity, and async-signal-safety in mind.
*/
char *my_safe_itoa(int base, longlong val, char *buf);

/**
Converts a ulonglong value to string.
@param base 10 for decimal, 16 for hex values (0..9a..f)
@param val The value to convert
@param buf Assumed to point to the *end* of the buffer.
@returns Pointer to the first character of the converted string.
Implemented with simplicity, and async-signal-safety in mind.
*/
char *my_safe_utoa(int base, ulonglong val, char *buf);

/**
A (very) limited version of snprintf.
@param to Destination buffer.
@param n Size of destination buffer.
@param fmt printf() style format string.
@returns Number of bytes written, including terminating '\0'
Supports 'd' 'i' 'u' 'x' 'p' 's' conversion.
Supports 'l' and 'll' modifiers for integral types.
Does not support any width/precision.
Implemented with simplicity, and async-signal-safety in mind.
*/
size_t my_safe_snprintf(char* to, size_t n, const char* fmt, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);

/**
A (very) limited version of snprintf, which writes the result to STDERR.
@sa my_safe_snprintf
Implemented with simplicity, and async-signal-safety in mind.
@note Has an internal buffer capacity of 512 bytes,
which should suffice for our signal handling routines.
*/
size_t my_safe_printf_stderr(const char* fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);

/**
Writes up to count bytes from buffer to STDERR.
Implemented with simplicity, and async-signal-safety in mind.
@param buf Buffer containing data to be written.
@param count Number of bytes to write.
@returns Number of bytes written.
*/
size_t my_write_stderr(const void *buf, size_t count);

C_MODE_END

#endif /* _my_stacktrace_h_ */
16 changes: 8 additions & 8 deletions libmysql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ CACHE INTERNAL "Functions exported by client API"

)

IF(WIN32)
ADD_SUBDIRECTORY(authentication_win)
SET(WITH_AUTHENTICATION_WIN 1)
ADD_DEFINITIONS(-DAUTHENTICATION_WIN)
ENDIF(WIN32)

SET(CLIENT_SOURCES
get_password.c
libmysql.c
Expand All @@ -157,9 +151,15 @@ ADD_DEPENDENCIES(clientlib GenError)

SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})

IF(WITH_AUTHENTICATION_WIN)
#
# On Windows platform client library includes the client-side
# Windows Native Authentication plugin.
#
IF(WIN32)
ADD_DEFINITIONS(-DAUTHENTICATION_WIN)
ADD_SUBDIRECTORY(authentication_win)
LIST(APPEND LIBS auth_win_client)
ENDIF(WITH_AUTHENTICATION_WIN)
ENDIF()

# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
Expand Down
1 change: 1 addition & 0 deletions libmysqld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/field.cc ../sql/field_conv.cc
../sql/filesort.cc ../sql/gstream.cc
../sql/signal_handler.cc
../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/collections/default.experimental
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wai
sys_vars.ndb_log_update_as_write_basic
sys_vars.have_ndbcluster_basic
sys_vars.ndb_log_updated_only_basic
sys_vars.query_cache_size_basic_64 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC
sys_vars.query_cache_size_basic_32 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC
sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5
10 changes: 9 additions & 1 deletion mysql-test/include/begin_include_file.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
# must be provided both for begin_include_file.inc and
# end_include_file.inc.
#
# $keep_include_silent
# This specifies whether it should be echoed to the result file
# the following string: include/$include_filename
# If not set, the string will be echoed.
#
# $rpl_debug
# If set, this script will print the following text:
# ==== BEGIN include/$include_filename.inc ====
Expand All @@ -59,7 +64,10 @@
# recursively.
if (!$_include_file_depth)
{
--echo include/$include_filename
if (!$keep_include_silent)
{
--echo include/$include_filename
}
--let $_include_file_depth= 0
}
--inc $_include_file_depth
Expand Down
Loading

0 comments on commit d55ebbb

Please sign in to comment.