1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Merge branch '11.4' into 11.8

This commit is contained in:
Sergei Golubchik
2026-01-05 18:19:14 +01:00
151 changed files with 4639 additions and 1773 deletions

View File

@@ -34,9 +34,10 @@ typedef struct st_line_buffer
bool truncated;
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
extern char *batch_readline(LINE_BUFFER *buffer, bool binary_mode);
extern void batch_readline_end(LINE_BUFFER *buffer);
extern bool init_line_buffer(LINE_BUFFER *buffer, File file, ulong size,
ulong max_size);
#endif /* CLIENT_MY_READLINE_INCLUDED */

View File

@@ -1211,6 +1211,81 @@ inline int get_command_index(char cmd_char)
return -1;
}
static LINE_BUFFER *batch_readline_init(ulong max_size, const char *path)
{
LINE_BUFFER *line_buff;
File file;
MY_STAT input_file_stat;
char buff[FN_REFLEN + 512];
if (path)
{
if ((file= my_open(path, O_RDONLY | O_BINARY, MYF(0))) < 0)
{
#ifdef _WIN32
if (my_errno == EACCES && my_stat(path, &input_file_stat, MYF(0)) &&
MY_S_ISDIR(input_file_stat.st_mode))
my_snprintf(buff, sizeof(buff), "Can't read from a directory '%.*s'",
FN_REFLEN, path);
else
#endif
my_snprintf(buff, sizeof(buff), "Failed to open file '%.*s', error: %d",
FN_REFLEN, path, my_errno);
put_info(buff, INFO_ERROR, 0);
return 0;
}
}
else
{
file= my_fileno(stdin);
}
if (my_fstat(file, &input_file_stat, MYF(0)))
{
my_snprintf(buff, sizeof(buff), "Failed to stat file '%.*s', error: %d",
FN_REFLEN, path ? path : "stdin", my_errno);
goto err1;
}
if (MY_S_ISDIR(input_file_stat.st_mode))
{
my_snprintf(buff, sizeof(buff), "Can't read from a directory '%.*s'",
FN_REFLEN, path ? path : "stdin");
goto err1;
}
#ifndef _WIN32
if (MY_S_ISBLK(input_file_stat.st_mode))
{
my_snprintf(buff, sizeof(buff), "Can't read from a block device '%.*s'",
FN_REFLEN, path ? path : "stdin");
goto err1;
}
#endif
if (!(line_buff= (LINE_BUFFER*) my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(*line_buff),
MYF(MY_WME | MY_ZEROFILL))))
{
goto err;
}
if (init_line_buffer(line_buff, file, IO_SIZE, max_size))
{
my_free(line_buff);
goto err;
}
return line_buff;
err1:
put_info(buff, INFO_ERROR, 0);
err:
if (path)
my_close(file, MYF(0));
return 0;
}
static int delimiter_index= -1;
static int charset_index= -1;
static int sandbox_index= -1;
@@ -1285,10 +1360,8 @@ int main(int argc,char *argv[])
}
if (status.batch && !status.line_buff &&
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, NULL)))
{
put_info("Can't initialize batch_readline - may be the input source is "
"a directory or a block device.", INFO_ERROR, 0);
free_defaults(defaults_argv);
my_end(0);
exit(1);
@@ -4723,7 +4796,6 @@ static int com_source(String *, char *line)
LINE_BUFFER *line_buff;
int error;
STATUS old_status;
FILE *sql_file;
my_bool save_ignore_errors;
if (status.sandbox)
@@ -4743,18 +4815,10 @@ static int com_source(String *, char *line)
end--;
end[0]=0;
unpack_filename(source_name,source_name);
/* open file name */
if (!(sql_file = my_fopen(source_name, O_RDONLY | O_BINARY,MYF(0))))
{
char buff[FN_REFLEN+60];
sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno);
return put_info(buff, INFO_ERROR, 0);
}
if (!(line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, sql_file)))
if (!(line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, source_name)))
{
my_fclose(sql_file,MYF(0));
return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
return ignore_errors ? -1 : 1;
}
/* Save old status */
@@ -4773,7 +4837,7 @@ static int com_source(String *, char *line)
ignore_errors= save_ignore_errors;
status=old_status; // Continue as before
in_com_source= aborted= 0;
my_fclose(sql_file,MYF(0));
my_close(line_buff->file, MYF(0));
batch_readline_end(line_buff);
/*
If we got an error during source operation, don't abort the client

View File

@@ -23,38 +23,11 @@
#include <my_dir.h>
#include "my_readline.h"
static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size);
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
static size_t fill_buffer(LINE_BUFFER *buffer);
static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
{
LINE_BUFFER *line_buff;
#ifndef _WIN32
MY_STAT input_file_stat;
if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
MY_S_ISDIR(input_file_stat.st_mode) ||
MY_S_ISBLK(input_file_stat.st_mode))
return 0;
#endif
if (!(line_buff=(LINE_BUFFER*)
my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*line_buff),
MYF(MY_WME | MY_ZEROFILL))))
return 0;
if (init_line_buffer(line_buff,my_fileno(file),IO_SIZE,max_size))
{
my_free(line_buff);
return 0;
}
return line_buff;
}
char *batch_readline(LINE_BUFFER *line_buff, bool binary_mode)
{
char *pos;
@@ -105,8 +78,7 @@ LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, char * str)
Functions to handle buffered readings of lines from a stream
******************************************************************************/
static bool
init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer)
bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer)
{
buffer->file=file;
buffer->bufread=size;

View File

@@ -120,8 +120,8 @@ ELSEIF(DEB)
SET(WITH_ZLIB system CACHE STRING "")
SET(WITH_LIBWRAP ON)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
# No hurd implementation
IF(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "i686-AT386")
# On Hurd systems (GNU) there is no auth socket implementation
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "GNU")
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
ENDIF()
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")

View File

@@ -75,6 +75,7 @@ extern int (*dbug_sanity)(void);
#define DBUG_PRINT(keyword,arglist) \
do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
#ifdef HAVE_ATTRIBUTE_CLEANUP
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_ __attribute__((cleanup(_db_return_))); \
@@ -94,6 +95,7 @@ extern int (*dbug_sanity)(void);
#define DBUG_RETURN(a1) return(a1)
#define DBUG_VOID_RETURN return
#define DBUG_PRINT(keyword,arglist) do{} while(0)
#define DBUG_DUMP(keyword,a1,a2) do{} while(0)
#endif
#define DBUG_EXECUTE(keyword,a1) \
@@ -111,7 +113,6 @@ extern int (*dbug_sanity)(void);
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
#define DBUG_PROCESS(a1) _db_process_(a1)
#define DBUG_FILE _db_fp_()
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
@@ -230,7 +231,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
one should #include <sstream>. We intentionally avoid including it here to save
compilation time.
*/
# ifdef DBUG_OFF
# if defined DBUG_OFF || !defined DBUG_TRACE
# define DBUG_LOG(keyword, v) do {} while (0)
# else
# define DBUG_LOG(keyword, v) do { \

View File

@@ -5,7 +5,7 @@ if (!$_galera_variables_delta) {
--let $galera_variables_delta=0
}
--let $galera_variables_expected=`SELECT 51 + $galera_variables_delta`
--let $galera_variables_expected=`SELECT 50 + $galera_variables_delta`
--let $galera_variables_count=`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`

View File

@@ -64,3 +64,156 @@ rm -fv crldir/*
cp -v client-cert.crl crldir/`openssl x509 -in client-cert.pem -noout -issuer_hash`.r0
rm -rf demoCA
# --- Certificate Chain ---
# These tests are inspired from the following commit from MySQL Server
# https://github.com/mysql/mysql-server/commit/969afef933f1872c5f38ea93047ef05c4509c335
#
# Credits to salman.s.khan@oracle.com
#
# -------------------------------------------------------------------------------------
#
# STEPS TO GENERATE THE FOLLOWING CHAINED CERTIFICATES WHICH IS USED IN THE TEST CASE :
#
# +---------+
# | Root CA |
# +---------+
# |
# /------------+-----------\
# | |
# +------------------+ +------------------+
# | Intermediate CA1 | | Intermediate CA2 |
# +------------------+ +------------------+
# | |
# +-------------+ +-------------+
# | Server | | Client |
# | certificate | | certificate |
# +-------------+ +-------------+
cd cachain
mkdir ca
mkdir server
mkdir clients
mkdir ca/root.certs
touch ca/root.index.txt
touch ca/root.index.txt.attr
echo '01' > ca/root.serial
cat > ca/root.cfg << EOF
[ ca ]
default_ca = CA_default
[ CA_default ]
dir = $PWD/ca
certs = \$dir/certs
database = \$dir/root.index.txt
serial = \$dir/root.serial
policy= policy_match
[ policy_match ]
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical,CA:TRUE
keyUsage = critical,keyCertSign,cRLSign
[ v3_ca_intermediate ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical,CA:TRUE,pathlen:0
keyUsage = critical,keyCertSign,cRLSign
EOF
# Generate Root CA key and cert
openssl genrsa -out ca/root.key 4096
openssl req -new -x509 '-sha256' -key ca/root.key -out ca/root.crt -days 7200 -subj "/O=MariaDB/OU=MariaDB/CN=Root CA" -config ca/root.cfg -extensions v3_ca
# Generate Intermediate CA1 key and cert
openssl genrsa -out ca/intermediate_ca1.key 4096
openssl req -new '-sha256' -key ca/intermediate_ca1.key -out ca/intermediate_ca1.csr -subj "/O=MariaDB/OU=MariaDB/CN=Intermediate CA1"
openssl ca -batch -days 7200 -notext -md sha256 -in ca/intermediate_ca1.csr -out ca/intermediate_ca1.crt -keyfile ca/root.key -cert ca/root.crt -outdir ca/root.certs/ -config ca/root.cfg -extensions v3_ca_intermediate
mkdir ca/intermediate_ca1.certs
touch ca/intermediate_ca1.index.txt
touch ca/intermediate_ca1.index.txt.attr
echo '01' > ca/intermediate_ca1.serial
cat > ca/intermediate_ca1.cfg << EOF
[ ca ]
default_ca = CA_default
[ CA_default ]
dir = $PWD/ca
certs = \$dir/intermediate_ca1.certs
database = \$dir/intermediate_ca1.index.txt
serial = \$dir/intermediate_ca1.serial
policy= policy_match
[ policy_match ]
commonName = supplied
[ alt_names ]
DNS.1 = localhost
IP.1 = 127.0.0.1
[ server_cert ]
basicConstraints = CA:FALSE
keyUsage = critical,digitalSignature,keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
EOF
# Generate Server key and cert
openssl genrsa -out server/server.key 4096
openssl req -new '-sha256' -key server/server.key -out server/server.csr -subj "/CN=localhost"
openssl ca -batch -days 7200 -notext -md sha256 -in server/server.csr -out server/server.crt -keyfile ca/intermediate_ca1.key -cert ca/intermediate_ca1.crt -outdir ca/intermediate_ca1.certs/ -config ca/intermediate_ca1.cfg -extensions server_cert
# Generate Intermediate CA2 key and cert
openssl genrsa -out ca/intermediate_ca2.key 4096
openssl req -new '-sha256' -key ca/intermediate_ca2.key -out ca/intermediate_ca2.csr -subj "/O=MariaDB/OU=MariaDB/CN=Intermediate CA2"
openssl ca -batch -days 7200 -notext -md sha256 -in ca/intermediate_ca2.csr -out ca/intermediate_ca2.crt -keyfile ca/root.key -cert ca/root.crt -outdir ca/root.certs/ -config ca/root.cfg -extensions v3_ca_intermediate
mkdir ca/intermediate_ca2.certs
touch ca/intermediate_ca2.index.txt
touch ca/intermediate_ca2.index.txt.attr
echo '01' > ca/intermediate_ca2.serial
cat > ca/intermediate_ca2.cfg << EOF
[ ca ]
default_ca = CA_default
[ CA_default ]
dir = $PWD/ca
certs = \$dir/intermediate_ca2.certs
database = \$dir/intermediate_ca2.index.txt
serial = \$dir/intermediate_ca2.serial
policy= policy_match
[ policy_match ]
commonName = supplied
[ client_cert ]
basicConstraints = CA:FALSE
keyUsage = critical,digitalSignature,keyEncipherment
extendedKeyUsage = clientAuth
EOF
# Generate Client key and cert
openssl genrsa -out clients/client.key 4096
openssl req -new '-sha256' -key clients/client.key -out clients/client.csr -subj "/CN=client"
openssl ca -batch -days 7200 -notext -md sha256 -in clients/client.csr -out clients/client.crt -keyfile ca/intermediate_ca2.key -cert ca/intermediate_ca2.crt -outdir ca/intermediate_ca2.certs/ -config ca/intermediate_ca2.cfg -extensions client_cert
cat server/server.crt ca/intermediate_ca1.crt > server/server.cachain
cat clients/client.crt ca/intermediate_ca2.crt > clients/client.cachain
cat ca/root.crt ca/intermediate_ca1.crt > ca/root_intermediate_ca1.crt
# Generate Unrelated Root CA key and cert
openssl genrsa -out ca/unrelated_root.key 4096
openssl req -new -x509 '-sha256' -key ca/unrelated_root.key -out ca/unrelated_root.crt -days 7200 -subj "/O=MariaDB/OU=MariaDB/CN=Root CA" -config ca/root.cfg -extensions v3_ca
cp -v ca/root.crt ca/root_intermediate_ca1.crt ca/unrelated_root.crt server/server.key server/server.cachain clients/client.key clients/client.cachain ./
rm -rf ca server clients
cd ..

View File

@@ -0,0 +1,3 @@
--ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/root.crt
--ssl-key=$MYSQL_TEST_DIR/std_data/cachain/server.key
--ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/server.cachain

View File

@@ -0,0 +1,12 @@
call mtr.add_suppression("Server SSL certificate doesn't verify");
CREATE USER 'user1'@'%' REQUIRE SSL;
Variable_name Value
Ssl_version TLS
Restart server and provide ssl-ca comprising intermediate_ca1 in addition to the root ca.
Variable_name Value
Ssl_version TLS
Restart server and provide unrelated ssl-ca at server startup
ERROR 2026 (HY000): TLS/SSL error:
DROP USER 'user1';

View File

@@ -0,0 +1,74 @@
# These tests are inspired from the following commit from MySQL Server
# https://github.com/mysql/mysql-server/commit/969afef933f1872c5f38ea93047ef05c4509c335
# Credits to salman.s.khan@oracle.com
#####################################################################################
# This test verifies MariaDB can handle chained ssl certificate
# This test uses chained ssl certificates which is depicted as
# below:-
#
# +---------+
# | Root CA |
# +---------+
# |
# /------------+-----------\
# | |
# +------------------+ +------------------+
# | Intermediate CA1 | | Intermediate CA2 |
# +------------------+ +------------------+
# | |
# +-------------+ +-------------+
# | Server | | Client |
# | certificate | | certificate |
# +-------------+ +-------------+
#
# certificates that may be helpful for chain construction.
# In order to validate server cert correctly, we need to
# provide the trusted root certificate and the untrusted
# intermediate certificates as part of ssl-ca. Hence
# root_intermediate_ca1.crt (trusted root certificate +
# untrusted intermediate ca1 certificate) is passed as with
# --ssl-ca option
--source include/not_embedded.inc
--source include/have_ssl_communication.inc
#Suppress warning by the server certificate verification check: unrelated CA
call mtr.add_suppression("Server SSL certificate doesn't verify");
CREATE USER 'user1'@'%' REQUIRE SSL;
--replace_result TLSv1.3 TLS TLSv1.2 TLS
--exec $MYSQL --host=localhost -P $MASTER_MYPORT --user=user1 --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/root.crt --ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/client.cachain --ssl-key=$MYSQL_TEST_DIR/std_data/cachain/client.key -e "SHOW STATUS LIKE 'ssl_version'"
--echo
--echo Restart server and provide ssl-ca comprising intermediate_ca1 in addition to the root ca.
--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--write_line "restart:--ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/root_intermediate_ca1.crt --ssl-key=$MYSQL_TEST_DIR/std_data/cachain/server.key --ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/server.cachain" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--replace_result TLSv1.3 TLS TLSv1.2 TLS
--exec $MYSQL --host=localhost -P $MASTER_MYPORT --user=user1 --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/root.crt --ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/client.cachain --ssl-key=$MYSQL_TEST_DIR/std_data/cachain/client.key -e "SHOW STATUS LIKE 'ssl_version'"
--echo
--echo Restart server and provide unrelated ssl-ca at server startup
--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--write_line "restart:--ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/unrelated_root.crt --ssl-key=$MYSQL_TEST_DIR/std_data/cachain/server.key --ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/server.cachain" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--replace_regex /(ERROR 2026 \(HY000\): TLS\/SSL error:).*/\1/
--error 1
--exec $MYSQL --host=localhost -P $MASTER_MYPORT --user=user1 --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/cachain/unrelated_root.crt --ssl-cert=$MYSQL_TEST_DIR/std_data/cachain/client.cachain --ssl-key=$MYSQL_TEST_DIR/std_data/cachain/client.key -e "SHOW STATUS LIKE 'ssl_version'" 2>&1
--echo
# Cleanup
DROP USER 'user1';

