Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Barkov committed Mar 31, 2017
2 parents e191833 + 2f3d4bd commit f00a314
Show file tree
Hide file tree
Showing 1,719 changed files with 29,610 additions and 15,646 deletions.
2 changes: 1 addition & 1 deletion BUILD/compile-bintar
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.


# This script's purpose is to build the binary tarball packages for MariaDB
Expand Down
4 changes: 2 additions & 2 deletions BUILD/compile-pentium64-wsrep
Expand Up @@ -14,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02111-1301, USA

path=`dirname $0`
. "$path/SETUP.sh"
Expand Down
2 changes: 1 addition & 1 deletion BUILD/util.sh
Expand Up @@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.

# Setting cpu options.
get_cpuopt () {
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -318,6 +318,9 @@ SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

# Common defines and includes
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
IF(_FILE_OFFSET_BITS)
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)

# Add bundled or system zlib.
Expand Down Expand Up @@ -448,8 +451,9 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

INSTALL_DOCUMENTATION(README.md CREDITS COPYING COPYING.LESSER COPYING.thirdparty
INSTALL_DOCUMENTATION(README.md CREDITS COPYING COPYING.thirdparty
EXCEPTIONS-CLIENT COMPONENT Readme)

# MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
Expand Down
516 changes: 0 additions & 516 deletions COPYING.LESSER

This file was deleted.

2 changes: 1 addition & 1 deletion COPYING.thirdparty
Expand Up @@ -1187,7 +1187,7 @@ Use of any of this software is governed by the terms of the license below:

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */

/*
* Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan
Expand Down
22 changes: 12 additions & 10 deletions CREDITS
Expand Up @@ -3,16 +3,18 @@ organization registered in the USA.

The current main sponsors of the MariaDB Foundation are:

Booking.com http://www.booking.com (2013 - 2016)
Development Bank of Singapore http://dbs.com (2016)
MariaDB Corporation https://www.mariadb.com (2013 - 2016)
Visma http://visma.com (2015 - 2016)
Acronis http://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2014 - 2016)
Tencent Game DBA http://tencentdba.com/about (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2016)
Virtuozzo https://virtuozzo.com (2016)
Alibaba Cloud https://intl.aliyun.com (2017)
Booking.com https://www.booking.com (2013 - 2017)
Development Bank of Singapore https://dbs.com (2016 - 2017)
MariaDB Corporation https://www.mariadb.com (2013 - 2017)
Visma https://visma.com (2015 - 2017)
Acronis http://acronis.com (2016 - 2017)
Nexedi https://www.nexedi.com (2016 - 2017)
Automattic https://automattic.com (2014 - 2017)
Tencent Game DBA http://tencentdba.com/about (2016 - 2017)
Tencent TDSQL http://tdsql.org/ (2016 - 2017)
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2017)
Virtuozzo https://virtuozzo.com (2016 - 2017)

For a full list of sponsors, see
https://mariadb.org/about/supporters/
Expand Down
2 changes: 1 addition & 1 deletion client/mysql.cc
Expand Up @@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */

/* mysql command tool
* Commands compatible with mSQL by David J. Hughes
Expand Down
2 changes: 1 addition & 1 deletion client/mysql_plugin.c
Expand Up @@ -1003,7 +1003,7 @@ static int find_tool(const char *tool_name, char *tool_path)

static int find_plugin(char *tp_path)
{
/* Check for existance of plugin */
/* Check for existence of plugin */
fn_format(tp_path, plugin_data.so_name, opt_plugin_dir, "", MYF(0));
if (!file_exists(tp_path))
{
Expand Down
92 changes: 83 additions & 9 deletions client/mysql_upgrade.c
Expand Up @@ -37,7 +37,7 @@
#endif

static int phase = 0;
static int phases_total = 6;
static const int phases_total = 7;
static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN];

Expand Down Expand Up @@ -69,6 +69,8 @@ static char **defaults_argv;

static my_bool not_used; /* Can't use GET_BOOL without a value pointer */

char upgrade_from_version[sizeof("10.20.456-MariaDB")+1];

static my_bool opt_write_binlog;

#define OPT_SILENT OPT_MAX_CLIENT_OPTION
Expand Down Expand Up @@ -545,7 +547,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
But mysql_upgrade is tightly bound to a specific server version
anyway - it was mysql_fix_privilege_tables_sql script embedded
into its binary - so even if it won't assume anything about server
wsrep-ness, it won't be any less server-dependend.
wsrep-ness, it won't be any less server-dependent.
*/
const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0, WSREP_ON=OFF;";
#else
Expand Down Expand Up @@ -675,23 +677,22 @@ static int upgrade_already_done(void)
{
FILE *in;
char upgrade_info_file[FN_REFLEN]= {0};
char buf[sizeof(MYSQL_SERVER_VERSION)+1];

if (get_upgrade_info_file_name(upgrade_info_file))
return 0; /* Could not get filename => not sure */

if (!(in= my_fopen(upgrade_info_file, O_RDONLY, MYF(0))))
return 0; /* Could not open file => not sure */

bzero(buf, sizeof(buf));
if (!fgets(buf, sizeof(buf), in))
bzero(upgrade_from_version, sizeof(upgrade_from_version));
if (!fgets(upgrade_from_version, sizeof(upgrade_from_version), in))
{
/* Ignore, will be detected by strncmp() below */
}

my_fclose(in, MYF(0));

return (strncmp(buf, MYSQL_SERVER_VERSION,
return (strncmp(upgrade_from_version, MYSQL_SERVER_VERSION,
sizeof(MYSQL_SERVER_VERSION)-1)==0);
}

Expand Down Expand Up @@ -756,9 +757,8 @@ static void print_conn_args(const char *tool_name)
verbose("Running '%s with default connection arguments", tool_name);
}


/*
Check and upgrade(if neccessary) all tables
Check and upgrade(if necessary) all tables
in the server using "mysqlcheck --check-upgrade .."
*/

Expand Down Expand Up @@ -925,6 +925,80 @@ static void print_line(char* line)
fputc('\n', stderr);
}

static my_bool from_before_10_1()
{
my_bool ret= TRUE;
DYNAMIC_STRING ds_events_struct;

if (upgrade_from_version[0])
{
return upgrade_from_version[1] == '.' ||
strncmp(upgrade_from_version, "10.1.", 5) < 0;
}

if (init_dynamic_string(&ds_events_struct, NULL, 2048, 2048))
die("Out of memory");

if (run_query("show create table mysql.user", &ds_events_struct, FALSE) ||
strstr(ds_events_struct.str, "default_role") != NULL)
ret= FALSE;
else
verbose("Upgrading from a version before MariaDB-10.1");

dynstr_free(&ds_events_struct);
return ret;
}


/*
Check for entries with "Unknown storage engine" in I_S.TABLES,
try to load plugins for these tables if available (MDEV-11942)
*/
static int install_used_engines(void)
{
char buf[512];
DYNAMIC_STRING ds_result;
const char *query = "SELECT DISTINCT LOWER(engine) FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown storage engine%'";

if (opt_systables_only || !from_before_10_1())
{
verbose("Phase %d/%d: Installing used storage engines... Skipped", ++phase, phases_total);
return 0;
}
verbose("Phase %d/%d: Installing used storage engines", ++phase, phases_total);

if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory");

verbose("Checking for tables with unknown storage engine");

run_query(query, &ds_result, TRUE);

if (ds_result.length)
{
char *line= ds_result.str, *next=get_line(line);
do
{
if (next[-1] == '\n')
next[-1]=0;

verbose("installing plugin for '%s' storage engine", line);

// we simply assume soname=ha_enginename
strxnmov(buf, sizeof(buf)-1, "install soname 'ha_", line, "'", NULL);


if (run_query(buf, NULL, TRUE))
fprintf(stderr, "... can't %s\n", buf);
line=next;
next=get_line(line);
} while (*line);
}
dynstr_free(&ds_result);
return 0;
}


/*
Update all system tables in MySQL Server to current
Expand Down Expand Up @@ -1132,6 +1206,7 @@ int main(int argc, char **argv)
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
if (run_mysqlcheck_upgrade(TRUE) ||
install_used_engines() ||
run_mysqlcheck_views() ||
run_sql_fix_privilege_tables() ||
run_mysqlcheck_fixnames() ||
Expand All @@ -1154,4 +1229,3 @@ int main(int argc, char **argv)
my_end(my_end_arg);
exit(0);
}

0 comments on commit f00a314

Please sign in to comment.