Commit dfc77d19 authored by Otto Kekäläinen's avatar Otto Kekäläinen

Imported Upstream version 10.0.21

parent bbbf51f8
......@@ -15,6 +15,7 @@
*.dat -text -whitespace
storage/connect/mysql-test/connect/std_data/*.txt -text
pcre/testdata/greppatN4 -text
# Denote all files that are truly binary and should not be modified.
*.png binary
......
......@@ -277,6 +277,10 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
*.vcproj.*
*.vcproj.*.*
*.vcproj.*.*.*
*.vcxproj
*.vcxproj.*
*.vcxproj.*.*
*.vcxproj.*.*.*
# Build results
[Dd]ebug/
......
......@@ -424,7 +424,6 @@ IF(NOT WITHOUT_SERVER)
IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
ADD_SUBDIRECTORY(internal)
ENDIF()
ADD_SUBDIRECTORY(packaging/rpm-oel)
ENDIF()
IF(UNIX)
......@@ -438,7 +437,6 @@ IF(WIN32)
ADD_SUBDIRECTORY(win/upgrade_wizard)
ADD_SUBDIRECTORY(win/packaging)
ENDIF()
ADD_SUBDIRECTORY(packaging/solaris)
IF(NOT CMAKE_CROSSCOMPILING)
SET(EXPORTED comp_err comp_sql factorial)
......
commit: a6087e7dc1ef3561d8189c8db15e9591d0f9b520
date: 2015-06-17 16:13:02 +0200
build-date: 2015-06-17 16:54:14 +0200
short: a6087e7
commit: 0403790722e3941779ccea26e85fcd818e2320b5
date: 2015-08-05 20:07:46 +0200
build-date: 2015-08-05 20:11:37 +0200
short: 0403790
branch: HEAD
MySQL source 10.0.20
MySQL source 10.0.21
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=20
MYSQL_VERSION_PATCH=21
......@@ -1095,7 +1095,7 @@ int main(int argc, char **argv)
printf("This installation of MySQL is already upgraded to %s, "
"use --force if you still need to run mysql_upgrade\n",
MYSQL_SERVER_VERSION);
die(NULL);
goto end;
}
if (opt_version_check && check_version_match())
......@@ -1124,6 +1124,7 @@ int main(int argc, char **argv)
DBUG_ASSERT(phase == phases_total);
end:
free_used_memory();
my_end(my_end_arg);
exit(0);
......
......@@ -36,7 +36,7 @@
/* Global Thread counter */
uint counter;
uint counter= 0;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
......@@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
{
if (error && ignore_errors)
return;
/* in multi-threaded mode protect from concurrent safe_exit's */
if (counter)
pthread_mutex_lock(&counter_mutex);
if (mysql)
mysql_close(mysql);
......
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, 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
......@@ -242,7 +243,7 @@ void print_conclusions_csv(conclusions *con);
void generate_stats(conclusions *con, option_string *eng, stats *sptr);
uint parse_comma(const char *string, uint **range);
uint parse_delimiter(const char *script, statement **stmt, char delm);
uint parse_option(const char *origin, option_string **stmt, char delm);
int parse_option(const char *origin, option_string **stmt, char delm);
static int drop_schema(MYSQL *mysql, const char *db);
uint get_random_string(char *buf);
static statement *build_table_string(void);
......@@ -1264,7 +1265,13 @@ get_options(int *argc,char ***argv)
if (num_int_cols_opt)
{
option_string *str;
parse_option(num_int_cols_opt, &str, ',');
if(parse_option(num_int_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-int-cols'\n");
option_cleanup(str);
return 1;
}
num_int_cols= atoi(str->string);
if (str->option)
num_int_cols_index= atoi(str->option);
......@@ -1275,7 +1282,13 @@ get_options(int *argc,char ***argv)
if (num_char_cols_opt)
{
option_string *str;
parse_option(num_char_cols_opt, &str, ',');
if(parse_option(num_char_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-char-cols'\n");
option_cleanup(str);
return 1;
}
num_char_cols= atoi(str->string);
if (str->option)
num_char_cols_index= atoi(str->option);
......@@ -1512,7 +1525,13 @@ get_options(int *argc,char ***argv)
printf("Parsing engines to use.\n");
if (default_engine)
parse_option(default_engine, &engine_options, ',');
{
if(parse_option(default_engine, &engine_options, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option 'engine'\n");
return 1;
}
}
if (tty_password)
opt_password= get_tty_password(NullS);
......@@ -1989,7 +2008,7 @@ pthread_handler_t run_task(void *p)
DBUG_RETURN(0);
}
uint
int
parse_option(const char *origin, option_string **stmt, char delm)
{
char *retstr;
......@@ -2014,6 +2033,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
char buffer[HUGE_STRING_LENGTH]= "";
char *buffer_ptr;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH)
return -1;
count++;
strncpy(buffer, ptr, (size_t)(retstr - ptr));
/*
......@@ -2053,6 +2079,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
{
char *origin_ptr;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if (strlen(ptr) > HUGE_STRING_LENGTH)
return -1;
if ((origin_ptr= strchr(ptr, ':')))
{
char *option_ptr;
......@@ -2063,13 +2096,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
option_ptr= (char *)ptr + 1 + tmp->length;
/* Move past the : and the first string */
tmp->option_length= (size_t)((ptr + length) - option_ptr);
tmp->option_length= strlen(option_ptr);
tmp->option= my_strndup(option_ptr, tmp->option_length,
MYF(MY_FAE));
}
else
{
tmp->length= (size_t)((ptr + length) - ptr);
tmp->length= strlen(ptr);
tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
}
......
......@@ -228,7 +228,7 @@ rollback;
create table t0 (n int);
insert t0 select * from t1;
set autocommit=1;
insert into t0 select GET_LOCK("lock1",null);
insert into t0 select GET_LOCK("lock1",0);
set autocommit=0;
create table t2 (n int) engine=innodb;
insert into t2 values (3);
......
......@@ -2686,7 +2686,9 @@ sub setup_vardir() {
{
$plugindir="$opt_vardir/plugins";
mkpath($plugindir);
if (IS_WINDOWS && !$opt_embedded_server)
if (IS_WINDOWS)
{
if (!$opt_embedded_server)
{
for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>,
......@@ -2697,6 +2699,7 @@ sub setup_vardir() {
set_plugin_var($pname);
}
}
}
else
{
my $opt_use_copy= 1;
......@@ -4859,6 +4862,7 @@ sub extract_warning_lines ($$) {
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind
qr|Failed to setup SSL|,
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
);
my $matched_lines= [];
......
......@@ -1773,8 +1773,8 @@ ALTER TABLE tm1 DROP INDEX im3;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
ALTER TABLE ti1 DROP COLUMN d2;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tm1 DROP COLUMN d2;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
......
......@@ -5,7 +5,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
INSTALL PLUGIN BLACKHOLE SONAME 'ha_blackhole.so';
ERROR HY000: Function 'BLACKHOLE' already exists
ERROR HY000: Plugin 'BLACKHOLE' already installed
UNINSTALL PLUGIN blackhole;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
......
......@@ -1103,3 +1103,19 @@ ORDER BY field;
field
c,c
drop table t3, t2, t1;
#
# MDEV-7821 - Server crashes in Item_func_group_concat::fix_fields on 2nd
# execution of PS
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1),(2);
PREPARE stmt FROM "SELECT GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0) FROM t1 AS t1a, t1 AS t1b GROUP BY t1a.a";
EXECUTE stmt;
GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0)
1,1
2,2
EXECUTE stmt;
GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0)
1,1
2,2
DROP TABLE t1;
......@@ -361,6 +361,19 @@ set optimizer_switch=@optimizer_switch_save;
drop view v_merge, vm;
drop table t1,tv;
#
# MDEV-4017 - GET_LOCK() with negative timeouts has strange behavior
#
SELECT GET_LOCK('ul1', NULL);
GET_LOCK('ul1', NULL)
NULL
Warnings:
Warning 1411 Incorrect timeout value: 'NULL' for function get_lock
SELECT GET_LOCK('ul1', -1);
GET_LOCK('ul1', -1)
NULL
Warnings:
Warning 1411 Incorrect timeout value: '-1' for function get_lock
#
# GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test
#
# IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired
......
......@@ -1689,6 +1689,7 @@ Assigning privileges without procs_priv table.
CREATE DATABASE mysqltest1;
CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER
SELECT 1;
CREATE FUNCTION mysqltest1.test() RETURNS INT RETURN 1;
GRANT EXECUTE ON FUNCTION mysqltest1.test TO mysqltest_1@localhost;
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
......@@ -2551,3 +2552,25 @@ ERROR 42000: Access denied for user 'untrusted'@'localhost' to database 'secret'
# Connection default
DROP USER untrusted@localhost;
DROP DATABASE secret;
#
# BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES
# DIFFERENTLY'.
#
drop database if exists mysqltest_db1;
create database mysqltest_db1;
create user mysqltest_u1;
# Both GRANT statements below should fail with the same error.
grant execute on function mysqltest_db1.f1 to mysqltest_u1;
ERROR 42000: FUNCTION or PROCEDURE f1 does not exist
grant execute on procedure mysqltest_db1.p1 to mysqltest_u1;
ERROR 42000: FUNCTION or PROCEDURE p1 does not exist
# Let us show that GRANT behaviour for routines is consistent
# with GRANT behaviour for tables. Attempt to grant privilege
# on non-existent table also results in an error.
grant select on mysqltest_db1.t1 to mysqltest_u1;
ERROR 42S02: Table 'mysqltest_db1.t1' doesn't exist
show grants for mysqltest_u1;
Grants for mysqltest_u1@%
GRANT USAGE ON *.* TO 'mysqltest_u1'@'%'
drop database mysqltest_db1;
drop user mysqltest_u1;
......@@ -19,3 +19,5 @@ mysqld-bin.000001 # Query # # use `test`; insert t1 values (2)
mysqld-bin.000001 # Query # # COMMIT
drop table t1;
uninstall plugin innodb;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
#
# Test of MyISAM MRG tables with corrupted children.
# Tests for corrupted MyISAM tables and MyISAMMRG tables with corrupted
# children..
#
# Run with --myisam-recover=force option.
#
# Preparation: we need to make sure that the merge parent
......@@ -101,3 +103,48 @@ execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
set @@global.table_open_cache=default;
#
# 18075170 - sql node restart required to avoid deadlock after
# restore
#
# Check that auto-repair for MyISAM tables can now happen in the
# middle of transaction, without aborting it.
create table t1 (a int, key(a)) engine=myisam;
create table t2 (a int);
insert into t2 values (1);
# Create a table with a corrupted index file:
# save an old index file, insert more rows,
# overwrite the new index file with the old one.
insert into t1 (a) values (1);
flush table t1;
insert into t1 (a) values (4);
flush table t1;
# Check table is needed to mark the table as crashed.
check table t1;
Table Op Msg_type Msg_text
test.t1 check warning Size of datafile is: 14 Should be: 7
test.t1 check error Record-count is not ok; is 2 Should be: 1
test.t1 check warning Found 2 key parts. Should be: 1
test.t1 check error Corrupt
# At this point we have a corrupt t1
set autocommit = 0;
select * from t2;
a
1
# Without fix select from t1 will break the transaction. After the fix
# transaction should be active and should hold lock on table t2. Alter
# table from con2 will wait only if the transaction is not broken.
select * from t1;
a
1
4
Warnings:
Error 145 Table 't1' is marked as crashed and should be repaired
Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 1 to 2
ALTER TABLE t2 ADD val INT;
# With fix we should have alter table waiting for t2 lock here.
ROLLBACK;
SET autocommit = 1;
# Cleanup
drop table t1, t2;
......@@ -634,6 +634,9 @@ The following options may be given as the first argument:
--performance-schema-max-cond-instances=#
Maximum number of instrumented condition objects. Use 0
to disable, -1 for automated sizing.
--performance-schema-max-digest-length=#
Maximum length considered for digest text, when stored in
performance_schema tables.
--performance-schema-max-file-classes=#
Maximum number of file instruments.
--performance-schema-max-file-handles=#
......@@ -1242,6 +1245,7 @@ performance-schema-hosts-size -1
performance-schema-instrument
performance-schema-max-cond-classes 80
performance-schema-max-cond-instances -1
performance-schema-max-digest-length 1024
performance-schema-max-file-classes 50
performance-schema-max-file-handles 32768
performance-schema-max-file-instances -1
......
......@@ -5,7 +5,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example';
INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
ERROR HY000: Function 'EXAMPLE' already exists
ERROR HY000: Plugin 'EXAMPLE' already installed
UNINSTALL PLUGIN example;
INSTALL SONAME 'ha_example';
select * from information_schema.plugins where plugin_library like 'ha_example%';
......
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
drop view if exists view_t1;
Warnings:
Note 1051 Unknown table 'test.view_t1'
SET sql_mode=ONLY_FULL_GROUP_BY;
CREATE TABLE t1 (
pk INT,
f0 INT, f1 INT, f2 INT, f3 INT, f4 INT,
f5 INT, f6 INT, f7 INT, f8 INT, f9 INT,
PRIMARY KEY (pk)
);
CREATE VIEW view_t1 AS SELECT * FROM t1;
CREATE PROCEDURE s1()
SELECT * FROM (
INFORMATION_SCHEMA.`INNODB_BUFFER_PAGE_LRU` AS table1
LEFT JOIN test.view_t1 AS table2
ON ( table2.`f6` = table1.FREE_PAGE_CLOCK)
)
ORDER BY table1.NUMBER_RECORDS
LIMIT 0
;
CALL s1;
POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
CALL s1;
POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
drop table t1;
drop view view_t1;
drop procedure s1;
CREATE TABLE A (
pk INTEGER AUTO_INCREMENT,
col_int_key INTEGER,
col_varchar_key VARCHAR(1),
PRIMARY KEY (pk)
) ENGINE=MyISAM;
CREATE VIEW view_A AS SELECT * FROM A;
CREATE TABLE C (
pk INTEGER AUTO_INCREMENT,
col_int_nokey INTEGER,
col_int_key INTEGER,
col_date_key DATE,
col_date_nokey DATE,
col_time_key TIME,
col_time_nokey TIME,
col_datetime_key DATETIME,
col_datetime_nokey DATETIME,
col_varchar_key VARCHAR(1),
col_varchar_nokey VARCHAR(1),
PRIMARY KEY (pk)
) ENGINE=MyISAM;
CREATE VIEW view_C AS SELECT * FROM C;
CREATE TABLE AA (
pk INTEGER AUTO_INCREMENT,
col_int_nokey INTEGER,
col_int_key INTEGER,
col_date_key DATE,
col_date_nokey DATE,
col_time_key TIME,
col_time_nokey TIME,
col_datetime_key DATETIME,
col_datetime_nokey DATETIME,
col_varchar_key VARCHAR(1),
col_varchar_nokey VARCHAR(1),
PRIMARY KEY (pk),
KEY (col_varchar_key, col_int_key)
) ENGINE=MyISAM;
CREATE VIEW view_AA AS SELECT * FROM AA;
CREATE TABLE BB (
pk INTEGER AUTO_INCREMENT,
col_int_key INTEGER,
col_varchar_key VARCHAR(1),
col_varchar_nokey VARCHAR(1),
PRIMARY KEY (pk),
KEY (col_varchar_key, col_int_key)
) ENGINE=MyISAM;
CREATE VIEW view_BB AS SELECT * FROM BB;
CREATE TABLE DD (
pk INTEGER AUTO_INCREMENT,
col_int_key INTEGER,
col_date_key DATE,
col_time_key TIME,
col_datetime_key DATETIME,
col_varchar_key VARCHAR(1),
PRIMARY KEY (pk),
KEY (col_varchar_key, col_int_key)
) ENGINE=MyISAM;
CREATE VIEW view_DD AS SELECT * FROM DD;
CREATE TRIGGER k BEFORE INSERT ON `DD` FOR EACH ROW INSERT INTO `view_BB` SELECT * FROM `view_A` LIMIT 0 ;
CREATE TRIGGER r BEFORE INSERT ON `A` FOR EACH ROW INSERT INTO `view_AA` SELECT * FROM `view_C` LIMIT 0 ;
ALTER TABLE `DD` DROP PRIMARY KEY;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
INSERT INTO `view_A` ( `pk` ) VALUES (NULL);
INSERT INTO `DD` ( `pk` ) VALUES (NULL);
INSERT INTO `A` ( `pk` ) VALUES (NULL);
INSERT INTO `view_DD` ( `pk` ) VALUES (NULL);
drop trigger r;
drop trigger k;
drop view view_A,view_AA,view_C,view_BB,view_DD;
drop table A,C,AA,BB,DD;
CREATE TABLE A (
i INT,
i1 INT,
i2 INT,
d1 DATE,
d2 DATE,
col_time_nokey1 TIME,
col_time_nokey2 TIME,
col_datetime_nokey1 DATETIME,
col_datetime_nokey2 DATETIME,
col_varchar_nokey1 VARCHAR(1),
col_varchar_nokey2 VARCHAR(1)
) ENGINE=MyISAM;
CREATE VIEW view_A AS SELECT * FROM A;
CREATE TABLE B (
col_varchar_nokey VARCHAR(1)
) ENGINE=MyISAM;
CREATE TABLE AA (
i INT,
i1 INT,
i2 INT,
d1 DATE,
d2 DATE,
col_time_nokey1 TIME,
col_time_nokey2 TIME,
col_datetime_nokey1 DATETIME,
col_datetime_nokey2 DATETIME,
col_varchar_nokey1 VARCHAR(1),
col_varchar_nokey2 VARCHAR(1)
) ENGINE=MyISAM;
CREATE VIEW view_AA AS SELECT * FROM AA;
CREATE TABLE DD (
i INT,
i1 INT,
i2 INT,
d1 DATE,
d2 DATE,
col_time_nokey1 TIME,
col_time_nokey2 TIME,
col_datetime_nokey1 DATETIME,
col_datetime_nokey2 DATETIME,
col_varchar_nokey1 VARCHAR(1),
col_varchar_nokey2 VARCHAR(1)
) ENGINE=MyISAM;
CREATE VIEW view_DD AS SELECT * FROM DD;
CREATE TRIGGER tr1 BEFORE INSERT ON `AA` FOR EACH ROW INSERT INTO `view_A` SELECT * FROM `view_AA` LIMIT 0 ;
CREATE TRIGGER tr2 BEFORE INSERT ON `B` FOR EACH ROW INSERT INTO `D` SELECT * FROM `A` LIMIT 0 ;
INSERT INTO `view_AA` ( `i` ) VALUES (1);
INSERT INTO `AA` ( `i` ) VALUES (2);
DELETE FROM `B`;
INSERT INTO `view_DD` ( `i` ) VALUES (1);
INSERT INTO `view_AA` ( `i` ) VALUES (3);
drop trigger tr1;
drop trigger tr2;
drop view view_A, view_AA,view_DD;
drop table A,B,AA,DD;
......@@ -7858,3 +7858,56 @@ v1
DROP PROCEDURE p1;
DROP TABLE t1;
# End of 5.5 test