View File

@@ -6063,4 +6063,111 @@ drop table t1;
#
SELECT ( WITH RECURSIVE x AS ( WITH x AS ( SELECT 1 FROM t14 ) SELECT x ) , t14 AS ( SELECT 1 UNION SELECT 'x' FROM x ) SELECT x FROM x WHERE ( SELECT x FROM x ) ) ;
ERROR 42S22: Unknown column 'x' in 'SELECT'
#
# MDEV-32299 Segfault when preparing unreferenced select in recursive CTE
#
SELECT ( WITH RECURSIVE x AS ( SELECT * FROM ( SELECT UTC_TIMESTAMP FROM ( SELECT ( WITH x AS ( WITH x AS ( SELECT * FROM x ) SELECT 1 ) SELECT 1 ) ) x ) x UNION SELECT NULL ) ( SELECT x FROM x ) ) ;
ERROR 42S22: Unknown column 'x' in 'SELECT'
select (
with recursive x as (
select * from (
select utc_timestamp
from (
select (
with x as (
with x as (
select * from x
)
select 1
)
select 1
) s
) y
) z
union
select null
)
(select x from x)
);
ERROR 42S22: Unknown column 'x' in 'SELECT'
select (
with recursive r as (
select * from (
with a as (
select * from r
)
select 1
) y
union
select 1
)
(select * from r)
);
(
with recursive r as (
select * from (
with a as (
select * from r
)
select 1
) y
union
select 1
)
(select * from r)
)
1
create table t1 (x int);
with recursive r as (
select f1 from (
with a as (
select x from t1
)
select 1 as f1
) y
union
select null
)
(select * from r);
f1
1
NULL
with recursive r as (
select f1 from (
with a as (
select f2 from t1
)
select 1 as f1
) y
union
select null
)
(select * from r);
ERROR 42S22: Unknown column 'f2' in 'SELECT'
drop table t1;
with recursive r as (
select 1 as f1
union
select f1 from (
with a as (
select f1 from r
)
select 1 as f1
) y
)
(select f1 from r);
f1
1
with recursive r as (
select 1 as f1
union
select f1 from (
with a as (
select f2 from r
)
select 1 as f1
) y
)
(select f1 from r);
ERROR 42S22: Unknown column 'f2' in 'SELECT'
# End of 10.6 tests

View File

@@ -3,6 +3,8 @@
--source include/no_msan_without_big.inc
--source include/not_valgrind.inc
--source include/have_innodb.inc
# --view-protocol fails due to MDEV-37119 for MDEV-32299
--source include/no_view_protocol.inc
create table t1 (a int, b varchar(32));
insert into t1 values
@@ -4067,4 +4069,121 @@ drop table t1;
--error ER_BAD_FIELD_ERROR
SELECT ( WITH RECURSIVE x AS ( WITH x AS ( SELECT 1 FROM t14 ) SELECT x ) , t14 AS ( SELECT 1 UNION SELECT 'x' FROM x ) SELECT x FROM x WHERE ( SELECT x FROM x ) ) ;
--echo #
--echo # MDEV-32299 Segfault when preparing unreferenced select in recursive CTE
--echo #
# As in bug report
--error ER_BAD_FIELD_ERROR
SELECT ( WITH RECURSIVE x AS ( SELECT * FROM ( SELECT UTC_TIMESTAMP FROM ( SELECT ( WITH x AS ( WITH x AS ( SELECT * FROM x ) SELECT 1 ) SELECT 1 ) ) x ) x UNION SELECT NULL ) ( SELECT x FROM x ) ) ;
#0 0x00005555569dff7b in TABLE_LIST::reset_const_table (this=0x7fffe0019938) at ../src/sql/table.cc:9615
#1 0x00005555569dffd4 in TABLE_LIST::reset_const_table (this=0x7fffe001a8c0) at ../src/sql/table.cc:9622
--error ER_BAD_FIELD_ERROR
select (
with recursive x as (
select * from (
select utc_timestamp
from (
select (
with x as (
with x as (
select * from x
)
select 1
)
select 1
) s
) y
) z
union
select null
)
(select x from x)
);
#6 0x00007ffff7639206 in __assert_fail (assertion=0x555555e121b6 "table_ref->table || table_ref->view", file=0x555555cdf138 "../src/sql/table.cc", line=7305, function=0x555555e30e24 "void Field_iterator_table_ref::set_field_iterator()") at ./assert/assert.c:101
#7 0x00005555569da013 in Field_iterator_table_ref::set_field_iterator (this=0x7ffff0a9afc0) at ../src/sql/table.cc:7305
select (
with recursive r as (
select * from (
with a as (
select * from r
)
select 1
) y
union
select 1
)
(select * from r)
);
# Field resolution in unreferenced:
create table t1 (x int);
with recursive r as (
select f1 from (
with a as (
select x from t1
)
select 1 as f1
) y
union
select null
)
(select * from r);
--error ER_BAD_FIELD_ERROR
with recursive r as (
select f1 from (
with a as (
select f2 from t1
)
select 1 as f1
) y
union
select null
)
(select * from r);
drop table t1;
with recursive r as (
select 1 as f1
union
select f1 from (
with a as (
select f1 from r
)
select 1 as f1
) y
)
(select f1 from r);
--error ER_BAD_FIELD_ERROR
with recursive r as (
select 1 as f1
union
select f1 from (
with a as (
select f2 from r
)
select 1 as f1
) y
)
(select f1 from r);
--echo # End of 10.6 tests

View File

@@ -5396,4 +5396,9 @@ result
[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]]
[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]]
[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]]
#
# MDEV-33640: Server crashes at my_hash_free
#
SELECT JSON_SCHEMA_VALID('{"properties": "a_string": {"pattern": "^[5-9]$"}}}', '{"a_string": "8"}');
ERROR HY000: Invalid value for keyword properties
# End of 11.4 Test

View File

