Merge tag 'mariadb-5.5.58' into 5.5-galera
This commit is contained in:
commit
8da6b4ef52
@ -1067,8 +1067,7 @@ static void fix_history(String *final_command);
|
|||||||
|
|
||||||
static COMMANDS *find_command(char *name);
|
static COMMANDS *find_command(char *name);
|
||||||
static COMMANDS *find_command(char cmd_name);
|
static COMMANDS *find_command(char cmd_name);
|
||||||
static bool add_line(String &buffer, char *line, ulong line_length,
|
static bool add_line(String &, char *, ulong, char *, bool *, bool);
|
||||||
char *in_string, bool *ml_comment, bool truncated);
|
|
||||||
static void remove_cntrl(String &buffer);
|
static void remove_cntrl(String &buffer);
|
||||||
static void print_table_data(MYSQL_RES *result);
|
static void print_table_data(MYSQL_RES *result);
|
||||||
static void print_table_data_html(MYSQL_RES *result);
|
static void print_table_data_html(MYSQL_RES *result);
|
||||||
@ -1080,7 +1079,7 @@ static ulong start_timer(void);
|
|||||||
static void end_timer(ulong start_time,char *buff);
|
static void end_timer(ulong start_time,char *buff);
|
||||||
static void mysql_end_timer(ulong start_time,char *buff);
|
static void mysql_end_timer(ulong start_time,char *buff);
|
||||||
static void nice_time(double sec,char *buff,bool part_second);
|
static void nice_time(double sec,char *buff,bool part_second);
|
||||||
extern "C" sig_handler mysql_end(int sig);
|
extern "C" sig_handler mysql_end(int sig) __attribute__ ((noreturn));
|
||||||
extern "C" sig_handler handle_sigint(int sig);
|
extern "C" sig_handler handle_sigint(int sig);
|
||||||
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
|
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
|
||||||
static sig_handler window_resize(int sig);
|
static sig_handler window_resize(int sig);
|
||||||
|
@ -2012,6 +2012,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
|
|||||||
case '-':
|
case '-':
|
||||||
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
|
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
|
||||||
break;
|
break;
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
fputc(*comment_string, xml_file);
|
fputc(*comment_string, xml_file);
|
||||||
break;
|
break;
|
||||||
|
@ -102,12 +102,16 @@ void cleanup_and_exit(int exit_code)
|
|||||||
exit(exit_code);
|
exit(exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage(my_bool version)
|
static void version()
|
||||||
{
|
{
|
||||||
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
|
||||||
MACHINE_TYPE);
|
}
|
||||||
if (version)
|
|
||||||
return;
|
|
||||||
|
static void usage() __attribute__ ((noreturn));
|
||||||
|
static void usage()
|
||||||
|
{
|
||||||
|
version();
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||||
puts("Prints all arguments that is give to some program using the default files");
|
puts("Prints all arguments that is give to some program using the default files");
|
||||||
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
|
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
|
||||||
@ -131,12 +135,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
cleanup_and_exit(0);
|
cleanup_and_exit(0);
|
||||||
case 'I':
|
case 'I':
|
||||||
case '?':
|
case '?':
|
||||||
usage(0);
|
usage();
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose++;
|
verbose++;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
usage(1);
|
version();
|
||||||
|
/* fall through */
|
||||||
case '#':
|
case '#':
|
||||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||||
break;
|
break;
|
||||||
@ -184,7 +189,7 @@ int main(int argc, char **argv)
|
|||||||
nargs+= array_elements(mysqld_groups);
|
nargs+= array_elements(mysqld_groups);
|
||||||
|
|
||||||
if (nargs < 2)
|
if (nargs < 2)
|
||||||
usage(0);
|
usage();
|
||||||
|
|
||||||
load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
|
load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
|
||||||
if (!load_default_groups)
|
if (!load_default_groups)
|
||||||
|
@ -174,6 +174,7 @@ register char **argv[];
|
|||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
version=1;
|
version=1;
|
||||||
|
/* fall through */
|
||||||
case 'I':
|
case 'I':
|
||||||
case '?':
|
case '?':
|
||||||
help=1; /* Help text written */
|
help=1; /* Help text written */
|
||||||
|
@ -12,6 +12,14 @@ before calling SSL_new();
|
|||||||
|
|
||||||
*** end Note ***
|
*** end Note ***
|
||||||
|
|
||||||
|
yaSSL Release notes, version 2.4.4 (8/8/2017)
|
||||||
|
This release of yaSSL fixes an interop issue. A fix for detecting cipher
|
||||||
|
suites with non leading zeros is included as yaSSL only supports cipher
|
||||||
|
suites with leading zeros. Thanks for the report from Security Innovation
|
||||||
|
and Oracle.
|
||||||
|
|
||||||
|
Users interoping with other SSL stacks should update.
|
||||||
|
|
||||||
yaSSL Release notes, version 2.4.2 (9/22/2016)
|
yaSSL Release notes, version 2.4.2 (9/22/2016)
|
||||||
This release of yaSSL fixes a medium security vulnerability. A fix for
|
This release of yaSSL fixes a medium security vulnerability. A fix for
|
||||||
potential AES side channel leaks is included that a local user monitoring
|
potential AES side channel leaks is included that a local user monitoring
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
Use is subject to license terms.
|
Use is subject to license terms.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#include "rsa.h"
|
#include "rsa.h"
|
||||||
|
|
||||||
|
|
||||||
#define YASSL_VERSION "2.4.2"
|
#define YASSL_VERSION "2.4.4"
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2005, 2014, Oracle and/or its affiliates
|
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1578,6 +1578,10 @@ void ServerHello::Process(input_buffer& input, SSL& ssl)
|
|||||||
ssl.SetError(badVersion_error);
|
ssl.SetError(badVersion_error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (cipher_suite_[0] != 0x00) {
|
||||||
|
ssl.SetError(unknown_cipher);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ssl.set_pending(cipher_suite_[1]);
|
ssl.set_pending(cipher_suite_[1]);
|
||||||
ssl.set_random(random_, server_end);
|
ssl.set_random(random_, server_end);
|
||||||
if (id_len_)
|
if (id_len_)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2005, 2014, Oracle and/or its affiliates
|
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1399,12 +1399,17 @@ void SSL::matchSuite(const opaque* peer, uint length)
|
|||||||
// start with best, if a match we are good, Ciphers are at odd index
|
// start with best, if a match we are good, Ciphers are at odd index
|
||||||
// since all SSL and TLS ciphers have 0x00 first byte
|
// since all SSL and TLS ciphers have 0x00 first byte
|
||||||
for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2)
|
for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2)
|
||||||
for (uint j = 1; j < length; j+= 2)
|
for (uint j = 0; (j + 1) < length; j+= 2) {
|
||||||
if (secure_.use_parms().suites_[i] == peer[j]) {
|
if (peer[j] != 0x00) {
|
||||||
|
continue; // only 0x00 first byte supported
|
||||||
|
}
|
||||||
|
|
||||||
|
if (secure_.use_parms().suites_[i] == peer[j + 1]) {
|
||||||
secure_.use_parms().suite_[0] = 0x00;
|
secure_.use_parms().suite_[0] = 0x00;
|
||||||
secure_.use_parms().suite_[1] = peer[j];
|
secure_.use_parms().suite_[1] = peer[j + 1];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetError(match_error);
|
SetError(match_error);
|
||||||
}
|
}
|
||||||
@ -2706,4 +2711,3 @@ template mySTL::list<yaSSL::SSL_SESSION*>::iterator find_if<mySTL::list<yaSSL::S
|
|||||||
template mySTL::list<yaSSL::ThreadError>::iterator find_if<mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match>(mySTL::list<yaSSL::ThreadError>::iterator, mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match);
|
template mySTL::list<yaSSL::ThreadError>::iterator find_if<mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match>(mySTL::list<yaSSL::ThreadError>::iterator, mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -66,6 +66,13 @@ if (!$slave_skip_counter) {
|
|||||||
}
|
}
|
||||||
source include/start_slave.inc;
|
source include/start_slave.inc;
|
||||||
|
|
||||||
|
# start_slave.inc returns when Slave_SQL_Running=Yes. But the slave
|
||||||
|
# thread sets it before clearing Last_SQL_Errno. So we have to wait
|
||||||
|
# for Last_SQL_Errno=0 separately.
|
||||||
|
|
||||||
|
let $slave_param= Last_SQL_Errno;
|
||||||
|
let $slave_param_value= 0;
|
||||||
|
source include/wait_for_slave_param.inc;
|
||||||
|
|
||||||
--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
|
--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
|
||||||
--source include/end_include_file.inc
|
--source include/end_include_file.inc
|
||||||
|
@ -742,8 +742,7 @@ sub run_test_server ($$$) {
|
|||||||
|
|
||||||
# Repeat test $opt_repeat number of times
|
# Repeat test $opt_repeat number of times
|
||||||
my $repeat= $result->{repeat} || 1;
|
my $repeat= $result->{repeat} || 1;
|
||||||
# Don't repeat if test was skipped
|
if ($repeat < $opt_repeat)
|
||||||
if ($repeat < $opt_repeat && $result->{'result'} ne 'MTR_RES_SKIPPED')
|
|
||||||
{
|
{
|
||||||
$result->{retries}= 0;
|
$result->{retries}= 0;
|
||||||
$result->{rep_failures}++ if $result->{failures};
|
$result->{rep_failures}++ if $result->{failures};
|
||||||
|
@ -1340,3 +1340,55 @@ rename table t2 to t1;
|
|||||||
execute stmt1;
|
execute stmt1;
|
||||||
deallocate prepare stmt1;
|
deallocate prepare stmt1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
#
|
||||||
|
# MDEV-8960 Can't refer the same column twice in one ALTER TABLE
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`consultant_id` int(11) NOT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
|
||||||
|
ALTER COLUMN `consultant_id` SET DEFAULT 2;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`consultant_id` int(11) NOT NULL DEFAULT '2'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`consultant_id` int(11) NOT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT,
|
||||||
|
MODIFY COLUMN `consultant_id` BIGINT;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`consultant_id` bigint(20) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -220,6 +220,22 @@ a d
|
|||||||
3 11120436154190595086
|
3 11120436154190595086
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
#
|
||||||
|
# Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
|
||||||
|
# (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
|
||||||
|
#
|
||||||
|
set @@sql_mode='';
|
||||||
|
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2);
|
||||||
|
Warnings:
|
||||||
|
Note 1291 Column 'c1' has duplicated value '' in SET
|
||||||
|
INSERT INTO t1 VALUES(990101.102);
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'c1' at row 1
|
||||||
|
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
|
||||||
|
COALESCE(c1)
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
set @@sql_mode=default;
|
||||||
CREATE TABLE t1(a YEAR);
|
CREATE TABLE t1(a YEAR);
|
||||||
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
|
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
|
||||||
1
|
1
|
||||||
|
@ -106,3 +106,28 @@ count(distinct user_id)
|
|||||||
17
|
17
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set @@tmp_table_size = default;
|
set @@tmp_table_size = default;
|
||||||
|
create table t1 (
|
||||||
|
a VARCHAR(1020),
|
||||||
|
b int
|
||||||
|
);
|
||||||
|
insert into t1 values
|
||||||
|
( 0 , 1 ),
|
||||||
|
( 1 , 2 ),
|
||||||
|
( 2 , 3 ),
|
||||||
|
( 3 , 4 ),
|
||||||
|
( 4 , 5 ),
|
||||||
|
( 5 , 6 ),
|
||||||
|
( 6 , 7 ),
|
||||||
|
( 7 , 8 ),
|
||||||
|
( 8 , 9 ),
|
||||||
|
( 9 , 10 ),
|
||||||
|
( 0 , 11 ),
|
||||||
|
( 1 , 12 ),
|
||||||
|
( 2 , 13 ),
|
||||||
|
( 3 , 14 );
|
||||||
|
set @@tmp_table_size=1024;
|
||||||
|
select count(distinct a) from t1;
|
||||||
|
count(distinct a)
|
||||||
|
10
|
||||||
|
drop table t1;
|
||||||
|
set @@tmp_table_size = default;
|
||||||
|
@ -4367,5 +4367,35 @@ NO_ENGINE_SUBSTITUTION
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
#
|
#
|
||||||
|
# MDEV-13972 crash in Item_func_sec_to_time::get_date
|
||||||
|
#
|
||||||
|
SELECT SEC_TO_TIME(CONVERT(900*24*60*60 USING ucs2));
|
||||||
|
SEC_TO_TIME(CONVERT(900*24*60*60 USING ucs2))
|
||||||
|
838:59:59.999999
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect time value: '77760000'
|
||||||
|
#
|
||||||
|
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32766) CHARACTER SET ucs2);
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 varchar(32766) YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32767) CHARACTER SET ucs2);
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 text YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32768) CHARACTER SET ucs2);
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 mediumtext YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@ -1283,5 +1283,20 @@ NO_ENGINE_SUBSTITUTION
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
#
|
#
|
||||||
|
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(16383) CHARACTER SET utf32);
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 varchar(16383) YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(16384) CHARACTER SET utf32);
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 mediumtext YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@ -5933,5 +5933,27 @@ Warnings:
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21844) CHARACTER SET utf8);
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 varchar(21844) YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21845) CHARACTER SET utf8);
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 text YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21846) CHARACTER SET utf8);
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 mediumtext YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@ -27,7 +27,7 @@ create table t1 (a int(256));
|
|||||||
ERROR 42000: Display width out of range for 'a' (max = 255)
|
ERROR 42000: Display width out of range for 'a' (max = 255)
|
||||||
set sql_mode='traditional';
|
set sql_mode='traditional';
|
||||||
create table t1 (a varchar(66000));
|
create table t1 (a varchar(66000));
|
||||||
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
|
ERROR 42000: Column length too big for column 'a' (max = 65532); use BLOB or TEXT instead
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
|
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
|
||||||
|
@ -812,3 +812,9 @@ EXECUTE s;
|
|||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
# End of 5.3 tests
|
# End of 5.3 tests
|
||||||
|
create table t1 (a int);
|
||||||
|
insert t1 values (1),(2),(3);
|
||||||
|
select * from t1 where 1 in (a, name_const('a', null));
|
||||||
|
a
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
@ -2626,3 +2626,37 @@ DROP TABLE t1;
|
|||||||
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
|
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
|
||||||
1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2
|
1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2
|
||||||
3
|
3
|
||||||
|
#
|
||||||
|
# MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
|
||||||
|
#
|
||||||
|
SET sql_mode='NO_ZERO_IN_DATE';
|
||||||
|
CREATE TABLE t1 (a TIME(6));
|
||||||
|
INSERT INTO t1 SELECT timediff(timestamp'2008-12-31 23:59:59.000001',timestamp'2008-12-30 01:01:01.000002');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
46:58:57.999999
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
#
|
||||||
|
# MDEV-13972 crash in Item_func_sec_to_time::get_date
|
||||||
|
#
|
||||||
|
DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(UUID()))));
|
||||||
|
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect INTEGER value: ''
|
||||||
|
Warning 1292 Truncated incorrect INTEGER value: ''
|
||||||
|
Warning 1292 Truncated incorrect INTEGER value: ''
|
||||||
|
Warning 1292 Truncated incorrect time value: '20000101'
|
||||||
|
SELECT TO_DAYS(SEC_TO_TIME(MAKEDATE(0,RAND(~0))));
|
||||||
|
TO_DAYS(SEC_TO_TIME(MAKEDATE(0,RAND(~0))))
|
||||||
|
0
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect time value: '20000101'
|
||||||
|
SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
|
||||||
|
SEC_TO_TIME(MAKEDATE(0,RAND(~0)))
|
||||||
|
838:59:59
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect time value: '20000101'
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
set @log_output.saved = @@global.log_output;
|
||||||
set @@global.log_output = 'TABLE';
|
set @@global.log_output = 'TABLE';
|
||||||
set session long_query_time=10;
|
set session long_query_time=10;
|
||||||
select get_lock('bug27638', 1);
|
select get_lock('bug27638', 1);
|
||||||
@ -7,25 +8,25 @@ set session long_query_time=1;
|
|||||||
select get_lock('bug27638', 2);
|
select get_lock('bug27638', 2);
|
||||||
get_lock('bug27638', 2)
|
get_lock('bug27638', 2)
|
||||||
0
|
0
|
||||||
select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:00:01', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 2)';
|
where sql_text = 'select get_lock(\'bug27638\', 2)';
|
||||||
qt sql_text
|
qt sql_text
|
||||||
OK select get_lock('bug27638', 2)
|
OK select get_lock('bug27638', 2)
|
||||||
select get_lock('bug27638', 60);
|
select get_lock('bug27638', 60);
|
||||||
get_lock('bug27638', 60)
|
get_lock('bug27638', 60)
|
||||||
0
|
0
|
||||||
select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:00:59', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 60)';
|
where sql_text = 'select get_lock(\'bug27638\', 60)';
|
||||||
qt sql_text
|
qt sql_text
|
||||||
OK select get_lock('bug27638', 60)
|
OK select get_lock('bug27638', 60)
|
||||||
select get_lock('bug27638', 101);
|
select get_lock('bug27638', 101);
|
||||||
get_lock('bug27638', 101)
|
get_lock('bug27638', 101)
|
||||||
0
|
0
|
||||||
select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:01:40', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 101)';
|
where sql_text = 'select get_lock(\'bug27638\', 101)';
|
||||||
qt sql_text
|
qt sql_text
|
||||||
OK select get_lock('bug27638', 101)
|
OK select get_lock('bug27638', 101)
|
||||||
select release_lock('bug27638');
|
select release_lock('bug27638');
|
||||||
release_lock('bug27638')
|
release_lock('bug27638')
|
||||||
1
|
1
|
||||||
set @@global.log_output=default;
|
set @@global.log_output = @log_output.saved;
|
||||||
|
@ -1697,7 +1697,14 @@ t1 CREATE TABLE `t1` (
|
|||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (v varchar(65535));
|
create table t1 (v varchar(65535));
|
||||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
Warnings:
|
||||||
|
Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`v` text
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
set storage_engine=MyISAM;
|
set storage_engine=MyISAM;
|
||||||
set @save_concurrent_insert=@@concurrent_insert;
|
set @save_concurrent_insert=@@concurrent_insert;
|
||||||
set global concurrent_insert=1;
|
set global concurrent_insert=1;
|
||||||
|
@ -314,12 +314,14 @@ bbbb
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a varchar(3070)) partition by key (a);
|
create table t1 (a varchar(3070)) partition by key (a);
|
||||||
ERROR HY000: The total length of the partitioning fields is too large
|
ERROR HY000: The total length of the partitioning fields is too large
|
||||||
|
create table t1 (a varchar(65532) not null) partition by key (a);
|
||||||
|
ERROR HY000: The total length of the partitioning fields is too large
|
||||||
create table t1 (a varchar(65533)) partition by key (a);
|
create table t1 (a varchar(65533)) partition by key (a);
|
||||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
ERROR HY000: A BLOB field is not allowed in partition function
|
||||||
create table t1 (a varchar(65534) not null) partition by key (a);
|
create table t1 (a varchar(65534) not null) partition by key (a);
|
||||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
ERROR HY000: A BLOB field is not allowed in partition function
|
||||||
create table t1 (a varchar(65535)) partition by key (a);
|
create table t1 (a varchar(65535)) partition by key (a);
|
||||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
ERROR HY000: A BLOB field is not allowed in partition function
|
||||||
create table t1 (a bit(27), primary key (a)) engine=myisam
|
create table t1 (a bit(27), primary key (a)) engine=myisam
|
||||||
partition by hash (a)
|
partition by hash (a)
|
||||||
(partition p0, partition p1, partition p2);
|
(partition p0, partition p1, partition p2);
|
||||||
|
@ -4173,4 +4173,147 @@ Warnings:
|
|||||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 0
|
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 0
|
||||||
deallocate prepare stmt2;
|
deallocate prepare stmt2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-9208: Function->Function->View = Mysqld segfault
|
||||||
|
# (Server crashes in Dependency_marker::visit_field on 2nd
|
||||||
|
# execution with merged subquery)
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (i1 INT);
|
||||||
|
insert into t1 values(1),(2);
|
||||||
|
CREATE TABLE t2 (i2 INT);
|
||||||
|
insert into t2 values(1),(2);
|
||||||
|
prepare stmt from "
|
||||||
|
select 1 from (
|
||||||
|
select
|
||||||
|
if (i1<0, 0, 0) as f1,
|
||||||
|
(select f1) as f2
|
||||||
|
from t1, t2
|
||||||
|
) sq
|
||||||
|
";
|
||||||
|
execute stmt;
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
execute stmt;
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
#
|
||||||
|
# MDEV-9619: Assertion `null_ref_table' failed in virtual
|
||||||
|
# table_map Item_direct_view_ref::used_tables() const on 2nd
|
||||||
|
# execution of PS
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES ('a'),('b');
|
||||||
|
CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES ('c'),('d');
|
||||||
|
PREPARE stmt FROM "SELECT * FROM v1 WHERE f1 = SOME ( SELECT f2 FROM t2 )";
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
insert into t1 values ('c');
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
c
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
c
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES ('a'),('b');
|
||||||
|
CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES ('c'),('d');
|
||||||
|
PREPARE stmt FROM "SELECT * FROM v1 WHERE (f1,f1) = SOME ( SELECT f2,f2 FROM t2 )";
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
insert into t1 values ('c');
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
c
|
||||||
|
EXECUTE stmt;
|
||||||
|
f1
|
||||||
|
c
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (3),(9);
|
||||||
|
CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES (1),(4);
|
||||||
|
CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t3 VALUES (6),(8);
|
||||||
|
CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t4 VALUES (2),(5);
|
||||||
|
PREPARE stmt FROM "
|
||||||
|
SELECT (
|
||||||
|
SELECT MAX( table1.column1 ) AS field1
|
||||||
|
FROM t1 AS table1
|
||||||
|
WHERE (111,table3.column3) IN ( SELECT 111,table2.column2 AS field2 FROM t2 AS table2 )
|
||||||
|
) AS sq
|
||||||
|
FROM t3 AS table3, t4 AS table4 GROUP BY sq
|
||||||
|
";
|
||||||
|
EXECUTE stmt;
|
||||||
|
sq
|
||||||
|
NULL
|
||||||
|
EXECUTE stmt;
|
||||||
|
sq
|
||||||
|
NULL
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
|
create table t1 (a int, b int, c int);
|
||||||
|
create table t2 (x int, y int, z int);
|
||||||
|
create table t3 as select * from t1;
|
||||||
|
insert into t1 values (1,2,3),(4,5,6),(100,200,300),(400,500,600);
|
||||||
|
insert into t2 values (1,2,3),(7,8,9),(100,200,300),(400,500,600);
|
||||||
|
insert into t3 values (1,2,3),(11,12,13),(100,0,0),(400,500,600);
|
||||||
|
set @optimizer_switch_save=@@optimizer_switch;
|
||||||
|
set @join_cache_level_save=@@join_cache_level;
|
||||||
|
set optimizer_switch='materialization=off';
|
||||||
|
set join_cache_level=0;
|
||||||
|
select * from t1 where (select a,b from t3 where t3.c=t1.c) in (select x,y from t2 where t1.c= t2.z);
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
prepare stmt from "select * from t1 where (select a,b from t3 where t3.c=t1.c) in (select x,y from t2 where t1.c= t2.z)";
|
||||||
|
EXECUTE stmt;
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
EXECUTE stmt;
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
create view v2 as select * from t2;
|
||||||
|
create view v3 as select * from t3;
|
||||||
|
select * from v1 where (select a,b from v3 where v3.c=v1.c) in (select x,y from v2 where v1.c= v2.z);
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
prepare stmt from "select * from v1 where (select a,b from v3 where v3.c=v1.c) in (select x,y from v2 where v1.c= v2.z)";
|
||||||
|
EXECUTE stmt;
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
EXECUTE stmt;
|
||||||
|
a b c
|
||||||
|
1 2 3
|
||||||
|
400 500 600
|
||||||
|
set optimizer_switch=@optimizer_switch_save;
|
||||||
|
set join_cache_level=@join_cache_level_save;
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1,v2,v3;
|
||||||
|
drop table t1,t2,t3;
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
|
@ -47,6 +47,9 @@ delete t1 from t1,t3 where t1.a=t3.a;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
insert into t1 values(1);
|
insert into t1 values(1);
|
||||||
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
||||||
|
drop temporary table if exists t1;
|
||||||
|
Warnings:
|
||||||
|
Note 1051 Unknown table 't1'
|
||||||
connection default;
|
connection default;
|
||||||
set global read_only=0;
|
set global read_only=0;
|
||||||
lock table t1 write;
|
lock table t1 write;
|
||||||
|
@ -959,7 +959,7 @@ def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N
|
|||||||
def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
|
def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
|
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589788 0 Y 16 0 33
|
||||||
def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
|
def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
|
def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
|
def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
|
||||||
@ -984,7 +984,7 @@ def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
|
|||||||
def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
|
def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
|
||||||
def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
|
def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
|
def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
|
||||||
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
|
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589788 0 Y 16 0 33
|
||||||
def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
|
def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
c int(11) NO PRI NULL
|
c int(11) NO PRI NULL
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
create function f() returns int return 1;
|
||||||
|
show function status;
|
||||||
|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||||
|
T f T T T T T T T T T
|
||||||
|
set sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';
|
||||||
|
show function status;
|
||||||
|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||||
|
T f T T T T T T T T T
|
||||||
|
drop function f;
|
||||||
|
select @@sql_mode;
|
||||||
|
@@sql_mode
|
||||||
|
PAD_CHAR_TO_FULL_LENGTH
|
||||||
|
create function f() returns int return 1;
|
||||||
|
select ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME='f';
|
||||||
|
ROUTINE_NAME
|
||||||
|
f
|
||||||
|
set sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';
|
||||||
|
select ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME='f';
|
||||||
|
ROUTINE_NAME
|
||||||
|
f
|
||||||
|
drop function f;
|
||||||
|
select @@sql_mode;
|
||||||
|
@@sql_mode
|
||||||
|
PAD_CHAR_TO_FULL_LENGTH
|
@ -1240,9 +1240,9 @@ Warning 1364 Field 'i' doesn't have a default value
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
set @@sql_mode='traditional';
|
set @@sql_mode='traditional';
|
||||||
create table t1(a varchar(65537));
|
create table t1(a varchar(65537));
|
||||||
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
|
ERROR 42000: Column length too big for column 'a' (max = 65532); use BLOB or TEXT instead
|
||||||
create table t1(a varbinary(65537));
|
create table t1(a varbinary(65537));
|
||||||
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
|
ERROR 42000: Column length too big for column 'a' (max = 65532); use BLOB or TEXT instead
|
||||||
set @@sql_mode='traditional';
|
set @@sql_mode='traditional';
|
||||||
create table t1(a int, b date not null);
|
create table t1(a int, b date not null);
|
||||||
alter table t1 modify a bigint unsigned not null;
|
alter table t1 modify a bigint unsigned not null;
|
||||||
|
@ -502,3 +502,20 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 PRIMARY t1 index idx idx 5 NULL 5 Using where; Using index
|
1 PRIMARY t1 index idx idx 5 NULL 5 Using where; Using index
|
||||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-13135: subquery with ON expression subject to
|
||||||
|
# semi-join optimizations
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a AS v_a FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (1),(3);
|
||||||
|
CREATE TABLE t2 (b INT, KEY(b));
|
||||||
|
INSERT INTO t2 VALUES (3),(4);
|
||||||
|
SELECT * FROM t1 WHERE a NOT IN (
|
||||||
|
SELECT b FROM t2 INNER JOIN v1 ON (b IN ( SELECT a FROM t1 ))
|
||||||
|
WHERE v_a = b
|
||||||
|
);
|
||||||
|
a
|
||||||
|
1
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
@ -37,7 +37,7 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT
|
|||||||
CREATE TABLE t2 (a char(256));
|
CREATE TABLE t2 (a char(256));
|
||||||
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead
|
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead
|
||||||
CREATE TABLE t1 (a varchar(70000) default "hello");
|
CREATE TABLE t1 (a varchar(70000) default "hello");
|
||||||
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
|
ERROR 42000: Column length too big for column 'a' (max = 65532); use BLOB or TEXT instead
|
||||||
CREATE TABLE t2 (a blob default "hello");
|
CREATE TABLE t2 (a blob default "hello");
|
||||||
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
|
@ -510,3 +510,72 @@ SELECT 5 = a FROM t1;
|
|||||||
Warnings:
|
Warnings:
|
||||||
Warning 1292 Truncated incorrect DOUBLE value: 's '
|
Warning 1292 Truncated incorrect DOUBLE value: 's '
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65532));
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 varbinary(65532) YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65533));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARBINARY to BLOB
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 blob YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65534));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARBINARY to BLOB
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 blob YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65535));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARBINARY to BLOB
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 blob YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65536));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARBINARY to BLOB
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 mediumblob YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65532));
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 varchar(65532) YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65533));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 text YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65534));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 text YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65535));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 text YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65536));
|
||||||
|
Warnings:
|
||||||
|
Note 1246 Converting column 'c1' from VARCHAR to TEXT
|
||||||
|
DESCRIBE t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
c1 mediumtext YES NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -5626,9 +5626,6 @@ CREATE TABLE t3 (a INT);
|
|||||||
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
||||||
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
||||||
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
||||||
EXECUTE stmt;
|
|
||||||
ERROR HY000: Can not insert into join view 'test.v2' without fields list
|
|
||||||
EXECUTE stmt;
|
|
||||||
ERROR HY000: Can not insert into join view 'test.v2' without fields list
|
ERROR HY000: Can not insert into join view 'test.v2' without fields list
|
||||||
drop view v1,v2;
|
drop view v1,v2;
|
||||||
drop table t3;
|
drop table t3;
|
||||||
|
@ -1586,7 +1586,14 @@ t1 CREATE TABLE `t1` (
|
|||||||
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (v varchar(65535));
|
create table t1 (v varchar(65535));
|
||||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
Warnings:
|
||||||
|
Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`v` text
|
||||||
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
|
||||||
|
drop table t1;
|
||||||
set @save_concurrent_insert=@@concurrent_insert;
|
set @save_concurrent_insert=@@concurrent_insert;
|
||||||
set global concurrent_insert=1;
|
set global concurrent_insert=1;
|
||||||
create table t1 (a int) ROW_FORMAT=FIXED;
|
create table t1 (a int) ROW_FORMAT=FIXED;
|
||||||
|
@ -924,8 +924,9 @@ show create table t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# ARIA specific varchar tests
|
# ARIA specific varchar tests
|
||||||
--error 1118
|
|
||||||
create table t1 (v varchar(65535));
|
create table t1 (v varchar(65535));
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test concurrent insert
|
# Test concurrent insert
|
||||||
|
18
mysql-test/suite/parts/r/partition_alter_maria.result
Normal file
18
mysql-test/suite/parts/r/partition_alter_maria.result
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
create table t1 (
|
||||||
|
pk bigint not null auto_increment,
|
||||||
|
dt datetime default null,
|
||||||
|
unique (pk, dt)
|
||||||
|
) engine=aria row_format=dynamic
|
||||||
|
partition by range columns(dt) (
|
||||||
|
partition `p20171231` values less than ('2017-12-31'),
|
||||||
|
partition `p20181231` values less than ('2018-12-31')
|
||||||
|
);
|
||||||
|
insert into t1 values (1,'2017-09-28 15:12:00');
|
||||||
|
select * from t1;
|
||||||
|
pk dt
|
||||||
|
1 2017-09-28 15:12:00
|
||||||
|
alter table t1 drop partition p20181231;
|
||||||
|
select * from t1;
|
||||||
|
pk dt
|
||||||
|
1 2017-09-28 15:12:00
|
||||||
|
drop table t1;
|
18
mysql-test/suite/parts/t/partition_alter_maria.test
Normal file
18
mysql-test/suite/parts/t/partition_alter_maria.test
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#
|
||||||
|
# MDEV-13937 Aria engine: Internal Error 160 after partition handling
|
||||||
|
#
|
||||||
|
source include/have_partition.inc;
|
||||||
|
create table t1 (
|
||||||
|
pk bigint not null auto_increment,
|
||||||
|
dt datetime default null,
|
||||||
|
unique (pk, dt)
|
||||||
|
) engine=aria row_format=dynamic
|
||||||
|
partition by range columns(dt) (
|
||||||
|
partition `p20171231` values less than ('2017-12-31'),
|
||||||
|
partition `p20181231` values less than ('2018-12-31')
|
||||||
|
);
|
||||||
|
insert into t1 values (1,'2017-09-28 15:12:00');
|
||||||
|
select * from t1;
|
||||||
|
alter table t1 drop partition p20181231;
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
@ -337,3 +337,22 @@ tsv timestamp as (adddate(ts, interval 1 day)) virtual
|
|||||||
);
|
);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
|
#
|
||||||
|
# MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
|
||||||
|
#
|
||||||
|
SET sql_mode='NO_ZERO_IN_DATE';
|
||||||
|
CREATE TABLE t1
|
||||||
|
(
|
||||||
|
a datetime DEFAULT NULL,
|
||||||
|
b datetime DEFAULT NULL,
|
||||||
|
c time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',DEFAULT);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a b c
|
||||||
|
2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -301,3 +301,23 @@ create table t1 (
|
|||||||
);
|
);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET sql_mode='NO_ZERO_IN_DATE';
|
||||||
|
CREATE TABLE t1
|
||||||
|
(
|
||||||
|
a datetime DEFAULT NULL,
|
||||||
|
b datetime DEFAULT NULL,
|
||||||
|
c time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',DEFAULT);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
@ -1231,3 +1231,44 @@ execute stmt1;
|
|||||||
deallocate prepare stmt1;
|
deallocate prepare stmt1;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-8960 Can't refer the same column twice in one ALTER TABLE
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT;
|
||||||
|
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
|
||||||
|
ALTER COLUMN `consultant_id` SET DEFAULT 2;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
|
||||||
|
ALTER COLUMN `consultant_id` DROP DEFAULT,
|
||||||
|
MODIFY COLUMN `consultant_id` BIGINT;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -174,6 +174,18 @@ drop table t1, t2;
|
|||||||
|
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
|
||||||
|
--echo # (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
set @@sql_mode='';
|
||||||
|
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2);
|
||||||
|
INSERT INTO t1 VALUES(990101.102);
|
||||||
|
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
set @@sql_mode=default;
|
||||||
|
|
||||||
#
|
#
|
||||||
# lp:1001510
|
# lp:1001510
|
||||||
# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN
|
# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN
|
||||||
|
@ -120,6 +120,35 @@ select count(distinct user_id) from t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
set @@tmp_table_size = default;
|
set @@tmp_table_size = default;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-13457: Wrong result for aggregate function with distinct clause when the value for
|
||||||
|
# tmp_table_size is small
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
a VARCHAR(1020),
|
||||||
|
b int
|
||||||
|
);
|
||||||
|
insert into t1 values
|
||||||
|
( 0 , 1 ),
|
||||||
|
( 1 , 2 ),
|
||||||
|
( 2 , 3 ),
|
||||||
|
( 3 , 4 ),
|
||||||
|
( 4 , 5 ),
|
||||||
|
( 5 , 6 ),
|
||||||
|
( 6 , 7 ),
|
||||||
|
( 7 , 8 ),
|
||||||
|
( 8 , 9 ),
|
||||||
|
( 9 , 10 ),
|
||||||
|
( 0 , 11 ),
|
||||||
|
( 1 , 12 ),
|
||||||
|
( 2 , 13 ),
|
||||||
|
( 3 , 14 );
|
||||||
|
set @@tmp_table_size=1024;
|
||||||
|
select count(distinct a) from t1;
|
||||||
|
drop table t1;
|
||||||
|
set @@tmp_table_size = default;
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@ -862,6 +862,29 @@ SELECT @@sql_mode;
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13972 crash in Item_func_sec_to_time::get_date
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SELECT SEC_TO_TIME(CONVERT(900*24*60*60 USING ucs2));
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32766) CHARACTER SET ucs2);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32767) CHARACTER SET ucs2);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(32768) CHARACTER SET ucs2);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -890,6 +890,19 @@ SELECT @@sql_mode;
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(16383) CHARACTER SET utf32);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(16384) CHARACTER SET utf32);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -1695,6 +1695,22 @@ SELECT CHAR(i USING utf8) FROM t1;
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21844) CHARACTER SET utf8);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21845) CHARACTER SET utf8);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(21846) CHARACTER SET utf8);
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -606,3 +606,11 @@ EXECUTE s;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo # End of 5.3 tests
|
--echo # End of 5.3 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
|
||||||
|
#
|
||||||
|
create table t1 (a int);
|
||||||
|
insert t1 values (1),(2),(3);
|
||||||
|
select * from t1 where 1 in (a, name_const('a', null));
|
||||||
|
drop table t1;
|
||||||
|
@ -1602,3 +1602,34 @@ DROP TABLE t1;
|
|||||||
--echo # MDEV-10524 Assertion `arg1_int >= 0' failed in Item_func_additive_op::result_precision()
|
--echo # MDEV-10524 Assertion `arg1_int >= 0' failed in Item_func_additive_op::result_precision()
|
||||||
--echo #
|
--echo #
|
||||||
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
|
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET sql_mode='NO_ZERO_IN_DATE';
|
||||||
|
CREATE TABLE t1 (a TIME(6));
|
||||||
|
INSERT INTO t1 SELECT timediff(timestamp'2008-12-31 23:59:59.000001',timestamp'2008-12-30 01:01:01.000002');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13972 crash in Item_func_sec_to_time::get_date
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
# The below query can return warning sporadically
|
||||||
|
--disable_warnings
|
||||||
|
DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(UUID()))));
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
|
||||||
|
SELECT TO_DAYS(SEC_TO_TIME(MAKEDATE(0,RAND(~0))));
|
||||||
|
SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
# check that CSV engine was compiled in
|
# check that CSV engine was compiled in
|
||||||
--source include/have_csv.inc
|
--source include/have_csv.inc
|
||||||
|
|
||||||
|
set @log_output.saved = @@global.log_output;
|
||||||
set @@global.log_output = 'TABLE';
|
set @@global.log_output = 'TABLE';
|
||||||
|
|
||||||
connect (con1,localhost,root,,);
|
connect (con1,localhost,root,,);
|
||||||
@ -21,13 +22,13 @@ select get_lock('bug27638', 1);
|
|||||||
connection con2;
|
connection con2;
|
||||||
set session long_query_time=1;
|
set session long_query_time=1;
|
||||||
select get_lock('bug27638', 2);
|
select get_lock('bug27638', 2);
|
||||||
select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:00:01', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 2)';
|
where sql_text = 'select get_lock(\'bug27638\', 2)';
|
||||||
select get_lock('bug27638', 60);
|
select get_lock('bug27638', 60);
|
||||||
select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:00:59', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 60)';
|
where sql_text = 'select get_lock(\'bug27638\', 60)';
|
||||||
select get_lock('bug27638', 101);
|
select get_lock('bug27638', 101);
|
||||||
select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
|
select if (query_time >= '00:01:40', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
|
||||||
where sql_text = 'select get_lock(\'bug27638\', 101)';
|
where sql_text = 'select get_lock(\'bug27638\', 101)';
|
||||||
connection con1;
|
connection con1;
|
||||||
select release_lock('bug27638');
|
select release_lock('bug27638');
|
||||||
@ -36,4 +37,4 @@ connection default;
|
|||||||
disconnect con1;
|
disconnect con1;
|
||||||
disconnect con2;
|
disconnect con2;
|
||||||
|
|
||||||
set @@global.log_output=default;
|
set @@global.log_output = @log_output.saved;
|
||||||
|
@ -1030,8 +1030,9 @@ show create table t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# MyISAM specific varchar tests
|
# MyISAM specific varchar tests
|
||||||
--error 1118
|
|
||||||
create table t1 (v varchar(65535));
|
create table t1 (v varchar(65535));
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
eval set storage_engine=$default;
|
eval set storage_engine=$default;
|
||||||
|
|
||||||
|
@ -217,11 +217,13 @@ select * from t1 where a = 'bbbb';
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
-- error ER_PARTITION_FIELDS_TOO_LONG
|
-- error ER_PARTITION_FIELDS_TOO_LONG
|
||||||
create table t1 (a varchar(3070)) partition by key (a);
|
create table t1 (a varchar(3070)) partition by key (a);
|
||||||
-- error ER_TOO_BIG_ROWSIZE
|
-- error ER_PARTITION_FIELDS_TOO_LONG
|
||||||
|
create table t1 (a varchar(65532) not null) partition by key (a);
|
||||||
|
-- error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
|
||||||
create table t1 (a varchar(65533)) partition by key (a);
|
create table t1 (a varchar(65533)) partition by key (a);
|
||||||
-- error ER_TOO_BIG_ROWSIZE
|
-- error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
|
||||||
create table t1 (a varchar(65534) not null) partition by key (a);
|
create table t1 (a varchar(65534) not null) partition by key (a);
|
||||||
-- error ER_TOO_BIG_ROWSIZE
|
-- error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
|
||||||
create table t1 (a varchar(65535)) partition by key (a);
|
create table t1 (a varchar(65535)) partition by key (a);
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -3714,4 +3714,133 @@ deallocate prepare stmt2;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-9208: Function->Function->View = Mysqld segfault
|
||||||
|
--echo # (Server crashes in Dependency_marker::visit_field on 2nd
|
||||||
|
--echo # execution with merged subquery)
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (i1 INT);
|
||||||
|
insert into t1 values(1),(2);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (i2 INT);
|
||||||
|
insert into t2 values(1),(2);
|
||||||
|
|
||||||
|
prepare stmt from "
|
||||||
|
select 1 from (
|
||||||
|
select
|
||||||
|
if (i1<0, 0, 0) as f1,
|
||||||
|
(select f1) as f2
|
||||||
|
from t1, t2
|
||||||
|
) sq
|
||||||
|
";
|
||||||
|
|
||||||
|
execute stmt;
|
||||||
|
execute stmt;
|
||||||
|
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-9619: Assertion `null_ref_table' failed in virtual
|
||||||
|
--echo # table_map Item_direct_view_ref::used_tables() const on 2nd
|
||||||
|
--echo # execution of PS
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES ('a'),('b');
|
||||||
|
|
||||||
|
CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES ('c'),('d');
|
||||||
|
|
||||||
|
PREPARE stmt FROM "SELECT * FROM v1 WHERE f1 = SOME ( SELECT f2 FROM t2 )";
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
insert into t1 values ('c');
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES ('a'),('b');
|
||||||
|
|
||||||
|
CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES ('c'),('d');
|
||||||
|
|
||||||
|
PREPARE stmt FROM "SELECT * FROM v1 WHERE (f1,f1) = SOME ( SELECT f2,f2 FROM t2 )";
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
insert into t1 values ('c');
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (3),(9);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
|
||||||
|
|
||||||
|
INSERT INTO t2 VALUES (1),(4);
|
||||||
|
|
||||||
|
CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t3 VALUES (6),(8);
|
||||||
|
|
||||||
|
CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t4 VALUES (2),(5);
|
||||||
|
|
||||||
|
PREPARE stmt FROM "
|
||||||
|
SELECT (
|
||||||
|
SELECT MAX( table1.column1 ) AS field1
|
||||||
|
FROM t1 AS table1
|
||||||
|
WHERE (111,table3.column3) IN ( SELECT 111,table2.column2 AS field2 FROM t2 AS table2 )
|
||||||
|
) AS sq
|
||||||
|
FROM t3 AS table3, t4 AS table4 GROUP BY sq
|
||||||
|
";
|
||||||
|
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
|
|
||||||
|
create table t1 (a int, b int, c int);
|
||||||
|
create table t2 (x int, y int, z int);
|
||||||
|
create table t3 as select * from t1;
|
||||||
|
insert into t1 values (1,2,3),(4,5,6),(100,200,300),(400,500,600);
|
||||||
|
insert into t2 values (1,2,3),(7,8,9),(100,200,300),(400,500,600);
|
||||||
|
insert into t3 values (1,2,3),(11,12,13),(100,0,0),(400,500,600);
|
||||||
|
|
||||||
|
|
||||||
|
set @optimizer_switch_save=@@optimizer_switch;
|
||||||
|
set @join_cache_level_save=@@join_cache_level;
|
||||||
|
set optimizer_switch='materialization=off';
|
||||||
|
set join_cache_level=0;
|
||||||
|
select * from t1 where (select a,b from t3 where t3.c=t1.c) in (select x,y from t2 where t1.c= t2.z);
|
||||||
|
prepare stmt from "select * from t1 where (select a,b from t3 where t3.c=t1.c) in (select x,y from t2 where t1.c= t2.z)";
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
create view v2 as select * from t2;
|
||||||
|
create view v3 as select * from t3;
|
||||||
|
select * from v1 where (select a,b from v3 where v3.c=v1.c) in (select x,y from v2 where v1.c= v2.z);
|
||||||
|
prepare stmt from "select * from v1 where (select a,b from v3 where v3.c=v1.c) in (select x,y from v2 where v1.c= v2.z)";
|
||||||
|
EXECUTE stmt;
|
||||||
|
EXECUTE stmt;
|
||||||
|
set optimizer_switch=@optimizer_switch_save;
|
||||||
|
set join_cache_level=@join_cache_level_save;
|
||||||
|
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1,v2,v3;
|
||||||
|
drop table t1,t2,t3;
|
||||||
|
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
|
@ -114,6 +114,11 @@ drop table t1;
|
|||||||
--error ER_OPTION_PREVENTS_STATEMENT
|
--error ER_OPTION_PREVENTS_STATEMENT
|
||||||
insert into t1 values(1);
|
insert into t1 values(1);
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-14056 DROP TEMPORARY TABLE IF EXISTS causes error 1290 with read_only option
|
||||||
|
#
|
||||||
|
drop temporary table if exists t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#11733 COMMITs should not happen if read-only is set
|
# Bug#11733 COMMITs should not happen if read-only is set
|
||||||
#
|
#
|
||||||
|
23
mysql-test/t/show_function_with_pad_char_to_full_length.test
Normal file
23
mysql-test/t/show_function_with_pad_char_to_full_length.test
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Test that show function status succeeds with
|
||||||
|
# sql_mode = 'PAD_CHAR_TO_FULL_LENGTH (MDEV-13149)
|
||||||
|
|
||||||
|
# show function status
|
||||||
|
|
||||||
|
create function f() returns int return 1;
|
||||||
|
--replace_column 1 T 3 T 4 T 5 T 6 T 7 T 8 T 9 T 10 T 11 T
|
||||||
|
show function status;
|
||||||
|
set sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';
|
||||||
|
--replace_column 1 T 3 T 4 T 5 T 6 T 7 T 8 T 9 T 10 T 11 T
|
||||||
|
show function status;
|
||||||
|
drop function f;
|
||||||
|
select @@sql_mode;
|
||||||
|
|
||||||
|
# select ROUTINE_NAME from information_schema.ROUTINES
|
||||||
|
|
||||||
|
create function f() returns int return 1;
|
||||||
|
select ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME='f';
|
||||||
|
set sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';
|
||||||
|
select ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME='f';
|
||||||
|
drop function f;
|
||||||
|
select @@sql_mode;
|
@ -522,4 +522,23 @@ select * from t1 where a in (select max(a) from t1 where a < 4) or a > 5;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13135: subquery with ON expression subject to
|
||||||
|
--echo # semi-join optimizations
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a AS v_a FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (1),(3);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (b INT, KEY(b));
|
||||||
|
INSERT INTO t2 VALUES (3),(4);
|
||||||
|
|
||||||
|
SELECT * FROM t1 WHERE a NOT IN (
|
||||||
|
SELECT b FROM t2 INNER JOIN v1 ON (b IN ( SELECT a FROM t1 ))
|
||||||
|
WHERE v_a = b
|
||||||
|
);
|
||||||
|
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
@ -217,3 +217,47 @@ CREATE TABLE t1 (a CHAR(16));
|
|||||||
INSERT INTO t1 VALUES ('5'), ('s'), ('');
|
INSERT INTO t1 VALUES ('5'), ('s'), ('');
|
||||||
SELECT 5 = a FROM t1;
|
SELECT 5 = a FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65532));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65533));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65534));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65535));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARBINARY(65536));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65532));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65533));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65534));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65535));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (c1 VARCHAR(65536));
|
||||||
|
DESCRIBE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -5573,11 +5573,8 @@ drop table t1,t2,t3;
|
|||||||
CREATE TABLE t3 (a INT);
|
CREATE TABLE t3 (a INT);
|
||||||
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
||||||
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
||||||
|
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
||||||
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
||||||
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
|
||||||
EXECUTE stmt;
|
|
||||||
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
|
||||||
EXECUTE stmt;
|
|
||||||
drop view v1,v2;
|
drop view v1,v2;
|
||||||
drop table t3;
|
drop table t3;
|
||||||
|
|
||||||
|
@ -47,6 +47,11 @@ void* operator new[](std::size_t sz, const std::nothrow_t&) throw()
|
|||||||
return (void *) my_malloc (sz ? sz : 1, MYF(0));
|
return (void *) my_malloc (sz ? sz : 1, MYF(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void operator delete (void *ptr, std::size_t)
|
||||||
|
{
|
||||||
|
my_free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
void operator delete (void *ptr)
|
void operator delete (void *ptr)
|
||||||
{
|
{
|
||||||
my_free(ptr);
|
my_free(ptr);
|
||||||
@ -57,6 +62,11 @@ void operator delete[] (void *ptr) throw ()
|
|||||||
my_free(ptr);
|
my_free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void operator delete[] (void *ptr, std::size_t) throw ()
|
||||||
|
{
|
||||||
|
my_free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
void operator delete(void* ptr, const std::nothrow_t&) throw()
|
void operator delete(void* ptr, const std::nothrow_t&) throw()
|
||||||
{
|
{
|
||||||
my_free(ptr);
|
my_free(ptr);
|
||||||
|
@ -10,6 +10,12 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
check_cxx_compiler_flag(" -Wdeprecated-declarations" HAVE_CXX_WDEPRECATED_DECLARATIONS)
|
||||||
|
IF (HAVE_CXX_WDEPRECATED_DECLARATIONS)
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(libhsclient)
|
INCLUDE_DIRECTORIES(libhsclient)
|
||||||
|
|
||||||
# Handlersocket client library. We do not distribute it,
|
# Handlersocket client library. We do not distribute it,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define PLUGIN_VERSION 0x104
|
#define PLUGIN_VERSION 0x104
|
||||||
#define PLUGIN_STR_VERSION "1.4.1"
|
#define PLUGIN_STR_VERSION "1.4.2"
|
||||||
|
|
||||||
#define _my_thread_var loc_thread_var
|
#define _my_thread_var loc_thread_var
|
||||||
|
|
||||||
@ -1090,6 +1090,7 @@ static void setup_connection_connect(struct connection_info *cn,
|
|||||||
const struct mysql_event_connection *event)
|
const struct mysql_event_connection *event)
|
||||||
{
|
{
|
||||||
cn->query_id= 0;
|
cn->query_id= 0;
|
||||||
|
cn->query_length= 0;
|
||||||
cn->log_always= 0;
|
cn->log_always= 0;
|
||||||
cn->thread_id= event->thread_id;
|
cn->thread_id= event->thread_id;
|
||||||
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
||||||
@ -1131,6 +1132,7 @@ static void setup_connection_initdb(struct connection_info *cn,
|
|||||||
|
|
||||||
cn->thread_id= event->general_thread_id;
|
cn->thread_id= event->general_thread_id;
|
||||||
cn->query_id= 0;
|
cn->query_id= 0;
|
||||||
|
cn->query_length= 0;
|
||||||
cn->log_always= 0;
|
cn->log_always= 0;
|
||||||
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
||||||
event->general_query, event->general_query_length);
|
event->general_query, event->general_query_length);
|
||||||
@ -1163,6 +1165,7 @@ static void setup_connection_table(struct connection_info *cn,
|
|||||||
cn->thread_id= event->thread_id;
|
cn->thread_id= event->thread_id;
|
||||||
cn->query_id= query_counter++;
|
cn->query_id= query_counter++;
|
||||||
cn->log_always= 0;
|
cn->log_always= 0;
|
||||||
|
cn->query_length= 0;
|
||||||
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
get_str_n(cn->db, &cn->db_length, sizeof(cn->db),
|
||||||
event->database, event->database_length);
|
event->database, event->database_length);
|
||||||
get_str_n(cn->user, &cn->user_length, sizeof(cn->db),
|
get_str_n(cn->user, &cn->user_length, sizeof(cn->db),
|
||||||
@ -1184,6 +1187,7 @@ static void setup_connection_query(struct connection_info *cn,
|
|||||||
cn->thread_id= event->general_thread_id;
|
cn->thread_id= event->general_thread_id;
|
||||||
cn->query_id= query_counter++;
|
cn->query_id= query_counter++;
|
||||||
cn->log_always= 0;
|
cn->log_always= 0;
|
||||||
|
cn->query_length= 0;
|
||||||
get_str_n(cn->db, &cn->db_length, sizeof(cn->db), "", 0);
|
get_str_n(cn->db, &cn->db_length, sizeof(cn->db), "", 0);
|
||||||
|
|
||||||
if (get_user_host(event->general_user, event->general_user_length,
|
if (get_user_host(event->general_user, event->general_user_length,
|
||||||
@ -2008,6 +2012,7 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
|
|||||||
event_query_command(event))
|
event_query_command(event))
|
||||||
{
|
{
|
||||||
log_statement(cn, event, "QUERY");
|
log_statement(cn, event, "QUERY");
|
||||||
|
cn->query_length= 0; /* So the log_current_query() won't log this again. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event_class == MYSQL_AUDIT_TABLE_CLASS && FILTER(EVENT_TABLE) && cn)
|
else if (event_class == MYSQL_AUDIT_TABLE_CLASS && FILTER(EVENT_TABLE) && cn)
|
||||||
@ -2523,7 +2528,8 @@ static void log_current_query(MYSQL_THD thd)
|
|||||||
if (!thd)
|
if (!thd)
|
||||||
return;
|
return;
|
||||||
cn= get_loc_info(thd);
|
cn= get_loc_info(thd);
|
||||||
if (!ci_needs_setup(cn) && FILTER(EVENT_QUERY) && do_log_user(cn->user))
|
if (!ci_needs_setup(cn) && cn->query_length &&
|
||||||
|
FILTER(EVENT_QUERY) && do_log_user(cn->user))
|
||||||
{
|
{
|
||||||
log_statement_ex(cn, cn->query_time, thd_get_thread_id(thd),
|
log_statement_ex(cn, cn->query_time, thd_get_thread_id(thd),
|
||||||
cn->query, cn->query_length, 0, "QUERY");
|
cn->query, cn->query_length, 0, "QUERY");
|
||||||
|
@ -205,6 +205,11 @@ ELSE()
|
|||||||
SET(localstatedir ${MYSQL_DATADIR})
|
SET(localstatedir ${MYSQL_DATADIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
SET(resolveip_locations "$basedir/${INSTALL_BINDIR} $basedir/bin")
|
||||||
|
SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin $basedir/bin")
|
||||||
|
SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mysql/english")
|
||||||
|
SET(pkgdata_locations "$basedir/${INSTALL_MYSQLSHAREDIR} $basedir/share $basedir/share/mysql")
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
|
${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
|
||||||
|
@ -159,7 +159,7 @@ parse_arguments()
|
|||||||
|
|
||||||
# Try to find a specific file within --basedir which can either be a binary
|
# Try to find a specific file within --basedir which can either be a binary
|
||||||
# release or installed source directory and return the path.
|
# release or installed source directory and return the path.
|
||||||
find_in_basedir()
|
find_in_dirs()
|
||||||
{
|
{
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--dir)
|
--dir)
|
||||||
@ -171,13 +171,13 @@ find_in_basedir()
|
|||||||
|
|
||||||
for dir in "$@"
|
for dir in "$@"
|
||||||
do
|
do
|
||||||
if test -f "$basedir/$dir/$file"
|
if test -f "$dir/$file"
|
||||||
then
|
then
|
||||||
if test -n "$return_dir"
|
if test -n "$return_dir"
|
||||||
then
|
then
|
||||||
echo "$basedir/$dir"
|
echo "$dir"
|
||||||
else
|
else
|
||||||
echo "$basedir/$dir/$file"
|
echo "$dir/$file"
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -239,7 +239,7 @@ then
|
|||||||
print_defaults="$builddir/extra/my_print_defaults"
|
print_defaults="$builddir/extra/my_print_defaults"
|
||||||
elif test -n "$basedir"
|
elif test -n "$basedir"
|
||||||
then
|
then
|
||||||
print_defaults=`find_in_basedir my_print_defaults bin extra`
|
print_defaults=`find_in_dirs my_print_defaults $basedir/bin $basedir/extra`
|
||||||
if test -z "$print_defaults"
|
if test -z "$print_defaults"
|
||||||
then
|
then
|
||||||
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
|
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
|
||||||
@ -265,41 +265,43 @@ if test -n "$srcdir"
|
|||||||
then
|
then
|
||||||
basedir="$builddir"
|
basedir="$builddir"
|
||||||
bindir="$basedir/client"
|
bindir="$basedir/client"
|
||||||
extra_bindir="$basedir/extra"
|
resolveip="$basedir/extra/resolveip"
|
||||||
mysqld="$basedir/sql/mysqld"
|
mysqld="$basedir/sql/mysqld"
|
||||||
langdir="$basedir/sql/share/english"
|
langdir="$basedir/sql/share/english"
|
||||||
pkgdatadir="$srcdir/scripts"
|
pkgdatadir="$srcdir/scripts"
|
||||||
scriptdir="$srcdir/scripts"
|
|
||||||
elif test -n "$basedir"
|
elif test -n "$basedir"
|
||||||
then
|
then
|
||||||
bindir="$basedir/bin"
|
bindir="$basedir/bin" # only used in the help text
|
||||||
extra_bindir="$bindir"
|
resolveip=`find_in_dirs resolveip @resolveip_locations@`
|
||||||
mysqld=`find_in_basedir mysqld libexec sbin bin`
|
if test -z "$resolveip"
|
||||||
|
then
|
||||||
|
cannot_find_file resolveip @resolveip_locations@
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mysqld=`find_in_dirs mysqld @mysqld_locations@`
|
||||||
if test -z "$mysqld"
|
if test -z "$mysqld"
|
||||||
then
|
then
|
||||||
cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
|
cannot_find_file mysqld @mysqld_locations@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
|
langdir=`find_in_dirs --dir errmsg.sys @errmsg_locations@`
|
||||||
if test -z "$langdir"
|
if test -z "$langdir"
|
||||||
then
|
then
|
||||||
cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
|
cannot_find_file errmsg.sys @errmsg_locations@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
|
pkgdatadir=`find_in_dirs --dir fill_help_tables.sql @pkgdata_locations@`
|
||||||
if test -z "$pkgdatadir"
|
if test -z "$pkgdatadir"
|
||||||
then
|
then
|
||||||
cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
|
cannot_find_file fill_help_tables.sql @pkgdata_locations@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
scriptdir="$basedir/scripts"
|
|
||||||
else
|
else
|
||||||
basedir="@prefix@"
|
basedir="@prefix@"
|
||||||
bindir="@bindir@"
|
bindir="@bindir@"
|
||||||
extra_bindir="$bindir"
|
resolveip="$bindir/resolveip"
|
||||||
mysqld="@libexecdir@/mysqld"
|
mysqld="@libexecdir@/mysqld"
|
||||||
pkgdatadir="@pkgdatadir@"
|
pkgdatadir="@pkgdatadir@"
|
||||||
scriptdir="@scriptdir@"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up paths to SQL scripts required for bootstrap
|
# Set up paths to SQL scripts required for bootstrap
|
||||||
@ -342,14 +344,14 @@ hostname=`@HOSTNAME@`
|
|||||||
# Check if hostname is valid
|
# Check if hostname is valid
|
||||||
if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
|
if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
|
||||||
then
|
then
|
||||||
resolved=`"$extra_bindir/resolveip" $hostname 2>&1`
|
resolved=`"$resolveip" $hostname 2>&1`
|
||||||
if test $? -ne 0
|
if test $? -ne 0
|
||||||
then
|
then
|
||||||
resolved=`"$extra_bindir/resolveip" localhost 2>&1`
|
resolved=`"$resolveip" localhost 2>&1`
|
||||||
if test $? -ne 0
|
if test $? -ne 0
|
||||||
then
|
then
|
||||||
echo "Neither host '$hostname' nor 'localhost' could be looked up with"
|
echo "Neither host '$hostname' nor 'localhost' could be looked up with"
|
||||||
echo "'$extra_bindir/resolveip'"
|
echo "'$resolveip'"
|
||||||
echo "Please configure the 'hostname' command to return a correct"
|
echo "Please configure the 'hostname' command to return a correct"
|
||||||
echo "hostname."
|
echo "hostname."
|
||||||
echo "If you want to solve this at a later stage, restart this script"
|
echo "If you want to solve this at a later stage, restart this script"
|
||||||
@ -357,7 +359,7 @@ then
|
|||||||
link_to_help
|
link_to_help
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "WARNING: The host '$hostname' could not be looked up with resolveip."
|
echo "WARNING: The host '$hostname' could not be looked up with $resolveip."
|
||||||
echo "This probably means that your libc libraries are not 100 % compatible"
|
echo "This probably means that your libc libraries are not 100 % compatible"
|
||||||
echo "with this binary MariaDB version. The MariaDB daemon, mysqld, should work"
|
echo "with this binary MariaDB version. The MariaDB daemon, mysqld, should work"
|
||||||
echo "normally with the exception that host name resolving will not work."
|
echo "normally with the exception that host name resolving will not work."
|
||||||
@ -436,7 +438,7 @@ else
|
|||||||
echo "The problem could be conflicting information in an external"
|
echo "The problem could be conflicting information in an external"
|
||||||
echo "my.cnf files. You can ignore these by doing:"
|
echo "my.cnf files. You can ignore these by doing:"
|
||||||
echo
|
echo
|
||||||
echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf"
|
echo " shell> $0 --defaults-file=~/.my.cnf"
|
||||||
echo
|
echo
|
||||||
echo "You can also try to start the mysqld daemon with:"
|
echo "You can also try to start the mysqld daemon with:"
|
||||||
echo
|
echo
|
||||||
|
@ -1276,6 +1276,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
|
|||||||
break;
|
break;
|
||||||
case OPT_pipe:
|
case OPT_pipe:
|
||||||
options->protocol = MYSQL_PROTOCOL_PIPE;
|
options->protocol = MYSQL_PROTOCOL_PIPE;
|
||||||
|
break;
|
||||||
case OPT_connect_timeout:
|
case OPT_connect_timeout:
|
||||||
case OPT_timeout:
|
case OPT_timeout:
|
||||||
if (opt_arg)
|
if (opt_arg)
|
||||||
|
@ -185,8 +185,8 @@ common_1_lev_code:
|
|||||||
|
|
||||||
expr= tmp_expr - (tmp_expr/60)*60;
|
expr= tmp_expr - (tmp_expr/60)*60;
|
||||||
/* the code after the switch will finish */
|
/* the code after the switch will finish */
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case INTERVAL_HOUR_SECOND:
|
case INTERVAL_HOUR_SECOND:
|
||||||
{
|
{
|
||||||
ulonglong tmp_expr= expr;
|
ulonglong tmp_expr= expr;
|
||||||
@ -202,8 +202,8 @@ common_1_lev_code:
|
|||||||
|
|
||||||
expr= tmp_expr - (tmp_expr/60)*60;
|
expr= tmp_expr - (tmp_expr/60)*60;
|
||||||
/* the code after the switch will finish */
|
/* the code after the switch will finish */
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case INTERVAL_DAY_SECOND:
|
case INTERVAL_DAY_SECOND:
|
||||||
{
|
{
|
||||||
ulonglong tmp_expr= expr;
|
ulonglong tmp_expr= expr;
|
||||||
@ -225,8 +225,8 @@ common_1_lev_code:
|
|||||||
|
|
||||||
expr= tmp_expr - (tmp_expr/60)*60;
|
expr= tmp_expr - (tmp_expr/60)*60;
|
||||||
/* the code after the switch will finish */
|
/* the code after the switch will finish */
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case INTERVAL_DAY_MICROSECOND:
|
case INTERVAL_DAY_MICROSECOND:
|
||||||
case INTERVAL_HOUR_MICROSECOND:
|
case INTERVAL_HOUR_MICROSECOND:
|
||||||
case INTERVAL_MINUTE_MICROSECOND:
|
case INTERVAL_MINUTE_MICROSECOND:
|
||||||
@ -240,6 +240,8 @@ common_1_lev_code:
|
|||||||
break;
|
break;
|
||||||
case INTERVAL_WEEK:
|
case INTERVAL_WEEK:
|
||||||
expr/= 7;
|
expr/= 7;
|
||||||
|
close_quote= FALSE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
close_quote= FALSE;
|
close_quote= FALSE;
|
||||||
break;
|
break;
|
||||||
|
16
sql/field.cc
16
sql/field.cc
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
Copyright (c) 2000, 2017, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2008, 2013, Monty Program Ab
|
Copyright (c) 2008, 2017, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -7947,13 +7947,13 @@ String *Field_set::val_str(String *val_buffer,
|
|||||||
ulonglong tmp=(ulonglong) Field_enum::val_int();
|
ulonglong tmp=(ulonglong) Field_enum::val_int();
|
||||||
uint bitnr=0;
|
uint bitnr=0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Some callers expect *val_buffer to contain the result,
|
||||||
|
so we assign to it, rather than doing 'return &empty_set_string.
|
||||||
|
*/
|
||||||
|
*val_buffer= empty_set_string;
|
||||||
if (tmp == 0)
|
if (tmp == 0)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Some callers expect *val_buffer to contain the result,
|
|
||||||
so we assign to it, rather than doing 'return &empty_set_string.
|
|
||||||
*/
|
|
||||||
*val_buffer= empty_set_string;
|
|
||||||
return val_buffer;
|
return val_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9218,7 +9218,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
|
|||||||
case MYSQL_TYPE_DATE:
|
case MYSQL_TYPE_DATE:
|
||||||
/* We don't support creation of MYSQL_TYPE_DATE anymore */
|
/* We don't support creation of MYSQL_TYPE_DATE anymore */
|
||||||
sql_type= MYSQL_TYPE_NEWDATE;
|
sql_type= MYSQL_TYPE_NEWDATE;
|
||||||
/* fall trough */
|
/* fall through */
|
||||||
case MYSQL_TYPE_NEWDATE:
|
case MYSQL_TYPE_NEWDATE:
|
||||||
length= MAX_DATE_WIDTH;
|
length= MAX_DATE_WIDTH;
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2005, 2013, Oracle and/or its affiliates.
|
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
|
||||||
|
Copyright (c) 2009, 2017, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1753,7 +1754,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
|
|||||||
cleanup_new_partition(part_count);
|
cleanup_new_partition(part_count);
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_PRINT("info", ("Add partition %s", part_name_buff));
|
DBUG_PRINT("info", ("Add partition %s", part_name_buff));
|
||||||
if ((error= prepare_new_partition(table, create_info,
|
if ((error= prepare_new_partition(table, create_info,
|
||||||
new_file_array[i],
|
new_file_array[i],
|
||||||
@ -7337,6 +7338,7 @@ void ha_partition::print_error(int error, myf errflag)
|
|||||||
m_err_rec= NULL;
|
m_err_rec= NULL;
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (!(thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
|
if (!(thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
|
||||||
|
12
sql/item.cc
12
sql/item.cc
@ -6004,7 +6004,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
|
|||||||
collation.collation);
|
collation.collation);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Fall through to make_string_field() */
|
/* fall through */
|
||||||
case MYSQL_TYPE_ENUM:
|
case MYSQL_TYPE_ENUM:
|
||||||
case MYSQL_TYPE_SET:
|
case MYSQL_TYPE_SET:
|
||||||
case MYSQL_TYPE_VAR_STRING:
|
case MYSQL_TYPE_VAR_STRING:
|
||||||
@ -6726,6 +6726,7 @@ bool Item::cache_const_expr_analyzer(uchar **arg)
|
|||||||
*/
|
*/
|
||||||
if (const_item() &&
|
if (const_item() &&
|
||||||
!(basic_const_item() || item->basic_const_item() ||
|
!(basic_const_item() || item->basic_const_item() ||
|
||||||
|
item->type() == Item::NULL_ITEM || /* Item_name_const hack */
|
||||||
item->type() == Item::FIELD_ITEM ||
|
item->type() == Item::FIELD_ITEM ||
|
||||||
item->type() == SUBSELECT_ITEM ||
|
item->type() == SUBSELECT_ITEM ||
|
||||||
/*
|
/*
|
||||||
@ -6876,7 +6877,11 @@ public:
|
|||||||
// Find which select the field is in. This is achieved by walking up
|
// Find which select the field is in. This is achieved by walking up
|
||||||
// the select tree and looking for the table of interest.
|
// the select tree and looking for the table of interest.
|
||||||
st_select_lex *sel;
|
st_select_lex *sel;
|
||||||
for (sel= current_select; sel; sel= sel->outer_select())
|
for (sel= current_select;
|
||||||
|
sel ;
|
||||||
|
sel= (sel->context.outer_context ?
|
||||||
|
sel->context.outer_context->select_lex:
|
||||||
|
NULL))
|
||||||
{
|
{
|
||||||
List_iterator<TABLE_LIST> li(sel->leaf_tables);
|
List_iterator<TABLE_LIST> li(sel->leaf_tables);
|
||||||
TABLE_LIST *tbl;
|
TABLE_LIST *tbl;
|
||||||
@ -8071,7 +8076,6 @@ bool Item_direct_view_ref::send(Protocol *protocol, String *buffer)
|
|||||||
|
|
||||||
bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(1);
|
|
||||||
/* view fild reference must be defined */
|
/* view fild reference must be defined */
|
||||||
DBUG_ASSERT(*ref);
|
DBUG_ASSERT(*ref);
|
||||||
/* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */
|
/* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */
|
||||||
@ -9955,7 +9959,7 @@ void Item_direct_view_ref::update_used_tables()
|
|||||||
|
|
||||||
table_map Item_direct_view_ref::used_tables() const
|
table_map Item_direct_view_ref::used_tables() const
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(null_ref_table);
|
DBUG_ASSERT(fixed);
|
||||||
|
|
||||||
if (get_depended_from())
|
if (get_depended_from())
|
||||||
return OUTER_REF_TABLE_BIT;
|
return OUTER_REF_TABLE_BIT;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef SQL_ITEM_INCLUDED
|
#ifndef SQL_ITEM_INCLUDED
|
||||||
#define SQL_ITEM_INCLUDED
|
#define SQL_ITEM_INCLUDED
|
||||||
|
|
||||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2009, 2016, MariaDB
|
Copyright (c) 2009, 2017, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -863,6 +863,7 @@ void Item_func_num1::fix_length_and_dec()
|
|||||||
break;
|
break;
|
||||||
case TIME_RESULT:
|
case TIME_RESULT:
|
||||||
cached_result_type= DECIMAL_RESULT;
|
cached_result_type= DECIMAL_RESULT;
|
||||||
|
/* fall through */
|
||||||
case DECIMAL_RESULT:
|
case DECIMAL_RESULT:
|
||||||
decimals= args[0]->decimal_scale(); // Do not preserve NOT_FIXED_DEC
|
decimals= args[0]->decimal_scale(); // Do not preserve NOT_FIXED_DEC
|
||||||
max_length= args[0]->max_length;
|
max_length= args[0]->max_length;
|
||||||
@ -2038,6 +2039,7 @@ my_decimal *Item_func_mod::decimal_op(my_decimal *decimal_value)
|
|||||||
return decimal_value;
|
return decimal_value;
|
||||||
case E_DEC_DIV_ZERO:
|
case E_DEC_DIV_ZERO:
|
||||||
signal_divide_by_null();
|
signal_divide_by_null();
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
null_value= 1;
|
null_value= 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -44,7 +44,14 @@ Item_row::Item_row(List<Item> &arg):
|
|||||||
|
|
||||||
//TODO: think placing 2-3 component items in item (as it done for function)
|
//TODO: think placing 2-3 component items in item (as it done for function)
|
||||||
if ((arg_count= arg.elements))
|
if ((arg_count= arg.elements))
|
||||||
|
{
|
||||||
items= (Item**) sql_alloc(sizeof(Item*)*arg_count);
|
items= (Item**) sql_alloc(sizeof(Item*)*arg_count);
|
||||||
|
if (!items)
|
||||||
|
{
|
||||||
|
arg_count= 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
items= 0;
|
items= 0;
|
||||||
List_iterator<Item> li(arg);
|
List_iterator<Item> li(arg);
|
||||||
@ -53,7 +60,28 @@ Item_row::Item_row(List<Item> &arg):
|
|||||||
while ((item= li++))
|
while ((item= li++))
|
||||||
{
|
{
|
||||||
items[i]= item;
|
items[i]= item;
|
||||||
i++;
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Item_row::Item_row(Item *item):
|
||||||
|
Item(),
|
||||||
|
used_tables_cache(0),
|
||||||
|
not_null_tables_cache(0),
|
||||||
|
arg_count(item->cols()),
|
||||||
|
const_item_cache(1),
|
||||||
|
with_null(0)
|
||||||
|
{
|
||||||
|
items= (Item**) sql_alloc(sizeof(Item*) * arg_count);
|
||||||
|
if (!items)
|
||||||
|
{
|
||||||
|
arg_count= 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (uint i= 0; i < arg_count; i++)
|
||||||
|
{
|
||||||
|
items[i]= item->element_index(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
const_item_cache(item->const_item_cache),
|
const_item_cache(item->const_item_cache),
|
||||||
with_null(0)
|
with_null(0)
|
||||||
{}
|
{}
|
||||||
|
Item_row(Item *item);
|
||||||
|
|
||||||
enum Type type() const { return ROW_ITEM; };
|
enum Type type() const { return ROW_ITEM; };
|
||||||
void illegal_method_call(const char *);
|
void illegal_method_call(const char *);
|
||||||
|
@ -4430,7 +4430,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
|
|||||||
goto null;
|
goto null;
|
||||||
case DYN_COL_INT:
|
case DYN_COL_INT:
|
||||||
signed_value= 1; // For error message
|
signed_value= 1; // For error message
|
||||||
/* fall_trough */
|
/* fall through */
|
||||||
case DYN_COL_UINT:
|
case DYN_COL_UINT:
|
||||||
if (signed_value || val.x.ulong_value <= LONGLONG_MAX)
|
if (signed_value || val.x.ulong_value <= LONGLONG_MAX)
|
||||||
{
|
{
|
||||||
@ -4443,7 +4443,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
|
|||||||
}
|
}
|
||||||
/* let double_to_datetime_with_warn() issue the warning message */
|
/* let double_to_datetime_with_warn() issue the warning message */
|
||||||
val.x.double_value= static_cast<double>(ULONGLONG_MAX);
|
val.x.double_value= static_cast<double>(ULONGLONG_MAX);
|
||||||
/* fall_trough */
|
/* fall through */
|
||||||
case DYN_COL_DOUBLE:
|
case DYN_COL_DOUBLE:
|
||||||
if (double_to_datetime_with_warn(val.x.double_value, ltime, fuzzy_date,
|
if (double_to_datetime_with_warn(val.x.double_value, ltime, fuzzy_date,
|
||||||
0 /* TODO */))
|
0 /* TODO */))
|
||||||
|
@ -1374,6 +1374,9 @@ Item_in_subselect::Item_in_subselect(Item * left_exp,
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("Item_in_subselect::Item_in_subselect");
|
DBUG_ENTER("Item_in_subselect::Item_in_subselect");
|
||||||
left_expr_orig= left_expr= left_exp;
|
left_expr_orig= left_expr= left_exp;
|
||||||
|
/* prepare to possible disassembling the item in convert_subq_to_sj() */
|
||||||
|
if (left_exp->type() == Item::ROW_ITEM)
|
||||||
|
left_expr_orig= new Item_row(left_exp);
|
||||||
func= &eq_creator;
|
func= &eq_creator;
|
||||||
init(select_lex, new select_exists_subselect(this));
|
init(select_lex, new select_exists_subselect(this));
|
||||||
max_columns= UINT_MAX;
|
max_columns= UINT_MAX;
|
||||||
@ -1398,6 +1401,9 @@ Item_allany_subselect::Item_allany_subselect(Item * left_exp,
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("Item_allany_subselect::Item_allany_subselect");
|
DBUG_ENTER("Item_allany_subselect::Item_allany_subselect");
|
||||||
left_expr_orig= left_expr= left_exp;
|
left_expr_orig= left_expr= left_exp;
|
||||||
|
/* prepare to possible disassembling the item in convert_subq_to_sj() */
|
||||||
|
if (left_exp->type() == Item::ROW_ITEM)
|
||||||
|
left_expr_orig= new Item_row(left_exp);
|
||||||
func= func_creator(all_arg);
|
func= func_creator(all_arg);
|
||||||
init(select_lex, new select_exists_subselect(this));
|
init(select_lex, new select_exists_subselect(this));
|
||||||
max_columns= 1;
|
max_columns= 1;
|
||||||
|
@ -1733,9 +1733,18 @@ overflow:
|
|||||||
|
|
||||||
ltime->hour= TIME_MAX_HOUR+1;
|
ltime->hour= TIME_MAX_HOUR+1;
|
||||||
check_time_range(ltime, decimals, &unused);
|
check_time_range(ltime, decimals, &unused);
|
||||||
make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
if (!err)
|
||||||
err->ptr(), err->length(),
|
{
|
||||||
MYSQL_TIMESTAMP_TIME, NullS);
|
ErrConvInteger err2(sec, unsigned_flag);
|
||||||
|
make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||||
|
&err2, MYSQL_TIMESTAMP_TIME, NullS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ErrConvString err2(err);
|
||||||
|
make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||||
|
&err2, MYSQL_TIMESTAMP_TIME, NullS);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,8 +500,16 @@ public:
|
|||||||
{ return val_decimal_from_date(decimal_value); }
|
{ return val_decimal_from_date(decimal_value); }
|
||||||
Field *tmp_table_field(TABLE *table)
|
Field *tmp_table_field(TABLE *table)
|
||||||
{ return tmp_table_field_from_field_type(table, 0); }
|
{ return tmp_table_field_from_field_type(table, 0); }
|
||||||
|
#if MARIADB_VERSION_ID > 100300
|
||||||
|
#error This code should be removed in 10.3, to use the derived save_in_field()
|
||||||
|
#else
|
||||||
int save_in_field(Field *field, bool no_conversions)
|
int save_in_field(Field *field, bool no_conversions)
|
||||||
{ return save_date_in_field(field); }
|
{
|
||||||
|
return field_type() == MYSQL_TYPE_TIME ?
|
||||||
|
save_time_in_field(field) :
|
||||||
|
save_date_in_field(field);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
void fix_length_and_dec();
|
void fix_length_and_dec();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7405,8 +7405,10 @@ void TC_LOG_MMAP::close()
|
|||||||
mysql_cond_destroy(&COND_pool);
|
mysql_cond_destroy(&COND_pool);
|
||||||
mysql_cond_destroy(&COND_active);
|
mysql_cond_destroy(&COND_active);
|
||||||
mysql_cond_destroy(&COND_queue_busy);
|
mysql_cond_destroy(&COND_queue_busy);
|
||||||
|
/* fall through */
|
||||||
case 5:
|
case 5:
|
||||||
data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails
|
data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails
|
||||||
|
/* fall through */
|
||||||
case 4:
|
case 4:
|
||||||
for (i=0; i < npages; i++)
|
for (i=0; i < npages; i++)
|
||||||
{
|
{
|
||||||
@ -7415,10 +7417,13 @@ void TC_LOG_MMAP::close()
|
|||||||
mysql_mutex_destroy(&pages[i].lock);
|
mysql_mutex_destroy(&pages[i].lock);
|
||||||
mysql_cond_destroy(&pages[i].cond);
|
mysql_cond_destroy(&pages[i].cond);
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
case 3:
|
case 3:
|
||||||
my_free(pages);
|
my_free(pages);
|
||||||
|
/* fall through */
|
||||||
case 2:
|
case 2:
|
||||||
my_munmap((char*)data, (size_t)file_length);
|
my_munmap((char*)data, (size_t)file_length);
|
||||||
|
/* fall through */
|
||||||
case 1:
|
case 1:
|
||||||
mysql_file_close(fd, MYF(0));
|
mysql_file_close(fd, MYF(0));
|
||||||
}
|
}
|
||||||
|
@ -6476,21 +6476,6 @@ User_var_log_event(const char* buf, uint event_len,
|
|||||||
we keep the flags set to UNDEF_F.
|
we keep the flags set to UNDEF_F.
|
||||||
*/
|
*/
|
||||||
uint bytes_read= ((val + val_len) - start);
|
uint bytes_read= ((val + val_len) - start);
|
||||||
#ifndef DBUG_OFF
|
|
||||||
bool old_pre_checksum_fd= description_event->is_version_before_checksum(
|
|
||||||
&description_event->server_version_split);
|
|
||||||
#endif
|
|
||||||
DBUG_ASSERT((bytes_read == data_written -
|
|
||||||
(old_pre_checksum_fd ||
|
|
||||||
(description_event->checksum_alg ==
|
|
||||||
BINLOG_CHECKSUM_ALG_OFF)) ?
|
|
||||||
0 : BINLOG_CHECKSUM_LEN)
|
|
||||||
||
|
|
||||||
(bytes_read == data_written -1 -
|
|
||||||
(old_pre_checksum_fd ||
|
|
||||||
(description_event->checksum_alg ==
|
|
||||||
BINLOG_CHECKSUM_ALG_OFF)) ?
|
|
||||||
0 : BINLOG_CHECKSUM_LEN));
|
|
||||||
if ((data_written - bytes_read) > 0)
|
if ((data_written - bytes_read) > 0)
|
||||||
{
|
{
|
||||||
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
|
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
|
||||||
|
@ -1609,6 +1609,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
|
|||||||
sj-nest.
|
sj-nest.
|
||||||
*/
|
*/
|
||||||
st_select_lex *subq_lex= subq_pred->unit->first_select();
|
st_select_lex *subq_lex= subq_pred->unit->first_select();
|
||||||
|
DBUG_ASSERT(subq_lex->next_select() == NULL);
|
||||||
nested_join->join_list.empty();
|
nested_join->join_list.empty();
|
||||||
List_iterator_fast<TABLE_LIST> li(subq_lex->top_join_list);
|
List_iterator_fast<TABLE_LIST> li(subq_lex->top_join_list);
|
||||||
TABLE_LIST *tl;
|
TABLE_LIST *tl;
|
||||||
@ -1706,7 +1707,8 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
|
|||||||
|
|
||||||
if (subq_pred->left_expr->cols() == 1)
|
if (subq_pred->left_expr->cols() == 1)
|
||||||
{
|
{
|
||||||
nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr);
|
/* add left = select_list_element */
|
||||||
|
nested_join->sj_outer_expr_list.push_back(&subq_pred->left_expr);
|
||||||
/*
|
/*
|
||||||
Create Item_func_eq. Note that
|
Create Item_func_eq. Note that
|
||||||
1. this is done on the statement, not execution, arena
|
1. this is done on the statement, not execution, arena
|
||||||
@ -1718,24 +1720,61 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
|
|||||||
*/
|
*/
|
||||||
Item_func_eq *item_eq=
|
Item_func_eq *item_eq=
|
||||||
new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]);
|
new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]);
|
||||||
|
if (!item_eq)
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
if (subq_pred->left_expr_orig != subq_pred->left_expr)
|
if (subq_pred->left_expr_orig != subq_pred->left_expr)
|
||||||
thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
|
thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
|
||||||
item_eq->in_equality_no= 0;
|
item_eq->in_equality_no= 0;
|
||||||
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
||||||
}
|
}
|
||||||
else
|
else if (subq_pred->left_expr->type() == Item::ROW_ITEM)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
disassemple left expression and add
|
||||||
|
left1 = select_list_element1 and left2 = select_list_element2 ...
|
||||||
|
*/
|
||||||
for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
|
for (uint i= 0; i < subq_pred->left_expr->cols(); i++)
|
||||||
{
|
{
|
||||||
nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr->
|
nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr->
|
||||||
element_index(i));
|
addr(i));
|
||||||
Item_func_eq *item_eq=
|
Item_func_eq *item_eq=
|
||||||
new Item_func_eq(subq_pred->left_expr->element_index(i),
|
new Item_func_eq(subq_pred->left_expr_orig->element_index(i),
|
||||||
subq_lex->ref_pointer_array[i]);
|
subq_lex->ref_pointer_array[i]);
|
||||||
|
if (!item_eq)
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
DBUG_ASSERT(subq_pred->left_expr->element_index(i)->fixed);
|
||||||
|
if (subq_pred->left_expr_orig->element_index(i) !=
|
||||||
|
subq_pred->left_expr->element_index(i))
|
||||||
|
thd->change_item_tree(item_eq->arguments(),
|
||||||
|
subq_pred->left_expr->element_index(i));
|
||||||
item_eq->in_equality_no= i;
|
item_eq->in_equality_no= i;
|
||||||
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
add row operation
|
||||||
|
left = (select_list_element1, select_list_element2, ...)
|
||||||
|
*/
|
||||||
|
Item_row *row= new Item_row(subq_lex->pre_fix);
|
||||||
|
/* fix fields on subquery was call so they should be the same */
|
||||||
|
DBUG_ASSERT(subq_pred->left_expr->cols() == row->cols());
|
||||||
|
if (!row)
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
nested_join->sj_outer_expr_list.push_back(&subq_pred->left_expr);
|
||||||
|
Item_func_eq *item_eq=
|
||||||
|
new Item_func_eq(subq_pred->left_expr_orig, row);
|
||||||
|
if (!item_eq)
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
for (uint i= 0; i < row->cols(); i++)
|
||||||
|
{
|
||||||
|
if (row->element_index(i) != subq_lex->ref_pointer_array[i])
|
||||||
|
thd->change_item_tree(row->addr(i), subq_lex->ref_pointer_array[i]);
|
||||||
|
}
|
||||||
|
item_eq->in_equality_no= 0;
|
||||||
|
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Fix the created equality and AND
|
Fix the created equality and AND
|
||||||
|
|
||||||
@ -3285,8 +3324,8 @@ void restore_prev_sj_state(const table_map remaining_tables,
|
|||||||
ulonglong get_bound_sj_equalities(TABLE_LIST *sj_nest,
|
ulonglong get_bound_sj_equalities(TABLE_LIST *sj_nest,
|
||||||
table_map remaining_tables)
|
table_map remaining_tables)
|
||||||
{
|
{
|
||||||
List_iterator<Item> li(sj_nest->nested_join->sj_outer_expr_list);
|
List_iterator<Item_ptr> li(sj_nest->nested_join->sj_outer_expr_list);
|
||||||
Item *item;
|
Item **item;
|
||||||
uint i= 0;
|
uint i= 0;
|
||||||
ulonglong res= 0;
|
ulonglong res= 0;
|
||||||
while ((item= li++))
|
while ((item= li++))
|
||||||
@ -3297,7 +3336,7 @@ ulonglong get_bound_sj_equalities(TABLE_LIST *sj_nest,
|
|||||||
class and see if there is an element that is bound?
|
class and see if there is an element that is bound?
|
||||||
(this is an optional feature)
|
(this is an optional feature)
|
||||||
*/
|
*/
|
||||||
if (!(item->used_tables() & remaining_tables))
|
if (!(item[0]->used_tables() & remaining_tables))
|
||||||
{
|
{
|
||||||
res |= 1ULL << i;
|
res |= 1ULL << i;
|
||||||
}
|
}
|
||||||
|
@ -1047,6 +1047,7 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond)
|
|||||||
case Item_func::LT_FUNC:
|
case Item_func::LT_FUNC:
|
||||||
case Item_func::LE_FUNC:
|
case Item_func::LE_FUNC:
|
||||||
less_fl= 1;
|
less_fl= 1;
|
||||||
|
/* fall through */
|
||||||
case Item_func::GT_FUNC:
|
case Item_func::GT_FUNC:
|
||||||
case Item_func::GE_FUNC:
|
case Item_func::GE_FUNC:
|
||||||
{
|
{
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
partition_info *partition_info::get_clone()
|
partition_info *partition_info::get_clone()
|
||||||
{
|
{
|
||||||
if (!this)
|
|
||||||
return 0;
|
|
||||||
List_iterator<partition_element> part_it(partitions);
|
List_iterator<partition_element> part_it(partitions);
|
||||||
partition_element *part;
|
partition_element *part;
|
||||||
partition_info *clone= new partition_info();
|
partition_info *clone= new partition_info();
|
||||||
|
@ -2344,7 +2344,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
|
|||||||
thd->enable_slow_log= opt_log_slow_slave_statements;
|
thd->enable_slow_log= opt_log_slow_slave_statements;
|
||||||
thd->variables.log_slow_filter= global_system_variables.log_slow_filter;
|
thd->variables.log_slow_filter= global_system_variables.log_slow_filter;
|
||||||
set_slave_thread_options(thd);
|
set_slave_thread_options(thd);
|
||||||
thd->client_capabilities = CLIENT_LOCAL_FILES;
|
|
||||||
mysql_mutex_lock(&LOCK_thread_count);
|
mysql_mutex_lock(&LOCK_thread_count);
|
||||||
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
|
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
|
||||||
mysql_mutex_unlock(&LOCK_thread_count);
|
mysql_mutex_unlock(&LOCK_thread_count);
|
||||||
|
@ -139,7 +139,7 @@ sp_get_item_value(THD *thd, Item *item, String *str)
|
|||||||
case DECIMAL_RESULT:
|
case DECIMAL_RESULT:
|
||||||
if (item->field_type() != MYSQL_TYPE_BIT)
|
if (item->field_type() != MYSQL_TYPE_BIT)
|
||||||
return item->val_str(str);
|
return item->val_str(str);
|
||||||
else {/* Bit type is handled as binary string */}
|
/* fall through */
|
||||||
case STRING_RESULT:
|
case STRING_RESULT:
|
||||||
{
|
{
|
||||||
String *result= item->val_str(str);
|
String *result= item->val_str(str);
|
||||||
|
@ -54,7 +54,6 @@ static bool admin_recreate_table(THD *thd, TABLE_LIST *table_list)
|
|||||||
if (thd->stmt_da->is_ok())
|
if (thd->stmt_da->is_ok())
|
||||||
thd->stmt_da->reset_diagnostics_area();
|
thd->stmt_da->reset_diagnostics_area();
|
||||||
table_list->table= NULL;
|
table_list->table= NULL;
|
||||||
result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
|
|
||||||
DBUG_RETURN(result_code);
|
DBUG_RETURN(result_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8150,13 +8150,15 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
|
|||||||
|
|
||||||
bool setup_fields(THD *thd, Item **ref_pointer_array,
|
bool setup_fields(THD *thd, Item **ref_pointer_array,
|
||||||
List<Item> &fields, enum_mark_columns mark_used_columns,
|
List<Item> &fields, enum_mark_columns mark_used_columns,
|
||||||
List<Item> *sum_func_list, bool allow_sum_func)
|
List<Item> *sum_func_list, List<Item> *pre_fix,
|
||||||
|
bool allow_sum_func)
|
||||||
{
|
{
|
||||||
reg2 Item *item;
|
reg2 Item *item;
|
||||||
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
|
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
|
||||||
nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
|
nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
|
||||||
List_iterator<Item> it(fields);
|
List_iterator<Item> it(fields);
|
||||||
bool save_is_item_list_lookup;
|
bool save_is_item_list_lookup;
|
||||||
|
bool make_pre_fix= (pre_fix && (pre_fix->elements == 0));
|
||||||
DBUG_ENTER("setup_fields");
|
DBUG_ENTER("setup_fields");
|
||||||
DBUG_PRINT("enter", ("ref_pointer_array: %p", ref_pointer_array));
|
DBUG_PRINT("enter", ("ref_pointer_array: %p", ref_pointer_array));
|
||||||
|
|
||||||
@ -8203,6 +8205,9 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
|
|||||||
thd->lex->current_select->cur_pos_in_select_list= 0;
|
thd->lex->current_select->cur_pos_in_select_list= 0;
|
||||||
while ((item= it++))
|
while ((item= it++))
|
||||||
{
|
{
|
||||||
|
if (make_pre_fix)
|
||||||
|
pre_fix->push_back(item, thd->stmt_arena->mem_root);
|
||||||
|
|
||||||
if ((!item->fixed && item->fix_fields(thd, it.ref())) ||
|
if ((!item->fixed && item->fix_fields(thd, it.ref())) ||
|
||||||
(item= *(it.ref()))->check_cols(1))
|
(item= *(it.ref()))->check_cols(1))
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,8 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
|
|||||||
List<Item> *sum_func_list, uint wild_num);
|
List<Item> *sum_func_list, uint wild_num);
|
||||||
bool setup_fields(THD *thd, Item** ref_pointer_array,
|
bool setup_fields(THD *thd, Item** ref_pointer_array,
|
||||||
List<Item> &item, enum_mark_columns mark_used_columns,
|
List<Item> &item, enum_mark_columns mark_used_columns,
|
||||||
List<Item> *sum_func_list, bool allow_sum_func);
|
List<Item> *sum_func_list, List<Item> *pre_fix,
|
||||||
|
bool allow_sum_func);
|
||||||
void unfix_fields(List<Item> &items);
|
void unfix_fields(List<Item> &items);
|
||||||
bool fill_record(THD *thd, Field **field, List<Item> &values,
|
bool fill_record(THD *thd, Field **field, List<Item> &values,
|
||||||
bool ignore_errors, bool use_value);
|
bool ignore_errors, bool use_value);
|
||||||
@ -407,7 +408,7 @@ inline bool setup_fields_with_no_wrap(THD *thd, Item **ref_pointer_array,
|
|||||||
bool res;
|
bool res;
|
||||||
thd->lex->select_lex.no_wrap_view_item= TRUE;
|
thd->lex->select_lex.no_wrap_view_item= TRUE;
|
||||||
res= setup_fields(thd, ref_pointer_array, item, mark_used_columns,
|
res= setup_fields(thd, ref_pointer_array, item, mark_used_columns,
|
||||||
sum_func_list, allow_sum_func);
|
sum_func_list, NULL, allow_sum_func);
|
||||||
thd->lex->select_lex.no_wrap_view_item= FALSE;
|
thd->lex->select_lex.no_wrap_view_item= FALSE;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -3983,7 +3983,7 @@ public:
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("unique_add");
|
DBUG_ENTER("unique_add");
|
||||||
DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements));
|
DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements));
|
||||||
if (!(tree.flag & TREE_ONLY_DUPS) &&
|
if (!(tree.flag & TREE_ONLY_DUPS) &&
|
||||||
tree.elements_in_tree >= max_elements && flush())
|
tree.elements_in_tree >= max_elements && flush())
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg));
|
DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg));
|
||||||
|
@ -41,7 +41,18 @@
|
|||||||
|
|
||||||
#define MAX_MBWIDTH 3 /* Max multibyte sequence */
|
#define MAX_MBWIDTH 3 /* Max multibyte sequence */
|
||||||
#define MAX_FIELD_CHARLENGTH 255
|
#define MAX_FIELD_CHARLENGTH 255
|
||||||
#define MAX_FIELD_VARCHARLENGTH 65535
|
/*
|
||||||
|
In MAX_FIELD_VARCHARLENGTH we reserve extra bytes for the overhead:
|
||||||
|
- 2 bytes for the length
|
||||||
|
- 1 byte for NULL bits
|
||||||
|
to avoid the "Row size too large" error for these three corner definitions:
|
||||||
|
CREATE TABLE t1 (c VARBINARY(65533));
|
||||||
|
CREATE TABLE t1 (c VARBINARY(65534));
|
||||||
|
CREATE TABLE t1 (c VARBINARY(65535));
|
||||||
|
Like VARCHAR(65536), they will be converted to BLOB automatically
|
||||||
|
in non-sctict mode.
|
||||||
|
*/
|
||||||
|
#define MAX_FIELD_VARCHARLENGTH (65535-2-1)
|
||||||
#define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */
|
#define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */
|
||||||
#define CONVERT_IF_BIGGER_TO_BLOB 512 /* Threshold *in characters* */
|
#define CONVERT_IF_BIGGER_TO_BLOB 512 /* Threshold *in characters* */
|
||||||
|
|
||||||
|
@ -510,6 +510,8 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||||||
DBUG_ENTER("mysql_derived_merge_for_insert");
|
DBUG_ENTER("mysql_derived_merge_for_insert");
|
||||||
if (derived->merged_for_insert)
|
if (derived->merged_for_insert)
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
if (derived->init_derived(thd, FALSE))
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
if (derived->is_materialized_derived())
|
if (derived->is_materialized_derived())
|
||||||
DBUG_RETURN(mysql_derived_prepare(thd, lex, derived));
|
DBUG_RETURN(mysql_derived_prepare(thd, lex, derived));
|
||||||
if ((thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
|
if ((thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
|
||||||
@ -526,8 +528,6 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||||||
derived->merged_for_insert= TRUE;
|
derived->merged_for_insert= TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
derived->table= derived->merge_underlying_list->table;
|
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ bool mysql_do(THD *thd, List<Item> &values)
|
|||||||
List_iterator<Item> li(values);
|
List_iterator<Item> li(values);
|
||||||
Item *value;
|
Item *value;
|
||||||
DBUG_ENTER("mysql_do");
|
DBUG_ENTER("mysql_do");
|
||||||
if (setup_fields(thd, 0, values, MARK_COLUMNS_NONE, 0, 0))
|
if (setup_fields(thd, 0, values, MARK_COLUMNS_NONE, 0, NULL, 0))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
while ((value = li++))
|
while ((value = li++))
|
||||||
value->val_int();
|
value->val_int();
|
||||||
|
@ -262,7 +262,7 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
|
|||||||
if (table_list->is_view())
|
if (table_list->is_view())
|
||||||
unfix_fields(fields);
|
unfix_fields(fields);
|
||||||
|
|
||||||
res= setup_fields(thd, 0, fields, MARK_COLUMNS_WRITE, 0, 0);
|
res= setup_fields(thd, 0, fields, MARK_COLUMNS_WRITE, 0, NULL, 0);
|
||||||
|
|
||||||
/* Restore the current context. */
|
/* Restore the current context. */
|
||||||
ctx_state.restore_state(context, table_list);
|
ctx_state.restore_state(context, table_list);
|
||||||
@ -373,7 +373,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check the fields we are going to modify */
|
/* Check the fields we are going to modify */
|
||||||
if (setup_fields(thd, 0, update_fields, MARK_COLUMNS_WRITE, 0, 0))
|
if (setup_fields(thd, 0, update_fields, MARK_COLUMNS_WRITE, 0, NULL, 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (insert_table_list->is_view() &&
|
if (insert_table_list->is_view() &&
|
||||||
@ -810,7 +810,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
|
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
|
||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
if (setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0))
|
if (setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, NULL, 0))
|
||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
its.rewind ();
|
its.rewind ();
|
||||||
@ -1456,7 +1456,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
|
|||||||
table_list->next_local= 0;
|
table_list->next_local= 0;
|
||||||
context->resolve_in_table_list_only(table_list);
|
context->resolve_in_table_list_only(table_list);
|
||||||
|
|
||||||
res= (setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0) ||
|
res= (setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, NULL, 0) ||
|
||||||
check_insert_fields(thd, context->table_list, fields, *values,
|
check_insert_fields(thd, context->table_list, fields, *values,
|
||||||
!insert_into_view, 0, &map));
|
!insert_into_view, 0, &map));
|
||||||
|
|
||||||
@ -1472,7 +1472,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!res)
|
if (!res)
|
||||||
res= setup_fields(thd, 0, update_values, MARK_COLUMNS_READ, 0, 0);
|
res= setup_fields(thd, 0, update_values, MARK_COLUMNS_READ, 0, NULL, 0);
|
||||||
|
|
||||||
if (!res && duplic == DUP_UPDATE)
|
if (!res && duplic == DUP_UPDATE)
|
||||||
{
|
{
|
||||||
@ -3378,7 +3378,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
|||||||
*/
|
*/
|
||||||
lex->current_select= &lex->select_lex;
|
lex->current_select= &lex->select_lex;
|
||||||
|
|
||||||
res= (setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, 0) ||
|
res= (setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, NULL, 0) ||
|
||||||
check_insert_fields(thd, table_list, *fields, values,
|
check_insert_fields(thd, table_list, *fields, values,
|
||||||
!insert_into_view, 1, &map));
|
!insert_into_view, 1, &map));
|
||||||
|
|
||||||
@ -3434,7 +3434,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
|||||||
ctx_state.get_first_name_resolution_table();
|
ctx_state.get_first_name_resolution_table();
|
||||||
|
|
||||||
res= res || setup_fields(thd, 0, *info.update_values,
|
res= res || setup_fields(thd, 0, *info.update_values,
|
||||||
MARK_COLUMNS_READ, 0, 0);
|
MARK_COLUMNS_READ, 0, NULL, 0);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -1147,12 +1147,14 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
|
|||||||
state= MY_LEX_HEX_NUMBER;
|
state= MY_LEX_HEX_NUMBER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
case MY_LEX_IDENT_OR_BIN:
|
case MY_LEX_IDENT_OR_BIN:
|
||||||
if (lip->yyPeek() == '\'')
|
if (lip->yyPeek() == '\'')
|
||||||
{ // Found b'bin-number'
|
{ // Found b'bin-number'
|
||||||
state= MY_LEX_BIN_NUMBER;
|
state= MY_LEX_BIN_NUMBER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
case MY_LEX_IDENT:
|
case MY_LEX_IDENT:
|
||||||
const char *start;
|
const char *start;
|
||||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||||
@ -1499,7 +1501,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
|
|||||||
state= MY_LEX_USER_VARIABLE_DELIMITER;
|
state= MY_LEX_USER_VARIABLE_DELIMITER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* " used for strings */
|
/* fall through */ /* " used for strings */
|
||||||
case MY_LEX_STRING: // Incomplete text string
|
case MY_LEX_STRING: // Incomplete text string
|
||||||
if (!(yylval->lex_str.str = get_text(lip, 1, 1)))
|
if (!(yylval->lex_str.str = get_text(lip, 1, 1)))
|
||||||
{
|
{
|
||||||
|
@ -758,6 +758,7 @@ public:
|
|||||||
Group_list_ptrs *group_list_ptrs;
|
Group_list_ptrs *group_list_ptrs;
|
||||||
|
|
||||||
List<Item> item_list; /* list of fields & expressions */
|
List<Item> item_list; /* list of fields & expressions */
|
||||||
|
List<Item> pre_fix; /* above list before fix_fields */
|
||||||
List<String> interval_list;
|
List<String> interval_list;
|
||||||
bool is_item_list_lookup;
|
bool is_item_list_lookup;
|
||||||
/*
|
/*
|
||||||
|
@ -293,15 +293,15 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||||||
Let us also prepare SET clause, altough it is probably empty
|
Let us also prepare SET clause, altough it is probably empty
|
||||||
in this case.
|
in this case.
|
||||||
*/
|
*/
|
||||||
if (setup_fields(thd, 0, set_fields, MARK_COLUMNS_WRITE, 0, 0) ||
|
if (setup_fields(thd, 0, set_fields, MARK_COLUMNS_WRITE, 0, NULL, 0) ||
|
||||||
setup_fields(thd, 0, set_values, MARK_COLUMNS_READ, 0, 0))
|
setup_fields(thd, 0, set_values, MARK_COLUMNS_READ, 0, NULL, 0))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Part field list
|
{ // Part field list
|
||||||
/* TODO: use this conds for 'WITH CHECK OPTIONS' */
|
/* TODO: use this conds for 'WITH CHECK OPTIONS' */
|
||||||
if (setup_fields(thd, 0, fields_vars, MARK_COLUMNS_WRITE, 0, 0) ||
|
if (setup_fields(thd, 0, fields_vars, MARK_COLUMNS_WRITE, 0, NULL, 0) ||
|
||||||
setup_fields(thd, 0, set_fields, MARK_COLUMNS_WRITE, 0, 0) ||
|
setup_fields(thd, 0, set_fields, MARK_COLUMNS_WRITE, 0, NULL, 0) ||
|
||||||
check_that_all_fields_are_given_values(thd, table, table_list))
|
check_that_all_fields_are_given_values(thd, table, table_list))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
/*
|
/*
|
||||||
@ -320,7 +320,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Fix the expressions in SET clause */
|
/* Fix the expressions in SET clause */
|
||||||
if (setup_fields(thd, 0, set_values, MARK_COLUMNS_READ, 0, 0))
|
if (setup_fields(thd, 0, set_values, MARK_COLUMNS_READ, 0, NULL, 0))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,8 +927,7 @@ out:
|
|||||||
@retval FALSE The statement isn't updating any relevant tables.
|
@retval FALSE The statement isn't updating any relevant tables.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static my_bool deny_updates_if_read_only_option(THD *thd,
|
static bool deny_updates_if_read_only_option(THD *thd, TABLE_LIST *all_tables)
|
||||||
TABLE_LIST *all_tables)
|
|
||||||
{
|
{
|
||||||
DBUG_ENTER("deny_updates_if_read_only_option");
|
DBUG_ENTER("deny_updates_if_read_only_option");
|
||||||
|
|
||||||
@ -937,11 +936,7 @@ static my_bool deny_updates_if_read_only_option(THD *thd,
|
|||||||
|
|
||||||
LEX *lex= thd->lex;
|
LEX *lex= thd->lex;
|
||||||
|
|
||||||
const my_bool user_is_super=
|
if (thd->security_ctx->master_access & SUPER_ACL)
|
||||||
((ulong)(thd->security_ctx->master_access & SUPER_ACL) ==
|
|
||||||
(ulong)SUPER_ACL);
|
|
||||||
|
|
||||||
if (user_is_super)
|
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
if (!(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA))
|
if (!(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA))
|
||||||
@ -951,30 +946,26 @@ static my_bool deny_updates_if_read_only_option(THD *thd,
|
|||||||
if (lex->sql_command == SQLCOM_UPDATE_MULTI)
|
if (lex->sql_command == SQLCOM_UPDATE_MULTI)
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
|
if (lex->sql_command == SQLCOM_CREATE_DB ||
|
||||||
|
lex->sql_command == SQLCOM_DROP_DB)
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
a table-to-be-created is not in the temp table list yet,
|
a table-to-be-created is not in the temp table list yet,
|
||||||
so CREATE TABLE needs a special treatment
|
so CREATE TABLE needs a special treatment
|
||||||
*/
|
*/
|
||||||
const bool update_real_tables=
|
if (lex->sql_command == SQLCOM_CREATE_TABLE)
|
||||||
lex->sql_command == SQLCOM_CREATE_TABLE
|
DBUG_RETURN(!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE));
|
||||||
? !(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
|
|
||||||
: some_non_temp_table_to_be_updated(thd, all_tables);
|
|
||||||
|
|
||||||
const bool create_or_drop_databases=
|
/*
|
||||||
(lex->sql_command == SQLCOM_CREATE_DB) ||
|
a table-to-be-dropped might not exist (DROP TEMPORARY TABLE IF EXISTS),
|
||||||
(lex->sql_command == SQLCOM_DROP_DB);
|
cannot use the temp table list either.
|
||||||
|
*/
|
||||||
|
if (lex->sql_command == SQLCOM_DROP_TABLE && lex->drop_temporary)
|
||||||
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
if (update_real_tables || create_or_drop_databases)
|
/* Now, check thd->temporary_tables list */
|
||||||
{
|
DBUG_RETURN(some_non_temp_table_to_be_updated(thd, all_tables));
|
||||||
/*
|
|
||||||
An attempt was made to modify one or more non-temporary tables.
|
|
||||||
*/
|
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Assuming that only temporary tables are modified. */
|
|
||||||
DBUG_RETURN(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_WSREP
|
#ifdef WITH_WSREP
|
||||||
@ -2785,7 +2776,7 @@ case SQLCOM_PREPARE:
|
|||||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||||
{
|
{
|
||||||
partition_info *part_info= thd->lex->part_info;
|
partition_info *part_info= thd->lex->part_info;
|
||||||
if (part_info && !(part_info= thd->lex->part_info->get_clone()))
|
if (part_info && !(part_info= part_info->get_clone()))
|
||||||
{
|
{
|
||||||
res= -1;
|
res= -1;
|
||||||
goto end_with_restore_list;
|
goto end_with_restore_list;
|
||||||
@ -3176,8 +3167,8 @@ end_with_restore_list:
|
|||||||
/* mysql_update return 2 if we need to switch to multi-update */
|
/* mysql_update return 2 if we need to switch to multi-update */
|
||||||
if (up_result != 2)
|
if (up_result != 2)
|
||||||
break;
|
break;
|
||||||
/* Fall through */
|
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
case SQLCOM_UPDATE_MULTI:
|
case SQLCOM_UPDATE_MULTI:
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(first_table == all_tables && first_table != 0);
|
DBUG_ASSERT(first_table == all_tables && first_table != 0);
|
||||||
@ -3288,6 +3279,7 @@ end_with_restore_list:
|
|||||||
DBUG_PRINT("debug", ("Just after generate_incident()"));
|
DBUG_PRINT("debug", ("Just after generate_incident()"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* fall through */
|
||||||
case SQLCOM_INSERT:
|
case SQLCOM_INSERT:
|
||||||
{
|
{
|
||||||
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE);
|
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE);
|
||||||
@ -4064,6 +4056,7 @@ end_with_restore_list:
|
|||||||
initialize this variable because RESET shares the same code as FLUSH
|
initialize this variable because RESET shares the same code as FLUSH
|
||||||
*/
|
*/
|
||||||
lex->no_write_to_binlog= 1;
|
lex->no_write_to_binlog= 1;
|
||||||
|
/* fall through */
|
||||||
case SQLCOM_FLUSH:
|
case SQLCOM_FLUSH:
|
||||||
{
|
{
|
||||||
int write_to_binlog;
|
int write_to_binlog;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2005, 2014, Oracle and/or its affiliates.
|
/* Copyright (c) 2005, 2017, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2009, 2014, SkySQL Ab.
|
Copyright (c) 2009, 2017, SkySQL Ab.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -4640,7 +4640,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
|
|||||||
thd->work_part_info= thd->lex->part_info;
|
thd->work_part_info= thd->lex->part_info;
|
||||||
|
|
||||||
if (thd->work_part_info &&
|
if (thd->work_part_info &&
|
||||||
!(thd->work_part_info= thd->lex->part_info->get_clone()))
|
!(thd->work_part_info= thd->work_part_info->get_clone()))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
|
|
||||||
/* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */
|
/* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */
|
||||||
@ -6672,7 +6672,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
|||||||
lpt->alter_info= alter_info;
|
lpt->alter_info= alter_info;
|
||||||
lpt->create_info= create_info;
|
lpt->create_info= create_info;
|
||||||
lpt->db_options= create_info->table_options;
|
lpt->db_options= create_info->table_options;
|
||||||
if (create_info->row_type == ROW_TYPE_DYNAMIC)
|
if (create_info->row_type != ROW_TYPE_FIXED &&
|
||||||
|
create_info->row_type != ROW_TYPE_DEFAULT)
|
||||||
lpt->db_options|= HA_OPTION_PACK_RECORD;
|
lpt->db_options|= HA_OPTION_PACK_RECORD;
|
||||||
lpt->table= fast_alter_table;
|
lpt->table= fast_alter_table;
|
||||||
lpt->old_table= table;
|
lpt->old_table= table;
|
||||||
@ -8163,6 +8164,7 @@ int create_partition_name(char *out, size_t outlen, const char *in1,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
transl_part= in2;
|
transl_part= in2;
|
||||||
|
|
||||||
if (name_variant == NORMAL_PART_NAME)
|
if (name_variant == NORMAL_PART_NAME)
|
||||||
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, NullS);
|
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, NullS);
|
||||||
else if (name_variant == TEMP_PART_NAME)
|
else if (name_variant == TEMP_PART_NAME)
|
||||||
@ -8177,25 +8179,19 @@ int create_partition_name(char *out, size_t outlen, const char *in1,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Create subpartition name. This method is used to calculate the
|
||||||
|
subpartition name, service routine to the del_ren_cre_table method.
|
||||||
|
The output buffer size should be FN_REFLEN + 1(terminating '\0').
|
||||||
|
|
||||||
/*
|
@param [out] out Created partition name string
|
||||||
Create subpartition name
|
@param in1 First part
|
||||||
|
@param in2 Second part
|
||||||
|
@param in3 Third part
|
||||||
|
@param name_variant Normal, temporary or renamed partition name
|
||||||
|
|
||||||
SYNOPSIS
|
@retval true Error.
|
||||||
create_subpartition_name()
|
@retval false Success.
|
||||||
out:out The buffer for the created partition name string
|
|
||||||
must be *at least* of FN_REFLEN+1 bytes
|
|
||||||
in1 First part
|
|
||||||
in2 Second part
|
|
||||||
in3 Third part
|
|
||||||
name_variant Normal, temporary or renamed partition name
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0 if ok, error if name too long
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This method is used to calculate the subpartition name, service routine to
|
|
||||||
the del_ren_cre_table method.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int create_subpartition_name(char *out, size_t outlen,
|
int create_subpartition_name(char *out, size_t outlen,
|
||||||
@ -8207,6 +8203,7 @@ int create_subpartition_name(char *out, size_t outlen,
|
|||||||
|
|
||||||
tablename_to_filename(in2, transl_part_name, FN_REFLEN);
|
tablename_to_filename(in2, transl_part_name, FN_REFLEN);
|
||||||
tablename_to_filename(in3, transl_subpart_name, FN_REFLEN);
|
tablename_to_filename(in3, transl_subpart_name, FN_REFLEN);
|
||||||
|
|
||||||
if (name_variant == NORMAL_PART_NAME)
|
if (name_variant == NORMAL_PART_NAME)
|
||||||
end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
|
end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
|
||||||
"#SP#", transl_subpart_name, NullS);
|
"#SP#", transl_subpart_name, NullS);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#ifndef SQL_PARTITION_INCLUDED
|
#ifndef SQL_PARTITION_INCLUDED
|
||||||
#define SQL_PARTITION_INCLUDED
|
#define SQL_PARTITION_INCLUDED
|
||||||
|
|
||||||
/* Copyright (c) 2006, 2013, Oracle and/or its affiliates.
|
/* Copyright (c) 2006, 2017, Oracle and/or its affiliates.
|
||||||
|
Copyright (c) 2011, 2017, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -194,7 +194,6 @@ static DYNAMIC_ARRAY plugin_array;
|
|||||||
static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
|
static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
|
||||||
static MEM_ROOT plugin_mem_root;
|
static MEM_ROOT plugin_mem_root;
|
||||||
static bool reap_needed= false;
|
static bool reap_needed= false;
|
||||||
static int plugin_array_version=0;
|
|
||||||
|
|
||||||
static bool initialized= 0;
|
static bool initialized= 0;
|
||||||
|
|
||||||
@ -312,7 +311,6 @@ static void plugin_vars_free_values(sys_var *vars);
|
|||||||
static void restore_pluginvar_names(sys_var *first);
|
static void restore_pluginvar_names(sys_var *first);
|
||||||
static void plugin_opt_set_limits(struct my_option *,
|
static void plugin_opt_set_limits(struct my_option *,
|
||||||
const struct st_mysql_sys_var *);
|
const struct st_mysql_sys_var *);
|
||||||
static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin);
|
|
||||||
static void intern_plugin_unlock(LEX *lex, plugin_ref plugin);
|
static void intern_plugin_unlock(LEX *lex, plugin_ref plugin);
|
||||||
static void reap_plugins(void);
|
static void reap_plugins(void);
|
||||||
|
|
||||||
@ -924,14 +922,16 @@ SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc)
|
static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc,
|
||||||
|
uint state_mask= PLUGIN_IS_READY |
|
||||||
|
PLUGIN_IS_UNINITIALIZED)
|
||||||
{
|
{
|
||||||
st_plugin_int *pi= plugin_ref_to_int(rc);
|
st_plugin_int *pi= plugin_ref_to_int(rc);
|
||||||
DBUG_ENTER("intern_plugin_lock");
|
DBUG_ENTER("intern_plugin_lock");
|
||||||
|
|
||||||
mysql_mutex_assert_owner(&LOCK_plugin);
|
mysql_mutex_assert_owner(&LOCK_plugin);
|
||||||
|
|
||||||
if (pi->state & (PLUGIN_IS_READY | PLUGIN_IS_UNINITIALIZED))
|
if (pi->state & state_mask)
|
||||||
{
|
{
|
||||||
plugin_ref plugin;
|
plugin_ref plugin;
|
||||||
#ifdef DBUG_OFF
|
#ifdef DBUG_OFF
|
||||||
@ -1078,43 +1078,42 @@ static bool plugin_add(MEM_ROOT *tmp_root,
|
|||||||
if (!name->str && plugin_find_internal(&tmp.name, MYSQL_ANY_PLUGIN))
|
if (!name->str && plugin_find_internal(&tmp.name, MYSQL_ANY_PLUGIN))
|
||||||
continue; // already installed
|
continue; // already installed
|
||||||
|
|
||||||
struct st_plugin_int *tmp_plugin_ptr;
|
struct st_plugin_int *tmp_plugin_ptr;
|
||||||
if (*(int*)plugin->info <
|
if (*(int*)plugin->info <
|
||||||
min_plugin_info_interface_version[plugin->type] ||
|
min_plugin_info_interface_version[plugin->type] ||
|
||||||
((*(int*)plugin->info) >> 8) >
|
((*(int*)plugin->info) >> 8) >
|
||||||
(cur_plugin_info_interface_version[plugin->type] >> 8))
|
(cur_plugin_info_interface_version[plugin->type] >> 8))
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
strxnmov(buf, sizeof(buf) - 1, "API version for ",
|
strxnmov(buf, sizeof(buf) - 1, "API version for ",
|
||||||
plugin_type_names[plugin->type].str,
|
plugin_type_names[plugin->type].str,
|
||||||
" plugin ", tmp.name.str,
|
" plugin ", tmp.name.str,
|
||||||
" not supported by this version of the server", NullS);
|
" not supported by this version of the server", NullS);
|
||||||
report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, ENOEXEC, buf);
|
report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, ENOEXEC, buf);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (plugin_maturity_map[plugin->maturity] < plugin_maturity)
|
if (plugin_maturity_map[plugin->maturity] < plugin_maturity)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
strxnmov(buf, sizeof(buf) - 1, "Loading of ",
|
strxnmov(buf, sizeof(buf) - 1, "Loading of ",
|
||||||
plugin_maturity_names[plugin->maturity],
|
plugin_maturity_names[plugin->maturity],
|
||||||
" plugin ", tmp.name.str,
|
" plugin ", tmp.name.str,
|
||||||
" is prohibited by --plugin-maturity=",
|
" is prohibited by --plugin-maturity=",
|
||||||
plugin_maturity_names[plugin_maturity],
|
plugin_maturity_names[plugin_maturity],
|
||||||
NullS);
|
NullS);
|
||||||
report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, EPERM, buf);
|
report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, EPERM, buf);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
tmp.plugin= plugin;
|
tmp.plugin= plugin;
|
||||||
tmp.ref_count= 0;
|
tmp.ref_count= 0;
|
||||||
tmp.state= PLUGIN_IS_UNINITIALIZED;
|
tmp.state= PLUGIN_IS_UNINITIALIZED;
|
||||||
tmp.load_option= PLUGIN_ON;
|
tmp.load_option= PLUGIN_ON;
|
||||||
|
|
||||||
if (!(tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
|
if (!(tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
|
||||||
goto err;
|
goto err;
|
||||||
plugin_array_version++;
|
if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
|
||||||
if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
|
tmp_plugin_ptr->state= PLUGIN_IS_FREED;
|
||||||
tmp_plugin_ptr->state= PLUGIN_IS_FREED;
|
init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
|
||||||
init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
|
|
||||||
|
|
||||||
if (name->str)
|
if (name->str)
|
||||||
DBUG_RETURN(FALSE); // all done
|
DBUG_RETURN(FALSE); // all done
|
||||||
@ -1210,7 +1209,6 @@ static void plugin_del(struct st_plugin_int *plugin)
|
|||||||
if (plugin->plugin_dl)
|
if (plugin->plugin_dl)
|
||||||
plugin_dl_del(&plugin->plugin_dl->dl);
|
plugin_dl_del(&plugin->plugin_dl->dl);
|
||||||
plugin->state= PLUGIN_IS_FREED;
|
plugin->state= PLUGIN_IS_FREED;
|
||||||
plugin_array_version++;
|
|
||||||
free_root(&plugin->mem_root, MYF(0));
|
free_root(&plugin->mem_root, MYF(0));
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
@ -1824,10 +1822,10 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
|
|||||||
case '\0':
|
case '\0':
|
||||||
list= NULL; /* terminate the loop */
|
list= NULL; /* terminate the loop */
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
case ';':
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
case ':': /* can't use this as delimiter as it may be drive letter */
|
case ':': /* can't use this as delimiter as it may be drive letter */
|
||||||
#endif
|
#endif
|
||||||
case ';':
|
|
||||||
str->str[str->length]= '\0';
|
str->str[str->length]= '\0';
|
||||||
if (str == &name) // load all plugins in named module
|
if (str == &name) // load all plugins in named module
|
||||||
{
|
{
|
||||||
@ -1865,6 +1863,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
|
|||||||
str->str= p;
|
str->str= p;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
str->length++;
|
str->length++;
|
||||||
continue;
|
continue;
|
||||||
@ -2297,64 +2296,55 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
|
|||||||
bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
|
bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
|
||||||
int type, uint state_mask, void *arg)
|
int type, uint state_mask, void *arg)
|
||||||
{
|
{
|
||||||
uint idx, total;
|
uint idx, total= 0;
|
||||||
struct st_plugin_int *plugin, **plugins;
|
struct st_plugin_int *plugin;
|
||||||
int version=plugin_array_version;
|
plugin_ref *plugins;
|
||||||
|
my_bool res= FALSE;
|
||||||
DBUG_ENTER("plugin_foreach_with_mask");
|
DBUG_ENTER("plugin_foreach_with_mask");
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
state_mask= ~state_mask; // do it only once
|
|
||||||
|
|
||||||
mysql_mutex_lock(&LOCK_plugin);
|
mysql_mutex_lock(&LOCK_plugin);
|
||||||
total= type == MYSQL_ANY_PLUGIN ? plugin_array.elements
|
|
||||||
: plugin_hash[type].records;
|
|
||||||
/*
|
/*
|
||||||
Do the alloca out here in case we do have a working alloca:
|
Do the alloca out here in case we do have a working alloca:
|
||||||
leaving the nested stack frame invalidates alloca allocation.
|
leaving the nested stack frame invalidates alloca allocation.
|
||||||
*/
|
*/
|
||||||
plugins=(struct st_plugin_int **)my_alloca(total*sizeof(plugin));
|
|
||||||
if (type == MYSQL_ANY_PLUGIN)
|
if (type == MYSQL_ANY_PLUGIN)
|
||||||
{
|
{
|
||||||
for (idx= 0; idx < total; idx++)
|
plugins= (plugin_ref*) my_alloca(plugin_array.elements * sizeof(plugin_ref));
|
||||||
|
for (idx= 0; idx < plugin_array.elements; idx++)
|
||||||
{
|
{
|
||||||
plugin= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
|
plugin= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
|
||||||
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
|
if ((plugins[total]= intern_plugin_lock(0, plugin_int_to_ref(plugin),
|
||||||
|
state_mask)))
|
||||||
|
total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HASH *hash= plugin_hash + type;
|
HASH *hash= plugin_hash + type;
|
||||||
for (idx= 0; idx < total; idx++)
|
plugins= (plugin_ref*) my_alloca(hash->records * sizeof(plugin_ref));
|
||||||
|
for (idx= 0; idx < hash->records; idx++)
|
||||||
{
|
{
|
||||||
plugin= (struct st_plugin_int *) my_hash_element(hash, idx);
|
plugin= (struct st_plugin_int *) my_hash_element(hash, idx);
|
||||||
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
|
if ((plugins[total]= intern_plugin_lock(0, plugin_int_to_ref(plugin),
|
||||||
|
state_mask)))
|
||||||
|
total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mysql_mutex_unlock(&LOCK_plugin);
|
mysql_mutex_unlock(&LOCK_plugin);
|
||||||
|
|
||||||
for (idx= 0; idx < total; idx++)
|
for (idx= 0; idx < total; idx++)
|
||||||
{
|
{
|
||||||
if (unlikely(version != plugin_array_version))
|
|
||||||
{
|
|
||||||
mysql_mutex_lock(&LOCK_plugin);
|
|
||||||
for (uint i=idx; i < total; i++)
|
|
||||||
if (plugins[i] && plugins[i]->state & state_mask)
|
|
||||||
plugins[i]=0;
|
|
||||||
mysql_mutex_unlock(&LOCK_plugin);
|
|
||||||
}
|
|
||||||
plugin= plugins[idx];
|
|
||||||
/* It will stop iterating on first engine error when "func" returns TRUE */
|
/* It will stop iterating on first engine error when "func" returns TRUE */
|
||||||
if (plugin && func(thd, plugin_int_to_ref(plugin), arg))
|
if ((res= func(thd, plugins[idx], arg)))
|
||||||
goto err;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin_unlock_list(0, plugins, total);
|
||||||
my_afree(plugins);
|
my_afree(plugins);
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(res);
|
||||||
err:
|
|
||||||
my_afree(plugins);
|
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3964,4 +3954,3 @@ void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root)
|
|||||||
insert_dynamic(options, (uchar*) opt);
|
insert_dynamic(options, (uchar*) opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1307,7 +1307,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
|
|||||||
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
|
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (setup_fields(thd, 0, *values, MARK_COLUMNS_NONE, 0, 0))
|
if (setup_fields(thd, 0, *values, MARK_COLUMNS_NONE, 0, NULL, 0))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1397,7 +1397,7 @@ static int mysql_test_update(Prepared_statement *stmt,
|
|||||||
table_list->register_want_access(want_privilege);
|
table_list->register_want_access(want_privilege);
|
||||||
#endif
|
#endif
|
||||||
thd->lex->select_lex.no_wrap_view_item= TRUE;
|
thd->lex->select_lex.no_wrap_view_item= TRUE;
|
||||||
res= setup_fields(thd, 0, select->item_list, MARK_COLUMNS_READ, 0, 0);
|
res= setup_fields(thd, 0, select->item_list, MARK_COLUMNS_READ, 0, NULL, 0);
|
||||||
thd->lex->select_lex.no_wrap_view_item= FALSE;
|
thd->lex->select_lex.no_wrap_view_item= FALSE;
|
||||||
if (res)
|
if (res)
|
||||||
goto error;
|
goto error;
|
||||||
@ -1408,7 +1408,8 @@ static int mysql_test_update(Prepared_statement *stmt,
|
|||||||
(SELECT_ACL & ~table_list->table->grant.privilege);
|
(SELECT_ACL & ~table_list->table->grant.privilege);
|
||||||
table_list->register_want_access(SELECT_ACL);
|
table_list->register_want_access(SELECT_ACL);
|
||||||
#endif
|
#endif
|
||||||
if (setup_fields(thd, 0, stmt->lex->value_list, MARK_COLUMNS_NONE, 0, 0) ||
|
if (setup_fields(thd, 0, stmt->lex->value_list, MARK_COLUMNS_NONE, 0, NULL,
|
||||||
|
0) ||
|
||||||
check_unique_table(thd, table_list))
|
check_unique_table(thd, table_list))
|
||||||
goto error;
|
goto error;
|
||||||
/* TODO: here we should send types of placeholders to the client. */
|
/* TODO: here we should send types of placeholders to the client. */
|
||||||
@ -1575,7 +1576,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt,
|
|||||||
if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL,
|
if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL,
|
||||||
DT_PREPARE | DT_CREATE))
|
DT_PREPARE | DT_CREATE))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
DBUG_RETURN(setup_fields(thd, 0, *values, MARK_COLUMNS_NONE, 0, 0));
|
DBUG_RETURN(setup_fields(thd, 0, *values, MARK_COLUMNS_NONE, 0, NULL, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2074,6 +2075,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
|
|||||||
if (res != 2)
|
if (res != 2)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case SQLCOM_UPDATE_MULTI:
|
case SQLCOM_UPDATE_MULTI:
|
||||||
res= mysql_test_multiupdate(stmt, tables, res == 2);
|
res= mysql_test_multiupdate(stmt, tables, res == 2);
|
||||||
break;
|
break;
|
||||||
|
@ -1139,6 +1139,7 @@ impossible position";
|
|||||||
loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
|
loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
errmsg = "could not find next log";
|
errmsg = "could not find next log";
|
||||||
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
||||||
|
@ -724,7 +724,7 @@ JOIN::prepare(Item ***rref_pointer_array,
|
|||||||
wild_num)) ||
|
wild_num)) ||
|
||||||
select_lex->setup_ref_array(thd, real_og_num) ||
|
select_lex->setup_ref_array(thd, real_og_num) ||
|
||||||
setup_fields(thd, (*rref_pointer_array), fields_list, MARK_COLUMNS_READ,
|
setup_fields(thd, (*rref_pointer_array), fields_list, MARK_COLUMNS_READ,
|
||||||
&all_fields, 1) ||
|
&all_fields, &select_lex->pre_fix, 1) ||
|
||||||
setup_without_group(thd, (*rref_pointer_array), tables_list,
|
setup_without_group(thd, (*rref_pointer_array), tables_list,
|
||||||
select_lex->leaf_tables, fields_list,
|
select_lex->leaf_tables, fields_list,
|
||||||
all_fields, &conds, order, group_list,
|
all_fields, &conds, order, group_list,
|
||||||
@ -13349,10 +13349,23 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top,
|
|||||||
nested_join= table->nested_join;
|
nested_join= table->nested_join;
|
||||||
if (table->sj_on_expr && !in_sj)
|
if (table->sj_on_expr && !in_sj)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
If this is a semi-join that is not contained within another semi-join,
|
If this is a semi-join that is not contained within another semi-join
|
||||||
leave it intact (otherwise it is flattened)
|
leave it intact (otherwise it is flattened)
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
Make sure that any semi-join appear in
|
||||||
|
the join->select_lex->sj_nests list only once
|
||||||
|
*/
|
||||||
|
List_iterator_fast<TABLE_LIST> sj_it(join->select_lex->sj_nests);
|
||||||
|
TABLE_LIST *sj_nest;
|
||||||
|
while ((sj_nest= sj_it++))
|
||||||
|
{
|
||||||
|
if (table == sj_nest)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (sj_nest)
|
||||||
|
continue;
|
||||||
join->select_lex->sj_nests.push_back(table);
|
join->select_lex->sj_nests.push_back(table);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -262,7 +262,7 @@ int fill_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
TABLE *table= tables->table;
|
TABLE *table= tables->table;
|
||||||
|
|
||||||
if (plugin_foreach_with_mask(thd, show_plugins, MYSQL_ANY_PLUGIN,
|
if (plugin_foreach_with_mask(thd, show_plugins, MYSQL_ANY_PLUGIN,
|
||||||
~PLUGIN_IS_FREED, table))
|
~(PLUGIN_IS_FREED | PLUGIN_IS_DYING), table))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
@ -931,6 +931,7 @@ public:
|
|||||||
is_handled= FALSE;
|
is_handled= FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
case ER_COLUMNACCESS_DENIED_ERROR:
|
case ER_COLUMNACCESS_DENIED_ERROR:
|
||||||
case ER_VIEW_NO_EXPLAIN: /* Error was anonymized, ignore all the same. */
|
case ER_VIEW_NO_EXPLAIN: /* Error was anonymized, ignore all the same. */
|
||||||
case ER_PROCACCESS_DENIED_ERROR:
|
case ER_PROCACCESS_DENIED_ERROR:
|
||||||
@ -5311,7 +5312,8 @@ int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
DBUG_ENTER("fill_schema_engines");
|
DBUG_ENTER("fill_schema_engines");
|
||||||
if (plugin_foreach_with_mask(thd, iter_schema_engines,
|
if (plugin_foreach_with_mask(thd, iter_schema_engines,
|
||||||
MYSQL_STORAGE_ENGINE_PLUGIN,
|
MYSQL_STORAGE_ENGINE_PLUGIN,
|
||||||
~PLUGIN_IS_FREED, tables->table))
|
~(PLUGIN_IS_FREED | PLUGIN_IS_DYING),
|
||||||
|
tables->table))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
@ -5733,6 +5735,10 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Disable padding temporarily so it doesn't break the query */
|
||||||
|
ulonglong sql_mode_was = thd->variables.sql_mode;
|
||||||
|
thd->variables.sql_mode &= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
|
||||||
|
|
||||||
if (proc_table->file->ha_index_init(0, 1))
|
if (proc_table->file->ha_index_init(0, 1))
|
||||||
{
|
{
|
||||||
res= 1;
|
res= 1;
|
||||||
@ -5768,6 +5774,7 @@ err:
|
|||||||
(void) proc_table->file->ha_index_end();
|
(void) proc_table->file->ha_index_end();
|
||||||
|
|
||||||
close_system_tables(thd, &open_tables_state_backup);
|
close_system_tables(thd, &open_tables_state_backup);
|
||||||
|
thd->variables.sql_mode = sql_mode_was;
|
||||||
DBUG_RETURN(res);
|
DBUG_RETURN(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5564,7 +5564,7 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
|
|||||||
case LEAVE_AS_IS:
|
case LEAVE_AS_IS:
|
||||||
if (!indexes_were_disabled)
|
if (!indexes_were_disabled)
|
||||||
break;
|
break;
|
||||||
/* fall-through: disabled indexes */
|
/* fall-through */
|
||||||
case DISABLE:
|
case DISABLE:
|
||||||
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
|
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
|
||||||
}
|
}
|
||||||
@ -5799,9 +5799,25 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||||||
{
|
{
|
||||||
if (def->change && ! def->field)
|
if (def->change && ! def->field)
|
||||||
{
|
{
|
||||||
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change,
|
/*
|
||||||
table->s->table_name.str);
|
Check if there is modify for newly added field.
|
||||||
goto err;
|
*/
|
||||||
|
Create_field *find;
|
||||||
|
find_it.rewind();
|
||||||
|
while((find=find_it++))
|
||||||
|
{
|
||||||
|
if (!my_strcasecmp(system_charset_info,find->field_name, def->field_name))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (find && !find->field)
|
||||||
|
find_it.remove();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change,
|
||||||
|
table->s->table_name.str);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Check that the DATE/DATETIME not null field we are going to add is
|
Check that the DATE/DATETIME not null field we are going to add is
|
||||||
@ -5853,6 +5869,29 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||||||
*/
|
*/
|
||||||
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
|
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Check if there is alter for newly added field.
|
||||||
|
*/
|
||||||
|
alter_it.rewind();
|
||||||
|
Alter_column *alter;
|
||||||
|
while ((alter=alter_it++))
|
||||||
|
{
|
||||||
|
if (!my_strcasecmp(system_charset_info,def->field_name, alter->name))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (alter)
|
||||||
|
{
|
||||||
|
if (def->sql_type == MYSQL_TYPE_BLOB)
|
||||||
|
{
|
||||||
|
my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if ((def->def=alter->def)) // Use new default
|
||||||
|
def->flags&= ~NO_DEFAULT_VALUE_FLAG;
|
||||||
|
else
|
||||||
|
def->flags|= NO_DEFAULT_VALUE_FLAG;
|
||||||
|
alter_it.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (alter_info->alter_list.elements)
|
if (alter_info->alter_list.elements)
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ int mysql_update(THD *thd,
|
|||||||
table_list->grant.want_privilege= table->grant.want_privilege=
|
table_list->grant.want_privilege= table->grant.want_privilege=
|
||||||
(SELECT_ACL & ~table->grant.privilege);
|
(SELECT_ACL & ~table->grant.privilege);
|
||||||
#endif
|
#endif
|
||||||
if (setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, 0))
|
if (setup_fields(thd, 0, values, MARK_COLUMNS_READ, 0, NULL, 0))
|
||||||
{
|
{
|
||||||
free_underlaid_joins(thd, select_lex);
|
free_underlaid_joins(thd, select_lex);
|
||||||
DBUG_RETURN(1); /* purecov: inspected */
|
DBUG_RETURN(1); /* purecov: inspected */
|
||||||
@ -1525,7 +1525,7 @@ int multi_update::prepare(List<Item> ¬_used_values,
|
|||||||
reference tables
|
reference tables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int error= setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0);
|
int error= setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, NULL, 0);
|
||||||
|
|
||||||
ti.rewind();
|
ti.rewind();
|
||||||
while ((table_ref= ti++))
|
while ((table_ref= ti++))
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user