Skip to content

Commit

Permalink
Merge branch '5.5' into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed May 19, 2018
2 parents cf52261 + 27a7365 commit c1b5d28
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 79 deletions.
81 changes: 45 additions & 36 deletions mysql-test/mysql-test-run.pl
Expand Up @@ -650,50 +650,59 @@ ($$$)
my $worker_savename= basename($worker_savedir);
my $savedir= "$opt_vardir/log/$worker_savename";

# Move any core files from e.g. mysqltest
foreach my $coref (glob("core*"), glob("*.dmp"))
{
mtr_report(" - found '$coref', moving it to '$worker_savedir'");
move($coref, $worker_savedir);
}

find(
{
no_chdir => 1,
wanted => sub
{
my $core_file= $File::Find::name;
my $core_name= basename($core_file);

# Name beginning with core, not ending in .gz
if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
or (IS_WINDOWS and $core_name =~ /\.dmp$/))
{
# Ending with .dmp
mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)");

My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel);

# Limit number of core files saved
if ($opt_max_save_core > 0 &&
$num_saved_cores >= $opt_max_save_core)
{
mtr_report(" - deleting it, already saved",
"$opt_max_save_core");
unlink("$core_file");
}
else
{
mtr_compress_file($core_file) unless @opt_cases;
++$num_saved_cores;
}
}
}
},
$worker_savedir);

if ($opt_max_save_datadir > 0 &&
$num_saved_datadir >= $opt_max_save_datadir)
{
mtr_report(" - skipping '$worker_savedir/'");
rmtree($worker_savedir);
}
else {
else
{
mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
rename($worker_savedir, $savedir);
# Move any core files from e.g. mysqltest
foreach my $coref (glob("core*"), glob("*.dmp"))
{
mtr_report(" - found '$coref', moving it to '$savedir'");
move($coref, $savedir);
}
if ($opt_max_save_core > 0) {
# Limit number of core files saved
find({ no_chdir => 1,
wanted => sub {
my $core_file= $File::Find::name;
my $core_name= basename($core_file);

# Name beginning with core, not ending in .gz
if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
or (IS_WINDOWS and $core_name =~ /\.dmp$/)){
# Ending with .dmp
mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)");

My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel);

if ($num_saved_cores >= $opt_max_save_core) {
mtr_report(" - deleting it, already saved",
"$opt_max_save_core");
unlink("$core_file");
} else {
mtr_compress_file($core_file) unless @opt_cases;
}
++$num_saved_cores;
}
}
},
$savedir);
}
}
resfile_print_test();
$num_saved_datadir++;
Expand Down
5 changes: 0 additions & 5 deletions mysql-test/r/grant.result
Expand Up @@ -1636,11 +1636,6 @@ drop user mysqluser11@localhost;
drop database mysqltest1;
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
user()
юзер_юзер@localhost
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
grant select on test.* to очень_длинный_юзер890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@localhost;
ERROR HY000: String 'очень_длинный_юзер890123456789012345678901234567890123' is too long for user name (should be no longer than 80)
set names default;
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/r/grant_not_windows.result
@@ -0,0 +1,7 @@
set names utf8;
grant select on test.* to юзер_юзер@localhost;
user()
юзер_юзер@localhost
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
set names default;
9 changes: 9 additions & 0 deletions mysql-test/r/insert_select.result
Expand Up @@ -854,3 +854,12 @@ INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
DROP TABLE t1;
End of 5.1 tests
create table t1 (i int);
create table t2 as select values(i) as a from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` binary(0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
End of 5.5 tests
6 changes: 0 additions & 6 deletions mysql-test/suite/innodb/r/innodb_bug54044.result
Expand Up @@ -16,9 +16,3 @@ tmp CREATE TABLE `tmp` (
`NULL` binary(0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE tmp;
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo'),('bar');
FLUSH TABLES;
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
ERROR HY000: Can't create table `test`.`tmp` (errno: -1 "Internal error < 0 (Not system error)")
DROP TABLE t1;
10 changes: 0 additions & 10 deletions mysql-test/suite/innodb/t/innodb_bug54044.test
Expand Up @@ -16,13 +16,3 @@ CREATE TABLE tmp ENGINE = INNODB
AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
DROP TABLE tmp;

# These 'create table' operations should fail because of
# using NULL datatype

CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo'),('bar');
FLUSH TABLES;
--error 1005
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
DROP TABLE t1;
8 changes: 0 additions & 8 deletions mysql-test/t/grant.test
Expand Up @@ -1566,15 +1566,7 @@ drop database mysqltest1;


--echo End of 5.0 tests

#
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
set names utf8;
grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
--error ER_WRONG_STRING_LENGTH
grant select on test.* to очень_длинный_юзер890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@localhost;
set names default;
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/t/grant_not_windows.test
@@ -0,0 +1,13 @@
# UTF8 parameters to mysql client do not work on Windows
--source include/not_windows.inc
--source include/not_embedded.inc

#
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
set names utf8;
grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
set names default;
10 changes: 10 additions & 0 deletions mysql-test/t/insert_select.test
Expand Up @@ -423,3 +423,13 @@ SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
DROP TABLE t1;

--echo End of 5.1 tests

#
# MDEV-15318 CREATE .. SELECT VALUES produces invalid table structure
#
create table t1 (i int);
create table t2 as select values(i) as a from t1;
show create table t2;
drop table t1, t2;

--echo End of 5.5 tests
16 changes: 12 additions & 4 deletions mysql-test/t/mysql.test
Expand Up @@ -51,14 +51,22 @@ drop table t1;

#
# Bug#17939 Wrong table format when using UTF8 strings
#
--exec $MYSQL --default-character-set=utf8 --table -e "SELECT 'John Doe' as '__tañgè Ñãmé'" 2>&1
--exec $MYSQL --default-character-set=utf8 --table -e "SELECT '__tañgè Ñãmé' as 'John Doe'" 2>&1
write_file $MYSQL_TMP_DIR/mysql_in;
SELECT 'John Doe' as '__tañgè Ñãmé';
SELECT '__tañgè Ñãmé' as 'John Doe';
EOF
--exec $MYSQL --default-character-set=utf8 --table < $MYSQL_TMP_DIR/mysql_in 2>&1
remove_file $MYSQL_TMP_DIR/mysql_in;

#
# Bug#18265 -- mysql client: No longer right-justifies numeric columns
#
--exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int, k char(25) charset utf8); insert into t1 (i) values (1); insert into t1 (k) values ('<----------------------->'); insert into t1 (k) values ('<-----'); insert into t1 (k) values ('Τη γλώσσα'); insert into t1 (k) values ('ᛖᚴ ᚷᛖᛏ'); select * from t1; DROP TABLE t1;"
write_file $MYSQL_TMP_DIR/mysql_in;
create table t1 (i int, j int, k char(25) charset utf8); insert into t1 (i) values (1); insert into t1 (k) values ('<----------------------->'); insert into t1 (k) values ('<-----'); insert into t1 (k) values ('Τη γλώσσα'); insert into t1 (k) values ('ᛖᚴ ᚷᛖᛏ'); select * from t1; DROP TABLE t1;
EOF
--exec $MYSQL -t --default-character-set utf8 test < $MYSQL_TMP_DIR/mysql_in
remove_file $MYSQL_TMP_DIR/mysql_in;


#
# "DESCRIBE" commands may return strange NULLness flags.
Expand Down
42 changes: 36 additions & 6 deletions mysql-test/t/mysql_cp932.test
Expand Up @@ -10,13 +10,43 @@
# BUG#16217 - MySQL client misinterprets multi-byte char as escape `\'
#