@@ -4277,4 +4277,12 @@ SELECT ( WITH x AS ( WITH x ( x ) AS ( SELECT ( 1.000000 ) ) SELECT x FROM x ) S
select json_array_intersect('[["1", "7"], ["2", "6"], ["4", "5"], ["3", "8"]]', '[["2","6"],["3","8"],["4","5"],["1","7"]]') as result from (values (1),(2),(3),(4),(5)) x;
--echo #
--echo # MDEV-33640: Server crashes at my_hash_free
--echo #
--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
SELECT JSON_SCHEMA_VALID('{"properties": "a_string": {"pattern": "^[5-9]$"}}}', '{"a_string": "8"}');
--echo # End of 11.4 Test

View File

@@ -180,7 +180,7 @@ F 17
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
GROUP BY c1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range k1 k1 5 NULL 2 Using where
1 SIMPLE t1 range k1 k1 5 NULL 2 Using where; Using index for group-by
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
GROUP BY c1;
c1 max(i2)
@@ -438,6 +438,43 @@ disconnect con1;
connection default;
DROP TABLE t1;
SET GLOBAL innodb_lru_scan_depth= @lru_depth.save;
#
# MDEV-38426: Clustered PK not used for Loose Index Scan optimization
#
create table t1 (
col1 int not null,
col2 int not null,
col3 int,
primary key(col1, col2)
) engine=innodb;
insert into t1 select
A.seq,
B.seq,
A.seq
from
seq_1_to_10 A,
seq_1_to_1000 B;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# This must use Loose Scan:
explain select distinct col1 from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 4 NULL 11 Using index for group-by
# This must use Loose Scan:
explain select col1 from t1 group by col1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 4 NULL 11 Using index for group-by
# This must use Loose Scan:
explain select col1, min(col2) from t1 group by col1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 4 NULL 11 Using index for group-by
# This will not use Loose Index Scan as col3 is not in PK:
explain select col1, min(col2), col3 from t1 group by col1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 8 NULL 10000
drop table t1;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;

View File

@@ -323,6 +323,40 @@ while ($run)
DROP TABLE t1;
SET GLOBAL innodb_lru_scan_depth= @lru_depth.save;
--echo #
--echo # MDEV-38426: Clustered PK not used for Loose Index Scan optimization
--echo #
--source include/have_sequence.inc
create table t1 (
col1 int not null,
col2 int not null,
col3 int,
primary key(col1, col2)
) engine=innodb;
insert into t1 select
A.seq,
B.seq,
A.seq
from
seq_1_to_10 A,
seq_1_to_1000 B;
analyze table t1;
--echo # This must use Loose Scan:
explain select distinct col1 from t1;
--echo # This must use Loose Scan:
explain select col1 from t1 group by col1;
--echo # This must use Loose Scan:
explain select col1, min(col2) from t1 group by col1;
--echo # This will not use Loose Index Scan as col3 is not in PK:
explain select col1, min(col2), col3 from t1 group by col1;
drop table t1;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;

View File

@@ -121,3 +121,46 @@ connection default;
DROP DATABASE meow;
set local sql_mode=default;
set global sql_mode=default;
#
# MDEV-37950: INSERT ... RETURNING exposes columns for which
# the user lacks SELECT privilege
#
CREATE USER regular;
GRANT INSERT ON *.* TO regular;
GRANT DELETE ON *.* TO regular;
CREATE DATABASE test1;
DROP TABLE IF EXISTS test1.t_trigger_test1;
Warnings:
Note 1051 Unknown table 'test1.t_trigger_test1'
CREATE TABLE test1.t_trigger_test1 (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
note VARCHAR(100)
);
CREATE TRIGGER test1.trg_before_insert
BEFORE INSERT ON test1.t_trigger_test1
FOR EACH ROW
BEGIN
SET NEW.name = CONCAT('BEFORE_', NEW.name);
END |
INSERT INTO test1.t_trigger_test1 (name) VALUES ('Alice') RETURNING *;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
INSERT INTO test1.t_trigger_test1 (name) VALUES ('Alice') RETURNING id, name, note;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
# same for DELETE because delete with "WHERE" still requires to
# read from the table, which basically means having select privileges
DELETE FROM test1.t_trigger_test1 WHERE id=1;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
DELETE FROM test1.t_trigger_test1 WHERE id=1 RETURNING id;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
DELETE FROM test1.t_trigger_test1 WHERE id=1 RETURNING *;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
DELETE FROM test1.t_trigger_test1 RETURNING *;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
DELETE FROM test1.t_trigger_test1 RETURNING id;
ERROR 42000: SELECT command denied to user 'regular'@'localhost' for column 'id' in table 't_trigger_test1'
DELETE FROM test1.t_trigger_test1;
DROP TRIGGER test1.trg_before_insert;
DROP TABLE test1.t_trigger_test1;
DROP USER regular;
DROP DATABASE test1;

View File

@@ -158,3 +158,60 @@ DROP DATABASE meow;
set local sql_mode=default;
set global sql_mode=default;
--echo #
--echo # MDEV-37950: INSERT ... RETURNING exposes columns for which
--echo # the user lacks SELECT privilege
--echo #
CREATE USER regular;
GRANT INSERT ON *.* TO regular;
GRANT DELETE ON *.* TO regular;
CREATE DATABASE test1;
DROP TABLE IF EXISTS test1.t_trigger_test1;
CREATE TABLE test1.t_trigger_test1 (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
note VARCHAR(100)
);
DELIMITER |;
CREATE TRIGGER test1.trg_before_insert
BEFORE INSERT ON test1.t_trigger_test1
FOR EACH ROW
BEGIN
SET NEW.name = CONCAT('BEFORE_', NEW.name);
END |
DELIMITER ;|
change_user regular;
--error ER_COLUMNACCESS_DENIED_ERROR
INSERT INTO test1.t_trigger_test1 (name) VALUES ('Alice') RETURNING *;
--error ER_COLUMNACCESS_DENIED_ERROR
INSERT INTO test1.t_trigger_test1 (name) VALUES ('Alice') RETURNING id, name, note;
--echo # same for DELETE because delete with "WHERE" still requires to
--echo # read from the table, which basically means having select privileges
--error ER_COLUMNACCESS_DENIED_ERROR
DELETE FROM test1.t_trigger_test1 WHERE id=1;
--error ER_COLUMNACCESS_DENIED_ERROR
DELETE FROM test1.t_trigger_test1 WHERE id=1 RETURNING id;
--error ER_COLUMNACCESS_DENIED_ERROR
DELETE FROM test1.t_trigger_test1 WHERE id=1 RETURNING *;
--error ER_COLUMNACCESS_DENIED_ERROR
DELETE FROM test1.t_trigger_test1 RETURNING *;
--error ER_COLUMNACCESS_DENIED_ERROR
DELETE FROM test1.t_trigger_test1 RETURNING id;
DELETE FROM test1.t_trigger_test1;
change_user root;
DROP TRIGGER test1.trg_before_insert;
DROP TABLE test1.t_trigger_test1;
DROP USER regular;
DROP DATABASE test1;

View File

@@ -1094,23 +1094,31 @@ NULL UNION RESULT <union1,4> ALL NULL NULL NULL NULL NULL
set sql_mode= 'oracle';
explain SELECT * from t3 union select * from u3 intersect all select * from i3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 0 Const row not found
2 UNION u3 system NULL NULL NULL NULL 0 Const row not found
3 INTERSECT i3 system NULL NULL NULL NULL 0 Const row not found
NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL
select * from t3 union select * from u3 intersect select * from i3;
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
5 INTERSECT NULL NULL NULL NULL NULL NULL NULL no matching row in const table
NULL INTERSECT RESULT <intersect4,5> ALL NULL NULL NULL NULL NULL
select x from t3 union select x from u3 intersect select x from i3;
x
SELECT * from t3 union select * from u3 intersect all select * from i3;
SELECT x from t3 union select x from u3 intersect all select x from i3;
x
insert into t3 values (0);
insert into i3 values (0);
Select * from t3 union select * from u3 intersect select * from i3;
Select x from t3 union select x from u3 intersect select x from i3;
x
0
SELECT * FROM t3 UNION SELECT * FROM u3 INTERSECT ALL SELECT * FROM i3;
SELECT x FROM t3 UNION SELECT x FROM u3 INTERSECT ALL SELECT x FROM i3;
x
0
create view v as select * from t3 union select * from u3 intersect select * from i3;
select * from v;
x
0
drop tables t3, u3, i3;
drop view v;
# First line of these results is column names, not the result
# (pay attention to "affected rows")
values (1, 2) union all values (1, 2);
@@ -1136,10 +1144,47 @@ values (1, 2) union all values (1, 2) union values (4, 3) union all values (4, 3
1 2
4 3
affected rows: 2
set sql_mode= default;
create table t1 (a int, b int);
create table t2 like t1;
insert t1 values (1, 2), (1, 2), (1, 2), (2, 3), (2, 3), (3, 4), (3, 4);
insert t2 values (1, 2), (1, 2), (2, 3), (2, 3), (2, 3), (2, 3), (4, 5);
select * from t1 intersect all select * from t2;
a b
1 2
2 3
1 2
2 3
select * from t1 intersect all select * from t2 union values (1, 2);
a b
1 2
2 3
select * from t1 intersect all (select * from t2 union values (1, 2));
a b
1 2
2 3
(select * from t1 intersect all select * from t2) union values (1, 2);
a b
1 2
2 3
create view v1 as select * from t1 intersect all select * from t2 union values (1, 2);
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` intersect all select `t2`.`a` AS `a`,`t2`.`b` AS `b` from `t2` union values (1,2) latin1 latin1_swedish_ci
select * from v1;
a b
1 2
2 3
create view v2 as select * from t1 union values (1, 2) intersect all select * from t2;
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` union select `__5`.`1` AS `1`,`__5`.`2` AS `2` from (values (1,2) intersect all select `t2`.`a` AS `a`,`t2`.`b` AS `b` from `t2`) `__5` latin1 latin1_swedish_ci
select * from v2;
a b
1 2
2 3
3 4
set sql_mode= 'oracle';
select * from t1 intersect select * from t2;
a b
1 2
@@ -1169,8 +1214,6 @@ select * from t1 intersect all select * from t2 union values (1, 2);
a b
1 2
2 3
1 2
2 3
select * from t1 intersect all (select * from t2 union values (1, 2));
a b
1 2
@@ -1181,9 +1224,209 @@ a b
2 3
explain select * from t1 intersect all select * from t2 union values (1, 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 7
2 INTERSECT t2 ALL NULL NULL NULL NULL 7
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 8
4 DERIVED <derived2> ALL NULL NULL NULL NULL 7
2 DERIVED t1 ALL NULL NULL NULL NULL 7
3 INTERSECT t2 ALL NULL NULL NULL NULL 7
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
5 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW "v1" AS select "__6"."a" AS "a","__6"."b" AS "b" from (select "__4"."a" AS "a","__4"."b" AS "b" from (select "t1"."a" AS "a","t1"."b" AS "b" from "t1" intersect all select "t2"."a" AS "a","t2"."b" AS "b" from "t2") "__4" union values (1,2)) "__6" latin1 latin1_swedish_ci
select * from v1;
a b
1 2
2 3
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE VIEW "v2" AS select "__7"."a" AS "a","__7"."b" AS "b" from (select "t1"."a" AS "a","t1"."b" AS "b" from "t1" union select "__5"."1" AS "1","__5"."2" AS "2" from (select "__6"."1" AS "1","__6"."2" AS "2" from (values (1,2) intersect all select "t2"."a" AS "a","t2"."b" AS "b" from "t2") "__6") "__5") "__7" latin1 latin1_swedish_ci
select * from v2;
a b
1 2
2 3
3 4
create view v3 as select * from t1 union values (1, 2) intersect all select * from t2;
show create view v3;
View Create View character_set_client collation_connection
v3 CREATE VIEW "v3" AS select "__6"."a" AS "a","__6"."b" AS "b" from (select "__8"."a" AS "a","__8"."b" AS "b" from (select "__4"."a" AS "a","__4"."b" AS "b" from (select "__6"."a" AS "a","__6"."b" AS "b" from (select "t1"."a" AS "a","t1"."b" AS "b" from "t1" union values (1,2)) "__6") "__4" intersect all select "t2"."a" AS "a","t2"."b" AS "b" from "t2") "__8") "__6" latin1 latin1_swedish_ci
select * from v3;
a b
1 2
2 3
drop tables t1, t2;
drop view v1, v2, v3;
create table t3 (x int);
create table u3 (x int);
create table i3 (x int);
create view v4 as SELECT * from t3 union select * from u3 intersect all select * from i3;
select * from v4;
x
drop tables t3, u3, i3;
drop view v4;
set sql_mode= default;
#
# MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode
#
create table t1 (a int, b int);
create table t2 like t1;
insert t1 values (1, 2), (1, 2), (1, 2), (1, 2);
insert t2 values (1, 2), (1, 2);
select * from t1 except all select * from t2 intersect all values (1, 2);
a b
1 2
1 2
1 2
explain select * from t1 except all select * from t2 intersect all values (1, 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
4 EXCEPT <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED t2 ALL NULL NULL NULL NULL 2
3 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
NULL EXCEPT RESULT <except1,4> ALL NULL NULL NULL NULL NULL
Explain select * from (select * from (select * from t1 except all select * from t2) __3 intersect all values (1,2)) __5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED <derived3> ALL NULL NULL NULL NULL 4
3 DERIVED t1 ALL NULL NULL NULL NULL 4
4 EXCEPT t2 ALL NULL NULL NULL NULL 2
NULL EXCEPT RESULT <except3,4> ALL NULL NULL NULL NULL NULL
5 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used
NULL INTERSECT RESULT <intersect2,5> ALL NULL NULL NULL NULL NULL
create view v1 as select * from t1 except all select * from t2 intersect all values (1, 2);
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` except all select `__5`.`a` AS `a`,`__5`.`b` AS `b` from (select `t2`.`a` AS `a`,`t2`.`b` AS `b` from `t2` intersect all values (1,2)) `__5` latin1 latin1_swedish_ci
select * from v1;
a b
1 2
1 2
1 2
drop view v1;
create view v1 as ((select * from t1 except all select * from t2) intersect all values (1, 2));
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__5`.`a` AS `a`,`__5`.`b` AS `b` from (select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` except all select `t2`.`a` AS `a`,`t2`.`b` AS `b` from `t2`) `__5` intersect all values (1,2) latin1 latin1_swedish_ci
select * from v1;
a b
1 2
drop view v1;
explain select * from ((select * from t1 except all select * from t2) intersect all values (1, 2)) v;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived5> ALL NULL NULL NULL NULL 2
5 DERIVED <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED t1 ALL NULL NULL NULL NULL 4
3 EXCEPT t2 ALL NULL NULL NULL NULL 2
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
4 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used
NULL INTERSECT RESULT <intersect5,4> ALL NULL NULL NULL NULL NULL
# Oracle: first UNION, then INTERSECT ALL
set sql_mode= 'oracle';
create view v2 as select * from t1 except all select * from t2 intersect all values (1, 2);
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE VIEW "v2" AS select "__6"."a" AS "a","__6"."b" AS "b" from (select "__8"."a" AS "a","__8"."b" AS "b" from (select "__4"."a" AS "a","__4"."b" AS "b" from (select "__6"."a" AS "a","__6"."b" AS "b" from (select "t1"."a" AS "a","t1"."b" AS "b" from "t1" except all select "t2"."a" AS "a","t2"."b" AS "b" from "t2") "__6") "__4" intersect all values (1,2)) "__8") "__6" latin1 latin1_swedish_ci
select * from v2;
a b
1 2
drop view v2;
EXPLAIN select * from t1 except all select * from t2 intersect all values (1, 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
4 DERIVED <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED t1 ALL NULL NULL NULL NULL 4
3 EXCEPT t2 ALL NULL NULL NULL NULL 2
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
5 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used
NULL INTERSECT RESULT <intersect4,5> ALL NULL NULL NULL NULL NULL
select * from t2 union all select * from t2;
a b
1 2
1 2
1 2
1 2
select * from t1 except all select * from t2 intersect all values (1, 2) union values (2, 3);
a b
1 2
2 3
select * from t2 union all select * from t2 except all select * from t2 intersect all values (1, 2) union values (2, 3);
a b
1 2
2 3
select * from t1 except all select * from t2 union values (2, 3);
a b
1 2
2 3
# Default: first INTERSECT ALL, then UNION
select * from t1 union values (1, 2) intersect all select * from t2;
a b
1 2
select * from t1 union (values (1, 2) intersect all select * from t2);
a b
1 2
set sql_mode= default;
select * from t1 union values (1, 2) intersect all select * from t2;
a b
1 2
select * from t1 union (values (1, 2) intersect all select * from t2);
a b
1 2
set sql_mode= 'oracle';
create or replace table t2 like t1;
insert t2 values (1, 2), (2, 3);
create table t3 select * from t1 except all select * from t2;
select * from t3;
a b
1 2
1 2
1 2
select * from t3 intersect all select * from t1;
a b
1 2
1 2
1 2
show create table t2;
Table Create Table
t2 CREATE TABLE "t2" (
"a" int(11) DEFAULT NULL,
"b" int(11) DEFAULT NULL
)
select * from t2 order by a desc;
a b
2 3
1 2
select * from t1 except all select * from t2;
a b
1 2
1 2
1 2
select * from t1 except all select * from t2 union all values (0, 1);
a b
1 2
1 2
1 2
0 1
select * from t1 except all select * from t2 union all values (0, 1) order by a limit 2;
a b
0 1
1 2
select * from t1 except all select * from t2 intersect all select * from t1;
a b
1 2
1 2
1 2
select * from t1 except all select * from t2 intersect all select * from t1 union all select * from t2;
a b
1 2
1 2
1 2
1 2
2 3
select * from t1 except all select * from t2 intersect all select * from t1 union all select * from t2 order by a desc limit 3;
a b
2 3
1 2
1 2
drop tables t1, t2, t3;
set sql_mode= default;

View File

@@ -338,13 +338,22 @@ create table i3 (x int);
explain SELECT * from t3 union select * from u3 intersect all select * from i3;
set sql_mode= 'oracle';
explain SELECT * from t3 union select * from u3 intersect all select * from i3;
# TODO: there is a bug in --view protocol, it displays column name as '*' instead of 'x'
--replace_result * x
select * from t3 union select * from u3 intersect select * from i3;
--replace_result * x
SELECT * from t3 union select * from u3 intersect all select * from i3;
insert into t3 values (0);
insert into i3 values (0);
--replace_result * x
Select * from t3 union select * from u3 intersect select * from i3;
--replace_result * x
SELECT * FROM t3 UNION SELECT * FROM u3 INTERSECT ALL SELECT * FROM i3;
# CREATE VIEW still works good
create view v as select * from t3 union select * from u3 intersect select * from i3;
select * from v;
drop tables t3, u3, i3;
drop view v;
--enable_info
--echo # First line of these results is column names, not the result
@@ -374,10 +383,26 @@ values (1, 2) union all values (1, 2) union values (4, 3) union all values (4, 3
values (1, 2) union all values (1, 2) union values (4, 3) union all values (4, 3) union all values (1, 2) union values (1, 2);
--disable_info
set sql_mode= default;
create table t1 (a int, b int);
create table t2 like t1;
insert t1 values (1, 2), (1, 2), (1, 2), (2, 3), (2, 3), (3, 4), (3, 4);
insert t2 values (1, 2), (1, 2), (2, 3), (2, 3), (2, 3), (2, 3), (4, 5);
select * from t1 intersect all select * from t2;
select * from t1 intersect all select * from t2 union values (1, 2);
select * from t1 intersect all (select * from t2 union values (1, 2));
(select * from t1 intersect all select * from t2) union values (1, 2);
create view v1 as select * from t1 intersect all select * from t2 union values (1, 2);
show create view v1;
select * from v1;
create view v2 as select * from t1 union values (1, 2) intersect all select * from t2;
show create view v2;
select * from v2;
set sql_mode= 'oracle';
select * from t1 intersect select * from t2;
select * from t1 intersect all select * from t2;
--echo # Default: first INTERSECT ALL, then UNION
@@ -392,5 +417,85 @@ select * from t1 intersect all select * from t2 union values (1, 2);
select * from t1 intersect all (select * from t2 union values (1, 2));
(select * from t1 intersect all select * from t2) union values (1, 2);
explain select * from t1 intersect all select * from t2 union values (1, 2);
show create view v1;
select * from v1;
show create view v2;
select * from v2;
create view v3 as select * from t1 union values (1, 2) intersect all select * from t2;
show create view v3;
select * from v3;
drop tables t1, t2;
drop view v1, v2, v3;
create table t3 (x int);
create table u3 (x int);
create table i3 (x int);
create view v4 as SELECT * from t3 union select * from u3 intersect all select * from i3;
select * from v4;
drop tables t3, u3, i3;
drop view v4;
set sql_mode= default;
--echo #
--echo # MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode
--echo #
create table t1 (a int, b int);
create table t2 like t1;
insert t1 values (1, 2), (1, 2), (1, 2), (1, 2);
insert t2 values (1, 2), (1, 2);
select * from t1 except all select * from t2 intersect all values (1, 2);
explain select * from t1 except all select * from t2 intersect all values (1, 2);
Explain select * from (select * from (select * from t1 except all select * from t2) __3 intersect all values (1,2)) __5;
create view v1 as select * from t1 except all select * from t2 intersect all values (1, 2);
show create view v1;
select * from v1;
drop view v1;
create view v1 as ((select * from t1 except all select * from t2) intersect all values (1, 2));
show create view v1;
select * from v1;
drop view v1;
explain select * from ((select * from t1 except all select * from t2) intersect all values (1, 2)) v;
--echo # Oracle: first UNION, then INTERSECT ALL
set sql_mode= 'oracle';
create view v2 as select * from t1 except all select * from t2 intersect all values (1, 2);
show create view v2;
select * from v2;
drop view v2;
EXPLAIN select * from t1 except all select * from t2 intersect all values (1, 2);
select * from t2 union all select * from t2;
select * from t1 except all select * from t2 intersect all values (1, 2) union values (2, 3);
select * from t2 union all select * from t2 except all select * from t2 intersect all values (1, 2) union values (2, 3);
select * from t1 except all select * from t2 union values (2, 3);
--echo # Default: first INTERSECT ALL, then UNION
select * from t1 union values (1, 2) intersect all select * from t2;
select * from t1 union (values (1, 2) intersect all select * from t2);
set sql_mode= default;
select * from t1 union values (1, 2) intersect all select * from t2;
select * from t1 union (values (1, 2) intersect all select * from t2);
set sql_mode= 'oracle';
create or replace table t2 like t1;
insert t2 values (1, 2), (2, 3);
create table t3 select * from t1 except all select * from t2;
select * from t3;
select * from t3 intersect all select * from t1;
show create table t2;
select * from t2 order by a desc;
select * from t1 except all select * from t2;
select * from t1 except all select * from t2 union all values (0, 1);
select * from t1 except all select * from t2 union all values (0, 1) order by a limit 2;
select * from t1 except all select * from t2 intersect all select * from t1;
select * from t1 except all select * from t2 intersect all select * from t1 union all select * from t2;
select * from t1 except all select * from t2 intersect all select * from t1 union all select * from t2 order by a desc limit 3;
drop tables t1, t2, t3;
set sql_mode= default;

View File

@@ -262,3 +262,9 @@ SET @@global.collation_server= @save_collation_server;
SET @@global.character_set_client= @save_character_set_client;
SET @@global.collation_connection= @save_collation_connection;
FOUND 1 /Aborted connection.*'u' host: '192.0.2.1' real ip: '(localhost|::1)'/ in mysqld.1.err
#
# MDEV-36269: Improve error handling for SOURCE command
# Test that SOURCE on an existent directory returns a clear error
#
ERROR at line 1: Can't read from a directory '.'
End of 10.11 tests

View File

@@ -63,3 +63,13 @@ SET @@global.collation_connection= @save_collation_connection;
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= Aborted connection.*'u' host: '192.0.2.1' real ip: '(localhost|::1)';
source include/search_pattern_in_file.inc;
--echo #
--echo # MDEV-36269: Improve error handling for SOURCE command
--echo # Test that SOURCE on an existent directory returns a clear error
--echo #
--error 1
--exec $MYSQL -e "source ." 2>&1
--echo End of 10.11 tests

View File

@@ -776,8 +776,8 @@ The following specify which files/extra groups are read (specified before remain
connection before aborting the write
--new-mode=name Used to introduce new behavior to existing MariaDB
versions. Any combination of: FIX_DISK_TMPTABLE_COSTS,
FIX_INDEX_STATS_FOR_ALL_NULLS, or ALL to set all
combinations
FIX_INDEX_STATS_FOR_ALL_NULLS, FIX_INDEX_LOOKUP_COST, or
ALL to set all combinations
--note-verbosity=name
Verbosity level for note-warnings given to the user. See
also @@sql_notes. Any combination of: basic,

View File

@@ -0,0 +1,42 @@
#
# MDEV-38164: Poor cost calculations for index access cause bad query plans for big VARCHARs in 11.x
#
create table t1 (
pk1 int not null,
pk2 int not null,
filler1 varchar(500),
filler2 varchar(500),
filler3 varchar(500),
filler4 varchar(500),
filler5 varchar(500),
filler6 varchar(500),
filler7 varchar(500),
filler8 varchar(500),
filler9 varchar(500),
fillerA varchar(500),
fillerB varchar(500),
fillerC varchar(500),
fillerD varchar(500),
fillerE varchar(500),
fillerF varchar(500),
primary key(pk1, pk2)
) collate utf8mb4_general_ci engine=innodb;
insert into t1 (pk1, pk2) select
mod(seq, 8), seq
from
seq_1_to_10000;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# Before the fix: this will use full table scan:
explain select * from t1 where pk1=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL # 10000 Using where
set @save_new_mode=@@new_mode;
set new_mode=concat(@@new_mode,'FIX_INDEX_LOOKUP_COST');
explain select * from t1 where pk1=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref PRIMARY PRIMARY 4 # 1250
set new_mode=@save_new_mode;
drop table t1;

View File

@@ -0,0 +1,44 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
--echo #
--echo # MDEV-38164: Poor cost calculations for index access cause bad query plans for big VARCHARs in 11.x
--echo #
create table t1 (
pk1 int not null,
pk2 int not null,
filler1 varchar(500),
filler2 varchar(500),
filler3 varchar(500),
filler4 varchar(500),
filler5 varchar(500),
filler6 varchar(500),
filler7 varchar(500),
filler8 varchar(500),
filler9 varchar(500),
fillerA varchar(500),
fillerB varchar(500),
fillerC varchar(500),
fillerD varchar(500),
fillerE varchar(500),
fillerF varchar(500),
primary key(pk1, pk2)
) collate utf8mb4_general_ci engine=innodb;
insert into t1 (pk1, pk2) select
mod(seq, 8), seq
from
seq_1_to_10000;
analyze table t1;
--echo # Before the fix: this will use full table scan:
--replace_column 8 #
explain select * from t1 where pk1=1;
set @save_new_mode=@@new_mode;
set new_mode=concat(@@new_mode,'FIX_INDEX_LOOKUP_COST');
--replace_column 8 #
explain select * from t1 where pk1=1;
set new_mode=@save_new_mode;
drop table t1;

View File

@@ -391,3 +391,25 @@ partitio values in (2, 3, 4),
pn values in (52, 53, 54));
drop table t1;
# End of 10.7 tests
#
# MDEV-35562 On partitionen tables algorithm is not supported
# throw "no such file or directory" error
#
CREATE TABLE t1par (
f1 datetime ,
f2 VARCHAR(2) ,
f3 VARCHAR(200) NOT NULL ,
f4 VARCHAR(100) charset utf8
)
PARTITION BY RANGE COLUMNS(f2)
(
PARTITION p_01 VALUES LESS THAN ('02') ENGINE = InnoDB,
PARTITION p_31 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB
);
ALTER online TABLE t1par MODIFY COLUMN f3 VARCHAR(201) NULL, ALGORITHM=NOCOPY , LOCK=NONE;
ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
show warnings;
Level Code Message
Error 1845 ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
drop table t1par;
# End of 10.11 tests

View File

@@ -323,3 +323,26 @@ partition by list(x) (
drop table t1;
--echo # End of 10.7 tests
--echo #
--echo # MDEV-35562 On partitionen tables algorithm is not supported
--echo # throw "no such file or directory" error
--echo #
CREATE TABLE t1par (
f1 datetime ,
f2 VARCHAR(2) ,
f3 VARCHAR(200) NOT NULL ,
f4 VARCHAR(100) charset utf8
)
PARTITION BY RANGE COLUMNS(f2)
(
PARTITION p_01 VALUES LESS THAN ('02') ENGINE = InnoDB,
PARTITION p_31 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB
);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER online TABLE t1par MODIFY COLUMN f3 VARCHAR(201) NULL, ALGORITHM=NOCOPY , LOCK=NONE;
show warnings;
drop table t1par;
--echo # End of 10.11 tests

View File

@@ -1015,5 +1015,45 @@ ERROR HY000: The target table v of the UPDATE is not updatable
DROP VIEW v;
DROP TABLE t;
#
# rownum in having without group by
#
create table t1 (a int primary key, b int);
insert into t1 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 2), (6, 2);
select * from (select * from t1 order by a, b) dt having rownum() = 4;
a b
4 2
drop table t1;
#
# rownum in subquery
#
create table t1 (a int primary key, b int);
insert into t1 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 2), (6, 2);
explain select * from t1 where a in (select rownum() from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 <subquery2>.rownum() 1 Using index condition
2 MATERIALIZED t1 index NULL PRIMARY 4 NULL 6 Using index
select * from t1 where a in (select rownum() from t1);
a b
1 1
2 1
3 1
4 2
5 2
6 2
set optimizer_switch='materialization=off';
explain select * from t1 where a + 1 in (select rownum() from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 Using where
2 DEPENDENT SUBQUERY t1 index NULL PRIMARY 4 NULL 6 Using index
select * from t1 where a + 1 in (select rownum() from t1);
a b
1 1
2 1
3 1
4 2
5 2
drop table t1;
#
# End of 10.6 tests
#

View File

@@ -617,6 +617,34 @@ UPDATE v SET f = 10 WHERE e > 42 LIMIT 1;
DROP VIEW v;
DROP TABLE t;
--echo #
--echo # rownum in having without group by
--echo #
create table t1 (a int primary key, b int);
insert into t1 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 2), (6, 2);
select * from (select * from t1 order by a, b) dt having rownum() = 4;
drop table t1;
--echo #
--echo # rownum in subquery
--echo #
create table t1 (a int primary key, b int);
insert into t1 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 2), (6, 2);
# When rownum used in subquery, the subquery shouldn't be transformed to semijoin
explain select * from t1 where a in (select rownum() from t1);
select * from t1 where a in (select rownum() from t1);
set optimizer_switch='materialization=off';
# When rownum used in IN-subquery and the subquery is transformed to EXISTS, the new condition should be added to HAVING clause.
explain select * from t1 where a + 1 in (select rownum() from t1);
select * from t1 where a + 1 in (select rownum() from t1);
drop table t1;
--echo #
--echo # End of 10.6 tests
--echo #

View File

@@ -2114,4 +2114,33 @@ a b c d e
2 NULL NULL NULL NULL
set join_cache_level= default;
DROP TABLE t1, t2, t3;
#
# MDEV-38240: Selectivity sampling not performed when the table has no indexed conditions
#
set use_stat_tables=PREFERABLY;
create table t1 (a varchar(100), b int);
insert into t1 select seq, seq from seq_1_to_1000;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
set optimizer_use_condition_selectivity=5;
# Must produce filtered=1% or so:
explain extended
select * from t1 where a like '%99%';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%'
# Must have same filtered as above
explain extended
select * from t1 where a like '%99%' and (b is null or b is not null);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' and (`test`.`t1`.`b` is null or `test`.`t1`.`b` is not null)
drop table t1;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set use_stat_tables= @save_use_stat_tables;
# End of 11.4 tests
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;

View File

@@ -1456,4 +1456,27 @@ SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
set join_cache_level= default;
DROP TABLE t1, t2, t3;
--echo #
--echo # MDEV-38240: Selectivity sampling not performed when the table has no indexed conditions
--echo #
set use_stat_tables=PREFERABLY;
create table t1 (a varchar(100), b int);
insert into t1 select seq, seq from seq_1_to_1000;
analyze table t1;
set optimizer_use_condition_selectivity=5;
--echo # Must produce filtered=1% or so:
explain extended
select * from t1 where a like '%99%';
--echo # Must have same filtered as above
explain extended
select * from t1 where a like '%99%' and (b is null or b is not null);
drop table t1;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set use_stat_tables= @save_use_stat_tables;
--echo # End of 11.4 tests
--source include/test_db_charset_restore.inc

View File

@@ -2121,6 +2121,35 @@ a b c d e
2 NULL NULL NULL NULL
set join_cache_level= default;
DROP TABLE t1, t2, t3;
#
# MDEV-38240: Selectivity sampling not performed when the table has no indexed conditions
#
set use_stat_tables=PREFERABLY;
create table t1 (a varchar(100), b int);
insert into t1 select seq, seq from seq_1_to_1000;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
set optimizer_use_condition_selectivity=5;
# Must produce filtered=1% or so:
explain extended
select * from t1 where a like '%99%';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%'
# Must have same filtered as above
explain extended
select * from t1 where a like '%99%' and (b is null or b is not null);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' and (`test`.`t1`.`b` is null or `test`.`t1`.`b` is not null)
drop table t1;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set use_stat_tables= @save_use_stat_tables;
# End of 11.4 tests
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
set @tmp_ust= @@use_stat_tables;

View File

@@ -95,6 +95,7 @@ FLUSH PRIVILEGES;
ALTER TABLE mysql.servers ENGINE=Aria;
FLUSH PRIVILEGES;
drop server s1;
ALTER TABLE mysql.servers ENGINE=Aria;
#
# MDEV-35622 SEGV, ASAN use-after-poison when reading system table with less than expected number of columns
# MDEV-37777 upgrade from MySQL 5.7 regression, mysql.servers invalid structure

View File

@@ -99,6 +99,8 @@ FLUSH PRIVILEGES;
ALTER TABLE mysql.servers ENGINE=Aria;
FLUSH PRIVILEGES;
drop server s1;
# Restore the table back to original engine, to not disrupt following tests.
ALTER TABLE mysql.servers ENGINE=Aria;
--echo #
--echo # MDEV-35622 SEGV, ASAN use-after-poison when reading system table with less than expected number of columns

View File

@@ -7,34 +7,44 @@ insert into t3 values (1,1),(3,3);
set SQL_MODE=ORACLE;
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
a b
4 4
3 3
4 4
explain extended
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
2 UNION t2 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 4 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00
3 UNION t2 ALL NULL NULL NULL NULL 2 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect4,5> ALL NULL NULL NULL NULL NULL NULL
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union6,7> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 (/* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") union (/* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") intersect (/* select#3 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") union (/* select#4 */ select 4 AS "4",4 AS "4")
Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from ((/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") union (/* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2")) "__3" intersect (/* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3")) "__5" union (/* select#7 */ select 4 AS "4",4 AS "4")) "__7"
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
e f
5 5
3 3
5 5
6 6
4 4
explain extended
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00
2 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
3 UNION t1 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 4 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 4 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL NULL
5 UNION t1 ALL NULL NULL NULL NULL 2 100.00
NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union6,7> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 (/* select#1 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") intersect (/* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") union (/* select#3 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") union (/* select#4 */ select 4 AS "4",4 AS "4")
Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from ((/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") intersect (/* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2")) "__3" union (/* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1")) "__5" union (/* select#7 */ select 4 AS "4",4 AS "4")) "__7"
create table t12(c1 int);
insert into t12 values(1);
insert into t12 values(2);
@@ -61,18 +71,21 @@ insert into t3 values (1,1),(3,3);
set SQL_MODE=ORACLE;
select a,b from t1 union all select c,d from t2 intersect select e,f from t3 union all select 4,'4' from dual;
a b
4 4
3 3
4 4
explain extended
select a,b from t1 union all select c,d from t2 intersect select e,f from t3 union all select 4,'4' from dual;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
2 UNION t2 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 4 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00
3 UNION t2 ALL NULL NULL NULL NULL 2 100.00
5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect4,5> ALL NULL NULL NULL NULL NULL NULL
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2" intersect /* select#3 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" union all /* select#4 */ select 4 AS "4",'4' AS "4"
Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from (/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" intersect /* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7"
select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual;
a b
3 3
@@ -80,29 +93,35 @@ a b
explain extended
select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
2 UNION t2 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 4 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00
3 UNION t2 ALL NULL NULL NULL NULL 2 100.00
5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect4,5> ALL NULL NULL NULL NULL NULL NULL
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2" intersect all /* select#3 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" union all /* select#4 */ select 4 AS "4",'4' AS "4"
Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from (/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" intersect all /* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7"
select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
e f
5 5
3 3
5 5
6 6
4 4
explain extended
select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00
2 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
3 UNION t1 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 4 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 4 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL NULL
5 UNION t1 ALL NULL NULL NULL NULL 2 100.00
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect /* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2" union all /* select#3 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#4 */ select 4 AS "4",'4' AS "4"
Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from (/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" union all /* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7"
select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
e f
3 3
@@ -112,13 +131,16 @@ e f
explain extended
select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00
2 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
3 UNION t1 ALL NULL NULL NULL NULL 2 100.00
4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,2,3,4> ALL NULL NULL NULL NULL NULL NULL
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 4 100.00
6 DERIVED <derived4> ALL NULL NULL NULL NULL 4 100.00
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00
3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL NULL
5 UNION t1 ALL NULL NULL NULL NULL 2 100.00
7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect all /* select#2 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2" union all /* select#3 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#4 */ select 4 AS "4",'4' AS "4"
Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from (/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" union all /* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7"
set SQL_MODE=default;
drop table t1,t2,t3;
set SQL_MODE=oracle;

View File

@@ -1,5 +1,5 @@
connect ssl_con,localhost,root,,,,,SSL;
select variable_name from performance_schema.status_by_thread where VARIABLE_NAME LIKE 'Ssl%';
select variable_name from performance_schema.status_by_thread where VARIABLE_NAME LIKE 'Ssl%' and thread_id in($default_id, $ssl_con_id);
variable_name
Ssl_cipher
Ssl_cipher_list

View File

@@ -12,9 +12,12 @@
--source include/default_charset.inc
--source include/have_perfschema.inc
let $default_id=`select thread_id from performance_schema.threads where processlist_id=connection_id()`;
connect (ssl_con,localhost,root,,,,,SSL);
select variable_name from performance_schema.status_by_thread where VARIABLE_NAME LIKE 'Ssl%';
let $ssl_con_id=`select thread_id from performance_schema.threads where processlist_id=connection_id()`;
evalp select variable_name from performance_schema.status_by_thread where VARIABLE_NAME LIKE 'Ssl%' and thread_id in($default_id, $ssl_con_id);
# Check ssl turned on
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';

View File

@@ -5,7 +5,7 @@
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
let $count_sessions=1;
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
--disable_query_log
@@ -694,7 +694,6 @@ xa rollback 'test1';
xa recover;
drop table asd;
disconnect con_tmp;
--source include/wait_until_disconnected.inc
connection default;
--echo # MDEV-30978: a read-only server should still allow the commit of
@@ -718,7 +717,6 @@ xa rollback '2';
--echo # Read-only disconnect case
--source include/count_sessions.inc
connect (con1_ro,localhost,root,,);
xa start '3';
select 0;
@@ -732,7 +730,6 @@ xa recover;
--error ER_XA_RBROLLBACK
xa commit '3';
--source include/count_sessions.inc
connect (con2_ro,localhost,root,,);
xa start '4';
select 0;
@@ -781,6 +778,7 @@ xa end 'r:foo';
xa prepare 'r:foo';
disconnect con1;
connection default;
--source include/wait_until_count_sessions.inc
xa recover;
xa start 'r:bar';

View File

@@ -0,0 +1,62 @@
-----BEGIN CERTIFICATE-----
MIIFPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQKDAdNYXJp
YURCMRAwDgYDVQQLDAdNYXJpYURCMRkwFwYDVQQDDBBJbnRlcm1lZGlhdGUgQ0Ey
MB4XDTI1MTIxMjE2NTY0NFoXDTQ1MDgyOTE2NTY0NFowETEPMA0GA1UEAwwGY2xp
ZW50MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtP9k21MRWxut47OV
CjK9jn+nJHnZ0agpAJbgdvsIFKrkV4v0VHb7m5dURaqV1lF1WhrSmc8k7gcSB32O
l+6Fo0OToe80KxH3NeYN5YscfnVOtrtbpwEkoYt4CFSn95TpjFrEaF0nZUwg5mJb
+ZZsXzYk60GBA1It9uLMbqWAioRHbLprV6bIn0yDqKlf5JTQRk4JORxw3J66ppWC
y+4OI8UmuOF4jJx3nWHTmPmtZEA7FgNisW9ReQC46+A8mdJCUqupIq6M7foG682+
eKarvX1kjlOhL60Peuz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tzmAj38l
AL8UgHmb0i+xkQwwHwYDVR0jBBgwFoAUNhJVtzmAj38lAL8UgHmb0i+xkQwwDwYD
VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIB
AHi3EtRvq9Dq6SISzL52X0Lzycm9GJ6lZ5D/8nWP8wdMMWVi9OxDKV5KSIPFf2t2
E6LS/bi45iBSsqrcJqr1NSf+nzvbhSWMbFcC/9xIwKaeRIj5JtafQHwpYX8uwAXr
nnN0GJ3tXd9Gc213ZjUsqCtPfStovDqchD58qIxGf1xUyWoOZwikmSjrbc2w75Zr
oBQ8yTUcdHiFNZqhRqKTe/rbxKIDbRnEV4dLoEfGJPaSygba/NPTxtmSX5vJbLLR
/l74jKOTxM+tNhSQ8e8HGo5yyunMWsnHtqvVl0JlQ9qKkF0wPPTJWkSeWh74e0Dd
mnnz0iDzkknguVwihvnuz0tFW5Cynsu4owVJpRSDd7C94f00S6lRQ10AWJiQLNhR
4370dVcbNCdIIwVOMQ0xA6fSKmOpLclIz1c6XHHuGR+klR1U8sX6dNOQMBRa8nZy
xGMXSQ0X05pqPnBBdZRmQDka1bWn/Uuk+2tY5CamWjF191EurtsZ1cJ7HQnPtheV
zdZxP+YSOvE5TJVnziqxlkIChxa+INBuaQoISxepBi2m2VPGj5SjAZcDPx9+uled
CzLan4jnrDW8d8HeiOleeWuQHp/mdKScKfsVD6yyoEQqVajBl4QV5QncgZQiH9LD
hzldPqgBh2P+MOiKGEPDPDe/+DSJOeASicDTeV5kFug7
-----END CERTIFICATE-----

View File

@@ -103,6 +103,10 @@ sub skip_combinations {
$skip{'include/check_windows_admin.inc'} = 'Requires admin privileges'
unless IS_WINDOWS and Win32::IsAdminUser();
# MDEV-38326. Chained TLS certificates fails verification for schannel clients
$skip{'main/chained_ssl_certificates.test'} = 'Skip if on Windows without OpenSSL'
unless !IS_WINDOWS || $openssl_ver;
%skip;
}

View File

@@ -0,0 +1,41 @@
create table t1 (a int primary key, b text) engine=innodb;
connect trx1_rollback,localhost,root,,;
CREATE TABLE t_x (a int) engine=MEMORY;
SET binlog_format=row;
CREATE TEMPORARY TABLE tt_tmp ( id INT ) ENGINE = Memory;
BEGIN;
insert into t_x values (1);
drop temporary table tt_tmp;
insert into t1 values (99, "gotta log first");
SET DEBUG_SYNC= 'reset';
SET DEBUG_SYNC= "before_group_commit_queue SIGNAL trx1_at_log WAIT_FOR trx1_go";
ROLLBACK;
connect trx2_commit,localhost,root,,;
insert into t1 values (99, "second best in binlog");
connection default;
SET DEBUG_SYNC= "now WAIT_FOR trx1_at_log";
SET DEBUG_SYNC= "now SIGNAL trx1_go";
connection trx2_commit;
select * from t1;
a b
99 second best in binlog
# Prove the logging order is Trx1, Trx2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t_x values (1)
master-bin.000001 # Table_map # # table_id: # (test.t_x)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 values (99, "gotta log first")
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; insert into t1 values (99, "second best in binlog")
master-bin.000001 # Xid # # COMMIT /* XID */
drop table t_x, t1;
disconnect trx1_rollback;
disconnect trx2_commit;
# end of the tests

View File

@@ -0,0 +1,59 @@
--source include/have_debug_sync.inc
--source include/have_innodb.inc
--source include/have_binlog_format_mixed.inc
# MDEV-37541 Race of rolling back and committing transaction to binlog
# The tests reproduce a scenario of two conflicting transactions
# of which the dependency decides to rollback. In order to reproduce the bug
# the parent features side effects (produced by DROP TEMPORARY TABLE)
# and multiple engines.
# The tests prove that the child transaction can not win race to binlogging
# with its parent as it gets stuck at engine lock acquiring all time
# while the parent conducts binlogging on its own.
create table t1 (a int primary key, b text) engine=innodb;
connect(trx1_rollback,localhost,root,,);
CREATE TABLE t_x (a int) engine=MEMORY;
--let $master_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)
SET binlog_format=row;
CREATE TEMPORARY TABLE tt_tmp ( id INT ) ENGINE = Memory;
BEGIN;
insert into t_x values (1);
drop temporary table tt_tmp;
insert into t1 values (99, "gotta log first");
SET DEBUG_SYNC= 'reset';
SET DEBUG_SYNC= "before_group_commit_queue SIGNAL trx1_at_log WAIT_FOR trx1_go";
--send ROLLBACK
connect(trx2_commit,localhost,root,,);
--send insert into t1 values (99, "second best in binlog")
connection default;
# Make sure ROLLBACK is in the binlogging phase ..
SET DEBUG_SYNC= "now WAIT_FOR trx1_at_log";
# .. and the contender trx2 in the locking phase ..
let $wait_condition=
select count(*) = 1 from information_schema.innodb_trx
where trx_state = "LOCK WAIT" and trx_query like "%insert into t1 values%";
source include/wait_condition.inc;
# .. when both provided unfreeze the trx:s ..
SET DEBUG_SYNC= "now SIGNAL trx1_go";
connection trx2_commit;
reap;
select * from t1;
# .. to observe proper binlogging.
--echo # Prove the logging order is Trx1, Trx2
--source include/show_binlog_events.inc
drop table t_x, t1;
disconnect trx1_rollback;
disconnect trx2_commit;
--echo # end of the tests

View File

@@ -156,7 +156,7 @@ c1 c2
1 one
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW "v1" AS select "t1"."c1" AS "c1","t1"."c2" AS "c2" from "t1" union select "t1"."c1" AS "c1",NULL AS "NULL" from "t1" order by 1,2 cp1250 latin2_general_ci
v1 CREATE VIEW "v1" AS select "__4"."c1" AS "c1","__4"."c2" AS "c2" from (select "__5"."c1" AS "c1","__5"."c2" AS "c2" from (select "t1"."c1" AS "c1","t1"."c2" AS "c2" from "t1" union select "t1"."c1" AS "c1",NULL AS "NULL" from "t1") "__5") "__4" order by 1,2 cp1250 latin2_general_ci
DROP VIEW v1;
DROP TABLE t1;
EXPLAIN EXTENDED SELECT '';

View File

@@ -37,9 +37,9 @@ c2
menny
SELECT c2 FROM tx1 MINUS SELECT c2 from tx2 UNION SELECT c2 from tx3;
c2
jim
menny
linda
jim
kris
create table MINUS (a int);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MINUS (a int)' at line 1

File diff suppressed because it is too large Load Diff

View File

@@ -1172,21 +1172,25 @@ eval explain extended $q;
let $q=
select 2 union (values (5), (7), (1), (3), (4) limit 2);
--replace_result * 2
eval $q;
eval explain extended $q;
let $q=
select 2 union (values (5), (7), (1), (3), (4) limit 2 offset 1);
--replace_result * 2
eval $q;
eval explain extended $q;
let $q=
select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2);
--replace_result * 2
eval $q;
eval explain extended $q;
let $q=
select 2 union (values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1);
--replace_result * 2
eval $q;
eval explain extended $q;
@@ -1194,6 +1198,7 @@ eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) limit 2) union select 2;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
let $q=
@@ -1204,16 +1209,19 @@ eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) order by 1 limit 2) union select 2;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) order by 1 limit 2 offset 1) union select 2;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
let $q=
select 3 union all (values (5), (7), (1), (3), (4) limit 2 offset 3);
--replace_result * 3
eval $q;
eval explain extended $q;
@@ -1224,12 +1232,14 @@ eval explain extended $q;
let $q=
select 3 union all (values (5), (7), (1), (3), (4) order by 1 limit 2);
--replace_result * 3
eval $q;
eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) order by 1 limit 2) union all select 3;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
let $q=
@@ -1254,12 +1264,14 @@ eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3 order by 1;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
let $q=
(values (5), (7), (1), (3), (4) order by 1 limit 3 offset 1) union all select 3
order by 1 limit 2 offset 1;
eval $q;
--replace_result derived4 derived2
eval explain extended $q;
--error ER_BAD_FIELD_ERROR

View File

@@ -17283,8 +17283,7 @@ set f1 = f1;
return f1;
END//
SELECT fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
fn104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@')
??@@@@
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
DROP FUNCTION IF EXISTS fn105;
CREATE FUNCTION fn105( f1 point) returns point
BEGIN
@@ -18418,8 +18417,7 @@ set f1 = f1;
SELECT f1;
END//
CALL sp104('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0@\0\0\0\0\0\0@');
f1
??@@@@
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
DROP PROCEDURE IF EXISTS sp105;
CREATE PROCEDURE sp105( f1 point)
BEGIN

View File

@@ -0,0 +1,53 @@
connection node_2;
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
START TRANSACTION;
INSERT INTO t1(i) VALUES(NULL);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
INSERT INTO t1(i) VALUES(NULL);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
SET GLOBAL wsrep_forced_binlog_format='ROW';
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
COMMIT;
SET GLOBAL wsrep_forced_binlog_format='ROW';
START TRANSACTION;
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
INSERT INTO t1(i) VALUES(NULL);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
INSERT INTO t1(i) VALUES(NULL);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
COMMIT;
SELECT * FROM t1 ORDER BY i;
i
1
3
5
7
9
11
13
15
connection node_2;
SELECT * FROM t1 ORDER BY i;
i
1
3
5
7
9
11
13
15
connection node_1;
SET GLOBAL wsrep_forced_binlog_format='NONE';
DROP TABLE t1;

View File

@@ -33,6 +33,28 @@ i c
3 dummy_text
5 dummy_text
7 dummy_text
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
insert into t1(i) values(null);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
select * from t1 order by i;
i c
1 dummy_text
3 dummy_text
5 dummy_text
7 dummy_text
9 dummy_text
11 dummy_text
13 dummy_text
15 dummy_text
connection node_2;
show variables like 'auto_increment%';
Variable_name Value
@@ -44,6 +66,10 @@ i c
3 dummy_text
5 dummy_text
7 dummy_text
9 dummy_text
11 dummy_text
13 dummy_text
15 dummy_text
SET GLOBAL wsrep_forced_binlog_format='none';
connection node_1;
SET GLOBAL wsrep_forced_binlog_format='none';

View File

@@ -0,0 +1,14 @@
connection node_2;
connection node_1;
#
# MDEV-38374 nonsense code in wsrep_store_key_val_for_row()
#
create table t1 (
id int auto_increment primary key,
blob_data longblob not null,
unique key idx_blob_prefix (blob_data(3072))
) engine=innodb;
insert into t1 (blob_data) values ('a');
update t1 set blob_data = repeat('x', 4000) where id = 1;
drop table t1;
# End of 10.6 tests

View File

@@ -0,0 +1,28 @@
connection node_2;
connection node_1;
# Make sure that the test is operating on the right version of galera library.
# Correct Galera library found
connection node_1;
connection node_2;
connection node_2;
CALL mtr.add_suppression("unknown variable 'non_existing_variable=ON'");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("sst_received failed: State wait was interrupted");
CALL mtr.add_suppression("State transfer interrupted, shutting down gracefully");
connection node_1;
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(1);
connection node_2;
connection node_1;
connection node_2;
connection node_1;
connection node_2;
connection node_1;
connection node_2;
Starting server ...
Starting server ...
SET GLOBAL wsrep_mode = DEFAULT;
connection node_1;
DROP TABLE t;
disconnect node_2;
disconnect node_1;

View File

@@ -0,0 +1,49 @@
##
## Test that mixed binlog replication works at the applier side.
##
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_2
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log");
--enable_query_log
--connection node_1
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log");
--enable_query_log
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
# Try mixed replication: statement then row.
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
START TRANSACTION;
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
SET GLOBAL wsrep_forced_binlog_format='ROW';
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
COMMIT;
# Try mixed replication: row then statement.
SET GLOBAL wsrep_forced_binlog_format='ROW';
START TRANSACTION;
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
INSERT INTO t1(i) VALUES(NULL);
INSERT INTO t1(i) VALUES(NULL);
COMMIT;
SELECT * FROM t1 ORDER BY i;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
--source include/wait_condition.inc
SELECT * FROM t1 ORDER BY i;
--connection node_1
SET GLOBAL wsrep_forced_binlog_format='NONE';
DROP TABLE t1;

View File

@@ -5,5 +5,6 @@ auto_increment_offset=1
auto_increment_increment=2
[mysqld.2]
wsrep_slave_threads=2
auto_increment_offset=2
auto_increment_increment=2

View File

@@ -48,8 +48,17 @@ insert into t1(i) values(null), (null), (null);
select * from t1 order by i;
# Ensure both appliers have some work to perform in parallel.
# This way we can see they both have proper isolation level set.
insert into t1(i) values(null);
insert into t1(i) values(null);
insert into t1(i) values(null);
insert into t1(i) values(null);
select * from t1 order by i;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
--source include/wait_condition.inc
show variables like 'auto_increment%';
select * from t1 order by i;

View File

@@ -0,0 +1,17 @@
source include/galera_cluster.inc;
source include/have_innodb.inc;
--echo #
--echo # MDEV-38374 nonsense code in wsrep_store_key_val_for_row()
--echo #
create table t1 (
id int auto_increment primary key,
blob_data longblob not null,
unique key idx_blob_prefix (blob_data(3072))
) engine=innodb;
insert into t1 (blob_data) values ('a');
update t1 set blob_data = repeat('x', 4000) where id = 1;
drop table t1;
--echo # End of 10.6 tests

View File

@@ -0,0 +1,138 @@
#
# Test for MDEV-31517: Wrong variable name in the configuration leads
# Galera to think SST/IST failed, at next restart will request a full
# SST.
#
# To reproduce:
#
# 1. Start Galera cluster
# 2. Stop a Node
# 3. Start the node
# 4. Stop a Node
# 5. Add non_existing_variable=ON in the config
# 6. Start the node, this will fail
# 7 Remove non_existing_variable=ON from the config file
# 8 Restart the server
# 9. Observe a full SST happening
#
# This test checks that an IST takes place at Step 9 instead of a full SST.
# Step 1: Start Galera cluster
--source include/galera_cluster.inc
--source include/have_mariabackup.inc
--echo # Make sure that the test is operating on the right version of galera library.
--let $galera_version=26.4.25
source ../wsrep/include/check_galera_version.inc;
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
# Suppress expected errors and warnings:
--connection node_2
CALL mtr.add_suppression("unknown variable 'non_existing_variable=ON'");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("sst_received failed: State wait was interrupted");
CALL mtr.add_suppression("State transfer interrupted, shutting down gracefully");
# Count the number of "SST completed" messages in the log file before
# and after testing. To do this we need to save original log file
# before testing:
#
--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err
--perl
use strict;
my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
my $test_log_copy=$test_log . '.copy';
if (-e $test_log_copy) {
unlink $test_log_copy;
}
EOF
--copy_file $TEST_LOG $TEST_LOG.copy
--connection node_1
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(1);
# Step 2: Stop node 2
--connection node_2
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Step 3: Start node 2
--connection node_2
--source include/start_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Step 4: Stop node 2
--connection node_2
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Step 5: Add non_existing_variable=ON in the config
--exec cp $MYSQLTEST_VARDIR/my.cnf $MYSQLTEST_VARDIR/my.cnf-orig
--exec echo '[mysqld.2]' >> $MYSQLTEST_VARDIR/my.cnf
--exec echo 'non_existing_variable=ON' >> $MYSQLTEST_VARDIR/my.cnf
# Step 6: start the stopped node, this will fail
--connection node_2
--exec cp -p $MYSQLD_DATADIR/grastate.dat $MYSQLD_DATADIR/grastate.dat_before
--echo Starting server ...
--error 1
--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf | grep 'non_existing_variable'
--exec cp -p $MYSQLD_DATADIR/grastate.dat $MYSQLD_DATADIR/grastate.dat_after
# Step 7: remove the wrong variable in the config file
--exec cp $MYSQLTEST_VARDIR/my.cnf-orig $MYSQLTEST_VARDIR/my.cnf
# Step 8: Start the node
--echo Starting server ...
let $restart_noprint=2;
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
# cleanup
SET GLOBAL wsrep_mode = DEFAULT;
--connection node_1
DROP TABLE t;
# Count the number of "SST completed" messages in the log file during
# test phase - to print the error message if the number of such
# messages in log file increased at the end of the test:
#
--perl
use strict;
my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
my $test_log_copy=$test_log . '.copy';
open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n");
my $initial=grep(/SST completed/gi,<FILE>);
close(FILE);
open(FILE, $test_log) or die("Unable to open $test_log: $!\n");
my $final=grep(/SST completed/gi,<FILE>);
close(FILE);
if ($final != $initial) {
my $diff=$final-$initial;
print("Full WSREP SST performed $diff times.\n");
}
EOF
--remove_file $TEST_LOG.copy
--source include/auto_increment_offset_restore.inc
--source include/galera_end.inc

View File

@@ -5,7 +5,7 @@ call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch on \\[page id: spac
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1");
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=127, page number=0\\] of corrupted file '.*test/t\\.ibd");
call mtr.add_suppression("(InnoDB: Plugin|Plugin 'InnoDB')");
call mtr.add_suppression("InnoDB: Page .* Current system log sequence number 123(38|54)\\.");
call mtr.add_suppression("InnoDB: Page .* Current system log sequence number 12(3(38|54|70|86)|4(02|18|34|50|66|82|98))");
SET GLOBAL innodb_fast_shutdown=0;
# restart
SELECT * FROM INFORMATION_SCHEMA.ENGINES

View File

@@ -18,7 +18,23 @@ ELSE 'SERIALIZABLE' END`;
eval SET TRANSACTION ISOLATION LEVEL $tx_isolation;
BEGIN;
DELETE FROM t1 WHERE b='2' AND c=2;
--replace_regex /.*(\d+ lock struct...), heap size \d+(, \d+ row lock...).*/\1\2/
# The SHOW ENGINE INNODB STATUS looks like this:
#
# ...
# +LIST OF TRANSACTIONS FOR EACH SESSION:
# +---TRANSACTION (0x7f1e08168300), not started
# +0 lock struct(s), heap size 1144, 0 row lock(s)
# +---TRANSACTION (0x7f1e08167780), not started
# +0 lock struct(s), heap size 1144, 0 row lock(s)
# +---TRANSACTION 25, ACTIVE 0 sec
# +2 lock struct(s), heap size 1144, 1 row lock(s)
# ...
#
# We want the lock struct(s) and row lock(s) of the ACTIVE transaction, but
# not of any inactive ones. Note the use of non-greedy match ".*?", so that
# we get the values for the ACTIVE transaction, not the last values in the
# list.
--replace_regex /.*---TRANSACTION \d+, ACTIVE.*?(\d+ lock struct...), heap size \d+(, \d+ row lock...).*/\1\2/
SHOW ENGINE INNODB STATUS;
ROLLBACK;

View File

@@ -14,8 +14,8 @@ call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch on \\[page id: spac
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1");
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=127, page number=0\\] of corrupted file '.*test/t\\.ibd");
call mtr.add_suppression("(InnoDB: Plugin|Plugin 'InnoDB')");
call mtr.add_suppression("InnoDB: Page .* Current system log sequence number 123(38|54)\\.");
# Allow innodb_force_recovery=1 to write up to 10 FILE_CHECKPOINT records
call mtr.add_suppression("InnoDB: Page .* Current system log sequence number 12(3(38|54|70|86)|4(02|18|34|50|66|82|98))");
SET GLOBAL innodb_fast_shutdown=0;
--source include/shutdown_mysqld.inc
--move_file $DATADIR/ib_logfile0 $DATADIR/ib_logfile0.old

View File

@@ -617,3 +617,15 @@ commit;
disconnect a;
connection default;
drop table t1;
#
# MDEV-38372 ASAN error in InnoDB on malformed WKB
#
create table t1 (
id int auto_increment primary key,
geom geometry not null,
spatial index (geom)
) engine=innodb;
insert t1 (geom) values (X'000000000107000000FF000000');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
# End of 10.6 tests

View File

@@ -1331,18 +1331,13 @@ geometrycollection(point(1,-1)),b
);
1
drop table t1;
CREATE TABLE t1(c1 POINT NOT NULL);
DROP TABLE mysql.innodb_table_stats;
#
# MDEV-24558 : Assertion !index->is_spatial() failed
#
CREATE TABLE t1(c1 POINT NOT NULL) ENGINE=InnoDB;
RENAME TABLE mysql.innodb_table_stats TO mysql.innodb_table_stats_;
CALL mtr.add_suppression("InnoDB: Table `mysql`.`innodb_table_stats` not found.");
CALL mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table `test`.`t1` but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.");
CREATE SPATIAL INDEX idx2 ON t1(c1);
DROP TABLE t1;
CREATE TABLE mysql.innodb_table_stats (
database_name varchar(64) COLLATE utf8_bin NOT NULL,
table_name varchar(199) COLLATE utf8_bin NOT NULL,
last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
n_rows bigint(20) unsigned NOT NULL,
clustered_index_size bigint(20) unsigned NOT NULL,
sum_of_other_index_sizes bigint(20) unsigned NOT NULL,
PRIMARY KEY (`database_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
RENAME TABLE mysql.innodb_table_stats_ TO mysql.innodb_table_stats;

View File

@@ -40,5 +40,18 @@ disconnect a;
connection default;
drop table t1;
--echo #
--echo # MDEV-38372 ASAN error in InnoDB on malformed WKB
--echo #
create table t1 (
id int auto_increment primary key,
geom geometry not null,
spatial index (geom)
) engine=innodb;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
insert t1 (geom) values (X'000000000107000000FF000000');
drop table t1;
--echo # End of 10.6 tests

View File

@@ -10,6 +10,7 @@
# Test spatial index with table have no primary key column
# Test spatial index with table have no auto_increment
# Test spatial index with check constraint
# Test spatial index with missing mysql.innodb_table_stats
# **********************************************************
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
@@ -1165,20 +1166,15 @@ select 1 from t1 where st_intersects(
);
drop table t1;
# Reproduce case for updating statistic after droping stats info table.
CREATE TABLE t1(c1 POINT NOT NULL);
DROP TABLE mysql.innodb_table_stats;
# Test spatial index with missing mysql.innodb_table_stats
--echo #
--echo # MDEV-24558 : Assertion !index->is_spatial() failed
--echo #
CREATE TABLE t1(c1 POINT NOT NULL) ENGINE=InnoDB;
RENAME TABLE mysql.innodb_table_stats TO mysql.innodb_table_stats_;
CALL mtr.add_suppression("InnoDB: Table `mysql`.`innodb_table_stats` not found.");
CALL mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table `test`.`t1` but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.");
CREATE SPATIAL INDEX idx2 ON t1(c1);
DROP TABLE t1;
CREATE TABLE mysql.innodb_table_stats (
database_name varchar(64) COLLATE utf8_bin NOT NULL,
table_name varchar(199) COLLATE utf8_bin NOT NULL,
last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
n_rows bigint(20) unsigned NOT NULL,
clustered_index_size bigint(20) unsigned NOT NULL,
sum_of_other_index_sizes bigint(20) unsigned NOT NULL,
PRIMARY KEY (`database_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
RENAME TABLE mysql.innodb_table_stats_ TO mysql.innodb_table_stats;

View File

@@ -450,8 +450,6 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD \n# comment\nFOR u1 = PASSWORD(*****)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0

View File

@@ -361,8 +361,6 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD\n# comment\nFOR u1 = PASSWORD(*****)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0

View File

@@ -32,7 +32,7 @@ ERROR 42000: Variable 'new_mode' can't be set to the value of 'TEST_WARNING3'
SET @@session.new_mode = "ALL";
select @@session.new_mode;
@@session.new_mode
FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS
FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS,FIX_INDEX_LOOKUP_COST
SET @@global.new_mode = NULL;
ERROR 42000: Variable 'new_mode' can't be set to the value of 'NULL'
SET @@global.new_mode = '';

View File

@@ -2399,7 +2399,7 @@ VARIABLE_COMMENT Used to introduce new behavior to existing MariaDB versions
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS
ENUM_VALUE_LIST FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS,FIX_INDEX_LOOKUP_COST
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NOTE_VERBOSITY

View File

@@ -2609,7 +2609,7 @@ VARIABLE_COMMENT Used to introduce new behavior to existing MariaDB versions
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS
ENUM_VALUE_LIST FIX_DISK_TMPTABLE_COSTS,FIX_INDEX_STATS_FOR_ALL_NULLS,FIX_INDEX_LOOKUP_COST
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NOTE_VERBOSITY

View File

@@ -3508,6 +3508,69 @@ alter table `t1` partition by system_time interval 10007 year ;
ERROR 22003: TIMESTAMP value is out of range in 'INTERVAL'
drop table t1;
#
# MDEV-29114 ALTER puts row into different partition for system_time
# interval partitioning
#
# CREATE case
set timestamp= unix_timestamp('2000-01-01 00:00:00');
create or replace table t1 (x int) with system versioning
partition by system_time interval 1 hour (
partition p0 history, partition p1 history, partition pn current);
set timestamp= unix_timestamp('2000-01-01 00:00:00');
insert t1 values (0);
set timestamp= unix_timestamp('2000-01-01 00:10:00');
update t1 set x= 1;
set timestamp= unix_timestamp('2000-01-01 01:00:00');
update t1 set x= 2;
set timestamp= unix_timestamp('2000-01-01 01:30:00');
update t1 set x= 3;
# CREATE result: row 1 got into p1
select *, row_start, row_end from t1 partition (p0);
x row_start row_end
0 2000-01-01 00:00:00.000000 2000-01-01 00:10:00.000000
select *, row_start, row_end from t1 partition (p1);
x row_start row_end
1 2000-01-01 00:10:00.000000 2000-01-01 01:00:00.000000
2 2000-01-01 01:00:00.000000 2000-01-01 01:30:00.000000
flush tables;
# For CREATE pruning is affected by current timestamp, but SELECT works
# in any case since row 1 got into p1
set timestamp= unix_timestamp('2000-01-01 00:00:00');
explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,pn ALL NULL NULL NULL NULL 4 Using where
select * from t1 for system_time as of '2000-01-01 00:59:59';
x
1
set timestamp= unix_timestamp('2020-01-01 00:00:00');
explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,pn ALL NULL NULL NULL NULL 4 Using where
select * from t1 for system_time as of '2000-01-01 00:59:59';
x
1
# ALTER case
set timestamp= unix_timestamp('2000-01-01 00:00:00');
alter table t1
partition by system_time interval 1 hour (
partition p0 history, partition p1 history, partition pn current);
# ALTER result: row 1 got into p1
Select *, row_start, row_end from t1 partition (p0);
x row_start row_end
0 2000-01-01 00:00:00.000000 2000-01-01 00:10:00.000000
Select *, row_start, row_end from t1 partition (p1);
x row_start row_end
1 2000-01-01 00:10:00.000000 2000-01-01 01:00:00.000000
2 2000-01-01 01:00:00.000000 2000-01-01 01:30:00.000000
flush tables;
Explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,pn ALL NULL NULL NULL NULL 4 Using where
Select * from t1 for system_time as of '2000-01-01 00:59:59';
x
1
drop table t1;
#
# End of 10.11 tests
#
set global innodb_stats_persistent= @save_persistent;

View File

@@ -2770,6 +2770,52 @@ partition by system_time interval 1 month (
alter table `t1` partition by system_time interval 10007 year ;
drop table t1;
--echo #
--echo # MDEV-29114 ALTER puts row into different partition for system_time
--echo # interval partitioning
--echo #
--echo # CREATE case
set timestamp= unix_timestamp('2000-01-01 00:00:00');
create or replace table t1 (x int) with system versioning
partition by system_time interval 1 hour (
partition p0 history, partition p1 history, partition pn current);
set timestamp= unix_timestamp('2000-01-01 00:00:00');
insert t1 values (0);
set timestamp= unix_timestamp('2000-01-01 00:10:00');
update t1 set x= 1;
set timestamp= unix_timestamp('2000-01-01 01:00:00');
update t1 set x= 2;
set timestamp= unix_timestamp('2000-01-01 01:30:00');
update t1 set x= 3;
--echo # CREATE result: row 1 got into p1
select *, row_start, row_end from t1 partition (p0);
select *, row_start, row_end from t1 partition (p1);
flush tables;
--echo # For CREATE pruning is affected by current timestamp, but SELECT works
--echo # in any case since row 1 got into p1
set timestamp= unix_timestamp('2000-01-01 00:00:00');
explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
select * from t1 for system_time as of '2000-01-01 00:59:59';
set timestamp= unix_timestamp('2020-01-01 00:00:00');
explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
select * from t1 for system_time as of '2000-01-01 00:59:59';
--echo # ALTER case
set timestamp= unix_timestamp('2000-01-01 00:00:00');
alter table t1
partition by system_time interval 1 hour (
partition p0 history, partition p1 history, partition pn current);
--echo # ALTER result: row 1 got into p1
Select *, row_start, row_end from t1 partition (p0);
Select *, row_start, row_end from t1 partition (p1);
flush tables;
Explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
Select * from t1 for system_time as of '2000-01-01 00:59:59';
drop table t1;
--echo #
--echo # End of 10.11 tests
--echo #

View File

@@ -44,6 +44,7 @@ wsrep_commit_window #
wsrep_local_state #
wsrep_local_state_comment #
wsrep_cert_index_size #
wsrep_causal_reads #
wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #

View File

@@ -44,6 +44,7 @@ wsrep_commit_window #
wsrep_local_state #
wsrep_local_state_comment #
wsrep_cert_index_size #
wsrep_causal_reads #
wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #

View File

@@ -3,7 +3,7 @@
--source include/have_innodb.inc
--source include/galera_no_debug_sync.inc
--let $galera_version=26.4.23
--let $galera_version=26.4.25
source include/check_galera_version.inc;
source include/galera_variables_ok.inc;

View File

@@ -5,9 +5,10 @@
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc
--let $galera_version=26.4.23
--let $galera_version=26.4.25
source include/check_galera_version.inc;
--let $galera_variables_delta=1
source include/galera_variables_ok_debug.inc;
--replace_column 2 #

View File

@@ -1,7 +1,7 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
--let $galera_version=26.4.24
--let $galera_version=26.4.25
source include/check_galera_version.inc;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN (

View File

@@ -151,13 +151,13 @@ CALL PREPARE_EXECUTE_PROC();
------------------Test body end----------------------
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME WHERE count != 0;
TIME COUNT TOTAL
1.000000 9 4.500000
1.000000 12 6.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_READ WHERE count != 0;
TIME COUNT TOTAL
1.000000 7 3.500000
1.000000 8 4.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_WRITE WHERE count != 0;
TIME COUNT TOTAL
1.000000 2 1.000000
1.000000 4 2.000000
include/assert.inc [The sum of query counts in read and write tables must be equal to query count of the common table]
include/assert.inc [QUERY_RESPONSE_TIME query counts must be equal regardless of the table name case]
include/assert.inc [QUERY_RESPONSE_TIME_READ query counts must be equal regardless of the table name case]
@@ -223,13 +223,13 @@ DML_FUNC()
------------------Test body end----------------------
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME WHERE count != 0;
TIME COUNT TOTAL
1.000000 5 2.500000
1.000000 4 2.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_READ WHERE count != 0;
TIME COUNT TOTAL
1.000000 1 0.500000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_WRITE WHERE count != 0;
TIME COUNT TOTAL
1.000000 4 2.000000
1.000000 3 1.500000
include/assert.inc [The sum of query counts in read and write tables must be equal to query count of the common table]
include/assert.inc [QUERY_RESPONSE_TIME query counts must be equal regardless of the table name case]
include/assert.inc [QUERY_RESPONSE_TIME_READ query counts must be equal regardless of the table name case]
@@ -637,13 +637,13 @@ CALL PREPARE_EXECUTE_PROC();
------------------Test body end----------------------
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME WHERE count != 0;
TIME COUNT TOTAL
1.000000 9 4.500000
1.000000 12 6.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_READ WHERE count != 0;
TIME COUNT TOTAL
1.000000 7 3.500000
1.000000 8 4.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_WRITE WHERE count != 0;
TIME COUNT TOTAL
1.000000 2 1.000000
1.000000 4 2.000000
include/assert.inc [The sum of query counts in read and write tables must be equal to query count of the common table]
include/assert.inc [QUERY_RESPONSE_TIME query counts must be equal regardless of the table name case]
include/assert.inc [QUERY_RESPONSE_TIME_READ query counts must be equal regardless of the table name case]
@@ -709,13 +709,13 @@ DML_FUNC()
------------------Test body end----------------------
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME WHERE count != 0;
TIME COUNT TOTAL
1.000000 5 2.500000
1.000000 4 2.000000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_READ WHERE count != 0;
TIME COUNT TOTAL
1.000000 1 0.500000
SELECT * FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME_WRITE WHERE count != 0;
TIME COUNT TOTAL
1.000000 4 2.000000
1.000000 3 1.500000
include/assert.inc [The sum of query counts in read and write tables must be equal to query count of the common table]
include/assert.inc [QUERY_RESPONSE_TIME query counts must be equal regardless of the table name case]
include/assert.inc [QUERY_RESPONSE_TIME_READ query counts must be equal regardless of the table name case]

View File

@@ -22,6 +22,7 @@
#include <my_config.h>
#include <assert.h>
#include "sql_command.h"
#ifndef _WIN32
#define DO_SYSLOG
@@ -796,189 +797,6 @@ static int user_coll_fill(struct user_coll *c, char *users,
}
enum sa_keywords
{
SQLCOM_NOTHING=0,
SQLCOM_DDL,
SQLCOM_DML,
SQLCOM_GRANT,
SQLCOM_CREATE_USER,
SQLCOM_ALTER_USER,
SQLCOM_CHANGE_MASTER,
SQLCOM_CREATE_SERVER,
SQLCOM_SET_OPTION,
SQLCOM_ALTER_SERVER,
SQLCOM_TRUNCATE,
SQLCOM_QUERY_ADMIN,
SQLCOM_DCL,
SQLCOM_FOUND=-1,
};
struct sa_keyword
{
int length;
const char *wd;
struct sa_keyword *next;
enum sa_keywords type;
};
struct sa_keyword xml_word[]=
{
{3, "XML", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword user_word[]=
{
{4, "USER", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword data_word[]=
{
{4, "DATA", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword server_word[]=
{
{6, "SERVER", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword master_word[]=
{
{6, "MASTER", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword password_word[]=
{
{8, "PASSWORD", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword function_word[]=
{
{8, "FUNCTION", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword statement_word[]=
{
{9, "STATEMENT", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword procedure_word[]=
{
{9, "PROCEDURE", 0, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword replace_user_word[]=
{
{7, "REPLACE", user_word, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword or_replace_user_word[]=
{
{2, "OR", replace_user_word, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword replace_server_word[]=
{
{7, "REPLACE", server_word, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword or_replace_server_word[]=
{
{2, "OR", replace_server_word, SQLCOM_FOUND},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword keywords_to_skip[]=
{
{3, "SET", statement_word, SQLCOM_QUERY_ADMIN},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword not_ddl_keywords[]=
{
{4, "DROP", user_word, SQLCOM_DCL},
{6, "CREATE", user_word, SQLCOM_DCL},
{6, "CREATE", or_replace_user_word, SQLCOM_DCL},
{6, "RENAME", user_word, SQLCOM_DCL},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword ddl_keywords[]=
{
{4, "DROP", 0, SQLCOM_DDL},
{5, "ALTER", 0, SQLCOM_DDL},
{6, "CREATE", 0, SQLCOM_DDL},
{6, "RENAME", 0, SQLCOM_DDL},
{8, "TRUNCATE", 0, SQLCOM_DDL},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword dml_keywords[]=
{
{2, "DO", 0, SQLCOM_DML},
{4, "CALL", 0, SQLCOM_DML},
{4, "LOAD", data_word, SQLCOM_DML},
{4, "LOAD", xml_word, SQLCOM_DML},
{6, "DELETE", 0, SQLCOM_DML},
{6, "INSERT", 0, SQLCOM_DML},
{6, "SELECT", 0, SQLCOM_DML},
{6, "UPDATE", 0, SQLCOM_DML},
{7, "HANDLER", 0, SQLCOM_DML},
{7, "REPLACE", 0, SQLCOM_DML},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword dml_no_select_keywords[]=
{
{2, "DO", 0, SQLCOM_DML},
{4, "CALL", 0, SQLCOM_DML},
{4, "LOAD", data_word, SQLCOM_DML},
{4, "LOAD", xml_word, SQLCOM_DML},
{6, "DELETE", 0, SQLCOM_DML},
{6, "INSERT", 0, SQLCOM_DML},
{6, "UPDATE", 0, SQLCOM_DML},
{7, "HANDLER", 0, SQLCOM_DML},
{7, "REPLACE", 0, SQLCOM_DML},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword dcl_keywords[]=
{
{6, "CREATE", user_word, SQLCOM_DCL},
{6, "CREATE", or_replace_user_word, SQLCOM_DCL},
{4, "DROP", user_word, SQLCOM_DCL},
{6, "RENAME", user_word, SQLCOM_DCL},
{5, "GRANT", 0, SQLCOM_DCL},
{6, "REVOKE", 0, SQLCOM_DCL},
{3, "SET", password_word, SQLCOM_DCL},
{0, NULL, 0, SQLCOM_NOTHING}
};
struct sa_keyword passwd_keywords[]=
{
{3, "SET", password_word, SQLCOM_SET_OPTION},
{5, "ALTER", server_word, SQLCOM_ALTER_SERVER},
{5, "ALTER", user_word, SQLCOM_ALTER_USER},
{5, "GRANT", 0, SQLCOM_GRANT},
{6, "CREATE", user_word, SQLCOM_CREATE_USER},
{6, "CREATE", or_replace_user_word, SQLCOM_CREATE_USER},
{6, "CREATE", server_word, SQLCOM_CREATE_SERVER},
{6, "CREATE", or_replace_server_word, SQLCOM_CREATE_SERVER},
{6, "CHANGE", master_word, SQLCOM_CHANGE_MASTER},
{0, NULL, 0, SQLCOM_NOTHING}
};
#define MAX_KEYWORD 9
static void error_header()
{
struct tm tm_time;
@@ -1092,6 +910,78 @@ static int get_user_host(const char *uh_line, unsigned int uh_len,
return 0;
}
static int sql_command_to_cmdtype(int sql_command)
{
switch (sql_command)
{
case SQLCOM_ALTER_DB:
case SQLCOM_ALTER_DB_UPGRADE:
case SQLCOM_ALTER_FUNCTION:
case SQLCOM_ALTER_PROCEDURE:
case SQLCOM_ALTER_SEQUENCE:
case SQLCOM_ALTER_TABLE:
case SQLCOM_CREATE_DB:
case SQLCOM_CREATE_INDEX:
case SQLCOM_CREATE_PACKAGE:
case SQLCOM_CREATE_PACKAGE_BODY:
case SQLCOM_CREATE_PROCEDURE:
case SQLCOM_CREATE_SEQUENCE:
case SQLCOM_CREATE_SPFUNCTION:
case SQLCOM_CREATE_TABLE:
case SQLCOM_CREATE_TRIGGER:
case SQLCOM_CREATE_VIEW:
case SQLCOM_DROP_DB:
case SQLCOM_DROP_FUNCTION:
case SQLCOM_DROP_INDEX:
case SQLCOM_DROP_PACKAGE:
case SQLCOM_DROP_PACKAGE_BODY:
case SQLCOM_DROP_PROCEDURE:
case SQLCOM_DROP_SEQUENCE:
case SQLCOM_DROP_TABLE:
case SQLCOM_DROP_TRIGGER:
case SQLCOM_DROP_VIEW:
case SQLCOM_RENAME_TABLE:
case SQLCOM_TRUNCATE:
return EVENT_QUERY_DDL;
case SQLCOM_DO:
case SQLCOM_CALL:
case SQLCOM_LOAD:
case SQLCOM_DELETE:
case SQLCOM_DELETE_MULTI:
case SQLCOM_INSERT:
case SQLCOM_INSERT_SELECT:
case SQLCOM_UPDATE:
case SQLCOM_UPDATE_MULTI:
case SQLCOM_HA_OPEN:
case SQLCOM_HA_READ:
case SQLCOM_HA_CLOSE:
case SQLCOM_REPLACE:
case SQLCOM_REPLACE_SELECT:
return EVENT_QUERY_DML | EVENT_QUERY_DML_NO_SELECT;
case SQLCOM_SELECT:
return EVENT_QUERY_DML;
case SQLCOM_CREATE_USER:
case SQLCOM_CREATE_ROLE:
case SQLCOM_DROP_ROLE:
case SQLCOM_DROP_USER:
case SQLCOM_RENAME_USER:
case SQLCOM_GRANT:
case SQLCOM_GRANT_ROLE:
case SQLCOM_REVOKE:
case SQLCOM_REVOKE_ROLE:
case SQLCOM_REVOKE_ALL:
return EVENT_QUERY_DCL;
default:
return EVENT_QUERY_ALL;
};
}
#if defined(_WIN32) && !defined(S_ISDIR)
#define S_ISDIR(x) ((x) & _S_IFDIR)
#endif /*_WIN32 && !S_ISDIR*/
@@ -1740,118 +1630,8 @@ static int do_log_user(const char *name, int len,
}
static int get_next_word(const char *query, char *word)
{
int len= 0;
char c;
while ((c= query[len]))
{
if (c >= 'a' && c <= 'z')
word[len]= 'A' + (c-'a');
else if (c >= 'A' && c <= 'Z')
word[len]= c;
else
break;
if (len++ == MAX_KEYWORD)
return 0;
}
word[len]= 0;
return len;
}
static int filter_query_type(const char *query, struct sa_keyword *kwd)
{
int qwe_in_list;
char fword[MAX_KEYWORD + 1], nword[MAX_KEYWORD + 1];
int len, nlen= 0;
const struct sa_keyword *l_keywords;
if (!query)
return SQLCOM_NOTHING;
while (*query && (is_space(*query) || *query == '(' || *query == '/'))
{
/* comment handling */
if (*query == '/' && query[1] == '*')
{
if (query[2] == '!')
{
query+= 3;
while (*query >= '0' && *query <= '9')
query++;
continue;
}
query+= 2;
while (*query)
{
if (*query=='*' && query[1] == '/')
{
query+= 2;
break;
}
query++;
}
continue;
}
query++;
}
qwe_in_list= SQLCOM_NOTHING;
if (!(len= get_next_word(query, fword)))
goto not_in_list;
query+= len+1;
l_keywords= kwd;
while (l_keywords->length)
{
if (l_keywords->length == len && strncmp(l_keywords->wd, fword, len) == 0)
{
if (l_keywords->next)
{
if (nlen == 0)
{
while (*query && is_space(*query))
query++;
nlen= get_next_word(query, nword);
}
if (filter_query_type(query, l_keywords->next) == SQLCOM_NOTHING)
goto do_loop;
}
qwe_in_list= l_keywords->type;
break;
};
do_loop:
l_keywords++;
}
not_in_list:
return qwe_in_list;
}
static const char *skip_set_statement(const char *query)
{
if (filter_query_type(query, keywords_to_skip))
{
char fword[MAX_KEYWORD + 1];
int len;
do
{
len= get_next_word(query, fword);
query+= len ? len : 1;
if (len == 3 && strncmp(fword, "FOR", 3) == 0)
break;
} while (*query);
if (*query == 0)
return 0;
}
return query;
}
static int log_statement_ex(const struct connection_info *cn,
time_t ev_time, unsigned long thd_id,
time_t ev_time, unsigned long thd_id, int sql_cmd,
const char *query, unsigned int query_len,
int error_code, const char *type, int take_lock)
{
@@ -1866,6 +1646,7 @@ static int log_statement_ex(const struct connection_info *cn,
long long query_id;
int result;
char *big_buffer= NULL;
int cmdtype= sql_command_to_cmdtype(sql_cmd);
if ((db= cn->db))
db_length= cn->db_length;
@@ -1892,30 +1673,14 @@ static int log_statement_ex(const struct connection_info *cn,
{
const char *orig_query= query;
if ((query= skip_set_statement(query)) == SQLCOM_NOTHING)
return 0;
if (events & EVENT_QUERY_DDL)
{
if (!filter_query_type(query, not_ddl_keywords) &&
filter_query_type(query, ddl_keywords))
goto do_log_query;
}
if (events & EVENT_QUERY_DML)
{
if (filter_query_type(query, dml_keywords))
goto do_log_query;
}
if (events & EVENT_QUERY_DML_NO_SELECT)
{
if (filter_query_type(query, dml_no_select_keywords))
goto do_log_query;
}
if (events & EVENT_QUERY_DCL)
{
if (filter_query_type(query, dcl_keywords))
goto do_log_query;
}
if (events & EVENT_QUERY_DDL && cmdtype & EVENT_QUERY_DDL)
goto do_log_query;
if (events & EVENT_QUERY_DML && cmdtype & EVENT_QUERY_DML)
goto do_log_query;
if (events & EVENT_QUERY_DML_NO_SELECT && cmdtype & EVENT_QUERY_DML_NO_SELECT)
goto do_log_query;
if (events & EVENT_QUERY_DCL && cmdtype & EVENT_QUERY_DCL)
goto do_log_query;
return 0;
do_log_query:
@@ -1949,7 +1714,7 @@ do_log_query:
if (query_log_limit > 0 && uh_buffer_size > query_log_limit+2)
uh_buffer_size= query_log_limit+2;
switch (filter_query_type(skip_set_statement(query), passwd_keywords))
switch (sql_cmd)
{
case SQLCOM_GRANT:
case SQLCOM_CREATE_USER:
@@ -1975,8 +1740,8 @@ do_log_query:
case SQLCOM_SET_OPTION:
csize+= escape_string_hide_passwords(query, query_len,
uh_buffer, uh_buffer_size,
NULL, 0, NULL, 0,
"=", 1, 0);
"PASSWORD", 8, "=", 1,
"PASSWORD", 8, '(');
break;
default:
csize+= escape_string(query, query_len,
@@ -1996,7 +1761,7 @@ do_log_query:
static int log_statement(const struct connection_info *cn,
const struct mysql_event_general *event,
const char *type)
const char *type, int sql_command)
{
DBUG_PRINT("info", ("log_statement: event_subclass=%d, general_command=%.*s, "
"cn->query_id=%lld, cn->query=%.*s, event->query_id=%lld, "
@@ -2009,7 +1774,8 @@ static int log_statement(const struct connection_info *cn,
event->query_id, event->general_query_length,
event->general_query, type));
return log_statement_ex(cn, event->general_time, event->general_thread_id,
event->general_query, event->general_query_length,
sql_command, event->general_query,
event->general_query_length,
event->general_error_code, type, 1);
}
@@ -2325,7 +2091,7 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
if (event->event_subclass == MYSQL_AUDIT_GENERAL_STATUS &&
event_query_command(event))
{
log_statement(cn, event, "QUERY");
log_statement(cn, event, "QUERY", thd_sql_command(thd));
cn->query_length= 0; /* So the log_current_query() won't log this again. */
cn->query_id= 0;
cn->log_always= 0;
@@ -2864,7 +2630,8 @@ static void log_current_query(MYSQL_THD thd)
{
cn->log_always= 1;
log_statement_ex(cn, cn->query_time, thd_get_thread_id(thd),
cn->query, cn->query_length, 0, "QUERY", 0);
thd_sql_command(thd), cn->query, cn->query_length, 0,
"QUERY", 0);
cn->log_always= 0;
}
}

10
scripts/mysql_secure_installation.sh Normal file → Executable file
View File

@@ -1,16 +1,16 @@
#!/bin/sh
# Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
@@ -218,8 +218,8 @@ validate_reply () {
}
prepare() {
touch $config $command
chmod 600 $config $command
umask 0077
touch $config $command $output
}
do_query() {

View File

@@ -690,8 +690,10 @@ int ha_partition::rename_table(const char *from, const char *to)
SYNOPSIS
create_partitioning_metadata()
path Path to the new frm file (without ext)
old_p Path to the old frm file (without ext)
create_info Create info generated for CREATE TABLE
old_path Path to the old frm file (without ext)
action_flag Action to take
ignore_delete_error Whether to ignore error in call to
mysql_file_delete
RETURN VALUE
>0 Error
@@ -707,7 +709,8 @@ int ha_partition::rename_table(const char *from, const char *to)
int ha_partition::create_partitioning_metadata(const char *path,
const char *old_path,
chf_create_flags action_flag)
chf_create_flags action_flag,
bool ignore_delete_error)
{
partition_element *part;
DBUG_ENTER("ha_partition::create_partitioning_metadata");
@@ -726,7 +729,8 @@ int ha_partition::create_partitioning_metadata(const char *path,
strxmov(name, path, ha_par_ext, NullS);
strxmov(old_name, old_path, ha_par_ext, NullS);
if ((action_flag == CHF_DELETE_FLAG &&
mysql_file_delete(key_file_ha_partition_par, name, MYF(MY_WME))) ||
mysql_file_delete(key_file_ha_partition_par, name,
ignore_delete_error ? MYF(0) : MYF(MY_WME))) ||
(action_flag == CHF_RENAME_FLAG &&
mysql_file_rename(key_file_ha_partition_par, old_name, name,
MYF(MY_WME))))

View File

@@ -544,7 +544,8 @@ public:
HA_CREATE_INFO *create_info) override;
int create_partitioning_metadata(const char *name,
const char *old_name,
chf_create_flags action_flag)
chf_create_flags action_flag,
bool ignore_delete_error)
override;
bool check_if_updates_are_ignored(const char *op) const override;
void update_create_info(HA_CREATE_INFO *create_info) override;

View File

@@ -2205,11 +2205,36 @@ static bool is_ro_1pc_trans(THD *thd, Ha_trx_info *ha_info, bool all,
return !rw_trans;
}
static bool has_binlog_hton(Ha_trx_info *ha_info)
inline Ha_trx_info* get_binlog_hton(Ha_trx_info *ha_info)
{
bool rc;
for (rc= false; ha_info && !rc; ha_info= ha_info->next())
rc= ha_info->ht() == &binlog_tp;
for (; ha_info; ha_info= ha_info->next())
if (ha_info->ht() == &binlog_tp)
return ha_info;
return ha_info;
}
static int run_binlog_first(THD *thd, bool all, THD_TRANS *trans,
bool is_real_trans, bool is_commit)
{
int rc= 0;
Ha_trx_info *ha_info= trans->ha_list;
if ((ha_info= get_binlog_hton(ha_info)))
{
int err;
if ((err= is_commit ? binlog_commit(thd, all,
is_ro_1pc_trans(thd, ha_info, all,
is_real_trans))
: binlog_rollback(thd, all)))
{
my_error(is_commit ? ER_ERROR_DURING_COMMIT : ER_ERROR_DURING_ROLLBACK,
MYF(0), err);
rc= 1;
}
}
else if (WSREP(thd))
rc= thd->binlog_flush_pending_rows_event(TRUE);
return rc;
}
@@ -2227,27 +2252,19 @@ commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans)
if (ha_info)
{
int err= 0;
if (has_binlog_hton(ha_info))
/*
Binlog hton must be called first regardless of its position
in trans->ha_list at least to prevent from commiting any engine
branches when afterward a duplicate GTID error out of binlog_commit()
is generated.
*/
for (int binlog_err= error=
run_binlog_first(thd, all, trans, is_real_trans, true);
ha_info; ha_info= ha_info_next)
{
if ((err= binlog_commit(thd, all, is_ro_1pc_trans(thd, ha_info, all,
is_real_trans))))
{
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
error= 1;
if (binlog_err)
goto err;
}
}
#ifdef WITH_WSREP
else
{
if (wsrep_on(thd))
error= thd->binlog_flush_pending_rows_event(TRUE);
}
#endif
for (; ha_info; ha_info= ha_info_next)
{
transaction_participant *ht= ha_info->ht();
if ((err= ht->commit(thd, all)))
{
@@ -2371,11 +2388,18 @@ int ha_rollback_trans(THD *thd, bool all)
if (is_real_trans) /* not a statement commit */
thd->stmt_map.close_transient_cursors();
for (; ha_info; ha_info= ha_info_next)
/*
Binlog hton must be called first regardless of its position
in trans->ha_list in order to avoid race to binlog between the current
rollbacker and any transaction that depends on it. This guarantees
the execution time dependency identifies binlog ordering.
*/
for (error= run_binlog_first(thd, all, trans, is_real_trans, false);
ha_info; ha_info= ha_info_next)
{
int err;
transaction_participant *ht= ha_info->ht();
if ((err= ht->rollback(thd, all)))
if (ht != &binlog_tp && (err= ht->rollback(thd, all)))
{
// cannot happen
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
@@ -5992,7 +6016,8 @@ handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info_arg)
int
handler::ha_create_partitioning_metadata(const char *name,
const char *old_name,
chf_create_flags action_flag)
chf_create_flags action_flag,
bool ignore_delete_error)
{
/*
Normally this is done when unlocked, but in fast_alter_partition_table,
@@ -6002,7 +6027,8 @@ handler::ha_create_partitioning_metadata(const char *name,
DBUG_ASSERT(m_lock_type == F_UNLCK ||
(!old_name && strcmp(name, table_share->path.str)));
return create_partitioning_metadata(name, old_name, action_flag);
return create_partitioning_metadata(name, old_name, action_flag,
ignore_delete_error);
}

View File

@@ -3679,7 +3679,8 @@ public:
int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info);
int ha_create_partitioning_metadata(const char *name, const char *old_name,
chf_create_flags action_flag);
chf_create_flags action_flag,
bool ignore_delete_error= false);
int ha_change_partitions(HA_CREATE_INFO *create_info,
const char *path,
@@ -5445,7 +5446,8 @@ public:
virtual int create_partitioning_metadata(const char *name,
const char *old_name,
chf_create_flags action_flag)
chf_create_flags action_flag,
bool ignore_delete_error)
{ return FALSE; }
virtual int change_partitions(HA_CREATE_INFO *create_info,

View File

@@ -2369,7 +2369,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
*having_item= NULL;
if (join_having || select_lex->with_sum_func ||
select_lex->group_list.elements)
select_lex->group_list.elements || select_lex->with_rownum)
{
LEX_CSTRING field_name= this->full_name_cstring();
Item *item= func->create(thd, expr,
@@ -2616,9 +2616,10 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
during JOIN::optimize: this->tmp_having= this->having; this->having= 0;
*/
Item* join_having= join->having ? join->having : join->tmp_having;
bool is_having_used= (join_having || select_lex->with_sum_func ||
select_lex->group_list.first ||
!select_lex->table_list.elements);
bool is_having_used=
(join_having || select_lex->with_sum_func ||
select_lex->group_list.first || !select_lex->table_list.elements ||
select_lex->with_rownum);
LEX_CSTRING list_ref= { STRING_WITH_LEN("<list ref>")};
DBUG_ENTER("Item_in_subselect::create_row_in_to_exists_cond");
DBUG_ASSERT(thd == join->thd);

View File

@@ -475,6 +475,7 @@ class Json_schema_properties : public Json_schema_keyword
Json_schema_properties()
{
priority= 1;
is_hash_inited= false;
}
bool validate(const json_engine_t *je, const uchar *k_start= NULL,
const uchar *k_end= NULL) override;
@@ -503,6 +504,10 @@ class Json_schema_dependent_schemas : public Json_schema_keyword
if (is_hash_inited)
my_hash_free(&properties);
}
Json_schema_dependent_schemas()
{
is_hash_inited= false;
}
bool validate(const json_engine_t *je, const uchar *k_start= NULL,
const uchar *k_end= NULL) override;
bool handle_keyword(THD *thd, json_engine_t *je,

View File

@@ -96,7 +96,6 @@ static int binlog_close_connection(THD *thd);
static int binlog_savepoint_set(THD *thd, void *sv);
static int binlog_savepoint_rollback(THD *thd, void *sv);
static bool binlog_savepoint_rollback_can_release_mdl(THD *thd);
static int binlog_rollback(THD *thd, bool all);
static int binlog_prepare(THD *thd, bool all);
static int binlog_start_consistent_snapshot(THD *thd);
static int binlog_flush_cache(THD *thd, binlog_cache_mngr *cache_mngr,
@@ -2477,7 +2476,7 @@ int binlog_commit(THD *thd, bool all, bool ro_1pc)
@see handlerton::rollback
*/
static int binlog_rollback(THD *thd, bool all)
int binlog_rollback(THD *thd, bool all)
{
DBUG_ENTER("binlog_rollback");
@@ -9053,6 +9052,7 @@ MYSQL_BIN_LOG::write_transaction_to_binlog_events(group_commit_entry *entry)
bool
MYSQL_BIN_LOG::write_transaction_with_group_commit(group_commit_entry *entry)
{
DEBUG_SYNC(entry->thd, "before_group_commit_queue");
int is_leader= queue_for_group_commit(entry);
#ifdef WITH_WSREP

View File

@@ -1507,6 +1507,7 @@ const char *
get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list);
int binlog_commit(THD *thd, bool all, bool is_ro_1pc= false);
int binlog_rollback(THD *thd, bool all);
int binlog_commit_by_xid(XID *xid);
int binlog_rollback_by_xid(XID *xid);
bool write_bin_log_start_alter(THD *thd, bool& partial_alter,

View File

@@ -209,7 +209,7 @@ private:
Log_event *m_ev; // Used for Flashback
};
#ifndef DBUG_OFF
#if !defined DBUG_OFF && defined DBUG_TRACE
#define DBUG_DUMP_EVENT_BUF(B,L) \
do { \
const uchar *_buf=(uchar*)(B); \

View File

@@ -75,9 +75,19 @@ void handler::calculate_costs(Cost_estimate *cost, uint keyno,
{
/* Clustered index */
io_blocks= unassigned_single_point_ranges;
cost->index_cost= ha_keyread_time(keyno, n_ranges,
total_rows + multi_row_ranges,
io_blocks);
if (TEST_NEW_MODE_FLAG(table->in_use, NEW_MODE_FIX_INDEX_LOOKUP_COST))
{
cost->index_cost=
ha_keyread_clustered_time(keyno, n_ranges,
total_rows + multi_row_ranges,
io_blocks);
}
else
{
cost->index_cost= ha_keyread_time(keyno, n_ranges,
total_rows + multi_row_ranges,
io_blocks);
}
cost->copy_cost= rows2double(total_rows) * ROW_COPY_COST;
}
/* Adjust io cost to data size */
@@ -178,11 +188,9 @@ handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
*/
ulonglong unassigned_single_point_ranges= 0;
uint len= table->key_info[keyno].key_length + table->file->ref_length;
if (table->file->is_clustering_key(keyno))
len= table->s->stored_rec_length;
size_t len= table->key_storage_length(keyno);
/* Assume block is 75 % full */
uint avg_block_records= ((uint) (stats.block_size*3/4))/len + 1;
size_t avg_block_records= ((uint) (stats.block_size*3/4))/len + 1;
uint limit= thd->variables.eq_range_index_dive_limit;
bool use_statistics_for_eq_range= eq_ranges_exceeds_limit(seq,
seq_init_param,

View File

@@ -5454,8 +5454,14 @@ static int init_server_components()
#endif
if ((ho_error= handle_options(&remaining_argc, &remaining_argv, removed_opts,
mysqld_get_one_option)))
mysqld_get_one_option))) {
#ifdef WITH_WSREP
Wsrep_server_state::instance().disable_node_reset();
#endif
unireg_abort(ho_error);
}
/* Add back the program name handle_options removes */
remaining_argc++;
remaining_argv--;

View File

@@ -14289,6 +14289,38 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
double *read_cost, ha_rows *records);
/*
@brief
Check if index keynr is clustered and the query only uses its explicitly
defined parts.
@detail
Clustered PK indexes are not present in table->covering_keys (one can say
a clustered index is always covering as it has all table's fields in it).
This function checks if the set of columns in the index definition
PRIMARY KEY(col1, ... colN) is covering for the quey.
*/
static bool index_is_clustered_covering(const TABLE *table, uint keynr)
{
if (!table->file->is_clustering_key(keynr))
return false;
/*
Check that all fields used by the query are explicitly present
in the index.
*/
for (uint i= bitmap_get_first_set(table->read_set);
i != MY_BIT_NONE;
i= bitmap_get_next_set(table->read_set, i))
{
if (!table->field[i]->part_of_key.is_set(keynr))
return false;
}
return true;
}
/**
Test if this access method is applicable to a GROUP query with MIN/MAX
functions, and if so, construct a new TRP object.
@@ -14644,7 +14676,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time)
(was also: "Exclude UNIQUE indexes ..." but this was removed because
there are cases Loose Scan over a multi-part index is useful).
*/
if (!table->covering_keys.is_set(cur_index) ||
if ((!table->covering_keys.is_set(cur_index) &&
!index_is_clustered_covering(table, cur_index)) ||
!table->keys_in_use_for_group_by.is_set(cur_index))
{
cause= "not covering";

View File

@@ -734,6 +734,7 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
11. It is first optimisation (the subquery could be moved from ON
clause during first optimisation and then be considered for SJ
on the second when it is too late)
13. Subquery does not have ROWNUM
There are also other requirements which cannot be checked at this phase,
yet. They are checked later in convert_join_subqueries_to_semijoins(),
@@ -752,7 +753,8 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
!((join->select_options | // 10
select_lex->outer_select()->join->select_options) // 10
& SELECT_STRAIGHT_JOIN) && // 10
select_lex->first_cond_optimization) // 11
select_lex->first_cond_optimization && // 11
!select_lex->with_rownum) // 13
{
DBUG_PRINT("info", ("Subquery is semi-join conversion candidate"));

View File

@@ -820,6 +820,7 @@ bool partition_info::vers_set_hist_part(THD *thd, uint *create_count)
return 0;
}
else if (vers_info->interval.is_set() &&
/* Left boundary is closed */
vers_info->hist_part->range_value <= (longlong) thd->query_start())
{
partition_element *next= NULL;
@@ -831,7 +832,8 @@ bool partition_info::vers_set_hist_part(THD *thd, uint *create_count)
while ((next= it++) != vers_info->now_part)
{
vers_info->hist_part= next;
if (next->range_value > (longlong) thd->query_start())
/* Right boundary is open */
if ((longlong)thd->query_start() < next->range_value)
{
error= false;
break;

View File

@@ -100,7 +100,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
length is stored in little-endian format, since this is the
format used for the binlog.
*/
#ifndef DBUG_OFF
#if !defined DBUG_OFF && defined DBUG_TRACE
const uchar *old_pack_ptr= pack_ptr;
#endif
pack_ptr= field->pack(pack_ptr, field->ptr + offset,

View File

@@ -267,6 +267,19 @@ public:
virtual const Class_info *get_class_info() const=0;
virtual uint32 get_data_size() const=0;
/*
The 'binary_valid' spatial object can be stored in the database
and be the correct argument to the spatial functions.
It can still be not valid by the OPENGIS standard like
having self-intersecting borders.
*/
bool is_binary_valid() const
{
uint32 data_size= get_data_size();
return (data_size == GET_SIZE_ERROR) ? false : !no_data(m_data, data_size);
}
virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0;
/* returns the length of the wkb that was read */
virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,

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