Skip to content

Commit

Permalink
Merge 10.1 into 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 29, 2017
2 parents 71931fd + 11352d5 commit f192b48
Show file tree
Hide file tree
Showing 33 changed files with 426 additions and 213 deletions.
4 changes: 2 additions & 2 deletions cmake/os/Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ IF(MSVC)
ENDIF()

#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700")

ENDIF()

Expand Down
5 changes: 5 additions & 0 deletions extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ xb_mysql_connect()
(char *) &opt_secure_auth);
}

if (xb_plugin_dir && *xb_plugin_dir){
mysql_options(connection, MYSQL_PLUGIN_DIR, xb_plugin_dir);
}
mysql_options(connection, MYSQL_OPT_PROTOCOL, &opt_protocol);

msg_ts("Connecting to MySQL server host: %s, user: %s, password: %s, "
"port: %s, socket: %s\n", opt_host ? opt_host : "localhost",
opt_user ? opt_user : "not set",
Expand Down
14 changes: 12 additions & 2 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ my_bool xtrabackup_export;

longlong xtrabackup_use_memory;

uint opt_protocol;
long xtrabackup_throttle; /* 0:unlimited */
static lint io_ticket;
static os_event_t wait_throttle;
Expand Down Expand Up @@ -527,6 +528,7 @@ enum options_xtrabackup

OPT_XTRA_TABLES_EXCLUDE,
OPT_XTRA_DATABASES_EXCLUDE,
OPT_PROTOCOL
};

struct my_option xb_client_options[] =
Expand Down Expand Up @@ -759,6 +761,9 @@ struct my_option xb_client_options[] =
0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

{"protocol", OPT_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

{"socket", 'S', "This option specifies the socket to use when "
"connecting to the local database server with a UNIX domain socket. "
"The option accepts a string argument. See mysql --help for details.",
Expand Down Expand Up @@ -1290,8 +1295,13 @@ xb_get_one_option(int optid,
start[1]=0 ;
}
break;


case OPT_PROTOCOL:
if (argument)
{
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
}
break;
#include "sslopt-case.h"

case '?':
Expand Down
2 changes: 2 additions & 0 deletions extra/mariabackup/xtrabackup.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ extern char *xtrabackup_incremental_dir;
extern char *xtrabackup_incremental_basedir;
extern char *innobase_data_home_dir;
extern char *innobase_buffer_pool_filename;
extern char *xb_plugin_dir;
extern uint opt_protocol;
extern ds_ctxt_t *ds_meta;
extern ds_ctxt_t *ds_data;

Expand Down
5 changes: 5 additions & 0 deletions mysql-test/include/innodb_undo_tablespaces.combinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[undo0]
innodb-undo-tablespaces=0

[undo3]
innodb-undo-tablespaces=3
3 changes: 3 additions & 0 deletions mysql-test/include/innodb_undo_tablespaces.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The goal of including this file is to enable innodb_undo_tablespaces combinations
# (see include/innodb_undo_tablespaces.combinations)

52 changes: 52 additions & 0 deletions mysql-test/r/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,58 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE t1;
#
# MDEV-8960 Can't refer the same column twice in one ALTER TABLE
#
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` DROP DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` SET DEFAULT 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL DEFAULT 2
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT,
MODIFY COLUMN `consultant_id` BIGINT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
#
# Start of 10.1 tests
#
#
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/encryption/r/innodb_encryption.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
call mtr.add_suppression("InnoDB: New log files created");
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
SET @start_global_value = @@global.innodb_encryption_threads;
SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/suite/encryption/t/innodb_encryption.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
#
-- source include/have_innodb.inc
-- source include/have_example_key_management_plugin.inc
-- source include/innodb_undo_tablespaces.inc

# embedded does not support restart
-- source include/not_embedded.inc

call mtr.add_suppression("InnoDB: New log files created");
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");

SET @start_global_value = @@global.innodb_encryption_threads;

SHOW VARIABLES LIKE 'innodb_encrypt%';
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/innodb/t/xa_recovery.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ connect (con1,localhost,root);
XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
connection default;

# innodb_force_recovery=2 prevents the purge and tests that the fix of
# MDEV-13606 XA PREPARE transactions should survive innodb_force_recovery=1 or 2
# is present.
--let $restart_parameters= --innodb-force-recovery=2
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
--let $restart_parameters=
--let $shutdown_timeout=

disconnect con1;
connect (con1,localhost,root);
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/mariabackup/auth_plugin_win.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--loose-enable-named-pipe
5 changes: 5 additions & 0 deletions mysql-test/suite/mariabackup/auth_plugin_win.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INSTALL SONAME 'auth_named_pipe';
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
GRANT ALL PRIVILEGES ON *.* to USERNAME;
DROP USER 'USERNAME';
UNINSTALL SONAME 'auth_named_pipe';
31 changes: 31 additions & 0 deletions mysql-test/suite/mariabackup/auth_plugin_win.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--source include/windows.inc
--source include/not_embedded.inc

if (!$AUTH_NAMED_PIPE_SO) {
skip No named pipe plugin;
}

if (!$USERNAME) {
skip USERNAME variable is undefined;
}

if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USERNAME'`) {
skip \$USER=$USER which exists in mysql.user;
}

INSTALL SONAME 'auth_named_pipe';

--replace_result $USERNAME USERNAME
eval CREATE USER '$USERNAME' IDENTIFIED WITH named_pipe;
--replace_result $USERNAME USERNAME
eval GRANT ALL PRIVILEGES ON *.* to $USERNAME;

let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf -u $USERNAME --backup --protocol=pipe --target-dir=$targetdir;
--enable_result_log
--replace_result $USERNAME USERNAME
eval DROP USER '$USERNAME';
rmdir $targetdir;
UNINSTALL SONAME 'auth_named_pipe';

42 changes: 42 additions & 0 deletions mysql-test/t/alter_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,48 @@ ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # MDEV-8960 Can't refer the same column twice in one ALTER TABLE
--echo #

CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;

ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` DROP DEFAULT;

SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;

ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` SET DEFAULT 2;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;

ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;

ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT,
MODIFY COLUMN `consultant_id` BIGINT;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # Start of 10.1 tests
--echo #
Expand Down
1 change: 0 additions & 1 deletion mysys/my_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
_CrtCheckMemory();
_CrtDumpMemoryLeaks();
#endif
}

