summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/mariabackup/xtrabackup.cc2
-rw-r--r--mysql-test/r/type_bit.result24
-rw-r--r--mysql-test/suite/mariabackup/data_directory.result13
-rw-r--r--mysql-test/suite/mariabackup/data_directory.test23
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.opt1
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.result22
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.test24
-rw-r--r--mysql-test/t/delimiter_command_case_sensitivity.test2
-rw-r--r--mysql-test/t/type_bit.test19
-rw-r--r--storage/innobase/fil/fil0fil.cc27
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
-rw-r--r--storage/xtradb/fil/fil0fil.cc2
-rw-r--r--storage/xtradb/handler/ha_innodb.cc7
-rw-r--r--storage/xtradb/lock/lock0lock.cc2
14 files changed, 164 insertions, 9 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index a6bc4dab552..de32b5b864f 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -2838,7 +2838,7 @@ static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback)
/* We found a symlink or a file */
if (strlen(fileinfo.name) > 4) {
bool is_isl= false;
- if (ends_with(fileinfo.name, ".ibd") || ((is_isl = ends_with(fileinfo.name, ".ibd"))))
+ if (ends_with(fileinfo.name, ".ibd") || ((is_isl = ends_with(fileinfo.name, ".isl"))))
(*callback)(dbinfo.name, fileinfo.name, is_isl);
}
}
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index b2067907391..30cd94c9277 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -806,3 +806,27 @@ SUM(a)
NULL
DROP TABLE t1;
End of 5.1 tests
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8867 Wrong field type or metadata for COALESCE(bit_column, 1)
+#
+CREATE TABLE t1 (val bit(1));
+INSERT INTO t1 VALUES (0);
+CREATE TABLE t2 AS SELECT COALESCE(val, 1) AS c FROM t1;
+SELECT * FROM t2;
+c
+0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c` decimal(1,0) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SELECT COALESCE(val, 1) FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def COALESCE(val, 1) 246 2 1 Y 32896 0 63
+COALESCE(val, 1)
+0
+DROP TABLE t1;
diff --git a/mysql-test/suite/mariabackup/data_directory.result b/mysql-test/suite/mariabackup/data_directory.result
new file mode 100644
index 00000000000..e7201918cbd
--- /dev/null
+++ b/mysql-test/suite/mariabackup/data_directory.result
@@ -0,0 +1,13 @@
+CREATE TABLE t(a INT) ENGINE=InnoDB DATA DIRECTORY='table_data_dir';
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+# xtrabackup prepare
+DROP TABLE t;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+a
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/data_directory.test b/mysql-test/suite/mariabackup/data_directory.test
new file mode 100644
index 00000000000..50789a34c78
--- /dev/null
+++ b/mysql-test/suite/mariabackup/data_directory.test
@@ -0,0 +1,23 @@
+let $table_data_dir=$MYSQLTEST_VARDIR/ddir;
+mkdir $table_data_dir;
+--replace_result $table_data_dir table_data_dir
+EVAL CREATE TABLE t(a INT) ENGINE=InnoDB DATA DIRECTORY='$table_data_dir';
+INSERT INTO t VALUES(1);
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+--enable_result_log
+--source include/shutdown_mysqld.inc
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+--source include/start_mysqld.inc
+DROP TABLE t;
+rmdir $table_data_dir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+rmdir $table_data_dir;
diff --git a/mysql-test/suite/mariabackup/partition_datadir.opt b/mysql-test/suite/mariabackup/partition_datadir.opt
new file mode 100644
index 00000000000..8a3240370eb
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.opt
@@ -0,0 +1 @@
+--partition \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/partition_datadir.result b/mysql-test/suite/mariabackup/partition_datadir.result
new file mode 100644
index 00000000000..3fc5fe30907
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.result
@@ -0,0 +1,22 @@
+CREATE TABLE t(i int)
+ENGINE=InnoDB
+PARTITION BY RANGE (i)
+(PARTITION p0 VALUES LESS THAN (100),
+PARTITION P1 VALUES LESS THAN (200),
+PARTITION p2 VALUES LESS THAN (300) DATA DIRECTORY = 'MYSQLTEST_VARDIR/partitdata',
+PARTITION p3 VALUES LESS THAN (400) DATA DIRECTORY = 'MYSQLTEST_VARDIR/partitdata',
+PARTITION p4 VALUES LESS THAN MAXVALUE);
+INSERT INTO t VALUES (1), (101), (201), (301), (401);
+DROP TABLE t;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+SELECT * FROM t;
+i
+1
+101
+201
+301
+401
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/partition_datadir.test b/mysql-test/suite/mariabackup/partition_datadir.test
new file mode 100644
index 00000000000..882b0111267
--- /dev/null
+++ b/mysql-test/suite/mariabackup/partition_datadir.test
@@ -0,0 +1,24 @@
+let $targetdir=$MYSQLTEST_VARDIR/backup;
+mkdir $targetdir;
+mkdir $MYSQLTEST_VARDIR/partitdata;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t(i int)
+ENGINE=InnoDB
+PARTITION BY RANGE (i)
+(PARTITION p0 VALUES LESS THAN (100),
+ PARTITION P1 VALUES LESS THAN (200),
+ PARTITION p2 VALUES LESS THAN (300) DATA DIRECTORY = '$MYSQLTEST_VARDIR/partitdata',
+ PARTITION p3 VALUES LESS THAN (400) DATA DIRECTORY = '$MYSQLTEST_VARDIR/partitdata',
+ PARTITION p4 VALUES LESS THAN MAXVALUE);
+INSERT INTO t VALUES (1), (101), (201), (301), (401);
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+DROP TABLE t;
+rmdir $MYSQLTEST_VARDIR/partitdata;
+--source include/restart_and_restore.inc
+--enable_result_log
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
+rmdir $MYSQLTEST_VARDIR/partitdata;
diff --git a/mysql-test/t/delimiter_command_case_sensitivity.test b/mysql-test/t/delimiter_command_case_sensitivity.test
index 2b06a35c723..11d1cf75aa0 100644
--- a/mysql-test/t/delimiter_command_case_sensitivity.test
+++ b/mysql-test/t/delimiter_command_case_sensitivity.test
@@ -1,2 +1,4 @@
+source include/not_embedded.inc;
+
# MDEV-10728
--exec $MYSQL --default-character-set=binary < "t/delimiter_case_mdev_10728.sql"
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 761f200fe0c..bb282fc15e5 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -439,3 +439,22 @@ SELECT SUM(a) FROM t1 GROUP BY c, b, a;
DROP TABLE t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8867 Wrong field type or metadata for COALESCE(bit_column, 1)
+--echo #
+
+CREATE TABLE t1 (val bit(1));
+INSERT INTO t1 VALUES (0);
+CREATE TABLE t2 AS SELECT COALESCE(val, 1) AS c FROM t1;
+SELECT * FROM t2;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+--enable_metadata
+SELECT COALESCE(val, 1) FROM t1;
+--disable_metadata
+DROP TABLE t1;
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index d836e872265..90a3baa6f83 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -4343,8 +4343,19 @@ fil_ibd_discover(
/* Look for a remote file-per-table tablespace. */
- df_rem_per.set_name(db);
- if (df_rem_per.open_link_file() == DB_SUCCESS) {
+ switch (srv_operation) {
+ case SRV_OPERATION_BACKUP:
+ case SRV_OPERATION_RESTORE_DELTA:
+ ut_ad(0);
+ break;
+ case SRV_OPERATION_RESTORE_EXPORT:
+ case SRV_OPERATION_RESTORE:
+ break;
+ case SRV_OPERATION_NORMAL:
+ df_rem_per.set_name(db);
+ if (df_rem_per.open_link_file() != DB_SUCCESS) {
+ break;
+ }
/* An ISL file was found with contents. */
if (df_rem_per.open_read_only(false) != DB_SUCCESS
@@ -4434,6 +4445,18 @@ fil_ibd_load(
return(FIL_LOAD_OK);
}
+ if (srv_operation == SRV_OPERATION_RESTORE) {
+ /* Replace absolute DATA DIRECTORY file paths with
+ short names relative to the backup directory. */
+ if (const char* name = strrchr(filename, OS_PATH_SEPARATOR)) {
+ while (--name > filename
+ && *name != OS_PATH_SEPARATOR);
+ if (name > filename) {
+ filename = name + 1;
+ }
+ }
+ }
+
Datafile file;
file.set_filepath(filename);
file.open_read_only(false);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 87360c8589c..0698bbc0576 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -20201,7 +20201,7 @@ wsrep_innobase_kill_one_trx(
wsrep_thd_awake(thd, signal);
} else {
/* abort currently executing query */
- DBUG_PRINT("wsrep",("sending KILL_QUERY to: %ld",
+ DBUG_PRINT("wsrep",("sending KILL_QUERY to: %lu",
thd_get_thread_id(thd)));
WSREP_DEBUG("kill query for: %ld",
thd_get_thread_id(thd));
@@ -20345,7 +20345,8 @@ wsrep_fake_trx_id(
mutex_enter(&trx_sys->mutex);
trx_id_t trx_id = trx_sys_get_new_trx_id();
mutex_exit(&trx_sys->mutex);
- WSREP_DEBUG("innodb fake trx id: %lu thd: %s", trx_id, wsrep_thd_query(thd));
+ WSREP_DEBUG("innodb fake trx id: " TRX_ID_FMT " thd: %s",
+ trx_id, wsrep_thd_query(thd));
wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
}
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 2210505a2bd..445c564e9cf 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -4857,7 +4857,7 @@ fil_load_single_table_tablespace(
/* Check for a link file which locates a remote tablespace. */
- remote.success = fil_open_linked_file(
+ remote.success = (IS_XTRABACKUP() && !srv_backup_mode) ? 0 : fil_open_linked_file(
tablename, &remote.filepath, &remote.file, FALSE);
/* Read the first page of the remote tablespace */
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 8d4cfbb29ff..4c3d6a1c11c 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -10947,7 +10947,7 @@ wsrep_append_foreign_key(
shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE,
copy);
if (rcode) {
- DBUG_PRINT("wsrep", ("row key failed: %lu", rcode));
+ DBUG_PRINT("wsrep", ("row key failed: %zu", rcode));
WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu",
(wsrep_thd_query(thd)) ?
wsrep_thd_query(thd) : "void", rcode);
@@ -19714,7 +19714,7 @@ wsrep_innobase_kill_one_trx(
wsrep_thd_awake(thd, signal);
} else {
/* abort currently executing query */
- DBUG_PRINT("wsrep",("sending KILL_QUERY to: %ld",
+ DBUG_PRINT("wsrep",("sending KILL_QUERY to: %lu",
thd_get_thread_id(thd)));
WSREP_DEBUG("kill query for: %ld",
thd_get_thread_id(thd));
@@ -19841,7 +19841,8 @@ wsrep_fake_trx_id(
mutex_enter(&trx_sys->mutex);
trx_id_t trx_id = trx_sys_get_new_trx_id();
mutex_exit(&trx_sys->mutex);
- WSREP_DEBUG("innodb fake trx id: %lu thd: %s", trx_id, wsrep_thd_query(thd));
+ WSREP_DEBUG("innodb fake trx id: " TRX_ID_FMT " thd: %s",
+ trx_id, wsrep_thd_query(thd));
wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
}
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index 8759cea9e6d..ddaeff69f10 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -2141,6 +2141,7 @@ lock_rec_insert_by_trx_age(
return DB_SUCCESS;
}
+#ifdef UNIV_DEBUG
static
bool
lock_queue_validate(
@@ -2174,6 +2175,7 @@ lock_queue_validate(
}
return true;
}
+#endif /* UNIV_DEBUG */
static
void