mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Merge 10.2 into 10.3
This commit is contained in:
commit
947b6b849d
53 changed files with 693 additions and 155 deletions
|
@ -46,7 +46,7 @@ ENDIF(UNIX)
|
|||
|
||||
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
|
||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||
TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcre pcreposix)
|
||||
TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcreposix pcre)
|
||||
SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
|
||||
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
|
|||
page_no first. */
|
||||
if (page_no
|
||||
&& mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION)
|
||||
&& (opt_backup_encrypted
|
||||
&& (opt_encrypted_backup
|
||||
|| (space->crypt_data
|
||||
&& space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED))) {
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ static char* log_ignored_opt;
|
|||
extern my_bool opt_use_ssl;
|
||||
my_bool opt_ssl_verify_server_cert;
|
||||
my_bool opt_extended_validation;
|
||||
my_bool opt_backup_encrypted;
|
||||
my_bool opt_encrypted_backup;
|
||||
|
||||
/* === metadata of backup === */
|
||||
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
|
||||
|
@ -761,7 +761,7 @@ enum options_xtrabackup
|
|||
OPT_XTRA_DATABASES_FILE,
|
||||
OPT_XTRA_PARALLEL,
|
||||
OPT_XTRA_EXTENDED_VALIDATION,
|
||||
OPT_XTRA_BACKUP_ENCRYPTED,
|
||||
OPT_XTRA_ENCRYPTED_BACKUP,
|
||||
OPT_XTRA_STREAM,
|
||||
OPT_XTRA_COMPRESS,
|
||||
OPT_XTRA_COMPRESS_THREADS,
|
||||
|
@ -1227,12 +1227,12 @@ struct my_option xb_server_options[] =
|
|||
(G_PTR*)&opt_extended_validation,
|
||||
0, GET_BOOL, NO_ARG, FALSE, 0, 0, 0, 0, 0},
|
||||
|
||||
{"backup_encrypted", OPT_XTRA_BACKUP_ENCRYPTED,
|
||||
{"encrypted_backup", OPT_XTRA_ENCRYPTED_BACKUP,
|
||||
"In --backup, assume that nonzero key_version implies that the page"
|
||||
" is encrypted. Use --backup --skip-backup-encrypted to allow"
|
||||
" is encrypted. Use --backup --skip-encrypted-backup to allow"
|
||||
" copying unencrypted that were originally created before MySQL 5.1.48.",
|
||||
(G_PTR*)&opt_backup_encrypted,
|
||||
(G_PTR*)&opt_backup_encrypted,
|
||||
(G_PTR*)&opt_encrypted_backup,
|
||||
(G_PTR*)&opt_encrypted_backup,
|
||||
0, GET_BOOL, NO_ARG, TRUE, 0, 0, 0, 0, 0},
|
||||
|
||||
{"log", OPT_LOG, "Ignored option for MySQL option compatibility",
|
||||
|
|
|
@ -108,7 +108,7 @@ extern my_bool opt_no_backup_locks;
|
|||
extern my_bool opt_decompress;
|
||||
extern my_bool opt_remove_original;
|
||||
extern my_bool opt_extended_validation;
|
||||
extern my_bool opt_backup_encrypted;
|
||||
extern my_bool opt_encrypted_backup;
|
||||
extern my_bool opt_lock_ddl_per_table;
|
||||
|
||||
extern char *opt_incremental_history_name;
|
||||
|
|
|
@ -34,7 +34,7 @@ ENDIF(UNIX)
|
|||
|
||||
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
|
||||
COMPONENT Test)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre pcreposix)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcreposix pcre)
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
# It does not seem possible to tell Xcode the resulting target might need
|
||||
|
|
|
@ -100,8 +100,20 @@ ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
|
|||
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
|
||||
connect fail_con,localhost,test,zorro,;
|
||||
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
|
||||
select user,host,password,plugin,authentication_string from mysql.user where user='test';
|
||||
user host password plugin authentication_string
|
||||
test localhost *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59
|
||||
test 127.0.0.1 *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59
|
||||
update mysql.user set password=old_password("gambling2") where user=_binary"test";
|
||||
flush privileges;
|
||||
show grants for test@localhost;
|
||||
Grants for test@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
|
||||
update mysql.user set plugin='mysql_old_password' where user='test';
|
||||
flush privileges;
|
||||
show grants for test@localhost;
|
||||
Grants for test@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
|
||||
connect con10,localhost,test,gambling2,;
|
||||
connect con5,localhost,test,gambling2,mysql;
|
||||
connection con5;
|
||||
|
|
|
@ -66,8 +66,13 @@ connect (fail_con,localhost,test,zorro,test2);
|
|||
connect (fail_con,localhost,test,zorro,);
|
||||
|
||||
# check if old password version also works
|
||||
select user,host,password,plugin,authentication_string from mysql.user where user='test';
|
||||
update mysql.user set password=old_password("gambling2") where user=_binary"test";
|
||||
flush privileges;
|
||||
show grants for test@localhost;
|
||||
update mysql.user set plugin='mysql_old_password' where user='test';
|
||||
flush privileges;
|
||||
show grants for test@localhost;
|
||||
|
||||
connect (con10,localhost,test,gambling2,);
|
||||
connect (con5,localhost,test,gambling2,mysql);
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
set global max_allowed_packet=1024*1024*10;
|
||||
connect con1,localhost,root;
|
||||
ERROR HY000: The definition for table `t1` is too big
|
||||
connection default;
|
||||
disconnect con1;
|
||||
set global max_allowed_packet=default;
|
||||
|
|
|
@ -4,17 +4,24 @@
|
|||
# verify that huge frms are rejected during creation, not on opening
|
||||
#
|
||||
--source include/have_partition.inc
|
||||
set global max_allowed_packet=1024*1024*10;
|
||||
connect con1,localhost,root;
|
||||
|
||||
let $n=5646;
|
||||
let $n=8164;
|
||||
let $a=create table t1 (a int) engine=myisam partition by hash(a) partitions $n (;
|
||||
dec $n;
|
||||
while ($n)
|
||||
{
|
||||
let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n,;
|
||||
let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n COMMENT 'partition p01234567890123456789012345678901234567890123456789012345678$n',;
|
||||
dec $n;
|
||||
}
|
||||
|
||||
--disable_query_log
|
||||
--error ER_TABLE_DEFINITION_TOO_BIG
|
||||
eval $a partition foo);
|
||||
--enable_query_log
|
||||
|
||||
connection default;
|
||||
disconnect con1;
|
||||
set global max_allowed_packet=default;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "")
|
||||
#<date> server id 1 end_log_pos 899 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 899
|
||||
#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -90,7 +90,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL)
|
||||
#<date> server id 1 end_log_pos 1214 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1214
|
||||
#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -119,7 +119,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A")
|
||||
#<date> server id 1 end_log_pos 1530 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1530
|
||||
#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -148,7 +148,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A")
|
||||
#<date> server id 1 end_log_pos 1842 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1842
|
||||
#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -177,7 +177,7 @@ BEGIN
|
|||
#Q> INSERT INTO t2 SELECT * FROM t1
|
||||
#<date> server id 1 end_log_pos 2134 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 2134
|
||||
#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 33 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t2`
|
||||
### SET
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -239,7 +239,7 @@ BEGIN
|
|||
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
|
||||
#<date> server id 1 end_log_pos 2462 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 2462
|
||||
#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 33 flags: STMT_END_F
|
||||
### UPDATE `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -320,7 +320,7 @@ BEGIN
|
|||
#Q> DELETE FROM t1
|
||||
#<date> server id 1 end_log_pos 2769 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 2769
|
||||
#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t1`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -382,7 +382,7 @@ BEGIN
|
|||
#Q> DELETE FROM t2
|
||||
#<date> server id 1 end_log_pos 3069 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 3069
|
||||
#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 33 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
|
|
@ -59,7 +59,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "")
|
||||
#<date> server id 1 end_log_pos 946 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 946
|
||||
#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -88,7 +88,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL)
|
||||
#<date> server id 1 end_log_pos 1262 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1262
|
||||
#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -117,7 +117,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A")
|
||||
#<date> server id 1 end_log_pos 1579 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1579
|
||||
#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -146,7 +146,7 @@ BEGIN
|
|||
#Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A")
|
||||
#<date> server id 1 end_log_pos 1892 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 1892
|
||||
#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t1`
|
||||
### SET
|
||||
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -175,7 +175,7 @@ BEGIN
|
|||
#Q> INSERT INTO t2 SELECT * FROM t1
|
||||
#<date> server id 1 end_log_pos 2187 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 2187
|
||||
#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 33 flags: STMT_END_F
|
||||
### INSERT INTO `test`.`t2`
|
||||
### SET
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -237,7 +237,7 @@ BEGIN
|
|||
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
|
||||
#<date> server id 1 end_log_pos 2591 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 2591
|
||||
#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
|
||||
### UPDATE `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -273,7 +273,7 @@ BEGIN
|
|||
#Q> DELETE FROM t1
|
||||
#<date> server id 1 end_log_pos 2873 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 2873
|
||||
#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t1`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
@ -303,7 +303,7 @@ BEGIN
|
|||
#Q> DELETE FROM t2
|
||||
#<date> server id 1 end_log_pos 3135 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 3135
|
||||
#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
|
|
|
@ -56,4 +56,6 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
|
|||
--error 2
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
|
||||
|
||||
rmdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
|
||||
|
||||
--echo Done.
|
||||
|
|
|
@ -55,3 +55,27 @@ pk f1 f2 f3 pk f1 f2 f3 f4 f5
|
|||
2 6 v NULL 14 1 q NULL 4 q
|
||||
3 7 c NULL 14 1 q NULL 4 q
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
|
||||
# failed in handler::ha_rnd_end upon SELECT from partitioned table
|
||||
#
|
||||
set @optimizer_switch_save= @@optimizer_switch;
|
||||
set optimizer_switch='index_merge_sort_intersection=off';
|
||||
create table t0 (a int)engine=innodb;
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (
|
||||
a int, b int, c int,
|
||||
key(a),key(b),key(c)
|
||||
)engine=innodb;
|
||||
insert into t1
|
||||
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
|
||||
from t0 A, t0 B, t0 C, t0 D where D.a<5;
|
||||
set @@global.debug_dbug="+d,ha_index_init_fail";
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
|
||||
select * from t1 where a=10 and b=10;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
DROP TABLE t0,t1;
|
||||
set @@global.debug_dbug="-d";
|
||||
set @@optimizer_switch= @optimizer_switch_save;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
--echo #
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t0, t1, t2;
|
||||
|
@ -62,3 +63,27 @@ INSERT INTO t2 VALUES (4,'q'),(NULL,'j');
|
|||
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
|
||||
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
|
||||
--echo # failed in handler::ha_rnd_end upon SELECT from partitioned table
|
||||
--echo #
|
||||
|
||||
set @optimizer_switch_save= @@optimizer_switch;
|
||||
set optimizer_switch='index_merge_sort_intersection=off';
|
||||
create table t0 (a int)engine=innodb;
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (
|
||||
a int, b int, c int,
|
||||
key(a),key(b),key(c)
|
||||
)engine=innodb;
|
||||
insert into t1
|
||||
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
|
||||
from t0 A, t0 B, t0 C, t0 D where D.a<5;
|
||||
set @@global.debug_dbug="+d,ha_index_init_fail";
|
||||
explain select * from t1 where a=10 and b=10;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from t1 where a=10 and b=10;
|
||||
DROP TABLE t0,t1;
|
||||
set @@global.debug_dbug="-d";
|
||||
set @@optimizer_switch= @optimizer_switch_save;
|
||||
|
|
|
@ -5289,6 +5289,7 @@ sub server_need_restart {
|
|||
{
|
||||
delete $server->{'restart_opts'};
|
||||
my $use_dynamic_option_switch= 0;
|
||||
delete $server->{'restart_opts'};
|
||||
if (!$use_dynamic_option_switch)
|
||||
{
|
||||
mtr_verbose_restart($server, "running with different options '" .
|
||||
|
|
|
@ -26,7 +26,6 @@ MW-416 : MDEV-13549 Galera test failures
|
|||
MW-388 : MDEV-13549 Galera test failures
|
||||
MW-44 : MDEV-15809 Test failure on galera.MW-44
|
||||
galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
|
||||
galera_drop_database : MDEV-17421 mtr does not restart the server whose parameters were changed
|
||||
galera_kill_applier : race condition at the start of the test
|
||||
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
|
||||
pxc-421: Lock timeout exceeded
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
connection node_1;
|
||||
connection node_2;
|
||||
CREATE DATABASE fts;
|
||||
USE fts;
|
||||
CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
|
||||
|
@ -9,6 +11,10 @@ INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
|
|||
DROP TABLE ten;
|
||||
UPDATE fts_t1 SET f2 = 'abcd';
|
||||
UPDATE fts_t2 SET f2 = 'efjh';
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
USE fts;
|
||||
DROP TABLE fts_t1;
|
||||
DROP TABLE fts_t2;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
# Create test database with two sets of the FTS indexes:
|
||||
CREATE DATABASE fts;
|
||||
USE fts;
|
||||
CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
|
||||
|
@ -23,34 +24,19 @@ DROP TABLE ten;
|
|||
UPDATE fts_t1 SET f2 = 'abcd';
|
||||
UPDATE fts_t2 SET f2 = 'efjh';
|
||||
|
||||
# Restart the second node:
|
||||
--connection node_2
|
||||
let $wsrep_cluster_address = `SELECT @@global.wsrep_node_incoming_address`;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $galera_connection_name = node_2a
|
||||
--let $galera_server_number = 2
|
||||
--source include/galera_connect.inc
|
||||
--connection node_2a
|
||||
--connection node_2
|
||||
--source include/wait_until_ready.inc
|
||||
|
||||
# Drop the tables and database after nodes restarted:
|
||||
--connection node_1
|
||||
--let $restart_parameters = --wsrep-cluster-address=gcomm://$wsrep_cluster_address
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--connection node_2a
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $galera_connection_name = node_1a
|
||||
--let $galera_server_number = 1
|
||||
--source include/galera_connect.inc
|
||||
--connection node_1a
|
||||
--source include/wait_until_ready.inc
|
||||
|
||||
USE fts;
|
||||
DROP TABLE fts_t1;
|
||||
DROP TABLE fts_t2;
|
||||
|
@ -58,8 +44,4 @@ SHOW TABLES;
|
|||
DROP DATABASE fts;
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--let $node_1=node_1a
|
||||
--let $node_2=node_2a
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
|
|
@ -7,9 +7,18 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb;
|
|||
CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL,
|
||||
fld3 INT AS (fld2) VIRTUAL, KEY(fld1),
|
||||
FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb;
|
||||
CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB;
|
||||
CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb),
|
||||
FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB;
|
||||
INSERT INTO u1 SET a=1;
|
||||
INSERT INTO u2 SET b=1;
|
||||
INSERT INTO t1(fld1) VALUES(1);
|
||||
INSERT INTO t2(fld1, fld2) VALUES(1, 2);
|
||||
UPDATE t1 SET fld1= 2;
|
||||
DELETE FROM u1;
|
||||
SELECT * FROM u2;
|
||||
b vb
|
||||
DROP TABLE u2,u1;
|
||||
SELECT fld3, fld1 FROM t2;
|
||||
fld3 fld1
|
||||
2 2
|
||||
|
|
|
@ -239,3 +239,23 @@ KEY (a(1))
|
|||
INSERT INTO t1(b) VALUES(REPEAT('b',1000));
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #22990029 GCOLS: INCORRECT BEHAVIOR
|
||||
# AFTER DATA INSERTED WITH IGNORE KEYWORD
|
||||
#
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb))
|
||||
ENGINE=InnoDB;
|
||||
INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'vb' at row 1
|
||||
BEGIN;
|
||||
DELETE FROM t1;
|
||||
INSERT INTO t1 (a,b) VALUES(1,20190123);
|
||||
ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row 1
|
||||
SELECT * FROM t1;
|
||||
a b vb
|
||||
ROLLBACK;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -11,10 +11,19 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb;
|
|||
CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL,
|
||||
fld3 INT AS (fld2) VIRTUAL, KEY(fld1),
|
||||
FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb;
|
||||
CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB;
|
||||
CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb),
|
||||
FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO u1 SET a=1;
|
||||
INSERT INTO u2 SET b=1;
|
||||
INSERT INTO t1(fld1) VALUES(1);
|
||||
INSERT INTO t2(fld1, fld2) VALUES(1, 2);
|
||||
--source include/restart_mysqld.inc
|
||||
UPDATE t1 SET fld1= 2;
|
||||
DELETE FROM u1;
|
||||
SELECT * FROM u2;
|
||||
DROP TABLE u2,u1;
|
||||
SELECT fld3, fld1 FROM t2;
|
||||
alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE;
|
||||
UPDATE t1 SET fld1=3;
|
||||
|
|
|
@ -263,3 +263,22 @@ CREATE TABLE t1(
|
|||
INSERT INTO t1(b) VALUES(REPEAT('b',1000));
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #22990029 GCOLS: INCORRECT BEHAVIOR
|
||||
--echo # AFTER DATA INSERTED WITH IGNORE KEYWORD
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb))
|
||||
ENGINE=InnoDB;
|
||||
INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
|
||||
BEGIN;
|
||||
DELETE FROM t1;
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
INSERT INTO t1 (a,b) VALUES(1,20190123);
|
||||
SELECT * FROM t1;
|
||||
ROLLBACK;
|
||||
# MDEV-18366 FIXME: fix the crash and enable this
|
||||
# SELECT * FROM t1;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
|
114
mysql-test/suite/innodb/r/alter_candidate_key.result
Normal file
114
mysql-test/suite/innodb/r/alter_candidate_key.result
Normal file
|
@ -0,0 +1,114 @@
|
|||
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL,
|
||||
UNIQUE KEY uidx2(f1,f2),
|
||||
UNIQUE KEY uidx1(f2)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `uidx2` (`f1`,`f2`),
|
||||
UNIQUE KEY `uidx1` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
|
||||
SIGNAL conc_dml WAIT_FOR go_ahead';
|
||||
ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE;
|
||||
connect con1,localhost,root,,;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
|
||||
DELETE FROM t1;
|
||||
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
|
||||
connection default;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f11` int(11) DEFAULT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `uidx1` (`f2`),
|
||||
UNIQUE KEY `uidx2` (`f11`,`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(f1 INT, f2 INT,
|
||||
PRIMARY KEY(f1, f2),
|
||||
UNIQUE INDEX uidx2 (f1, f2),
|
||||
UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `uidx2` (`f1`,`f2`),
|
||||
UNIQUE KEY `uidx1` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
|
||||
SIGNAL conc_dml WAIT_FOR go_ahead';
|
||||
ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
|
||||
INSERT INTO t1 VALUES(1, 1), (1, 1);
|
||||
ERROR 23000: Duplicate entry '1-1' for key 'uidx2'
|
||||
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
|
||||
connection default;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f11` int(11) DEFAULT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `uidx1` (`f2`),
|
||||
UNIQUE KEY `uidx2` (`f11`,`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
SET SQL_MODE= strict_trans_tables;
|
||||
CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB;
|
||||
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
|
||||
ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR dml';
|
||||
BEGIN;
|
||||
INSERT INTO t1 SET a=NULL;
|
||||
ROLLBACK;
|
||||
set DEBUG_SYNC='now SIGNAL dml_done';
|
||||
connection default;
|
||||
ERROR 22004: Invalid use of NULL value
|
||||
DROP TABLE t1;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC="RESET";
|
||||
SET SQL_MODE=DEFAULT;
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2),
|
||||
UNIQUE KEY(f2))ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `f2` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
|
||||
UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB;
|
||||
Warnings:
|
||||
Note 1831 Duplicate index `f2_2`. This is deprecated and will be disallowed in a future release
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `f2` (`f2`),
|
||||
UNIQUE KEY `f2_2` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
UNIQUE KEY `f2_2` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
|
@ -1567,6 +1567,7 @@ create table t1(f1 int not null, f2 int not null,
|
|||
primary key (f1), unique key(f1, f2))engine=innodb;
|
||||
insert into t1 values(1,3), (2,2);
|
||||
alter table t1 drop primary key, lock=none;
|
||||
alter table t1 drop index f1, lock=none;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try LOCK=SHARED
|
||||
drop table t1;
|
||||
#
|
||||
|
|
|
@ -99,17 +99,6 @@ t1 CREATE TABLE `t1` (
|
|||
UNIQUE KEY `c2` (`c2`),
|
||||
UNIQUE KEY `c2_2` (`c2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
`c3` char(255) NOT NULL,
|
||||
UNIQUE KEY `c2` (`c2`),
|
||||
UNIQUE KEY `c2_2` (`c2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1);
|
||||
# session default
|
||||
connection default;
|
||||
|
|
9
mysql-test/suite/innodb/r/innodb_28867993.result
Normal file
9
mysql-test/suite/innodb/r/innodb_28867993.result
Normal file
|
@ -0,0 +1,9 @@
|
|||
create table t1 (a int) engine=innodb;
|
||||
insert t1 values (1),(2);
|
||||
create database ib_logfile2;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
drop database ib_logfile2;
|
72
mysql-test/suite/innodb/t/alter_candidate_key.test
Normal file
72
mysql-test/suite/innodb/t/alter_candidate_key.test
Normal file
|
@ -0,0 +1,72 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL,
|
||||
UNIQUE KEY uidx2(f1,f2),
|
||||
UNIQUE KEY uidx1(f2)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
SHOW CREATE TABLE t1;
|
||||
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
|
||||
SIGNAL conc_dml WAIT_FOR go_ahead';
|
||||
--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE
|
||||
connect (con1,localhost,root,,);
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
|
||||
DELETE FROM t1;
|
||||
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
|
||||
connection default;
|
||||
reap;
|
||||
SHOW CREATE TABLE t1;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(f1 INT, f2 INT,
|
||||
PRIMARY KEY(f1, f2),
|
||||
UNIQUE INDEX uidx2 (f1, f2),
|
||||
UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE t1;
|
||||
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
|
||||
SIGNAL conc_dml WAIT_FOR go_ahead';
|
||||
--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE
|
||||
connection con1;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t1 VALUES(1, 1), (1, 1);
|
||||
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
|
||||
connection default;
|
||||
reap;
|
||||
SHOW CREATE TABLE t1;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET SQL_MODE= strict_trans_tables;
|
||||
CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB;
|
||||
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
|
||||
--send ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL
|
||||
connection con1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR dml';
|
||||
BEGIN;
|
||||
INSERT INTO t1 SET a=NULL;
|
||||
ROLLBACK;
|
||||
set DEBUG_SYNC='now SIGNAL dml_done';
|
||||
connection default;
|
||||
--error ER_INVALID_USE_OF_NULL
|
||||
reap;
|
||||
DROP TABLE t1;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC="RESET";
|
||||
SET SQL_MODE=DEFAULT;
|
||||
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2),
|
||||
UNIQUE KEY(f2))ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
|
||||
UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB;
|
||||
SHOW CREATE TABLE t1;
|
||||
ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
|
@ -905,8 +905,9 @@ drop table t1;
|
|||
create table t1(f1 int not null, f2 int not null,
|
||||
primary key (f1), unique key(f1, f2))engine=innodb;
|
||||
insert into t1 values(1,3), (2,2);
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t1 drop primary key, lock=none;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t1 drop index f1, lock=none;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
|
|
|
@ -101,10 +101,6 @@ LOCK = SHARED, ALGORITHM = INPLACE;
|
|||
ALTER TABLE t1 ADD UNIQUE INDEX(c2),
|
||||
LOCK = EXCLUSIVE, ALGORITHM = INPLACE;
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
# We do not support plain DROP_PK_INDEX without ADD_PK_INDEX.
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE;
|
||||
SHOW CREATE TABLE t1;
|
||||
# Now the previous DEBUG_SYNC should kick in.
|
||||
--send
|
||||
|
|
12
mysql-test/suite/innodb/t/innodb_28867993.test
Normal file
12
mysql-test/suite/innodb/t/innodb_28867993.test
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART
|
||||
#
|
||||
|
||||
source include/have_innodb.inc;
|
||||
create table t1 (a int) engine=innodb;
|
||||
insert t1 values (1),(2);
|
||||
create database ib_logfile2;
|
||||
source include/restart_mysqld.inc;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
drop database ib_logfile2;
|
31
mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
Normal file
31
mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
Normal file
|
@ -0,0 +1,31 @@
|
|||
--- r/rpl_row_big_table_id.result 2019-01-23 19:58:07.204914873 +0200
|
||||
+++ r/rpl_row_big_table_id_32bit.result 2019-01-23 19:43:54.590640934 +0200
|
||||
@@ -22,22 +22,22 @@
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1
|
||||
-master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t)
|
||||
-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F
|
||||
+master-bin.000002 # Table_map 1 # table_id: 1 (test.t)
|
||||
+master-bin.000002 # Write_rows_v1 1 # table_id: 1 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
master-bin.000002 # Gtid 1 # GTID #-#-#
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2
|
||||
-master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t)
|
||||
-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F
|
||||
+master-bin.000002 # Table_map 1 # table_id: 2 (test.t)
|
||||
+master-bin.000002 # Write_rows_v1 1 # table_id: 2 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
master-bin.000002 # Gtid 1 # GTID #-#-#
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3
|
||||
-master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t)
|
||||
-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F
|
||||
+master-bin.000002 # Table_map 1 # table_id: 3 (test.t)
|
||||
+master-bin.000002 # Write_rows_v1 1 # table_id: 3 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
connection slave;
|
||||
connection master;
|
46
mysql-test/suite/rpl/r/rpl_row_big_table_id.result
Normal file
46
mysql-test/suite/rpl/r/rpl_row_big_table_id.result
Normal file
|
@ -0,0 +1,46 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection master;
|
||||
include/rpl_restart_server.inc [server_number=1]
|
||||
SET @@debug_dbug="d,simulate_big_table_id";
|
||||
CREATE TABLE t (a int);
|
||||
INSERT INTO t SET a= 0;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 1;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 2;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 3;
|
||||
show binlog events in <file> from <pos>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 0
|
||||
master-bin.000002 # Table_map 1 # table_id: 4294967294 (test.t)
|
||||
master-bin.000002 # Write_rows_v1 1 # table_id: 4294967294 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
master-bin.000002 # Gtid 1 # GTID #-#-#
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1
|
||||
master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t)
|
||||
master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
master-bin.000002 # Gtid 1 # GTID #-#-#
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2
|
||||
master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t)
|
||||
master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
master-bin.000002 # Gtid 1 # GTID #-#-#
|
||||
master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
|
||||
master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
|
||||
master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3
|
||||
master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t)
|
||||
master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F
|
||||
master-bin.000002 # Query 1 # COMMIT
|
||||
connection slave;
|
||||
connection master;
|
||||
DROP TABLE t;
|
||||
connection slave;
|
||||
include/rpl_end.inc
|
57
mysql-test/suite/rpl/t/rpl_row_big_table_id.test
Normal file
57
mysql-test/suite/rpl/t/rpl_row_big_table_id.test
Normal file
|
@ -0,0 +1,57 @@
|
|||
##################################################################
|
||||
# rpl_row_big_table_id
|
||||
#
|
||||
# MDEV-17803 Row-based event is not applied when
|
||||
# table map id is greater 32 bit int
|
||||
#
|
||||
# Verify row-based events applying when table map id value is about and greater
|
||||
# than 1 << 32.
|
||||
##################################################################
|
||||
--source include/word_size.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection master
|
||||
# To reset last table id
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_restart_server.inc
|
||||
|
||||
SET @@debug_dbug="d,simulate_big_table_id";
|
||||
CREATE TABLE t (a int);
|
||||
|
||||
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
--let $binlog_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
INSERT INTO t SET a= 0;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 1;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 2;
|
||||
ALTER TABLE t comment '';
|
||||
INSERT INTO t SET a= 3;
|
||||
|
||||
# display simulated big table_id
|
||||
--let $_in_from=in '$binlog_file' from $binlog_pos
|
||||
--replace_result "$_in_from" "in <file> from <pos>"
|
||||
--replace_column 2 # 5 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
|
||||
--eval show binlog events in '$binlog_file' from $binlog_pos
|
||||
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
if (`SELECT sum(a) != 6 FROM t`)
|
||||
{
|
||||
--echo *** unexpected result; check slave applier ***
|
||||
--die
|
||||
}
|
||||
|
||||
|
||||
# Cleanup
|
||||
|
||||
--connection master
|
||||
DROP TABLE t;
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/rpl_end.inc
|
|
@ -91,6 +91,9 @@ DATA="${WSREP_SST_OPT_DATA}"
|
|||
INFO_FILE="xtrabackup_galera_info"
|
||||
IST_FILE="xtrabackup_ist"
|
||||
MAGIC_FILE="${DATA}/${INFO_FILE}"
|
||||
INNOAPPLYLOG="${DATA}/mariabackup.prepare.log"
|
||||
INNOMOVELOG="${DATA}/mariabackup.move.log"
|
||||
INNOBACKUPLOG="${DATA}/mariabackup.backup.log"
|
||||
|
||||
# Setting the path for ss and ip
|
||||
export PATH="/usr/sbin:/sbin:$PATH"
|
||||
|
@ -352,6 +355,8 @@ read_cnf()
|
|||
ssyslog=$(parse_cnf sst sst-syslog 0)
|
||||
ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
|
||||
ssystag+="-"
|
||||
sstlogarchive=$(parse_cnf sst sst-log-archive 1)
|
||||
sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir "/tmp/sst_log_archive")
|
||||
|
||||
if [[ $speciald -eq 0 ]];then
|
||||
wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
|
||||
|
@ -744,10 +749,71 @@ if [[ $ssyslog -eq 1 ]];then
|
|||
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
|
||||
fi
|
||||
|
||||
else
|
||||
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
|
||||
else
|
||||
|
||||
if [[ "$sstlogarchive" -eq 1 ]]
|
||||
then
|
||||
ARCHIVETIMESTAMP=$(date "+%Y.%m.%d-%H.%M.%S")
|
||||
newfile=""
|
||||
|
||||
if [[ ! -z "$sstlogarchivedir" ]]
|
||||
then
|
||||
if [[ ! -d "$sstlogarchivedir" ]]
|
||||
then
|
||||
mkdir -p "$sstlogarchivedir"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e "${INNOAPPLYLOG}" ]
|
||||
then
|
||||
if [[ ! -z "$sstlogarchivedir" ]]
|
||||
then
|
||||
newfile=$sstlogarchivedir/$(basename "${INNOAPPLYLOG}").${ARCHIVETIMESTAMP}
|
||||
else
|
||||
newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP}
|
||||
fi
|
||||
|
||||
wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}"
|
||||
mv "${INNOAPPLYLOG}" "${newfile}"
|
||||
gzip "${newfile}"
|
||||
fi
|
||||
|
||||
if [ -e "${INNOMOVELOG}" ]
|
||||
then
|
||||
if [[ ! -z "$sstlogarchivedir" ]]
|
||||
then
|
||||
newfile=$sstlogarchivedir/$(basename "${INNOMOVELOG}").${ARCHIVETIMESTAMP}
|
||||
else
|
||||
newfile=${INNOMOVELOG}.${ARCHIVETIMESTAMP}
|
||||
fi
|
||||
|
||||
wsrep_log_info "Moving ${INNOMOVELOG} to ${newfile}"
|
||||
mv "${INNOMOVELOG}" "${newfile}"
|
||||
gzip "${newfile}"
|
||||
fi
|
||||
|
||||
if [ -e "${INNOBACKUPLOG}" ]
|
||||
then
|
||||
if [[ ! -z "$sstlogarchivedir" ]]
|
||||
then
|
||||
newfile=$sstlogarchivedir/$(basename "${INNOBACKUPLOG}").${ARCHIVETIMESTAMP}
|
||||
else
|
||||
newfile=${INNOBACKUPLOG}.${ARCHIVETIMESTAMP}
|
||||
fi
|
||||
|
||||
wsrep_log_info "Moving ${INNOBACKUPLOG} to ${newfile}"
|
||||
mv "${INNOBACKUPLOG}" "${newfile}"
|
||||
gzip "${newfile}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
|
||||
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
|
||||
|
||||
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &> ${INNOAPPLYLOG}"
|
||||
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &> ${INNOMOVELOG}"
|
||||
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> ${INNOBACKUPLOG}"
|
||||
fi
|
||||
|
||||
get_stream
|
||||
|
@ -844,7 +910,7 @@ then
|
|||
|
||||
if [ ${RC[0]} -ne 0 ]; then
|
||||
wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \
|
||||
"Check ${DATA}/innobackup.backup.log"
|
||||
"Check syslog or ${INNOBACKUPLOG} for details"
|
||||
exit 22
|
||||
elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
|
||||
wsrep_log_error "$tcmd finished with error: ${RC[1]}"
|
||||
|
@ -1073,13 +1139,12 @@ then
|
|||
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check ${DATA}/innobackup.prepare.log"
|
||||
wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check syslog or ${INNOAPPLYLOG} for details"
|
||||
exit 22
|
||||
fi
|
||||
|
||||
MAGIC_FILE="${TDATA}/${INFO_FILE}"
|
||||
set +e
|
||||
rm $TDATA/innobackup.prepare.log $TDATA/innobackup.move.log
|
||||
set -e
|
||||
wsrep_log_info "Moving the backup to ${TDATA}"
|
||||
timeit "Xtrabackup move stage" "$INNOMOVE"
|
||||
|
@ -1089,7 +1154,7 @@ then
|
|||
DATA=${TDATA}
|
||||
else
|
||||
wsrep_log_error "Move failed, keeping ${DATA} for further diagnosis"
|
||||
wsrep_log_error "Check ${DATA}/innobackup.move.log for details"
|
||||
wsrep_log_error "Check syslog or ${INNOMOVELOG} for details"
|
||||
exit 22
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2018, MariaDB
|
||||
Copyright (c) 2009, 2019, MariaDB
|
||||
|
||||
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
|
||||
|
@ -12634,7 +12634,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
table_list->updating= 1;
|
||||
table_list->required_type= TABLE_TYPE_NORMAL;
|
||||
|
||||
DBUG_PRINT("debug", ("table: %s is mapped to %u",
|
||||
DBUG_PRINT("debug", ("table: %s is mapped to %lu",
|
||||
table_list->table_name.str,
|
||||
table_list->table_id));
|
||||
table_list->master_had_triggers= ((m_flags & TM_BIT_HAS_TRIGGERS_F) ? 1 : 0);
|
||||
|
|
|
@ -1562,6 +1562,7 @@ failure:
|
|||
head->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set);
|
||||
delete file;
|
||||
file= save_file;
|
||||
free_file= false;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1492,8 +1492,7 @@ static bool fix_user_plugin_ptr(ACL_USER *user)
|
|||
else
|
||||
return true;
|
||||
|
||||
if (user->auth_string.length)
|
||||
set_user_salt(user, user->auth_string.str, user->auth_string.length);
|
||||
set_user_salt(user, user->auth_string.str, user->auth_string.length);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1968,6 +1967,11 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
|
|||
safe_str(user.user.str),
|
||||
safe_str(user.host.hostname));
|
||||
}
|
||||
else if (password_len)
|
||||
{
|
||||
user.auth_string.str= password;
|
||||
user.auth_string.length= password_len;
|
||||
}
|
||||
|
||||
fix_user_plugin_ptr(&user);
|
||||
}
|
||||
|
|
|
@ -6801,6 +6801,12 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||
KEY *new_key;
|
||||
KEY *new_key_end=
|
||||
ha_alter_info->key_info_buffer + ha_alter_info->key_count;
|
||||
/*
|
||||
Primary key index for the new table
|
||||
*/
|
||||
const KEY* const new_pk= (ha_alter_info->key_count > 0 &&
|
||||
is_candidate_key(ha_alter_info->key_info_buffer)) ?
|
||||
ha_alter_info->key_info_buffer : NULL;
|
||||
|
||||
DBUG_PRINT("info", ("index count old: %d new: %d",
|
||||
table->s->keys, ha_alter_info->key_count));
|
||||
|
@ -6877,6 +6883,16 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||
goto index_changed;
|
||||
}
|
||||
|
||||
/*
|
||||
Rebuild the index if following condition get satisfied:
|
||||
|
||||
(i) Old table doesn't have primary key, new table has it and vice-versa
|
||||
(ii) Primary key changed to another existing index
|
||||
*/
|
||||
if ((new_key == new_pk) !=
|
||||
((uint) (table_key - table->key_info) == table->s->primary_key))
|
||||
goto index_changed;
|
||||
|
||||
/* Check that key comment is not changed. */
|
||||
if (table_key->comment.length != new_key->comment.length ||
|
||||
(table_key->comment.length &&
|
||||
|
|
|
@ -338,6 +338,9 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
|
|||
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
|
||||
&share->LOCK_ha_data, MY_MUTEX_INIT_FAST);
|
||||
|
||||
DBUG_EXECUTE_IF("simulate_big_table_id",
|
||||
if (last_table_id < UINT_MAX32)
|
||||
last_table_id= UINT_MAX32 - 1;);
|
||||
/*
|
||||
There is one reserved number that cannot be used. Remember to
|
||||
change this when 6-byte global table id's are introduced.
|
||||
|
@ -346,7 +349,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
|
|||
{
|
||||
share->table_map_id=(ulong) my_atomic_add64_explicit(&last_table_id, 1,
|
||||
MY_MEMORY_ORDER_RELAXED);
|
||||
} while (unlikely(share->table_map_id == ~0UL));
|
||||
} while (unlikely(share->table_map_id == ~0UL ||
|
||||
share->table_map_id == 0));
|
||||
}
|
||||
DBUG_RETURN(share);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef TABLE_INCLUDED
|
||||
#define TABLE_INCLUDED
|
||||
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2018, MariaDB
|
||||
Copyright (c) 2009, 2019, MariaDB
|
||||
|
||||
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
|
||||
|
@ -2082,7 +2082,7 @@ struct TABLE_LIST
|
|||
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
|
||||
List<Index_hint> *index_hints;
|
||||
TABLE *table; /* opened table */
|
||||
uint table_id; /* table id (from binlog) for opened table */
|
||||
ulong table_id; /* table id (from binlog) for opened table */
|
||||
/*
|
||||
select_result for derived table to pass it from table creation to table
|
||||
filling procedure
|
||||
|
|
|
@ -198,7 +198,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING *table,
|
|||
|
||||
#define FRM_HEADER_SIZE 64
|
||||
#define FRM_FORMINFO_SIZE 288
|
||||
#define FRM_MAX_SIZE (512*1024)
|
||||
#define FRM_MAX_SIZE (1024*1024)
|
||||
|
||||
static inline bool is_binary_frm_header(uchar *head)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2012, Facebook Inc.
|
||||
Copyright (c) 2013, 2018, MariaDB Corporation.
|
||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -7020,32 +7020,16 @@ UNIV_INTERN
|
|||
ulint
|
||||
dict_sys_get_size()
|
||||
{
|
||||
ulint size = 0;
|
||||
/* No mutex; this is a very crude approximation anyway */
|
||||
ulint size = UT_LIST_GET_LEN(dict_sys->table_LRU)
|
||||
+ UT_LIST_GET_LEN(dict_sys->table_non_LRU);
|
||||
size *= sizeof(dict_table_t)
|
||||
+ sizeof(dict_index_t) * 2
|
||||
+ (sizeof(dict_col_t) + sizeof(dict_field_t)) * 10
|
||||
+ sizeof(dict_field_t) * 5 /* total number of key fields */
|
||||
+ 200; /* arbitrary, covering names and overhead */
|
||||
|
||||
ut_ad(dict_sys);
|
||||
|
||||
mutex_enter(&dict_sys->mutex);
|
||||
|
||||
for(ulint i = 0; i < hash_get_n_cells(dict_sys->table_hash); i++) {
|
||||
dict_table_t* table;
|
||||
|
||||
for (table = static_cast<dict_table_t*>(HASH_GET_FIRST(dict_sys->table_hash,i));
|
||||
table != NULL;
|
||||
table = static_cast<dict_table_t*>(HASH_GET_NEXT(name_hash, table))) {
|
||||
dict_index_t* index;
|
||||
size += mem_heap_get_size(table->heap) + strlen(table->name.m_name) +1;
|
||||
|
||||
for(index = dict_table_get_first_index(table);
|
||||
index != NULL;
|
||||
index = dict_table_get_next_index(index)) {
|
||||
size += mem_heap_get_size(index->heap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mutex_exit(&dict_sys->mutex);
|
||||
|
||||
return (size);
|
||||
return size;
|
||||
}
|
||||
|
||||
/** Look for any dictionary objects that are found in the given tablespace.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2014, 2018, MariaDB Corporation.
|
||||
Copyright (c) 2014, 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -778,10 +778,9 @@ fil_try_to_close_file_in_LRU(
|
|||
}
|
||||
|
||||
/** Flush any writes cached by the file system.
|
||||
@param[in,out] space tablespace */
|
||||
static
|
||||
void
|
||||
fil_flush_low(fil_space_t* space)
|
||||
@param[in,out] space tablespace
|
||||
@param[in] metadata whether to update file system metadata */
|
||||
static void fil_flush_low(fil_space_t* space, bool metadata = false)
|
||||
{
|
||||
ut_ad(mutex_own(&fil_system.mutex));
|
||||
ut_ad(space);
|
||||
|
@ -805,7 +804,7 @@ fil_flush_low(fil_space_t* space)
|
|||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
return;
|
||||
if (!metadata) return;
|
||||
}
|
||||
|
||||
/* Prevent dropping of the space while we are flushing */
|
||||
|
@ -982,6 +981,7 @@ fil_space_extend_must_retry(
|
|||
|
||||
os_has_said_disk_full = *success;
|
||||
if (*success) {
|
||||
os_file_flush(node->handle);
|
||||
last_page_no = size;
|
||||
} else {
|
||||
/* Let us measure the size of the file
|
||||
|
@ -1013,14 +1013,14 @@ fil_space_extend_must_retry(
|
|||
switch (space->id) {
|
||||
case TRX_SYS_SPACE:
|
||||
srv_sys_space.set_last_file_size(pages_in_MiB);
|
||||
fil_flush_low(space);
|
||||
fil_flush_low(space, true);
|
||||
return(false);
|
||||
default:
|
||||
ut_ad(space->purpose == FIL_TYPE_TABLESPACE
|
||||
|| space->purpose == FIL_TYPE_IMPORT);
|
||||
if (space->purpose == FIL_TYPE_TABLESPACE
|
||||
&& !space->is_being_truncated) {
|
||||
fil_flush_low(space);
|
||||
fil_flush_low(space, true);
|
||||
}
|
||||
return(false);
|
||||
case SRV_TMP_SPACE_ID:
|
||||
|
|
|
@ -4338,17 +4338,19 @@ innobase_end(handlerton*, ha_panic_function)
|
|||
}
|
||||
}
|
||||
|
||||
st_my_thread_var* running = reinterpret_cast<st_my_thread_var*>(
|
||||
st_my_thread_var* r = reinterpret_cast<st_my_thread_var*>(
|
||||
my_atomic_loadptr_explicit(
|
||||
reinterpret_cast<void**>(&srv_running),
|
||||
MY_MEMORY_ORDER_RELAXED));
|
||||
if (!abort_loop && running) {
|
||||
// may be UNINSTALL PLUGIN statement
|
||||
running->abort = 1;
|
||||
mysql_cond_broadcast(running->current_cond);
|
||||
}
|
||||
|
||||
if (!srv_read_only_mode) {
|
||||
if (r) {
|
||||
ut_ad(!srv_read_only_mode);
|
||||
if (!abort_loop) {
|
||||
// may be UNINSTALL PLUGIN statement
|
||||
mysql_mutex_lock(r->current_mutex);
|
||||
r->abort = 1;
|
||||
mysql_cond_broadcast(r->current_cond);
|
||||
mysql_mutex_unlock(r->current_mutex);
|
||||
}
|
||||
pthread_join(thd_destructor_thread, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -680,8 +680,7 @@ struct dict_v_col_t{
|
|||
ulint v_pos;
|
||||
|
||||
/** Virtual index list, and column position in the index,
|
||||
the allocated memory is not from table->heap, nor it is
|
||||
tracked by dict_sys->size */
|
||||
the allocated memory is not from table->heap */
|
||||
dict_v_idx_list* v_indexes;
|
||||
|
||||
};
|
||||
|
@ -1577,15 +1576,7 @@ struct dict_table_t {
|
|||
/** Hash chain node. */
|
||||
hash_node_t name_hash;
|
||||
|
||||
/** Memory heap. If you allocate from this heap after the table has
|
||||
been created then be sure to account the allocation into
|
||||
dict_sys->size. When closing the table we do something like
|
||||
dict_sys->size -= mem_heap_get_size(table->heap) and if that is going
|
||||
to become negative then we would assert. Something like this should do:
|
||||
old_size = mem_heap_get_size()
|
||||
mem_heap_alloc()
|
||||
new_size = mem_heap_get_size()
|
||||
dict_sys->size += new_size - old_size. */
|
||||
/** Memory heap */
|
||||
mem_heap_t* heap;
|
||||
|
||||
/** NULL or the directory path specified by DATA DIRECTORY. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2017, 2018, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
|
@ -219,6 +219,7 @@ the equal ordering fields. NOTE: we compare the fields as binary strings!
|
|||
@param[in] heap memory heap from which allocated
|
||||
@param[in,out] mysql_table NULL, or mysql table object when
|
||||
user thread invokes dml
|
||||
@param[out] error error number in case of failure
|
||||
@return own: update vector of differing fields, excluding roll ptr and
|
||||
trx id */
|
||||
upd_t*
|
||||
|
@ -230,8 +231,9 @@ row_upd_build_difference_binary(
|
|||
bool no_sys,
|
||||
trx_t* trx,
|
||||
mem_heap_t* heap,
|
||||
TABLE* mysql_table)
|
||||
MY_ATTRIBUTE((nonnull(1,2,3,7), warn_unused_result));
|
||||
TABLE* mysql_table,
|
||||
dberr_t* error)
|
||||
MY_ATTRIBUTE((nonnull(1,2,3,7,9), warn_unused_result));
|
||||
/** Apply an update vector to an index entry.
|
||||
@param[in,out] entry index entry to be updated; the clustered index record
|
||||
must be covered by a lock or a page latch to prevent
|
||||
|
|
|
@ -39,10 +39,6 @@ Created 1/20/1994 Heikki Tuuri
|
|||
#define _IB_TO_STR(s) #s
|
||||
#define IB_TO_STR(s) _IB_TO_STR(s)
|
||||
|
||||
#define INNODB_VERSION_MAJOR 5
|
||||
#define INNODB_VERSION_MINOR 7
|
||||
#define INNODB_VERSION_BUGFIX 24
|
||||
|
||||
/* The following is the InnoDB version as shown in
|
||||
SELECT plugin_version FROM information_schema.plugins;
|
||||
calculated in make_version_string() in sql/sql_show.cc like this:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
Copyright (c) 2013, 2018, MariaDB Corporation.
|
||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted
|
||||
by Percona Inc.. Those modifications are
|
||||
|
@ -1762,6 +1762,8 @@ LinuxAIOHandler::resubmit(Slot* slot)
|
|||
slot->n_bytes = 0;
|
||||
slot->io_already_done = false;
|
||||
|
||||
compile_time_assert(sizeof(off_t) >= sizeof(os_offset_t));
|
||||
|
||||
struct iocb* iocb = &slot->control;
|
||||
|
||||
if (slot->type.is_read()) {
|
||||
|
@ -1771,7 +1773,7 @@ LinuxAIOHandler::resubmit(Slot* slot)
|
|||
slot->file,
|
||||
slot->ptr,
|
||||
slot->len,
|
||||
static_cast<off_t>(slot->offset));
|
||||
slot->offset);
|
||||
} else {
|
||||
|
||||
ut_a(slot->type.is_write());
|
||||
|
@ -1781,7 +1783,7 @@ LinuxAIOHandler::resubmit(Slot* slot)
|
|||
slot->file,
|
||||
slot->ptr,
|
||||
slot->len,
|
||||
static_cast<off_t>(slot->offset));
|
||||
slot->offset);
|
||||
}
|
||||
|
||||
iocb->data = slot;
|
||||
|
@ -6260,7 +6262,7 @@ AIO::reserve_slot(
|
|||
#ifdef _WIN32
|
||||
slot->len = static_cast<DWORD>(len);
|
||||
#else
|
||||
slot->len = static_cast<ulint>(len);
|
||||
slot->len = len;
|
||||
#endif /* _WIN32 */
|
||||
slot->type = type;
|
||||
slot->buf = static_cast<byte*>(buf);
|
||||
|
|
|
@ -328,7 +328,7 @@ row_ins_clust_index_entry_by_modify(
|
|||
{
|
||||
const rec_t* rec;
|
||||
upd_t* update;
|
||||
dberr_t err;
|
||||
dberr_t err = DB_SUCCESS;
|
||||
btr_cur_t* cursor = btr_pcur_get_btr_cur(pcur);
|
||||
TABLE* mysql_table = NULL;
|
||||
ut_ad(dict_index_is_clust(cursor->index));
|
||||
|
@ -351,7 +351,11 @@ row_ins_clust_index_entry_by_modify(
|
|||
|
||||
update = row_upd_build_difference_binary(
|
||||
cursor->index, entry, rec, NULL, true,
|
||||
thr_get_trx(thr), heap, mysql_table);
|
||||
thr_get_trx(thr), heap, mysql_table, &err);
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
}
|
||||
|
||||
if (mode != BTR_MODIFY_TREE) {
|
||||
ut_ad((mode & ulint(~BTR_ALREADY_S_LATCHED))
|
||||
== BTR_MODIFY_LEAF);
|
||||
|
@ -962,11 +966,11 @@ row_ins_foreign_fill_virtual(
|
|||
|
||||
if (innobase_allocate_row_for_vcol(thd, index, &v_heap,
|
||||
&mysql_table,
|
||||
&record, &vcol_storage))
|
||||
{
|
||||
&record, &vcol_storage)) {
|
||||
if (v_heap) mem_heap_free(v_heap);
|
||||
*err = DB_OUT_OF_MEMORY;
|
||||
goto func_exit;
|
||||
}
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
for (ulint i = 0; i < n_v_fld; i++) {
|
||||
|
||||
|
|
|
@ -2232,7 +2232,10 @@ func_exit_committed:
|
|||
row, NULL, index, heap, ROW_BUILD_NORMAL);
|
||||
upd_t* update = row_upd_build_difference_binary(
|
||||
index, entry, btr_pcur_get_rec(&pcur), cur_offsets,
|
||||
false, NULL, heap, dup->table);
|
||||
false, NULL, heap, dup->table, &error);
|
||||
if (error != DB_SUCCESS) {
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
if (!update->n_fields) {
|
||||
/* Nothing to do. */
|
||||
|
|
|
@ -1034,8 +1034,9 @@ the equal ordering fields. NOTE: we compare the fields as binary strings!
|
|||
@param[in] heap memory heap from which allocated
|
||||
@param[in] mysql_table NULL, or mysql table object when
|
||||
user thread invokes dml
|
||||
@param[out] error error number in case of failure
|
||||
@return own: update vector of differing fields, excluding roll ptr and
|
||||
trx id */
|
||||
trx id,if error is not equal to DB_SUCCESS, return NULL */
|
||||
upd_t*
|
||||
row_upd_build_difference_binary(
|
||||
dict_index_t* index,
|
||||
|
@ -1045,7 +1046,8 @@ row_upd_build_difference_binary(
|
|||
bool no_sys,
|
||||
trx_t* trx,
|
||||
mem_heap_t* heap,
|
||||
TABLE* mysql_table)
|
||||
TABLE* mysql_table,
|
||||
dberr_t* error)
|
||||
{
|
||||
upd_field_t* upd_field;
|
||||
dfield_t* dfield;
|
||||
|
@ -1156,6 +1158,11 @@ row_upd_build_difference_binary(
|
|||
update->old_vrow, col, index,
|
||||
&v_heap, heap, NULL, thd, mysql_table, record,
|
||||
NULL, NULL, NULL);
|
||||
if (vfield == NULL) {
|
||||
if (v_heap) mem_heap_free(v_heap);
|
||||
*error = DB_COMPUTE_VALUE_FAILED;
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (!dfield_data_is_binary_equal(
|
||||
dfield, vfield->len,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2008, 2009 Google Inc.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
Copyright (c) 2013, 2018, MariaDB Corporation.
|
||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted by
|
||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||
|
|
|
@ -1730,6 +1730,10 @@ dberr_t srv_start(bool create_new_db)
|
|||
break;
|
||||
}
|
||||
|
||||
if (stat_info.type != OS_FILE_TYPE_FILE) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!srv_file_check_mode(logfilename)) {
|
||||
return(srv_init_abort(DB_ERROR));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue