mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch '10.2' into 10.3
This commit is contained in:
@ -692,7 +692,7 @@ SET GLOBAL READ_ONLY = 1;
|
|||||||
|
|
||||||
connect u1_con,localhost,mysqltest_u1,,events_test;
|
connect u1_con,localhost,mysqltest_u1,,events_test;
|
||||||
|
|
||||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
|
||||||
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
||||||
|
|
||||||
ALTER EVENT e1 COMMENT 'comment';
|
ALTER EVENT e1 COMMENT 'comment';
|
||||||
@ -703,7 +703,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can
|
|||||||
|
|
||||||
connect root_con,localhost,root,,events_test;
|
connect root_con,localhost,root,,events_test;
|
||||||
|
|
||||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
|
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
|
||||||
|
|
||||||
|
@ -1029,7 +1029,7 @@ SET GLOBAL READ_ONLY = 1;
|
|||||||
--echo
|
--echo
|
||||||
|
|
||||||
--error ER_OPTION_PREVENTS_STATEMENT
|
--error ER_OPTION_PREVENTS_STATEMENT
|
||||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
@ -1049,7 +1049,7 @@ DROP EVENT e1;
|
|||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
|
@ -1491,6 +1491,19 @@ x
|
|||||||
x
|
x
|
||||||
DEALLOCATE PREPARE stmt;
|
DEALLOCATE PREPARE stmt;
|
||||||
#
|
#
|
||||||
|
# MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
|
||||||
|
# (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
|
||||||
|
# or alike failed upon SELECT with mix of functions from simple view
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;
|
||||||
|
ISNULL( BENCHMARK(1, MIN(a)))
|
||||||
|
0
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# Start of 10.2 tests
|
# Start of 10.2 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -1139,6 +1139,21 @@ PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
|
|||||||
EXECUTE stmt;
|
EXECUTE stmt;
|
||||||
DEALLOCATE PREPARE stmt;
|
DEALLOCATE PREPARE stmt;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
|
||||||
|
--echo # (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
|
||||||
|
--echo # or alike failed upon SELECT with mix of functions from simple view
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
|
||||||
|
SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;
|
||||||
|
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Start of 10.2 tests
|
--echo # Start of 10.2 tests
|
||||||
|
@ -2828,6 +2828,22 @@ SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
|
|||||||
0
|
0
|
||||||
drop table t1;
|
drop table t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-20922: Adding an order by changes the query results
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(a int, b int);
|
||||||
|
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);
|
||||||
|
create view v1 as select a, b+1 as x from t1;
|
||||||
|
SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
|
||||||
|
x y
|
||||||
|
101 2
|
||||||
|
201 2
|
||||||
|
SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
|
||||||
|
x y
|
||||||
|
101 2
|
||||||
|
201 2
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
# MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
|
# MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
|
||||||
#
|
#
|
||||||
create table t1 (a int,b int) ;
|
create table t1 (a int,b int) ;
|
||||||
|
@ -1945,6 +1945,20 @@ INSERT INTO t1 VALUES (0,'foo'),(1,'bar');
|
|||||||
SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
|
SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-20922: Adding an order by changes the query results
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1(a int, b int);
|
||||||
|
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);
|
||||||
|
|
||||||
|
create view v1 as select a, b+1 as x from t1;
|
||||||
|
|
||||||
|
SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
|
||||||
|
SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
|
--echo # MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -5530,12 +5530,12 @@ sub server_need_restart {
|
|||||||
{
|
{
|
||||||
delete $server->{'restart_opts'};
|
delete $server->{'restart_opts'};
|
||||||
my $use_dynamic_option_switch= 0;
|
my $use_dynamic_option_switch= 0;
|
||||||
delete $server->{'restart_opts'};
|
my $restart_opts = delete $server->{'restart_opts'} || [];
|
||||||
if (!$use_dynamic_option_switch)
|
if (!$use_dynamic_option_switch)
|
||||||
{
|
{
|
||||||
mtr_verbose_restart($server, "running with different options '" .
|
mtr_verbose_restart($server, "running with different options '" .
|
||||||
join(" ", @{$extra_opts}) . "' != '" .
|
join(" ", @{$extra_opts}) . "' != '" .
|
||||||
join(" ", @{$started_opts}) . "'" );
|
join(" ", @{$started_opts}, @{$restart_opts}) . "'" );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ wsrep_provider=@ENV.WSREP_PROVIDER
|
|||||||
[mysqld.1]
|
[mysqld.1]
|
||||||
#galera_port=@OPT.port
|
#galera_port=@OPT.port
|
||||||
#sst_port=@OPT.port
|
#sst_port=@OPT.port
|
||||||
|
wsrep-on=1
|
||||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
|
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
|
||||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||||
wsrep_node_name=test-node-1
|
wsrep_node_name=test-node-1
|
||||||
@ -18,6 +19,7 @@ wsrep_node_name=test-node-1
|
|||||||
[mysqld.2]
|
[mysqld.2]
|
||||||
#galera_port=@OPT.port
|
#galera_port=@OPT.port
|
||||||
#sst_port=@OPT.port
|
#sst_port=@OPT.port
|
||||||
|
wsrep-on=1
|
||||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
|
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
|
||||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||||
|
40
sql/item.cc
40
sql/item.cc
@ -9251,6 +9251,46 @@ bool Item_direct_view_ref::excl_dep_on_grouping_fields(st_select_lex *sel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double Item_direct_view_ref::val_result()
|
||||||
|
{
|
||||||
|
double tmp=(*ref)->val_result();
|
||||||
|
null_value=(*ref)->null_value;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
longlong Item_direct_view_ref::val_int_result()
|
||||||
|
{
|
||||||
|
longlong tmp=(*ref)->val_int_result();
|
||||||
|
null_value=(*ref)->null_value;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String *Item_direct_view_ref::str_result(String* tmp)
|
||||||
|
{
|
||||||
|
tmp=(*ref)->str_result(tmp);
|
||||||
|
null_value=(*ref)->null_value;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
my_decimal *Item_direct_view_ref::val_decimal_result(my_decimal *val)
|
||||||
|
{
|
||||||
|
my_decimal *tmp= (*ref)->val_decimal_result(val);
|
||||||
|
null_value=(*ref)->null_value;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Item_direct_view_ref::val_bool_result()
|
||||||
|
{
|
||||||
|
bool tmp= (*ref)->val_bool_result();
|
||||||
|
null_value=(*ref)->null_value;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Item_default_value::eq(const Item *item, bool binary_cmp) const
|
bool Item_default_value::eq(const Item *item, bool binary_cmp) const
|
||||||
{
|
{
|
||||||
return item->type() == DEFAULT_VALUE_ITEM &&
|
return item->type() == DEFAULT_VALUE_ITEM &&
|
||||||
|
@ -5392,6 +5392,15 @@ public:
|
|||||||
item_equal= NULL;
|
item_equal= NULL;
|
||||||
Item_direct_ref::cleanup();
|
Item_direct_ref::cleanup();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
TODO move these val_*_result function to Item_dierct_ref (maybe)
|
||||||
|
*/
|
||||||
|
double val_result();
|
||||||
|
longlong val_int_result();
|
||||||
|
String *str_result(String* tmp);
|
||||||
|
my_decimal *val_decimal_result(my_decimal *val);
|
||||||
|
bool val_bool_result();
|
||||||
|
|
||||||
Item *get_copy(THD *thd)
|
Item *get_copy(THD *thd)
|
||||||
{ return get_item_copy<Item_direct_view_ref>(thd, this); }
|
{ return get_item_copy<Item_direct_view_ref>(thd, this); }
|
||||||
};
|
};
|
||||||
|
@ -4480,7 +4480,7 @@ void SELECT_LEX::update_used_tables()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item *item;
|
Item *item;
|
||||||
List_iterator_fast<Item> it(join->fields_list);
|
List_iterator_fast<Item> it(join->all_fields);
|
||||||
select_list_tables= 0;
|
select_list_tables= 0;
|
||||||
while ((item= it++))
|
while ((item= it++))
|
||||||
{
|
{
|
||||||
|
@ -7537,33 +7537,6 @@ btr_store_big_rec_extern_fields(
|
|||||||
/* Initialize the unused "prev page" pointer */
|
/* Initialize the unused "prev page" pointer */
|
||||||
mlog_write_ulint(page + FIL_PAGE_PREV,
|
mlog_write_ulint(page + FIL_PAGE_PREV,
|
||||||
FIL_NULL, MLOG_4BYTES, &mtr);
|
FIL_NULL, MLOG_4BYTES, &mtr);
|
||||||
/* Write a back pointer to the record
|
|
||||||
into the otherwise unused area. This
|
|
||||||
information could be useful in
|
|
||||||
debugging. Later, we might want to
|
|
||||||
implement the possibility to relocate
|
|
||||||
BLOB pages. Then, we would need to be
|
|
||||||
able to adjust the BLOB pointer in the
|
|
||||||
record. We do not store the heap
|
|
||||||
number of the record, because it can
|
|
||||||
change in page_zip_reorganize() or
|
|
||||||
btr_page_reorganize(). However, also
|
|
||||||
the page number of the record may
|
|
||||||
change when B-tree nodes are split or
|
|
||||||
merged.
|
|
||||||
NOTE: FIL_PAGE_FILE_FLUSH_LSN space is
|
|
||||||
used by R-tree index for a Split Sequence
|
|
||||||
Number */
|
|
||||||
ut_ad(!dict_index_is_spatial(index));
|
|
||||||
|
|
||||||
mlog_write_ulint(page
|
|
||||||
+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
|
|
||||||
space_id,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
mlog_write_ulint(page
|
|
||||||
+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4,
|
|
||||||
rec_page_no,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
|
|
||||||
/* Zero out the unused part of the page. */
|
/* Zero out the unused part of the page. */
|
||||||
memset(page + page_zip_get_size(page_zip)
|
memset(page + page_zip_get_size(page_zip)
|
||||||
|
Reference in New Issue
Block a user