Expand Down
45 changes: 42 additions & 3 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7702,9 +7702,25 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
{
if (def->change && ! def->field)
{
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change,
table->s->table_name.str);
goto err;
/*
Check if there is modify for newly added field.
*/
Create_field *find;
find_it.rewind();
while((find=find_it++))
{
if (!my_strcasecmp(system_charset_info,find->field_name, def->field_name))
break;
}

if (find && !find->field)
find_it.remove();
else
{
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change,
table->s->table_name.str);
goto err;
}
}
/*
Check that the DATE/DATETIME not null field we are going to add is
Expand Down Expand Up @@ -7770,6 +7786,29 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
find_it.after(def); // Put column after this
}
}
/*
Check if there is alter for newly added field.
*/
alter_it.rewind();
Alter_column *alter;
while ((alter=alter_it++))
{
if (!my_strcasecmp(system_charset_info,def->field_name, alter->name))
break;
}
if (alter)
{
if (def->sql_type == MYSQL_TYPE_BLOB)
{
my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
goto err;
}
if ((def->default_value= alter->default_value)) // Use new default
def->flags&= ~NO_DEFAULT_VALUE_FLAG;
else
def->flags|= NO_DEFAULT_VALUE_FLAG;
alter_it.remove();
}
}
if (alter_info->alter_list.elements)
{
Expand Down
34 changes: 27 additions & 7 deletions storage/connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,6 @@ IF(CONNECT_WITH_JDBC)
JdbcInterface.java ApacheInterface.java MariadbInterface.java
MysqlInterface.java OracleInterface.java PostgresqlInterface.java
JavaWrappers.jar)
# TODO: Find how to compile and install the java wrapper classes
# Find required libraries and include directories
SET (JAVA_SOURCES JdbcInterface.java)
add_jar(JdbcInterface ${JAVA_SOURCES})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/JavaWrappers.jar
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
add_definitions(-DJDBC_SUPPORT)
IF(CONNECT_WITH_MONGO)
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
Expand Down Expand Up @@ -348,4 +341,31 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY})

IF(NOT TARGET connect)
RETURN()
ENDIF()

# Install some extra files that belong to connect engine
IF(WIN32)
# install ha_connect.lib
GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION)
STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION})
IF(CMAKE_CONFIGURATION_TYPES)
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
CONNECT_LIB ${CONNECT_LIB})
ENDIF()
INSTALL(FILES ${CONNECT_LIB}
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
ENDIF(WIN32)

IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
# TODO: Find how to compile and install the java wrapper classes
# Find required libraries and include directories
SET (JAVA_SOURCES JdbcInterface.java)
add_jar(JdbcInterface ${JAVA_SOURCES})
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/JavaWrappers.jar
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
ENDIF()

Loading

0 comments on commit f192b48

Please sign in to comment.