Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b35290e1
Commit
b35290e1
authored
Jan 03, 2020
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' into 10.2
parents
ef1e488b
4d7f0735
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
7 deletions
+114
-7
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+2
-2
mysql-test/r/events_bugs.result
mysql-test/r/events_bugs.result
+2
-2
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+13
-0
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+16
-0
mysql-test/t/events_bugs.test
mysql-test/t/events_bugs.test
+2
-2
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+15
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+14
-0
sql/item.cc
sql/item.cc
+40
-0
sql/item.h
sql/item.h
+9
-0
sql/sql_lex.cc
sql/sql_lex.cc
+1
-1
No files found.
mysql-test/mysql-test-run.pl
View file @
b35290e1
...
...
@@ -5514,12 +5514,12 @@ sub server_need_restart {
exists
$server
->
{'
restart_opts
'})
{
my
$use_dynamic_option_switch
=
0
;
delete
$server
->
{'
restart_opts
'}
;
my
$restart_opts
=
delete
$server
->
{'
restart_opts
'}
||
[]
;
if
(
!
$use_dynamic_option_switch
)
{
mtr_verbose_restart
(
$server
,
"
running with different options '
"
.
join
("
",
@
{
$extra_opts
})
.
"
' != '
"
.
join
("
",
@
{
$started_opts
})
.
"
'
"
);
join
("
",
@
{
$started_opts
}
,
@
{
$restart_opts
}
)
.
"
'
"
);
return
1
;
}
...
...
mysql-test/r/events_bugs.result
View file @
b35290e1
...
...
@@ -692,7 +692,7 @@ SET GLOBAL READ_ONLY = 1;
connect u1_con,localhost,mysqltest_u1,,events_test;
CREATE EVENT e1 ON SCHEDULE AT '20
20
-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '20
38
-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
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;
CREATE EVENT e1 ON SCHEDULE AT '20
20
-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '20
38
-01-01 00:00:00' DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
...
...
mysql-test/r/func_misc.result
View file @
b35290e1
...
...
@@ -1491,6 +1491,19 @@ x
x
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
#
#
...
...
mysql-test/r/group_by.result
View file @
b35290e1
...
...
@@ -2827,6 +2827,22 @@ SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
0
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
#
create table t1 (a int,b int) ;
...
...
mysql-test/t/events_bugs.test
View file @
b35290e1
...
...
@@ -1029,7 +1029,7 @@ SET GLOBAL READ_ONLY = 1;
--
echo
--
error
ER_OPTION_PREVENTS_STATEMENT
CREATE
EVENT
e1
ON
SCHEDULE
AT
'20
20
-01-01 00:00:00'
DO
SET
@
a
=
1
;
CREATE
EVENT
e1
ON
SCHEDULE
AT
'20
38
-01-01 00:00:00'
DO
SET
@
a
=
1
;
--
echo
...
...
@@ -1049,7 +1049,7 @@ DROP EVENT e1;
--
echo
CREATE
EVENT
e1
ON
SCHEDULE
AT
'20
20
-01-01 00:00:00'
DO
SET
@
a
=
1
;
CREATE
EVENT
e1
ON
SCHEDULE
AT
'20
38
-01-01 00:00:00'
DO
SET
@
a
=
1
;
--
echo
...
...
mysql-test/t/func_misc.test
View file @
b35290e1
...
...
@@ -1139,6 +1139,21 @@ PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
EXECUTE
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
# Start of 10.2 tests
...
...
mysql-test/t/group_by.test
View file @
b35290e1
...
...
@@ -1945,6 +1945,20 @@ INSERT INTO t1 VALUES (0,'foo'),(1,'bar');
SELECT
1
IN
(
SELECT
COUNT
(
DISTINCT
f2
)
FROM
t1
WHERE
f1
<=
4
);
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
# MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
--
echo
#
...
...
sql/item.cc
View file @
b35290e1
...
...
@@ -8876,6 +8876,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
{
return
item
->
type
()
==
DEFAULT_VALUE_ITEM
&&
...
...
sql/item.h
View file @
b35290e1
...
...
@@ -4978,6 +4978,15 @@ class Item_direct_view_ref :public Item_direct_ref
item_equal
=
NULL
;
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
,
MEM_ROOT
*
mem_root
)
{
return
get_item_copy
<
Item_direct_view_ref
>
(
thd
,
mem_root
,
this
);
}
};
...
...
sql/sql_lex.cc
View file @
b35290e1
...
...
@@ -4249,7 +4249,7 @@ void SELECT_LEX::update_used_tables()
}
Item
*
item
;
List_iterator_fast
<
Item
>
it
(
join
->
fields_list
);
List_iterator_fast
<
Item
>
it
(
join
->
all_fields
);
select_list_tables
=
0
;
while
((
item
=
it
++
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment