Merge tag 'mariadb-10.0.28' into 10.0-galera

This commit is contained in:
Nirbhay Choubey 2016-10-28 15:50:13 -04:00
commit 5db2195a35
307 changed files with 10695 additions and 5219 deletions

View File

@ -10,6 +10,7 @@ Visma http://visma.com (2015 - 2016)
Acronis http://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2014 - 2016)
Tencent Game DBA http://tencentdba.com/about (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2016)
Virtuozzo https://virtuozzo.com (2016)

View File

@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=27
MYSQL_VERSION_PATCH=28

View File

@ -245,7 +245,8 @@ static void end_pager();
static void init_tee(const char *);
static void end_tee();
static const char* construct_prompt();
static char *get_arg(char *line, my_bool get_next_arg);
enum get_arg_mode { CHECK, GET, GET_NEXT};
static char *get_arg(char *line, get_arg_mode mode);
static void init_username();
static void add_int_to_prompt(int toadd);
static int get_result_width(MYSQL_RES *res);
@ -2257,7 +2258,7 @@ static COMMANDS *find_command(char *name)
if (!my_strnncoll(&my_charset_latin1, (uchar*) name, len,
(uchar*) commands[i].name, len) &&
(commands[i].name[len] == '\0') &&
(!end || commands[i].takes_params))
(!end || (commands[i].takes_params && get_arg(name, CHECK))))
{
index= i;
break;
@ -3177,7 +3178,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
char buff[256], *param;
CHARSET_INFO * new_cs;
strmake_buf(buff, line);
param= get_arg(buff, 0);
param= get_arg(buff, GET);
if (!param || !*param)
{
return put_info("Usage: \\C charset_name | charset charset_name",
@ -4263,12 +4264,12 @@ com_connect(String *buffer, char *line)
#ifdef EXTRA_DEBUG
tmp[1]= 0;
#endif
tmp= get_arg(buff, 0);
tmp= get_arg(buff, GET);
if (tmp && *tmp)
{
my_free(current_db);
current_db= my_strdup(tmp, MYF(MY_WME));
tmp= get_arg(buff, 1);
tmp= get_arg(buff, GET_NEXT);
if (tmp)
{
my_free(current_host);
@ -4371,7 +4372,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
char buff[256], *tmp;
strmake_buf(buff, line);
tmp= get_arg(buff, 0);
tmp= get_arg(buff, GET);
if (!tmp || !*tmp)
{
@ -4402,7 +4403,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
bzero(buff, sizeof(buff));
strmake_buf(buff, line);
tmp= get_arg(buff, 0);
tmp= get_arg(buff, GET);
if (!tmp || !*tmp)
{
put_info("USE must be followed by a database name", INFO_ERROR);
@ -4487,23 +4488,22 @@ com_nowarnings(String *buffer __attribute__((unused)),
}
/*
Gets argument from a command on the command line. If get_next_arg is
not defined, skips the command and returns the first argument. The
line is modified by adding zero to the end of the argument. If
get_next_arg is defined, then the function searches for end of string
first, after found, returns the next argument and adds zero to the
end. If you ever wish to use this feature, remember to initialize all
items in the array to zero first.
Gets argument from a command on the command line. If mode is not GET_NEXT,
skips the command and returns the first argument. The line is modified by
adding zero to the end of the argument. If mode is GET_NEXT, then the
function searches for end of string first, after found, returns the next
argument and adds zero to the end. If you ever wish to use this feature,
remember to initialize all items in the array to zero first.
*/
char *get_arg(char *line, my_bool get_next_arg)
static char *get_arg(char *line, get_arg_mode mode)
{
char *ptr, *start;
my_bool quoted= 0, valid_arg= 0;
bool short_cmd= false;
char qtype= 0;
ptr= line;
if (get_next_arg)
if (mode == GET_NEXT)
{
for (; *ptr; ptr++) ;
if (*(ptr + 1))
@ -4514,7 +4514,7 @@ char *get_arg(char *line, my_bool get_next_arg)
/* skip leading white spaces */
while (my_isspace(charset_info, *ptr))
ptr++;
if (*ptr == '\\') // short command was used
if ((short_cmd= *ptr == '\\')) // short command was used
ptr+= 2;
else
while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
@ -4527,24 +4527,28 @@ char *get_arg(char *line, my_bool get_next_arg)
if (*ptr == '\'' || *ptr == '\"' || *ptr == '`')
{
qtype= *ptr;
quoted= 1;
ptr++;
}
for (start=ptr ; *ptr; ptr++)
{
if (*ptr == '\\' && ptr[1]) // escaped character
if ((*ptr == '\\' && ptr[1]) || // escaped character
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
{
// Remove the backslash
strmov_overlapp(ptr, ptr+1);
// Remove (or skip) the backslash (or a second quote)
if (mode != CHECK)
strmov_overlapp(ptr, ptr+1);
else
ptr++;
}
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
else if (*ptr == (qtype ? qtype : ' '))
{
*ptr= 0;
qtype= 0;
if (mode != CHECK)
*ptr= 0;
break;
}
}
valid_arg= ptr != start;
return valid_arg ? start : NullS;
return ptr != start && !qtype ? start : NullS;
}

View File

@ -575,9 +575,7 @@ static int dump_all_tablespaces();
static int dump_tablespaces_for_tables(char *db, char **table_names, int tables);
static int dump_tablespaces_for_databases(char** databases);
static int dump_tablespaces(char* ts_where);
static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
...);
static void print_comment(FILE *, my_bool, const char *, ...);
/*
Print the supplied message if in verbose mode
@ -655,6 +653,30 @@ static void short_usage(FILE *f)
}
/** returns a string fixed to be safely printed inside a -- comment
that is, any new line in it gets prefixed with --
*/
static const char *fix_for_comment(const char *ident)
{
static char buf[1024];
char c, *s= buf;
while ((c= *s++= *ident++))
{
if (s >= buf + sizeof(buf) - 10)
{
strmov(s, "...");
break;
}
if (c == '\n')
s= strmov(s, "-- ");
}
return buf;
}
static void write_header(FILE *sql_file, char *db_name)
{
if (opt_xml)
@ -677,8 +699,8 @@ static void write_header(FILE *sql_file, char *db_name)
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
MACHINE_TYPE);
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
current_host ? current_host : "localhost",
db_name ? db_name : "");
fix_for_comment(current_host ? current_host : "localhost"),
fix_for_comment(db_name ? db_name : ""));
print_comment(sql_file, 0,
"-- ------------------------------------------------------\n"
);
@ -2224,7 +2246,8 @@ static uint dump_events_for_db(char *db)
/* nice comments */
print_comment(sql_file, 0,
"\n--\n-- Dumping events for database '%s'\n--\n", db);
"\n--\n-- Dumping events for database '%s'\n--\n",
fix_for_comment(db));
/*
not using "mysql_query_with_error_report" because we may have not
@ -2436,7 +2459,8 @@ static uint dump_routines_for_db(char *db)
/* nice comments */
print_comment(sql_file, 0,
"\n--\n-- Dumping routines for database '%s'\n--\n", db);
"\n--\n-- Dumping routines for database '%s'\n--\n",
fix_for_comment(db));
/*
not using "mysql_query_with_error_report" because we may have not
@ -2731,11 +2755,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
if (strcmp (table_type, "VIEW") == 0) /* view */
print_comment(sql_file, 0,
"\n--\n-- Temporary table structure for view %s\n--\n\n",
result_table);
fix_for_comment(result_table));
else
print_comment(sql_file, 0,
"\n--\n-- Table structure for table %s\n--\n\n",
result_table);
fix_for_comment(result_table));
if (opt_drop)
{
@ -2977,7 +3001,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
print_comment(sql_file, 0,
"\n--\n-- Table structure for table %s\n--\n\n",
result_table);
fix_for_comment(result_table));
if (opt_drop)
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
if (!opt_xml)
@ -3684,21 +3708,21 @@ static void dump_table(char *table, char *db)
{
print_comment(md_result_file, 0,
"\n--\n-- Dumping data for table %s\n--\n",
result_table);
fix_for_comment(result_table));
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM ");
dynstr_append_checked(&query_string, result_table);
if (where)
{
print_comment(md_result_file, 0, "-- WHERE: %s\n", where);
print_comment(md_result_file, 0, "-- WHERE: %s\n", fix_for_comment(where));
dynstr_append_checked(&query_string, " WHERE ");
dynstr_append_checked(&query_string, where);
}
if (order_by)
{
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by);
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", fix_for_comment(order_by));
dynstr_append_checked(&query_string, " ORDER BY ");
dynstr_append_checked(&query_string, order_by);
@ -4208,7 +4232,7 @@ static int dump_tablespaces(char* ts_where)
if (first)
{
print_comment(md_result_file, 0, "\n--\n-- Logfile group: %s\n--\n",
row[0]);
fix_for_comment(row[0]));
fprintf(md_result_file, "\nCREATE");
}
@ -4277,7 +4301,8 @@ static int dump_tablespaces(char* ts_where)
first= 1;
if (first)
{
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n", row[0]);
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n",
fix_for_comment(row[0]));
fprintf(md_result_file, "\nCREATE");
}
else
@ -4481,7 +4506,8 @@ static int init_dumping(char *database, int init_func(char*))
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
print_comment(md_result_file, 0,
"\n--\n-- Current Database: %s\n--\n", qdatabase);
"\n--\n-- Current Database: %s\n--\n",
fix_for_comment(qdatabase));
/* Call the view or table specific function */
init_func(qdatabase);
@ -5672,7 +5698,7 @@ static my_bool get_view_structure(char *table, char* db)
print_comment(sql_file, 0,
"\n--\n-- Final view structure for view %s\n--\n\n",
result_table);
fix_for_comment(result_table));
/* Table might not exist if this view was dumped with --tab. */
fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);

View File

@ -3373,10 +3373,6 @@ void do_exec(struct st_command *command)
#endif
#endif
/* exec command is interpreted externally and will not take newlines */
while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
;
DBUG_PRINT("info", ("Executing '%s' as '%s'",
command->first_argument, ds_cmd.str));

View File

@ -221,6 +221,9 @@ SETA(CPACK_RPM_test_PACKAGE_PROVIDES
"perl(mtr_io.pl)"
"perl(mtr_match)"
"perl(mtr_misc.pl)"
"perl(mtr_gcov.pl)"
"perl(mtr_gprof.pl)"
"perl(mtr_process.pl)"
"perl(mtr_report)"
"perl(mtr_results)"
"perl(mtr_unique)")

View File

@ -30,6 +30,10 @@ IF(NOT VERSION)
SET(64BIT 1)
ENDIF()
IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
SET(DEFAULT_MACHINE "mips")
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
SET(DEFAULT_PLATFORM "win")

View File

@ -243,10 +243,9 @@ int main(int argc, char **argv)
time_t lastt; /* last time */
ulint oldcsum, oldcsumfield, csum, csumfield, crc32, logseq, logseqfield;
/* ulints for checksum storage */
struct stat st; /* for stat, if you couldn't guess */
unsigned long long int size; /* size of file (has to be 64 bits) */
ulint pages; /* number of pages in file */
off_t offset= 0;
long long offset= 0;
int fd;
printf("InnoDB offline file checksum utility.\n");
@ -269,6 +268,47 @@ int main(int argc, char **argv)
goto error;
}
#ifdef _WIN32
/* Switch off OS file buffering for the file. */
HANDLE h = CreateFile(filename, GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE, 0,
OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0);
if (!h)
{
fprintf(stderr, "Error; cant open file\n");
goto error;
}
if (!GetFileSizeEx(h, (LARGE_INTEGER *)&size))
{
fprintf(stderr, "Error; GetFileSize() failed\n");
goto error;
}
fd = _open_osfhandle ((intptr_t) h, _O_RDONLY);
if (fd < 0)
{
fprintf(stderr, "Error; _open_osfhandle() failed\n");
goto error;
}
f = _fdopen(fd, "rb");
if (!f)
{
fprintf(stderr, "Error; fdopen() failed\n");
goto error;
}
/*
Disable stdio buffering (FILE_FLAG_NO_BUFFERING requires properly IO buffers
which stdio does not guarantee.
*/
setvbuf(f, NULL, _IONBF, 0);
#else
struct stat st;
/* stat the file to get size and page count */
if (stat(filename, &st))
{
@ -279,6 +319,8 @@ int main(int argc, char **argv)
/* Open the file for reading */
f= fopen(filename, "rb");
#endif
if (f == NULL)
{
fprintf(stderr, "Error; %s cannot be opened", filename);
@ -323,7 +365,7 @@ int main(int argc, char **argv)
}
else if (verbose)
{
printf("file %s = %llu bytes (%lu pages)...\n", filename, size, pages);
printf("file %s = %llu bytes (%lu pages)...\n", filename, size, (ulong)pages);
if (do_one_page)
printf("InnoChecksum; checking page %lu\n", do_page);
else
@ -348,9 +390,12 @@ int main(int argc, char **argv)
goto error;
}
offset= (off_t)start_page * (off_t)physical_page_size;
offset= (longlong)start_page * (longlong)physical_page_size;
#ifdef _WIN32
if (_lseeki64(fd, offset, SEEK_SET) != offset)
#else
if (lseek(fd, offset, SEEK_SET) != offset)
#endif
{
perror("Error; Unable to seek to necessary offset");
goto error;

View File

@ -12,6 +12,24 @@ before calling SSL_new();
*** end Note ***
yaSSL Release notes, version 2.4.2 (9/22/2016)
This release of yaSSL fixes a medium security vulnerability. A fix for
potential AES side channel leaks is included that a local user monitoring
the same CPU core cache could exploit. VM users, hyper-threading users,
and users where potential attackers have access to the CPU cache will need
to update if they utilize AES.
DSA padding fixes for unusual sizes is included as well. Users with DSA
certficiates should update.
yaSSL Release notes, version 2.4.0 (5/20/2016)
This release of yaSSL fixes the OpenSSL compatibility function
SSL_CTX_load_verify_locations() when using the path directory to allow
unlimited path sizes. Minor Windows build fixes are included.
No high level security fixes in this version but we always recommend
updating.
yaSSL Release notes, version 2.3.9b (2/03/2016)
This release of yaSSL fixes the OpenSSL compatibility function
X509_NAME_get_index_by_NID() to use the actual index of the common name

View File

@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDqzCCA2ugAwIBAgIJAMGqrgDU6DyhMAkGByqGSM44BAMwgY4xCzAJBgNVBAYT
MIIDrzCCA2+gAwIBAgIJAK1zRM7YFcNjMAkGByqGSM44BAMwgZAxCzAJBgNVBAYT
AlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQK
DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wu
Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTEzMDQyMjIw
MDk0NFoXDTE2MDExNzIwMDk0NFowgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP
cmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYD
VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQYJKoZIhvcN
AQkBFhBpbmZvQHdvbGZzc2wuY29tMIIBuDCCASwGByqGSM44BAEwggEfAoGBAL1R
7koy4IrH6sbh6nDEUUPPKgfhxxLCWCVexF2+qzANEr+hC9M002haJXFOfeS9DyoO
WFbL0qMZOuqv+22CaHnoUWl7q3PjJOAI3JH0P54ZyUPuU1909RzgTdIDp5+ikbr7
KYjnltL73FQVMbjTZQKthIpPn3MjYcF+4jp2W2zFAhUAkcntYND6MGf+eYzIJDN2
L7SonHUCgYEAklpxErfqznIZjVvqqHFaq+mgAL5J8QrKVmdhYZh/Y8z4jCjoCA8o
TDoFKxf7s2ZzgaPKvglaEKiYqLqic9qY78DYJswzQMLFvjsF4sFZ+pYCBdWPQI4N
PgxCiznK6Ce+JH9ikSBvMvG+tevjr2UpawDIHX3+AWYaZBZwKADAaboDgYUAAoGB
AJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caaDDa0XJ7ak6A7
TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WXS0kk3m/DHaC0
3ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVo1AwTjAdBgNVHQ4EFgQU
IJjk416o4v8qpH9LBtXlR9v8gccwHwYDVR0jBBgwFoAUIJjk416o4v8qpH9LBtXl
R9v8gccwDAYDVR0TBAUwAwEB/zAJBgcqhkjOOAQDAy8AMCwCFCjGKIdOSV12LcTu
k08owGM6YkO1AhQe+K173VuaO/OsDNsxZlKpyH8+1g==
DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTYwOTIy
MjEyMzA0WhcNMjIwMzE1MjEyMzA0WjCBkDELMAkGA1UEBhMCVVMxDzANBgNVBAgM
Bk9yZWdvbjERMA8GA1UEBwwIUG9ydGxhbmQxEDAOBgNVBAoMB3dvbGZTU0wxEDAO
BgNVBAsMB3Rlc3RpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCAbgwggEsBgcqhkjOOAQBMIIBHwKB
gQC9Ue5KMuCKx+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvTNNNoWiVxTn3k
vQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNfdPUc4E3SA6ef
opG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ7WDQ+jBn/nmM
yCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZnYWGYf2PM+Iwo
6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47BeLBWfqWAgXV
j0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQWcCgAwGm6A4GF
AAKBgQCdy2PPch8r0P07EOs5WG6L425P6IJ3bDKj3TVLy+Ebj04CT/3Gmgw2tFye
2pOgO0yfkIXizcDl6GT2CQuBBhUgwF6WJ4hoW1iK1UwhnupZmQ358eNFl0tJJN5v
wx2gtNxJSwIsm8VRscqqFH2092b9ScH7VjLoqhx+bgA4XV7l1aNQME4wHQYDVR0O
BBYEFCCY5ONeqOL/KqR/SwbV5Ufb/IHHMB8GA1UdIwQYMBaAFCCY5ONeqOL/KqR/
SwbV5Ufb/IHHMAwGA1UdEwQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhQRYSCVN/Ge
agV3mffU3qNZ92fI0QIUPH7Jp+iASI7U1ocaYDc10qXGaGY=
-----END CERTIFICATE-----

View File

@ -34,7 +34,7 @@
#include "rsa.h"
#define YASSL_VERSION "2.3.9b"
#define YASSL_VERSION "2.4.2"
#if defined(__cplusplus)

View File

@ -162,7 +162,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
TaoCrypt::DSA_PrivateKey dsaKey;
dsaKey.Initialize(dsaSource);
if (rsaSource.GetError().What()) {
if (dsaSource.GetError().What()) {
// neither worked
ret = SSL_FAILURE;
}
@ -785,40 +785,67 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
char name[MAX_PATH + 1]; // directory specification
strncpy(name, path, MAX_PATH - 3);
strncat(name, "\\*", 3);
const int DELIMITER_SZ = 2;
const int DELIMITER_STAR_SZ = 3;
int pathSz = (int)strlen(path);
int nameSz = pathSz + DELIMITER_STAR_SZ + 1; // plus 1 for terminator
char* name = NEW_YS char[nameSz]; // directory specification
memset(name, 0, nameSz);
strncpy(name, path, nameSz - DELIMITER_STAR_SZ - 1);
strncat(name, "\\*", DELIMITER_STAR_SZ);
hFind = FindFirstFile(name, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE) return SSL_BAD_PATH;
if (hFind == INVALID_HANDLE_VALUE) {
ysArrayDelete(name);
return SSL_BAD_PATH;
}
do {
if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
strncpy(name, path, MAX_PATH - 2 - HALF_PATH);
strncat(name, "\\", 2);
strncat(name, FindFileData.cFileName, HALF_PATH);
if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
int curSz = (int)strlen(FindFileData.cFileName);
if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
ysArrayDelete(name);
// plus 1 for terminator
nameSz = pathSz + curSz + DELIMITER_SZ + 1;
name = NEW_YS char[nameSz];
}
memset(name, 0, nameSz);
strncpy(name, path, nameSz - curSz - DELIMITER_SZ - 1);
strncat(name, "\\", DELIMITER_SZ);
strncat(name, FindFileData.cFileName,
nameSz - pathSz - DELIMITER_SZ - 1);
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
}
} while (ret == SSL_SUCCESS && FindNextFile(hFind, &FindFileData));
ysArrayDelete(name);
FindClose(hFind);
#else // _WIN32
const int MAX_PATH = 260;
DIR* dir = opendir(path);
if (!dir) return SSL_BAD_PATH;
struct dirent* entry;
struct stat buf;
char name[MAX_PATH + 1];
const int DELIMITER_SZ = 1;
int pathSz = (int)strlen(path);
int nameSz = pathSz + DELIMITER_SZ + 1; //plus 1 for null terminator
char* name = NEW_YS char[nameSz]; // directory specification
while (ret == SSL_SUCCESS && (entry = readdir(dir))) {
strncpy(name, path, MAX_PATH - 1 - HALF_PATH);
strncat(name, "/", 1);
strncat(name, entry->d_name, HALF_PATH);
int curSz = (int)strlen(entry->d_name);
if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
ysArrayDelete(name);
nameSz = pathSz + DELIMITER_SZ + curSz + 1;
name = NEW_YS char[nameSz];
}
memset(name, 0, nameSz);
strncpy(name, path, nameSz - curSz - 1);
strncat(name, "/", DELIMITER_SZ);
strncat(name, entry->d_name, nameSz - pathSz - DELIMITER_SZ - 1);
if (stat(name, &buf) < 0) {
ysArrayDelete(name);
closedir(dir);
return SSL_BAD_STAT;
}
@ -827,6 +854,7 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
}
ysArrayDelete(name);
closedir(dir);
#endif

View File

@ -60,6 +60,7 @@ private:
static const word32 Te[5][256];
static const word32 Td[5][256];
static const byte CTd4[256];
static const word32* Te0;
static const word32* Te1;
@ -80,11 +81,68 @@ private:
void ProcessAndXorBlock(const byte*, const byte*, byte*) const;
word32 PreFetchTe() const;
word32 PreFetchTd() const;
word32 PreFetchCTd4() const;
AES(const AES&); // hide copy
AES& operator=(const AES&); // and assign
};
#if defined(__x86_64__) || defined(_M_X64) || \
(defined(__ILP32__) && (__ILP32__ >= 1))
#define TC_CACHE_LINE_SZ 64
#else
/* default cache line size */
#define TC_CACHE_LINE_SZ 32
#endif
inline word32 AES::PreFetchTe() const
{
word32 x = 0;
/* 4 tables of 256 entries */
for (int i = 0; i < 4; i++) {
/* each entry is 4 bytes */
for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
x &= Te[i][j];
}
}
return x;
}
inline word32 AES::PreFetchTd() const
{
word32 x = 0;
/* 4 tables of 256 entries */
for (int i = 0; i < 4; i++) {
/* each entry is 4 bytes */
for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
x &= Td[i][j];
}
}
return x;
}
inline word32 AES::PreFetchCTd4() const
{
word32 x = 0;
int i;
for (i = 0; i < 256; i += TC_CACHE_LINE_SZ) {
x &= CTd4[i];
}
return x;
}
typedef BlockCipher<ENCRYPTION, AES, ECB> AES_ECB_Encryption;
typedef BlockCipher<DECRYPTION, AES, ECB> AES_ECB_Decryption;

View File

@ -119,6 +119,9 @@ namespace TaoCrypt {
#ifdef _WIN32
#undef max // avoid name clash
#endif
// general MAX
template<typename T> inline
const T& max(const T& a, const T& b)

View File

@ -109,10 +109,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
{
temp = rk[3];
rk[4] = rk[0] ^
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
@ -128,10 +128,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
{
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
@ -149,10 +149,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
{
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
@ -161,10 +161,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
break;
temp = rk[11];
rk[12] = rk[ 4] ^
(Te4[GETBYTE(temp, 3)] & 0xff000000) ^
(Te4[GETBYTE(temp, 2)] & 0x00ff0000) ^
(Te4[GETBYTE(temp, 1)] & 0x0000ff00) ^
(Te4[GETBYTE(temp, 0)] & 0x000000ff);
(Te2[GETBYTE(temp, 3)] & 0xff000000) ^
(Te3[GETBYTE(temp, 2)] & 0x00ff0000) ^
(Te0[GETBYTE(temp, 1)] & 0x0000ff00) ^
(Te1[GETBYTE(temp, 0)] & 0x000000ff);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
@ -191,25 +191,25 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
for (i = 1; i < rounds_; i++) {
rk += 4;
rk[0] =
Td0[Te4[GETBYTE(rk[0], 3)] & 0xff] ^
Td1[Te4[GETBYTE(rk[0], 2)] & 0xff] ^
Td2[Te4[GETBYTE(rk[0], 1)] & 0xff] ^
Td3[Te4[GETBYTE(rk[0], 0)] & 0xff];
Td0[Te1[GETBYTE(rk[0], 3)] & 0xff] ^
Td1[Te1[GETBYTE(rk[0], 2)] & 0xff] ^
Td2[Te1[GETBYTE(rk[0], 1)] & 0xff] ^
Td3[Te1[GETBYTE(rk[0], 0)] & 0xff];
rk[1] =
Td0[Te4[GETBYTE(rk[1], 3)] & 0xff] ^
Td1[Te4[GETBYTE(rk[1], 2)] & 0xff] ^
Td2[Te4[GETBYTE(rk[1], 1)] & 0xff] ^
Td3[Te4[GETBYTE(rk[1], 0)] & 0xff];
Td0[Te1[GETBYTE(rk[1], 3)] & 0xff] ^
Td1[Te1[GETBYTE(rk[1], 2)] & 0xff] ^
Td2[Te1[GETBYTE(rk[1], 1)] & 0xff] ^
Td3[Te1[GETBYTE(rk[1], 0)] & 0xff];
rk[2] =
Td0[Te4[GETBYTE(rk[2], 3)] & 0xff] ^
Td1[Te4[GETBYTE(rk[2], 2)] & 0xff] ^
Td2[Te4[GETBYTE(rk[2], 1)] & 0xff] ^
Td3[Te4[GETBYTE(rk[2], 0)] & 0xff];
Td0[Te1[GETBYTE(rk[2], 3)] & 0xff] ^
Td1[Te1[GETBYTE(rk[2], 2)] & 0xff] ^
Td2[Te1[GETBYTE(rk[2], 1)] & 0xff] ^
Td3[Te1[GETBYTE(rk[2], 0)] & 0xff];
rk[3] =
Td0[Te4[GETBYTE(rk[3], 3)] & 0xff] ^
Td1[Te4[GETBYTE(rk[3], 2)] & 0xff] ^
Td2[Te4[GETBYTE(rk[3], 1)] & 0xff] ^
Td3[Te4[GETBYTE(rk[3], 0)] & 0xff];
Td0[Te1[GETBYTE(rk[3], 3)] & 0xff] ^
Td1[Te1[GETBYTE(rk[3], 2)] & 0xff] ^
Td2[Te1[GETBYTE(rk[3], 1)] & 0xff] ^
Td3[Te1[GETBYTE(rk[3], 0)] & 0xff];
}
}
}
@ -244,6 +244,7 @@ void AES::encrypt(const byte* inBlock, const byte* xorBlock,
s2 ^= rk[2];
s3 ^= rk[3];
s0 |= PreFetchTe();
/*
* Nr - 1 full rounds:
*/
@ -312,28 +313,28 @@ void AES::encrypt(const byte* inBlock, const byte* xorBlock,
*/
s0 =
(Te4[GETBYTE(t0, 3)] & 0xff000000) ^
(Te4[GETBYTE(t1, 2)] & 0x00ff0000) ^
(Te4[GETBYTE(t2, 1)] & 0x0000ff00) ^
(Te4[GETBYTE(t3, 0)] & 0x000000ff) ^
(Te2[GETBYTE(t0, 3)] & 0xff000000) ^
(Te3[GETBYTE(t1, 2)] & 0x00ff0000) ^
(Te0[GETBYTE(t2, 1)] & 0x0000ff00) ^
(Te1[GETBYTE(t3, 0)] & 0x000000ff) ^
rk[0];
s1 =
(Te4[GETBYTE(t1, 3)] & 0xff000000) ^
(Te4[GETBYTE(t2, 2)] & 0x00ff0000) ^
(Te4[GETBYTE(t3, 1)] & 0x0000ff00) ^
(Te4[GETBYTE(t0, 0)] & 0x000000ff) ^
(Te2[GETBYTE(t1, 3)] & 0xff000000) ^
(Te3[GETBYTE(t2, 2)] & 0x00ff0000) ^
(Te0[GETBYTE(t3, 1)] & 0x0000ff00) ^
(Te1[GETBYTE(t0, 0)] & 0x000000ff) ^
rk[1];
s2 =
(Te4[GETBYTE(t2, 3)] & 0xff000000) ^
(Te4[GETBYTE(t3, 2)] & 0x00ff0000) ^
(Te4[GETBYTE(t0, 1)] & 0x0000ff00) ^
(Te4[GETBYTE(t1, 0)] & 0x000000ff) ^
(Te2[GETBYTE(t2, 3)] & 0xff000000) ^
(Te3[GETBYTE(t3, 2)] & 0x00ff0000) ^
(Te0[GETBYTE(t0, 1)] & 0x0000ff00) ^
(Te1[GETBYTE(t1, 0)] & 0x000000ff) ^
rk[2];
s3 =
(Te4[GETBYTE(t3, 3)] & 0xff000000) ^
(Te4[GETBYTE(t0, 2)] & 0x00ff0000) ^
(Te4[GETBYTE(t1, 1)] & 0x0000ff00) ^
(Te4[GETBYTE(t2, 0)] & 0x000000ff) ^
(Te2[GETBYTE(t3, 3)] & 0xff000000) ^
(Te3[GETBYTE(t0, 2)] & 0x00ff0000) ^
(Te0[GETBYTE(t1, 1)] & 0x0000ff00) ^
(Te1[GETBYTE(t2, 0)] & 0x000000ff) ^
rk[3];
@ -358,6 +359,8 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock,
s2 ^= rk[2];
s3 ^= rk[3];
s0 |= PreFetchTd();
/*
* Nr - 1 full rounds:
*/
@ -423,29 +426,32 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock,
* apply last round and
* map cipher state to byte array block:
*/
t0 |= PreFetchCTd4();
s0 =
(Td4[GETBYTE(t0, 3)] & 0xff000000) ^
(Td4[GETBYTE(t3, 2)] & 0x00ff0000) ^
(Td4[GETBYTE(t2, 1)] & 0x0000ff00) ^
(Td4[GETBYTE(t1, 0)] & 0x000000ff) ^
((word32)CTd4[GETBYTE(t0, 3)] << 24) ^
((word32)CTd4[GETBYTE(t3, 2)] << 16) ^
((word32)CTd4[GETBYTE(t2, 1)] << 8) ^
((word32)CTd4[GETBYTE(t1, 0)]) ^
rk[0];
s1 =
(Td4[GETBYTE(t1, 3)] & 0xff000000) ^
(Td4[GETBYTE(t0, 2)] & 0x00ff0000) ^
(Td4[GETBYTE(t3, 1)] & 0x0000ff00) ^
(Td4[GETBYTE(t2, 0)] & 0x000000ff) ^
((word32)CTd4[GETBYTE(t1, 3)] << 24) ^
((word32)CTd4[GETBYTE(t0, 2)] << 16) ^
((word32)CTd4[GETBYTE(t3, 1)] << 8) ^
((word32)CTd4[GETBYTE(t2, 0)]) ^
rk[1];
s2 =
(Td4[GETBYTE(t2, 3)] & 0xff000000) ^
(Td4[GETBYTE(t1, 2)] & 0x00ff0000) ^
(Td4[GETBYTE(t0, 1)] & 0x0000ff00) ^
(Td4[GETBYTE(t3, 0)] & 0x000000ff) ^
((word32)CTd4[GETBYTE(t2, 3)] << 24 ) ^
((word32)CTd4[GETBYTE(t1, 2)] << 16 ) ^
((word32)CTd4[GETBYTE(t0, 1)] << 8 ) ^
((word32)CTd4[GETBYTE(t3, 0)]) ^
rk[2];
s3 =
(Td4[GETBYTE(t3, 3)] & 0xff000000) ^
(Td4[GETBYTE(t2, 2)] & 0x00ff0000) ^
(Td4[GETBYTE(t1, 1)] & 0x0000ff00) ^
(Td4[GETBYTE(t0, 0)] & 0x000000ff) ^
((word32)CTd4[GETBYTE(t3, 3)] << 24) ^
((word32)CTd4[GETBYTE(t2, 2)] << 16) ^
((word32)CTd4[GETBYTE(t1, 1)] << 8) ^
((word32)CTd4[GETBYTE(t0, 0)]) ^
rk[3];
gpBlock::Put(xorBlock, outBlock)(s0)(s1)(s2)(s3);
@ -1826,18 +1832,52 @@ const word32 AES::Td[5][256] = {
}
};
const byte AES::CTd4[256] =
{
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
};
const word32* AES::Te0 = AES::Te[0];
const word32* AES::Te1 = AES::Te[1];
const word32* AES::Te2 = AES::Te[2];
const word32* AES::Te3 = AES::Te[3];
const word32* AES::Te4 = AES::Te[4];
const word32* AES::Td0 = AES::Td[0];
const word32* AES::Td1 = AES::Td[1];
const word32* AES::Td2 = AES::Td[2];
const word32* AES::Td3 = AES::Td[3];
const word32* AES::Td4 = AES::Td[4];

View File

@ -1219,17 +1219,17 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
}
word32 rLen = GetLength(source);
if (rLen != 20) {
if (rLen == 21) { // zero at front, eat
while (rLen > 20 && source.remaining() > 0) { // zero's at front, eat
source.next();
--rLen;
}
else if (rLen == 19) { // add zero to front so 20 bytes
if (rLen < 20) { // add zero's to front so 20 bytes
word32 tmpLen = rLen;
while (tmpLen < 20) {
decoded[0] = 0;
decoded++;
tmpLen++;
}
else {
source.SetError(DSA_SZ_E);
return 0;
}
}
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
@ -1242,17 +1242,17 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
}
word32 sLen = GetLength(source);
if (sLen != 20) {
if (sLen == 21) {
source.next(); // zero at front, eat
while (sLen > 20 && source.remaining() > 0) {
source.next(); // zero's at front, eat
--sLen;
}
else if (sLen == 19) {
decoded[rLen] = 0; // add zero to front so 20 bytes
if (sLen < 20) { // add zero's to front so 20 bytes
word32 tmpLen = sLen;
while (tmpLen < 20) {
decoded[rLen] = 0;
decoded++;
tmpLen++;
}
else {
source.SetError(DSA_SZ_E);
return 0;
}
}
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);

View File

@ -172,6 +172,7 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig,
const Integer& q = key_.GetSubGroupOrder();
const Integer& g = key_.GetSubGroupGenerator();
const Integer& x = key_.GetPrivatePart();
byte* tmpPtr = sig; // initial signature output
Integer k(rng, 1, q - 1);
@ -187,22 +188,23 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig,
return (word32) -1;
int rSz = r_.ByteCount();
int tmpSz = rSz;
if (rSz == 19) {
sig[0] = 0;
sig++;
while (tmpSz++ < SHA::DIGEST_SIZE) {
*sig++ = 0;
}
r_.Encode(sig, rSz);
sig = tmpPtr + SHA::DIGEST_SIZE; // advance sig output to s
int sSz = s_.ByteCount();
tmpSz = sSz;
if (sSz == 19) {
sig[rSz] = 0;
sig++;
while (tmpSz++ < SHA::DIGEST_SIZE) {
*sig++ = 0;
}
s_.Encode(sig + rSz, sSz);
s_.Encode(sig, sSz);
return 40;
}

View File

@ -193,8 +193,9 @@ DWord() {}
"a" (a), "rm" (b) : "cc");
#elif defined(__mips64)
__asm__("dmultu %2,%3" : "=d" (r.halfs_.high), "=l" (r.halfs_.low)
: "r" (a), "r" (b));
unsigned __int128 t = (unsigned __int128) a * b;
r.halfs_.high = t >> 64;
r.halfs_.low = (word) t;
#elif defined(_M_IX86)
// for testing

View File

@ -1281,6 +1281,9 @@ int dsa_test()
if (!verifier.Verify(digest, decoded))
return -90;
if (!verifier.Verify(digest, signature))
return -91;
return 0;
}

View File

@ -22,7 +22,6 @@
#define yaSSL_TEST_HPP
#include "runtime.hpp"
#include "openssl/ssl.h" /* openssl compatibility test */
#include "error.hpp"
#include <stdio.h>
#include <stdlib.h>
@ -56,6 +55,7 @@
#endif
#define SOCKET_T int
#endif /* _WIN32 */
#include "openssl/ssl.h" /* openssl compatibility test */
#ifdef _MSC_VER

View File

@ -27,19 +27,9 @@
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((const long *) (A)))
#define uint2korr(A) (*((const uint16 *) (A)))
/*
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
It means, that you have to provide enough allocated space.
*/
#if defined(HAVE_valgrind) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
#else
#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF)
#endif
#define uint4korr(A) (*((const uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\

View File

@ -27,17 +27,9 @@
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (int32) (*((int32 *) (A)))
#define uint2korr(A) (uint16) (*((uint16 *) (A)))
/*
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
It means, that you have to provide enough allocated space.
*/
#if defined(HAVE_valgrind) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
#else
#define uint3korr(A) (uint32) (*((unsigned int *) (A)) & 0xFFFFFF)
#endif
#define uint4korr(A) (uint32) (*((uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\

View File

@ -888,8 +888,7 @@ typedef long long my_ptrdiff_t;
and related routines are refactored.
*/
#define my_offsetof(TYPE, MEMBER) \
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)
#define NullS (char *) 0

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
Copyright (c) 2010, 2016, Monty Program Ab.
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
@ -271,7 +271,7 @@ extern my_bool my_use_symdir;
extern ulong my_default_record_cache_size;
extern my_bool my_disable_locking, my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern my_bool my_disable_sync;
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
extern my_bool timed_mutexes;

View File

@ -450,8 +450,9 @@ void read_user_name(char *name)
void read_user_name(char *name)
{
char *str=getenv("USER"); /* ODBC will send user variable */
strmake(name,str ? str : "ODBC", USERNAME_LENGTH);
DWORD len= USERNAME_LENGTH;
if (!GetUserName(name, &len))
strmov(name,"UNKNOWN_USER");
}
#endif

View File

@ -52,7 +52,7 @@ eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix';
# Use '/' instead of '\' in the error message. On windows platform, dir is
# formed with '\'.
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /17/39/ /File exists/Directory not empty/
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /93/39/ /17/39/ /247/39/ /File exists/Directory not empty/
--error 1010
DROP DATABASE testing_1;
let $wait_binlog_event= DROP TABLE IF EXIST;

View File

@ -341,6 +341,7 @@ while ($1)
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
analyze table t1;
# to test the bug, the following must use "sort_union":
--replace_column 9 REF

View File

@ -60,12 +60,12 @@
perl;
use strict;
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{'SEARCH_RANGE'};
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{'SEARCH_RANGE'};
my $file_content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
if ($search_range >= 0) {
read(FILE, $file_content, $search_range, 0);
} else {
@ -75,7 +75,10 @@ perl;
read(FILE, $file_content, -$search_range, 0);
}
close(FILE);
if ( not $file_content =~ m{$search_pattern} ) {
die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
$search_file =~ s{^.*?([^/\\]+)$}{$1};
if ($file_content =~ m{$search_pattern}) {
print "FOUND /$search_pattern/ in $search_file\n"
} else {
print "NOT FOUND /$search_pattern/ in $search_file\n"
}
EOF

View File

@ -261,11 +261,7 @@ sub show {
# On Windows, rely on cdb to be there...
if (IS_WINDOWS)
{
# Starting cdb is unsafe when used with --parallel > 1 option
if ( $parallel < 2 )
{
_cdb($core_name);
}
_cdb($core_name);
return;
}

View File

@ -24,7 +24,7 @@ use File::Path;
use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
native_path posix_path mixed_path
check_socket_path_length process_alive);
check_socket_path_length process_alive open_for_append);
BEGIN {
if ($^O eq "cygwin") {
@ -161,4 +161,51 @@ sub process_alive {
}
use Symbol qw( gensym );
use if $^O eq 'MSWin32', 'Win32API::File', qw( CloseHandle CreateFile GetOsFHandle OsFHandleOpen OPEN_ALWAYS FILE_APPEND_DATA
FILE_SHARE_READ FILE_SHARE_WRITE FILE_SHARE_DELETE );
use if $^O eq 'MSWin32', 'Win32::API';
use constant WIN32API_FILE_NULL => [];
# Open a file for append
# On Windows we use CreateFile with FILE_APPEND_DATA
# to insure that writes are atomic, not interleaved
# with writes by another processes.
sub open_for_append
{
my ($file) = @_;
my $fh = gensym();
if (IS_WIN32PERL)
{
my $handle;
if (!($handle = CreateFile(
$file,
FILE_APPEND_DATA(),
FILE_SHARE_READ()|FILE_SHARE_WRITE()|FILE_SHARE_DELETE(),
WIN32API_FILE_NULL,
OPEN_ALWAYS(),# Create if doesn't exist.
0,
WIN32API_FILE_NULL,
)))
{
return undef;
}
if (!OsFHandleOpen($fh, $handle, 'wat'))
{
CloseHandle($handle);
return undef;
}
return $fh;
}
open($fh,">>",$file) or return undef;
return $fh;
}
1;

View File

@ -60,8 +60,6 @@ use My::Test;
use My::Find;
use My::Suite;
require "mtr_misc.pl";
# locate plugin suites, depending on whether it's a build tree or installed
my @plugin_suitedirs;
my $plugin_suitedir_regex;
@ -1122,7 +1120,7 @@ sub get_tags_from_file($$) {
$file_to_tags{$file}= $tags;
$file_to_master_opts{$file}= $master_opts;
$file_to_slave_opts{$file}= $slave_opts;
$file_combinations{$file}= [ uniq(@combinations) ];
$file_combinations{$file}= [ ::uniq(@combinations) ];
$file_in_overlay{$file} = 1 if $in_overlay;
return @{$tags};
}

View File

@ -21,6 +21,7 @@
use strict;
use Carp;
use My::Platform;
sub mtr_fromfile ($);
sub mtr_tofile ($@);
@ -45,10 +46,10 @@ sub mtr_fromfile ($) {
sub mtr_tofile ($@) {
my $file= shift;
open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!");
print FILE join("", @_);
close FILE;
my $fh= open_for_append $file;
mtr_error("can't open file \"$file\": $!") unless defined($fh);
print $fh join("", @_);
close $fh;
}

View File

@ -34,7 +34,6 @@ use mtr_match;
use My::Platform;
use POSIX qw[ _exit ];
use IO::Handle qw[ flush ];
require "mtr_io.pl";
use mtr_results;
my $tot_real_time= 0;
@ -92,7 +91,7 @@ sub mtr_report_test_passed ($) {
my $timer_str= "";
if ( $timer and -f "$::opt_vardir/log/timer" )
{
$timer_str= mtr_fromfile("$::opt_vardir/log/timer");
$timer_str= ::mtr_fromfile("$::opt_vardir/log/timer");
$tinfo->{timer}= $timer_str;
resfile_test_info('duration', $timer_str) if $::opt_resfile;
}

View File

@ -102,11 +102,11 @@ use mtr_results;
use IO::Socket::INET;
use IO::Select;
require "lib/mtr_process.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
require "lib/mtr_gprof.pl";
require "lib/mtr_misc.pl";
require "mtr_process.pl";
require "mtr_io.pl";
require "mtr_gcov.pl";
require "mtr_gprof.pl";
require "mtr_misc.pl";
$SIG{INT}= sub { mtr_error("Got ^C signal"); };
$SIG{HUP}= sub { mtr_error("Hangup detected on controlling terminal"); };

View File

@ -2021,3 +2021,58 @@ ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
Warnings:
Note 1061 Multiple primary key defined
DROP TABLE t1;
#
# MDEV-11126 Crash while altering persistent virtual column
#
CREATE TABLE `tab1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`field2` set('option1','option2','option3','option4') NOT NULL,
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
`field4` set('option1','option2','option3','option4') NOT NULL,
`field5` varchar(32) NOT NULL,
`field6` varchar(32) NOT NULL,
`field7` varchar(32) NOT NULL,
`field8` varchar(32) NOT NULL,
`field9` int(11) NOT NULL DEFAULT '1',
`field10` varchar(16) NOT NULL,
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
`v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=latin1;
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128);
SHOW CREATE TABLE `tab1`;
Table Create Table
tab1 CREATE TABLE `tab1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`field2` set('option1','option2','option3','option4') NOT NULL,
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
`field4` set('option1','option2','option3','option4') NOT NULL,
`field5` varchar(32) NOT NULL,
`field6` varchar(32) NOT NULL,
`field7` varchar(32) NOT NULL,
`field8` varchar(32) NOT NULL,
`field9` int(11) NOT NULL DEFAULT '1',
`field10` varchar(16) NOT NULL,
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
`v_col` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT;
SHOW CREATE TABLE `tab1`;
Table Create Table
tab1 CREATE TABLE `tab1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`field2` set('option1','option2','option3','option4') NOT NULL,
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
`field4` set('option1','option2','option3','option4') NOT NULL,
`field5` varchar(32) NOT NULL,
`field6` varchar(32) NOT NULL,
`field7` varchar(32) NOT NULL,
`field8` varchar(32) NOT NULL,
`field9` int(11) NOT NULL DEFAULT '1',
`field10` varchar(16) NOT NULL,
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
`v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `tab1`;

View File

@ -9,6 +9,7 @@ Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation
Verkkokauppa.com https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com/ Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about/ Bronze Sponsor of the MariaDB Foundation
Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction

View File

@ -442,3 +442,14 @@ KILL QUERY con_id;
ERROR 70100: Query execution was interrupted
drop table t1;
DROP TABLE t2;
#
# MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()
#
CREATE TABLE t1(a INT);
CREATE FUNCTION f1() RETURNS VARCHAR(16383) RETURN 'test';
CREATE OR REPLACE TABLE t1 AS SELECT f1();
LOCK TABLE t1 WRITE;
CREATE OR REPLACE TABLE t1 AS SELECT f1();
UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;

View File

@ -1658,6 +1658,9 @@ CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061))
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
1
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
c
FFFF0000
#
# End of 5.5 tests
#

View File

@ -209,3 +209,9 @@ INSERT INTO table1 VALUES (1);
ERROR 42S02: Unknown table 't.notable'
DROP TABLE table1,table2;
# End BUG#34750
#
# MDEV-11105 Table named 'db' has weird side effect.
#
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.db(id INT);
DROP DATABASE mysqltest;

View File

@ -286,3 +286,19 @@ F 28 28
F 29 29
F 30 30
DROP TABLE t0,t1,t2;
#
# MDEV-MariaDB daemon leaks memory with specific query
#
CREATE TABLE t1 (`voter_id` int(11) unsigned NOT NULL,
`language_id` int(11) unsigned NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE t2 (`voter_id` int(10) unsigned NOT NULL DEFAULT '0',
`serialized_c` mediumblob) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into t2 values (1,repeat("a",1000)),(2,repeat("a",1000)),(3,repeat("b",1000)),(4,repeat("c",1000)),(4,repeat("b",1000));
SELECT GROUP_CONCAT(t1.language_id SEPARATOR ',') AS `translation_resources`, `d`.`serialized_c` FROM t2 AS `d` LEFT JOIN t1 ON `d`.`voter_id` = t1.`voter_id` GROUP BY `d`.`voter_id` ORDER BY 10-d.voter_id+RAND()*0;
translation_resources serialized_c
NULL cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
NULL bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
NULL aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
NULL aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
drop table t1,t2;

View File

@ -311,6 +311,9 @@ set @d=@d*2;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL REF Using sort_union(i3,i2); Using where

View File

@ -1146,6 +1146,9 @@ set @d=@d*2;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL REF Using sort_union(i3,i2); Using where

View File

@ -1004,19 +1004,19 @@ show grants;
Grants for user3@localhost
GRANT USAGE ON *.* TO 'user3'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
select * from information_schema.column_privileges where grantee like '%user%'
select * from information_schema.column_privileges where grantee like '\'user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'user1'@'localhost' def mysqltest t1 f1 SELECT NO
select * from information_schema.table_privileges where grantee like '%user%'
select * from information_schema.table_privileges where grantee like '\'user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'user2'@'localhost' def mysqltest t2 SELECT NO
select * from information_schema.schema_privileges where grantee like '%user%'
select * from information_schema.schema_privileges where grantee like '\'user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'user3'@'localhost' def mysqltest SELECT NO
select * from information_schema.user_privileges where grantee like '%user%'
select * from information_schema.user_privileges where grantee like '\'user%'
order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user1'@'localhost' def USAGE NO

View File

@ -1,3 +1,4 @@
#
# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
#
FOUND /\[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names/ in my_restart.err

View File

@ -3832,6 +3832,23 @@ test.m1 repair error Corrupt
# Clean-up.
drop tables m1, t1, t4;
drop view t3;
#
# MDEV-10424 - Assertion `ticket == __null' failed in
# MDL_request::set_type
#
CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
CREATE TABLE tmerge (f1 INT) ENGINE=MERGE UNION=(t1);
PREPARE stmt FROM "ANALYZE TABLE tmerge, t1";
EXECUTE stmt;
Table Op Msg_type Msg_text
test.tmerge analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status Table is already up to date
EXECUTE stmt;
Table Op Msg_type Msg_text
test.tmerge analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status Table is already up to date
DEALLOCATE PREPARE stmt;
DROP TABLE t1, tmerge;
End of 5.5 tests
#
# Additional coverage for refactoring which is made as part

View File

@ -512,6 +512,14 @@ DROP DATABASE connected_db;
create database `aa``bb````cc`;
DATABASE()
aa`bb``cc
DATABASE()
test
DATABASE()
aa`bb``cc
DATABASE()
test
DATABASE()
aa`bb``cc
drop database `aa``bb````cc`;
a
>>\ndelimiter\n<<

View File

@ -3,3 +3,9 @@ a
1
End of tests
1
1
2
2
X
3

View File

@ -0,0 +1,126 @@
create database `mysqltest1
1tsetlqsym`;
use `mysqltest1
1tsetlqsym`;
create table `t1
1t` (`foobar
raboof` int);
create view `v1
1v` as select * from `t1
1t`;
create procedure sp() select * from `v1
1v`;
flush tables;
use test;
--
-- Current Database: `mysqltest1
-- 1tsetlqsym`
--
/*!40000 DROP DATABASE IF EXISTS `mysqltest1
1tsetlqsym`*/;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1
1tsetlqsym` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mysqltest1
1tsetlqsym`;
--
-- Table structure for table `t1
-- 1t`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1
1t` (
`foobar
raboof` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t1
-- 1t`
--
--
-- Temporary table structure for view `v1
-- 1v`
--
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1
1v` (
`foobar
raboof` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Dumping routines for database 'mysqltest1
-- 1tsetlqsym'
--
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = latin1 */ ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
select * from `v1
1v` ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Current Database: `mysqltest1
-- 1tsetlqsym`
--
USE `mysqltest1
1tsetlqsym`;
--
-- Final view structure for view `v1
-- 1v`
--
/*!50001 DROP TABLE IF EXISTS `v1
1v`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = latin1 */;
/*!50001 SET character_set_results = latin1 */;
/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1
1v` AS select `t1
1t`.`foobar
raboof` AS `foobar
raboof` from `t1
1t` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
show tables from `mysqltest1
1tsetlqsym`;
Tables_in_mysqltest1
1tsetlqsym
t1
1t
v1
1v
drop database `mysqltest1
1tsetlqsym`;

View File

@ -5236,9 +5236,6 @@ SET @@global.log_output="TABLE";
SET @@global.general_log='OFF';
SET @@global.slow_query_log='OFF';
DROP DATABASE mysql;
Warnings:
Error 1146 Table 'mysql.proc' doesn't exist
Error 1146 Table 'mysql.event' doesn't exist
SHOW CREATE TABLE mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (

View File

@ -269,12 +269,6 @@ source database
echo message echo message
mysqltest: At line 1: Missing argument in exec
1
1
2
2
X
3
MySQL
"MySQL"
MySQL: The

View File

@ -2154,3 +2154,4 @@ Privat (Private Nutzung) Mobilfunk
Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
FOUND /\[ERROR\] Create named pipe failed/ in second-mysqld.err

View File

@ -4076,4 +4076,35 @@ id value
deallocate prepare stmt;
SET SESSION sql_mode = @save_sql_mode;
DROP TABLE t1,t2;
# End of 10.0 tests
#
# MDEV-8833: Crash of server on prepared statement with
# conversion to semi-join
#
CREATE TABLE t1 (column1 INT);
INSERT INTO t1 VALUES (3),(9);
CREATE TABLE t2 (column2 INT);
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (column3 INT);
INSERT INTO t3 VALUES (6),(8);
CREATE TABLE t4 (column4 INT);
INSERT INTO t4 VALUES (2),(5);
PREPARE stmt FROM "SELECT ( SELECT MAX( table1.column1 ) AS field1
FROM t1 AS table1
WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
) AS sq
FROM t3 AS table3, t4 AS table4";
EXECUTE stmt;
sq
NULL
NULL
NULL
NULL
EXECUTE stmt;
sq
NULL
NULL
NULL
NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
# End of 5.5 tests

View File

@ -1446,3 +1446,74 @@ a b i
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
DROP TABLE t1,t2;
set use_stat_tables=@save_use_stat_tables;
#
# Bug mdev-11096: range condition over column without statistical data
#
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1 persistent for columns () indexes ();
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
explain extended
select * from t1 where col1 > 'b' and col1 < 'e';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where ((`test`.`t1`.`col1` > 'b') and (`test`.`t1`.`col1` < 'e'))
select * from t1 where col1 > 'b' and col1 < 'e';
col1
c
d
drop table t1;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
#
# Bug mdev-9628: unindexed blob column without min-max statistics
# with optimizer_use_condition_selectivity=3
#
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
create table t2(col1 text);
insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
select * from t1 where col1 > 'b' and col1 < 'd';
col1
c
explain extended
select * from t1 where col1 > 'b' and col1 < 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 28.57 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where ((`test`.`t1`.`col1` > 'b') and (`test`.`t1`.`col1` < 'd'))
select * from t2 where col1 > 'b' and col1 < 'd';
col1
c
explain extended
select * from t2 where col1 > 'b' and col1 < 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where ((`test`.`t2`.`col1` > 'b') and (`test`.`t2`.`col1` < 'd'))
select * from t2 where col1 < 'b' and col1 > 'd';
col1
explain extended
select * from t2 where col1 < 'b' and col1 > 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where 0
drop table t1,t2;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;

View File

@ -802,9 +802,9 @@ insert into t2 values (2),(3);
explain extended
select * from t1 where a in ( select b from t2 ) AND ( a > 3 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1 0.00 Using where
1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 0.00
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t1`.`a` > 3))
select * from t1 where a in ( select b from t2 ) AND ( a > 3 );
@ -1450,6 +1450,77 @@ a b i
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
DROP TABLE t1,t2;
set use_stat_tables=@save_use_stat_tables;
#
# Bug mdev-11096: range condition over column without statistical data
#
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1 persistent for columns () indexes ();
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
explain extended
select * from t1 where col1 > 'b' and col1 < 'e';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where ((`test`.`t1`.`col1` > 'b') and (`test`.`t1`.`col1` < 'e'))
select * from t1 where col1 > 'b' and col1 < 'e';
col1
c
d
drop table t1;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
#
# Bug mdev-9628: unindexed blob column without min-max statistics
# with optimizer_use_condition_selectivity=3
#
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
create table t2(col1 text);
insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
select * from t1 where col1 > 'b' and col1 < 'd';
col1
c
explain extended
select * from t1 where col1 > 'b' and col1 < 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 28.57 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where ((`test`.`t1`.`col1` > 'b') and (`test`.`t1`.`col1` < 'd'))
select * from t2 where col1 > 'b' and col1 < 'd';
col1
c
explain extended
select * from t2 where col1 > 'b' and col1 < 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where ((`test`.`t2`.`col1` > 'b') and (`test`.`t2`.`col1` < 'd'))
select * from t2 where col1 < 'b' and col1 > 'd';
col1
explain extended
select * from t2 where col1 < 'b' and col1 > 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where 0
drop table t1,t2;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
set @tmp_ust= @@use_stat_tables;
set @tmp_oucs= @@optimizer_use_condition_selectivity;
@ -1536,6 +1607,44 @@ where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_na
parent_id child_group_id child_user_id id lower_group_name directory_id id
drop table t1,t2,t3;
#
# MDEV-9187: duplicate of bug mdev-9628
#
set use_stat_tables = preferably;
set optimizer_use_condition_selectivity=3;
CREATE TABLE t1 (f1 char(32)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo'),('bar'),('qux');
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * FROM t1 WHERE f1 < 'm';
f1
foo
bar
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE f1 < 'm';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 72.09 Using where
Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where (`test`.`t1`.`f1` < 'm')
CREATE TABLE t2 (f1 TEXT) ENGINE=InnoDB;
INSERT INTO t2 VALUES ('foo'),('bar'),('qux');
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
SELECT * FROM t2 WHERE f1 <> 'qux';
f1
foo
bar
EXPLAIN EXTENDED
SELECT * FROM t2 WHERE f1 <> 'qux';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`f1` AS `f1` from `test`.`t2` where (`test`.`t2`.`f1` <> 'qux')
DROP TABLE t1,t2;
#
# End of 10.0 tests
#
set use_stat_tables= @tmp_ust;

View File

@ -14,6 +14,25 @@ this
0
4294967295
drop table t1;
create table t1 (a bigint unsigned, b mediumint unsigned);
insert t1 values (1,2),(0xffffffffffffffff,0xffffff);
select coalesce(a,b), coalesce(b,a) from t1;
coalesce(a,b) coalesce(b,a)
1 2
18446744073709551615 16777215
create table t2 as select a from t1 union select b from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t2;
a
1
18446744073709551615
2
16777215
drop table t1, t2;
#
# Start of 10.0 tests
#

View File

@ -5432,6 +5432,7 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1, t2;
create view v1 as select 1;
FOUND /mariadb-version/ in v1.frm
drop view v1;
#
# MDEV-7260: Crash in get_best_combination when executing multi-table

View File

@ -1,3 +1,4 @@
set global log_warnings=2;
set @@wait_timeout=1;
FOUND /Aborted.*Got timeout reading communication packets/ in mysqld.1.err
set global log_warnings=@@log_warnings;

View File

@ -33,6 +33,7 @@ INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
SELECT b FROM t1 LIMIT 3;
ERROR HY000: Lost connection to MySQL server during query
FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK

View File

@ -6,7 +6,8 @@ table_54044 CREATE TEMPORARY TABLE `table_54044` (
`IF(NULL IS NOT NULL, NULL, NULL)` binary(0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE table_54044;
CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
CREATE TABLE tmp ENGINE = INNODB
AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
Table Create Table
tmp CREATE TABLE `tmp` (

View File

@ -0,0 +1,8 @@
alter table mysql.time_zone_name engine=InnoDB;
create table envois3 (starttime datetime) engine=InnoDB;
insert envois3 values ('2008-08-11 22:43:00');
select convert_tz(starttime,'UTC','Europe/Moscow') starttime from envois3;
starttime
2008-08-12 02:43:00
drop table envois3;
alter table mysql.time_zone_name engine=MyISAM;

View File

@ -10,7 +10,10 @@ CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
SHOW CREATE TABLE table_54044;
DROP TABLE table_54044;
CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
# This 'create table' should pass since it uses a Field_string of size 0.
CREATE TABLE tmp ENGINE = INNODB
AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
DROP TABLE tmp;
@ -23,4 +26,3 @@ FLUSH TABLES;
--error 1005
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
DROP TABLE t1;

View File

@ -0,0 +1,12 @@
--source include/have_innodb.inc
#
# MDEV-10775 System table in InnoDB format allowed in MariaDB could lead to crash
#
alter table mysql.time_zone_name engine=InnoDB;
create table envois3 (starttime datetime) engine=InnoDB;
insert envois3 values ('2008-08-11 22:43:00');
--source include/restart_mysqld.inc
select convert_tz(starttime,'UTC','Europe/Moscow') starttime from envois3;
drop table envois3;
alter table mysql.time_zone_name engine=MyISAM;

View File

@ -1,121 +0,0 @@
"General cleanup"
set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
set @@global.aria_checkpoint_interval= 0;
drop table if exists t1;
update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
truncate table performance_schema.file_summary_by_event_name;
truncate table performance_schema.file_summary_by_instance;
truncate table performance_schema.socket_summary_by_event_name;
truncate table performance_schema.socket_summary_by_instance;
truncate table performance_schema.events_waits_summary_global_by_event_name;
truncate table performance_schema.events_waits_summary_by_instance;
truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
update performance_schema.setup_instruments SET enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
set @dump_all=FALSE;
"Verifying file aggregate consistency"
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_READ SUM(i.SUM_NUMBER_OF_BYTES_READ)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_WRITE SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
"Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT)
"Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT)
update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;

View File

@ -1,197 +0,0 @@
# Tests for PERFORMANCE_SCHEMA
# Verify that statistics aggregated by different criteria are consistent.
--source include/not_embedded.inc
--source include/have_perfschema.inc
--echo "General cleanup"
# MDEV-7187 - test fails sporadically in buildbot
set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
set @@global.aria_checkpoint_interval= 0;
--disable_warnings
drop table if exists t1;
--enable_warnings
update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
# Cleanup statistics
truncate table performance_schema.file_summary_by_event_name;
truncate table performance_schema.file_summary_by_instance;
truncate table performance_schema.socket_summary_by_event_name;
truncate table performance_schema.socket_summary_by_instance;
truncate table performance_schema.events_waits_summary_global_by_event_name;
truncate table performance_schema.events_waits_summary_by_instance;
truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
# Start recording data
update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
# Stop recording data, so the select below don't add noise.
update performance_schema.setup_instruments SET enabled = 'NO';
# Disable all consumers, for long standing waits
update performance_schema.setup_consumers set enabled = 'NO';
# Helper to debug
set @dump_all=FALSE;
# Note that in general:
# - COUNT/SUM/MAX(file_summary_by_event_name) >=
# COUNT/SUM/MAX(file_summary_by_instance).
# - MIN(file_summary_by_event_name) <=
# MIN(file_summary_by_instance).
# There will be equality only when file instances are not removed,
# aka when a file is not deleted from the file system,
# because doing so removes a row in file_summary_by_instance.
# Likewise:
# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
# COUNT/SUM/MAX(events_waits_summary_by_instance)
# - MIN(events_waits_summary_global_by_event_name) <=
# MIN(events_waits_summary_by_instance)
# There will be equality only when an instrument instance
# is not removed, which is next to impossible to predictably guarantee
# in the server.
# For example, a MyISAM table removed from the table cache
# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock.
# Another example, a thread terminating will cause a mysql_mutex_destroy
# on sql/LOCK_delete
# Both cause a row to be deleted from events_waits_summary_by_instance.
# Likewise:
# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
# COUNT/SUM/MAX(events_waits_summary_by_thread_by_event_name)
# - MIN(events_waits_summary_global_by_event_name) <=
# MIN(events_waits_summary_by_thread_by_event_name)
# There will be equality only when no thread is removed,
# that is if no thread disconnects, or no sub thread (for example insert
# delayed) ever completes.
# A thread completing will cause rows in
# events_waits_summary_by_thread_by_event_name to be removed.
--echo "Verifying file aggregate consistency"
# Since the code generating the load in this test does:
# - create table
# - insert
# - does not cause temporary tables to be used
# we can test for equality here for file aggregates.
# If any of these queries returns data, the test failed.
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
--echo "Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
--echo "Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
FROM performance_schema.events_waits_summary_global_by_event_name AS e
JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
# Cleanup
update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;

View File

@ -8,7 +8,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users
server_audit_loc_info
server_audit_logging OFF
server_audit_mode 0
server_audit_output_type file
@ -72,7 +71,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 0
server_audit_output_type file
@ -218,7 +216,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file

View File

@ -8,7 +8,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users
server_audit_loc_info
server_audit_logging OFF
server_audit_mode 0
server_audit_output_type file
@ -72,7 +71,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 0
server_audit_output_type file
@ -218,7 +216,6 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file

View File

@ -143,6 +143,7 @@ SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
SELECT * FROM t4 ORDER BY a;
a
1

View File

@ -38,5 +38,7 @@ a
3
4
5
FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
DROP TABLE t1;
include/rpl_end.inc

View File

@ -0,0 +1,6 @@
include/master-slave.inc
[connection master]
include/stop_slave.inc
NOT FOUND /Error reading packet from server: Lost connection/ in slave_log.err
include/start_slave.inc
include/rpl_end.inc

View File

@ -13,7 +13,7 @@ insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
--replace_result \\ / 66 39 17 39 "File exists" "Directory not empty"
--replace_result \\ / 66 39 93 39 17 39 247 39 "File exists" "Directory not empty"
--error 1010
drop database mysqltest1;
use mysqltest1;
@ -30,7 +30,7 @@ while ($1)
}
--enable_query_log
--replace_result \\ / 66 39 17 39 "File exists" "Directory not empty"
--replace_result \\ / 66 39 93 39 17 39 247 39 "File exists" "Directory not empty"
--error 1010
drop database mysqltest1;
use mysqltest1;

View File

@ -0,0 +1 @@
--log-error=$MYSQLTEST_VARDIR/tmp/slave_log.err

View File

@ -0,0 +1,17 @@
#
# MDEV-8345 STOP SLAVE should not cause an ERROR to be logged to the error log
#
source include/have_binlog_format_mixed.inc; # don't repeat the test three times
source include/master-slave.inc;
connection master;
sync_slave_with_master;
source include/stop_slave.inc;
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err;
let SEARCH_PATTERN=Error reading packet from server: Lost connection;
let SEARCH_RANGE= -50000;
source include/search_pattern_in_file.inc;
source include/start_slave.inc;
source include/rpl_end.inc;

View File

@ -1712,3 +1712,28 @@ CREATE TABLE t1 (
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
DROP TABLE t1;
--echo #
--echo # MDEV-11126 Crash while altering persistent virtual column
--echo #
CREATE TABLE `tab1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`field2` set('option1','option2','option3','option4') NOT NULL,
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
`field4` set('option1','option2','option3','option4') NOT NULL,
`field5` varchar(32) NOT NULL,
`field6` varchar(32) NOT NULL,
`field7` varchar(32) NOT NULL,
`field8` varchar(32) NOT NULL,
`field9` int(11) NOT NULL DEFAULT '1',
`field10` varchar(16) NOT NULL,
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
`v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=latin1;
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128);
SHOW CREATE TABLE `tab1`;
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT;
SHOW CREATE TABLE `tab1`;
DROP TABLE `tab1`;

View File

@ -386,3 +386,15 @@ drop table t1;
# Cleanup
#
DROP TABLE t2;
--echo #
--echo # MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()
--echo #
CREATE TABLE t1(a INT);
CREATE FUNCTION f1() RETURNS VARCHAR(16383) RETURN 'test';
CREATE OR REPLACE TABLE t1 AS SELECT f1();
LOCK TABLE t1 WRITE;
CREATE OR REPLACE TABLE t1 AS SELECT f1();
UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;

View File

@ -889,6 +889,11 @@ SELECT CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _utf32 0x00000061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
#
# potential signedness issue
#
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
--echo #
--echo # End of 5.5 tests
--echo #

View File

@ -313,3 +313,12 @@ INSERT INTO table1 VALUES (1);
DROP TABLE table1,table2;
--echo # End BUG#34750
--echo #
--echo # MDEV-11105 Table named 'db' has weird side effect.
--echo #
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.db(id INT);
DROP DATABASE mysqltest;

View File

@ -230,3 +230,16 @@ eval EXPLAIN $query;
eval $query;
DROP TABLE t0,t1,t2;
--echo #
--echo # MDEV-MariaDB daemon leaks memory with specific query
--echo #
CREATE TABLE t1 (`voter_id` int(11) unsigned NOT NULL,
`language_id` int(11) unsigned NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE t2 (`voter_id` int(10) unsigned NOT NULL DEFAULT '0',
`serialized_c` mediumblob) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into t2 values (1,repeat("a",1000)),(2,repeat("a",1000)),(3,repeat("b",1000)),(4,repeat("c",1000)),(4,repeat("b",1000));
SELECT GROUP_CONCAT(t1.language_id SEPARATOR ',') AS `translation_resources`, `d`.`serialized_c` FROM t2 AS `d` LEFT JOIN t1 ON `d`.`voter_id` = t1.`voter_id` GROUP BY `d`.`voter_id` ORDER BY 10-d.voter_id+RAND()*0;
drop table t1,t2;

View File

@ -612,13 +612,13 @@ select * from information_schema.schema_privileges order by grantee;
select * from information_schema.user_privileges order by grantee;
show grants;
connection con4;
select * from information_schema.column_privileges where grantee like '%user%'
select * from information_schema.column_privileges where grantee like '\'user%'
order by grantee;
select * from information_schema.table_privileges where grantee like '%user%'
select * from information_schema.table_privileges where grantee like '\'user%'
order by grantee;
select * from information_schema.schema_privileges where grantee like '%user%'
select * from information_schema.schema_privileges where grantee like '\'user%'
order by grantee;
select * from information_schema.user_privileges where grantee like '%user%'
select * from information_schema.user_privileges where grantee like '\'user%'
order by grantee;
show grants;
connection default;

View File

@ -2880,6 +2880,19 @@ drop tables m1, t1, t4;
drop view t3;
--echo #
--echo # MDEV-10424 - Assertion `ticket == __null' failed in
--echo # MDL_request::set_type
--echo #
CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
CREATE TABLE tmerge (f1 INT) ENGINE=MERGE UNION=(t1);
PREPARE stmt FROM "ANALYZE TABLE tmerge, t1";
EXECUTE stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1, tmerge;
--echo End of 5.5 tests

View File

@ -586,8 +586,16 @@ DROP DATABASE connected_db;
# USE and names with backticks
#
--write_file $MYSQLTEST_VARDIR/tmp/backticks.sql
\u aa`bb``cc
SELECT DATABASE();
USE test
SELECT DATABASE();
USE aa`bb``cc
SELECT DATABASE();
USE test
SELECT DATABASE();
USE `aa``bb````cc`
SELECT DATABASE();
EOF
create database `aa``bb````cc`;
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/backticks.sql

View File

@ -13,3 +13,12 @@
--echo
--echo End of tests
# Multi-line exec
exec $MYSQL \
test -e "select 1";
exec $MYSQL test -e "select
2";
let $query = select 3
as X;
exec $MYSQL test -e "$query";

View File

@ -0,0 +1,38 @@
#
# New lines in identifiers
#
# embedded server doesn't support external clients
--source include/not_embedded.inc
# cmd.exe doesn't like new lines on the command line
--source include/not_windows.inc
create database `mysqltest1
1tsetlqsym`;
use `mysqltest1
1tsetlqsym`;
create table `t1
1t` (`foobar
raboof` int);
create view `v1
1v` as select * from `t1
1t`;
create procedure sp() select * from `v1
1v`;
flush tables;
use test;
exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym';
exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym' | $MYSQL;
show tables from `mysqltest1
1tsetlqsym`;
drop database `mysqltest1
1tsetlqsym`;

View File

@ -741,15 +741,6 @@ echo ;
--error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1
# Multi-line exec
exec $MYSQL
test -e "select 1";
exec $MYSQL test -e "select
2";
let $query = select 3
as X;
exec $MYSQL test -e "$query";
# ----------------------------------------------------------------------------
# Test let command
# ----------------------------------------------------------------------------

View File

@ -3653,5 +3653,32 @@ deallocate prepare stmt;
SET SESSION sql_mode = @save_sql_mode;
DROP TABLE t1,t2;
--echo #
--echo # MDEV-8833: Crash of server on prepared statement with
--echo # conversion to semi-join
--echo #
--echo # End of 10.0 tests
CREATE TABLE t1 (column1 INT);
INSERT INTO t1 VALUES (3),(9);
CREATE TABLE t2 (column2 INT);
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (column3 INT);
INSERT INTO t3 VALUES (6),(8);
CREATE TABLE t4 (column4 INT);
INSERT INTO t4 VALUES (2),(5);
PREPARE stmt FROM "SELECT ( SELECT MAX( table1.column1 ) AS field1
FROM t1 AS table1
WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
) AS sq
FROM t3 AS table3, t4 AS table4";
EXECUTE stmt;
EXECUTE stmt;
deallocate prepare stmt;
drop table t1,t2,t3,t4;
--echo # End of 5.5 tests

View File

@ -970,6 +970,58 @@ set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivit
DROP TABLE t1,t2;
set use_stat_tables=@save_use_stat_tables;
--echo #
--echo # Bug mdev-11096: range condition over column without statistical data
--echo #
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1 persistent for columns () indexes ();
explain extended
select * from t1 where col1 > 'b' and col1 < 'e';
select * from t1 where col1 > 'b' and col1 < 'e';
drop table t1;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
--echo #
--echo # Bug mdev-9628: unindexed blob column without min-max statistics
--echo # with optimizer_use_condition_selectivity=3
--echo #
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=3;
create table t1(col1 char(32));
insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t1;
create table t2(col1 text);
insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
analyze table t2;
select * from t1 where col1 > 'b' and col1 < 'd';
explain extended
select * from t1 where col1 > 'b' and col1 < 'd';
select * from t2 where col1 > 'b' and col1 < 'd';
explain extended
select * from t2 where col1 > 'b' and col1 < 'd';
select * from t2 where col1 < 'b' and col1 > 'd';
explain extended
select * from t2 where col1 < 'b' and col1 > 'd';
drop table t1,t2;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;

View File

@ -109,6 +109,31 @@ where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_na
drop table t1,t2,t3;
--echo #
--echo # MDEV-9187: duplicate of bug mdev-9628
--echo #
set use_stat_tables = preferably;
set optimizer_use_condition_selectivity=3;
CREATE TABLE t1 (f1 char(32)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo'),('bar'),('qux');
ANALYZE TABLE t1;
SELECT * FROM t1 WHERE f1 < 'm';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE f1 < 'm';
CREATE TABLE t2 (f1 TEXT) ENGINE=InnoDB;
INSERT INTO t2 VALUES ('foo'),('bar'),('qux');
ANALYZE TABLE t2;
SELECT * FROM t2 WHERE f1 <> 'qux';
EXPLAIN EXTENDED
SELECT * FROM t2 WHERE f1 <> 'qux';
DROP TABLE t1,t2;
--echo #
--echo # End of 10.0 tests
--echo #

View File

@ -16,6 +16,13 @@ drop table t1;
# End of 4.1 tests
create table t1 (a bigint unsigned, b mediumint unsigned);
insert t1 values (1,2),(0xffffffffffffffff,0xffffff);
select coalesce(a,b), coalesce(b,a) from t1;
create table t2 as select a from t1 union select b from t1;
show create table t2;
select * from t2;
drop table t1, t2;
--echo #
--echo # Start of 10.0 tests

View File

@ -23,77 +23,66 @@
#
##############################################################################
main.bootstrap : Modified on 2016-06-18 (MDEV-9969)
main.create_delayed : MDEV-10605 - failed with timeout
main.create_or_replace : Modified on 2016-06-23 (MDEV-9728)
main.ctype_recoding : Modified on 2016-06-10 (MDEV-10181)
main.ctype_utf8 : Modified on 2016-06-21 (merge)
main.ctype_utf8mb4 : Modified on 2016-06-21 (merge)
main.events_1 : Modified on 2016-06-21 (MDEV-9524)
main.ctype_utf32 : Modified on 2016-09-27 (merge)
main.func_group : Modified on 2016-08-08 (MDEV-10468)
main.func_in : Modified on 2016-06-20 (MDEV-10020)
main.func_math : Modified on 2016-08-10 (merge)
main.func_misc : Modified on 2016-08-10 (merge)
main.grant2 : Modified on 2016-07-18 (MDEV-8569)
main.help : Modified on 2016-06-21 (MDEV-9524)
main.group_min_max_innodb : Modified on 2016-08-25 (MDEV-10595)
main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown
main.index_intersect_innodb : MDEV-10643 - failed with timeout
main.index_merge_innodb : MDEV-7142 - sporadic wrong execution plan
main.index_merge_myisam : Modified on 2016-09-05 (include file changed)
main.index_merge_innodb : Modified on 2016-09-05 (MDEV-7142)
main.information_schema_stats : Modified on 2016-07-25 (MDEV-10428)
main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure
main.insert_innodb : Modified on 2016-06-14 (merge from upstream)
main.loaddata : Modified on 2016-08-10 (merge)
main.locale : Modified on 2016-06-21 (merge)
main.mdev-504 : MDEV-10607 - sporadic "can't connect"
main.mdev375 : MDEV-10607 - sporadic "can't connect"
main.merge : MDEV-10607 - sporadic "can't connect"
main.multi_update : Modified on 2016-06-20 (MDEV-5973)
main.myisam_enable_keys-10506 : New test, added on 2016-08-10 (MDEV-10506)
main.mysqlcheck : Modified on 2016-08-10 (merge)
main.mysqldump : MDEV-10512 - sporadic assertion failure
main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build
main.mysqltest : MDEV-9269 - fails on Alpha
main.named_pipe : Modified on 2016-08-02 (MDEV-10383)
main.openssl_1 : Modified on 2016-07-11 (MDEV-10211)
main.parser : Modified on 2016-06-21 (merge)
main.pool_of_threads : MDEV-10100 - sporadic error on detecting max connections
main.ps_1general : Modified on 2016-07-12 (merge)
main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count
main.range : Modified on 2016-08-10 (merge)
main.range_mrr_icp : Modified on 2016-08-10 (merge)
main.query_cache : MDEV-10611 - sporadic mutex problem
main.shutdown : MDEV-10612 - sporadic crashes
main.shutdown : MDEV-10563 - sporadic crashes
main.sp-prelocking : Modified on 2016-08-10 (merge)
main.sp-security : MDEV-10607 - sporadic "can't connect"
main.ssl : MDEV-10211 - different ciphers on some platforms
main.ssl_ca : Modified on 2016-07-11 (MDEV-10211)
main.ssl_compress : Modified on 2016-07-11 (MDEV-10211)
main.ssl_timeout : Modified on 2016-07-11 (MDEV-10211)
main.ssl_compress : MDEV-11110 - valgrind failures
main.stat_tables_par_innodb : MDEV-10515 - sporadic wrong results
main.status_user : Modified on 2016-06-20 (MDEV-8633)
main.subselect_innodb : MDEV-10614 - sporadic wrong results
main.temp_table : Modified on 2016-06-18 (MDEV-8569)
main.type_date : Modified on 2016-08-10 (merge)
main.type_datetime : Modified on 2016-06-16 (MDEV-9374)
main.type_uint : Modified on 2016-09-27 (merge)
main.view : Modified on 2016-08-10 (merge)
main.xtradb_mrr : Modified on 2016-08-04 (MDEV-9946)
#----------------------------------------------------------------
archive.archive-big : MDEV-10615 - table is marked as crashed
archive.discover : MDEV-10510 - table is marked as crashed
archive.archive-big : MDEV-10615 - table is marked as crashed
archive.discover : MDEV-10510 - table is marked as crashed
archive.mysqlhotcopy_archive : MDEV-10995 - test hangs on debug build
#----------------------------------------------------------------
binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed
binlog.binlog_dmls_on_tmp_tables_readonly : New test, added on 2016-05-04 (upstream)
binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
#----------------------------------------------------------------
connect.tbl : MDEV-9844, MDEV-10179 - sporadic crashes, valgrind warnings, wrong results
connect.jdbc : New test, added on 2016-07-15
connect.jdbc-new : New test, added on 2016-07-14
connect.jdbc-oracle : New test, added on 2016-07-13
connect.jdbc-postgresql : New test, added on 2016-07-13
#----------------------------------------------------------------
engines/rr_trx.* : MDEV-10998 - tests not maintained
#----------------------------------------------------------------
extra/binlog_tests.database : Modified on 2016-10-21 (Upstream MIPS test fixes)
#----------------------------------------------------------------
@ -104,20 +93,19 @@ federated.federated_transactions : MDEV-10617, MDEV-10417 - Wrong checksum, time
#----------------------------------------------------------------
funcs_1.processlist_priv_no_prot : Include file modified on 2016-07-12 (merge)
funcs_1.processlist_priv_ps : Include file modified on 2016-07-12 (merge)
funcs_2/charset.* : MDEV-10999 - test not maintained
#----------------------------------------------------------------
innodb.binlog_consistent : MDEV-10618 - Server fails to start
innodb.innodb-alter-table : MDEV-10619 - Testcase timeout
innodb.innodb-alter-tempfile : Modified on 2016-08-09 (MDEV-10469)
innodb.innodb_corrupt_bit : Modified on 2016-06-21 (merge)
innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan
innodb.innodb-fk-warnings : Modified on 2016-07-18 (MDEV-8569)
innodb.innodb-fkcheck : Modified on 2016-06-13 (MDEV-10083)
innodb.innodb_bug54044 : Modified on 2016-09-27 (merge)
innodb.innodb_monitor : MDEV-10939 - Testcase timeout
innodb.innodb-wl5522 : rdiff file modified on 2016-08-10 (merge)
innodb.innodb-wl5522-debug-zip : MDEV-10427 - Warning: database page corruption
innodb.system_tables : Added on 2016-09-23 (MDEV-10775)
#----------------------------------------------------------------
@ -142,21 +130,16 @@ parts.partition_int_myisam : MDEV-10621 - Testcase timeout
#----------------------------------------------------------------
perfschema.digest_table_full : Modified on 2016-06-21 (merge)
perfschema.func_file_io : MDEV-5708 - fails for s390x
perfschema.func_mutex : MDEV-5708 - fails for s390x
perfschema.rpl_gtid_func : Modified on 2016-06-21 (merge)
perfschema.sizing_low : Modified on 2016-04-26 (5.6.30 merge)
perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown
perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match
perfschema.start_server_low_digest : Modified on 2016-06-21 (merge)
perfschema.statement_digest : Modified on 2016-06-21 (merge)
perfschema.statement_digest_consumers : Modified on 2016-06-21 (merge)
perfschema.statement_digest_long_query : Modified on 2016-06-21 (merge)
perfschema.table_name : New test, added on 2016-04-26 (5.6.30 merge)
perfschema_stress.* : MDEV-10996 - tests not maintained
#----------------------------------------------------------------
plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url
plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url, MDEV-11112 - valgrind warnings
plugins.pam : Modified on 2016-08-03 (MDEV-7329)
plugins.pam_cleartext : Modified on 2016-08-03
plugins.server_audit : MDEV-9562 - crashes on sol10-sparc
@ -164,11 +147,6 @@ plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc
#----------------------------------------------------------------
roles.rpl_grant_revoke_current_role-8638 : New test, added on 2016-06-20 (MDEV-8638)
roles.set_role-9614 : New test, added on 2016-05-30 (MDEV-9614)
#----------------------------------------------------------------
rpl.last_insert_id : MDEV-10625 - warnings in error log
rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips
rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips
@ -177,11 +155,11 @@ rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registering
rpl.rpl_checksum_cache : MDEV-10626 - Testcase timeout
rpl.rpl_circular_for_4_hosts : MDEV-10627 - Testcase timeout
rpl.rpl_ddl : MDEV-10417 - Fails on Mips
rpl.rpl_drop_db : Modified on 2016-10-21 (Upstream MIPS test fixes)
rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master
rpl.rpl_gtid_master_promote : MDEV-10628 - Timeout in sync_with_master
rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown
rpl.rpl_gtid_until : MDEV-10625 - warnings in error log
rpl.rpl_ignore_table : Modified on 2016-06-22
rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips
rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x
rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x
@ -201,6 +179,8 @@ rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries
rpl.sec_behind_master-5114 : MDEV-8518 - Wrong value of Seconds_Behind_Master
rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha
rpl/extra/rpl_tests.* : MDEV-10994 - tests not maintained
#----------------------------------------------------------------
spider.* : MDEV-9329 - tests are too memory-consuming
@ -214,6 +194,10 @@ spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x
#----------------------------------------------------------------
sphinx.* : MDEV-10747 - tests are not run in buildbot, they can't be stable
#----------------------------------------------------------------
stress.ddl_innodb : MDEV-10635 - Testcase timeout
#----------------------------------------------------------------
@ -229,11 +213,14 @@ tokudb.background_job_manager : MDEV-10327 - Assertion failure on server
tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan
tokudb.* : MDEV-9891 - massive crashes on shutdown
tokudb_alter_table.* : MDEV-9891 - massive crashes on shutdown
tokudb_backup.* : MDEV-11001 - tests don't work
tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output
tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output
tokudb_bugs.* : MDEV-9891 - massive crashes on shutdown
tokudb_parts.* : MDEV-9891 - massive crashes on shutdown
rpl-tokudb.* : MDEV-9891 - massive crashes on shutdown, also modified on 2016-06-10 (Merge)
tokudb_rpl_suites.* : MDEV-11001 - tests don't work
tokudb_sys_vars.* : MDEV-11001 - tests don't work
rpl-tokudb.* : MDEV-9891 - massive crashes on shutdown
tokudb/tokudb_add_index.* : MDEV-9891 - massive crashes on shutdown
tokudb/tokudb_backup.* : MDEV-9891 - massive crashes on shutdown
tokudb/tokudb_mariadb.* : MDEV-9891 - massive crashes on shutdown
@ -247,7 +234,6 @@ unit.ma_test_loghandler : MDEV-10638 - record read not ok
#----------------------------------------------------------------
vcol.charsets : Added on 2016-06-23
vcol.not_supported : MDEV-10639 - Testcase timeout
vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout

View File

@ -1228,6 +1228,125 @@
fun:dlopen@@GLIBC_2.2.5
}
#
# MDEV-11061: OpenSSL 0.9.8 problems
#
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
obj:*/libz.so*
...
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Value8
obj:*/libz.so*
...
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Value8
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
obj:*/libssl.so.0.9.8
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Value8
obj:*/libssl.so.0.9.8
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
fun:memcpy
obj:*/libcrypto.so.0.9.8
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Value8
fun:memcpy
obj:*/libcrypto.so.0.9.8
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
fun:is_overlap
fun:memcpy
obj:*/libcrypto.so.0.9.8
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Cond
fun:memset
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Value8
fun:memset
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
MDEV-11061: OpenSSL 0.9.8
Memcheck:Param
write(buf)
obj:*/libpthread-2.9.so*
obj:*/libcrypto.so.0.9.8
...
obj:*/libssl.so.0.9.8
...
}
{
GitHub codership/galera#330
Memcheck:Leak
@ -1316,7 +1435,7 @@
}
{
g codership/mysql-wsrep/issues#176
codership/mysql-wsrep/issues#176
Memcheck:Leak
fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
}

View File

@ -102,6 +102,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
HANDLE osfh;
DBUG_ASSERT(path && stream);
DBUG_ASSERT(strchr(mode, 'a')); /* We use FILE_APPEND_DATA below */
/* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
if (fd < 0)
@ -112,15 +113,14 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
fd= _fileno(stream);
}
if ((osfh= CreateFile(path, GENERIC_READ | GENERIC_WRITE,
if ((osfh= CreateFile(path, GENERIC_READ | FILE_APPEND_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE |
FILE_SHARE_DELETE, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,
NULL)) == INVALID_HANDLE_VALUE)
return NULL;
if ((handle_fd= _open_osfhandle((intptr_t)osfh,
_O_APPEND | _O_TEXT)) == -1)
if ((handle_fd= _open_osfhandle((intptr_t)osfh, _O_TEXT)) == -1)
{
CloseHandle(osfh);
return NULL;

View File

@ -1,5 +1,5 @@
/*
Copyright (c) 2000, 2010, Oracle and/or its affiliates
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates
Copyright (c) 2009, 2016, 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
@ -49,7 +49,8 @@ int my_redel(const char *org_name, const char *tmp_name,
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %lu",
org_name,tmp_name,MyFlags));
if (my_copystat(org_name,tmp_name,MyFlags) < 0)
if (!my_disable_copystat_in_redel &&
my_copystat(org_name,tmp_name,MyFlags) < 0)
goto end;
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{

View File

@ -98,3 +98,4 @@ my_bool my_disable_sync=0;
my_bool my_disable_async_io=0;
my_bool my_disable_flush_key_blocks=0;
my_bool my_disable_symlinks=0;
my_bool my_disable_copystat_in_redel=0;

View File

@ -43,7 +43,11 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
{
DWORD major = ver->dwMajorVersion;
DWORD minor = ver->dwMinorVersion;
if (major == 10 && minor == 0)
{
return (ver->wProductType == VER_NT_WORKSTATION) ?
"Windows 10" : "Windows Server 2016";
}
if (major == 6 && minor == 3)
{
return (ver->wProductType == VER_NT_WORKSTATION)?
@ -102,7 +106,12 @@ static int uname(struct utsname *buf)
if(version_str && version_str[0])
sprintf(buf->version, "%s %s",version_str, ver.szCSDVersion);
else
sprintf(buf->version, "%s", ver.szCSDVersion);
{
/* Fallback for unknown versions, e.g "Windows <major_ver>.<minor_ver>" */
sprintf(buf->version, "Windows %d.%d%s",
ver.dwMajorVersion, ver.dwMinorVersion,
(ver.wProductType == VER_NT_WORKSTATION ? "" : " Server"));
}
#ifdef _WIN64
strcpy(buf->machine, "x64");

View File

@ -427,9 +427,8 @@ static MYSQL_SYSVAR_UINT(query_log_limit, query_log_limit,
char locinfo_ini_value[sizeof(struct connection_info)+4];
static MYSQL_THDVAR_STR(loc_info,
PLUGIN_VAR_READONLY | PLUGIN_VAR_MEMALLOC,
"Auxiliary info.", NULL, NULL,
locinfo_ini_value);
PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_MEMALLOC,
"Internal info", NULL, NULL, locinfo_ini_value);
static const char *syslog_facility_names[]=
{

View File

@ -717,6 +717,10 @@ else
logging=syslog
fi
# close stdout and stderr, everything goes to $logging now
exec 1>&-
exec 2>&-
USER_OPTION=""
if test -w / -o "$USER" = "root"
then
@ -747,7 +751,7 @@ if [ ! -d $mysql_unix_port_dir ]
then
if ! `mkdir -p $mysql_unix_port_dir`
then
echo "Fatal error Can't create database directory '$mysql_unix_port'"
log_error "Fatal error Can't create database directory '$mysql_unix_port'"
exit 1
fi
chown $user $mysql_unix_port_dir

View File

@ -46,6 +46,7 @@ struct show_table_contributors_st show_table_contributors[]= {
{"Auttomattic", "https://automattic.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Verkkokauppa.com", "https://virtuozzo.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Virtuozzo", "https://virtuozzo.com/", "Bronze Sponsor of the MariaDB Foundation"},
{"Tencent Game DBA", "http://tencentdba.com/about/", "Bronze Sponsor of the MariaDB Foundation"},
/* Sponsors of important features */
{"Google", "USA", "Sponsoring encryption, parallel replication and GTID"},

View File

@ -355,7 +355,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]=
//MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_VARCHAR,
//MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONG,
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG,
//MYSQL_TYPE_DATE MYSQL_TYPE_TIME
MYSQL_TYPE_VARCHAR, MYSQL_TYPE_VARCHAR,
//MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR

View File

@ -2743,9 +2743,28 @@ void Item_field::fix_after_pullout(st_select_lex *new_parent, Item **ref)
if (context)
{
Name_resolution_context *ctx= new Name_resolution_context();
ctx->outer_context= NULL; // We don't build a complete name resolver
ctx->table_list= NULL; // We rely on first_name_resolution_table instead
if (context->select_lex == new_parent)
{
/*
This field was pushed in then pulled out
(for example left part of IN)
*/
ctx->outer_context= context->outer_context;
}
else if (context->outer_context)
{
/* just pull to the upper context */
ctx->outer_context= context->outer_context->outer_context;
}
else
{
/* No upper context (merging Derived/VIEW where context chain ends) */
ctx->outer_context= NULL;
}
ctx->table_list= context->first_name_resolution_table;
ctx->select_lex= new_parent;
if (context->select_lex == NULL)
ctx->select_lex= NULL;
ctx->first_name_resolution_table= context->first_name_resolution_table;
ctx->last_name_resolution_table= context->last_name_resolution_table;
ctx->error_processor= context->error_processor;

View File

@ -2620,8 +2620,8 @@ static bool check_equality_for_exist2in(Item_func *func,
args[0]->all_used_tables() == OUTER_REF_TABLE_BIT)
{
/* It is Item_field or Item_direct_view_ref) */
DBUG_ASSERT(args[0]->type() == Item::FIELD_ITEM ||
args[0]->type() == Item::REF_ITEM);
DBUG_ASSERT(args[1]->type() == Item::FIELD_ITEM ||
args[1]->type() == Item::REF_ITEM);
*local_field= (Item_ident *)args[1];
*outer_exp= args[0];
return TRUE;

View File

@ -3144,7 +3144,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
if (! write_error)
{
write_error= 1;
sql_print_error(ER(ER_ERROR_ON_WRITE), name, error);
sql_print_error(ER(ER_ERROR_ON_WRITE), name, tmp_errno);
}
}
}

Some files were not shown because too many files have changed in this diff Show More