let $mysql_in= $MYSQL_TMP_DIR/mysql_in;

# new command \C or charset
--exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g"
--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
write_file $mysql_in;
\C cp932 \g
EOF
--exec $MYSQL --default-character-set=utf8 test < $mysql_in
remove_file $mysql_in;

write_file $mysql_in;
charset utf8;
EOF
--exec $MYSQL --default-character-set=cp932 test < $mysql_in
remove_file $mysql_in;

# its usage to switch internally in mysql to requested charset
--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '�\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('�\'); select * from t1; drop table t1;"
--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '�\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select '�\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select '�\'"
write_file $mysql_in;
charset cp932; select '�\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('�\'); select * from t1; drop table t1;
EOF
--exec $MYSQL --default-character-set=utf8 test < $mysql_in
remove_file $mysql_in;

write_file $mysql_in;
charset cp932; select '�\'
EOF
--exec $MYSQL --default-character-set=utf8 test < $mysql_in
remove_file $mysql_in;

write_file $mysql_in;
/*charset cp932 */; set character_set_client= cp932; select '�\'
EOF
--exec $MYSQL --default-character-set=utf8 test < $mysql_in
remove_file $mysql_in;

write_file $mysql_in;
/*!\C cp932 */; set character_set_client= cp932; select '�\'
EOF
--exec $MYSQL --default-character-set=utf8 test < $mysql_in
remove_file $mysql_in;

8 changes: 4 additions & 4 deletions sql/item.cc
Expand Up @@ -8529,10 +8529,10 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
}
else
{
Field *tmp_field= field_arg->field;
/* charset doesn't matter here, it's to avoid sigsegv only */
tmp_field= new Field_null(0, 0, Field::NONE, field_arg->field->field_name,
&my_charset_bin);
static uchar null_bit=1;
/* charset doesn't matter here */
Field *tmp_field= new Field_string(0, 0, &null_bit, 1, Field::NONE,
field_arg->field->field_name, &my_charset_bin);
if (tmp_field)
{
tmp_field->init(field_arg->field->table);
Expand Down
1 change: 1 addition & 0 deletions storage/maria/ha_maria.cc
Expand Up @@ -1325,6 +1325,7 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt)
old_proc_info= thd_proc_info(thd, "Checking status");
thd_progress_init(thd, 3);
error= maria_chk_status(param, file); // Not fatal
/* maria_chk_size() will flush the page cache for this file */
if (maria_chk_size(param, file))
error= 1;
if (!error)
Expand Down
8 changes: 8 additions & 0 deletions storage/maria/ma_recovery.c
Expand Up @@ -3520,6 +3520,14 @@ void _ma_tmp_disable_logging_for_table(MARIA_HA *info,
{
MARIA_SHARE *share= info->s;
DBUG_ENTER("_ma_tmp_disable_logging_for_table");

/*
We have to ensure that bitmap is flushed, as it's checking
that share->now_transactional is set
*/
if (share->now_transactional && share->data_file_type == BLOCK_RECORD)
_ma_bitmap_flush_all(share);

if (log_incomplete)
{
uchar log_data[FILEID_STORE_SIZE];
Expand Down

0 comments on commit c1b5d28

Please sign in to comment.