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
2c766538
Commit
2c766538
authored
Aug 23, 2018
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test cases for MDEV-17017 and MDEV-16930 into compat/oracle
parent
b4cf8557
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
0 deletions
+128
-0
mysql-test/suite/compat/oracle/r/table_value_constr.result
mysql-test/suite/compat/oracle/r/table_value_constr.result
+84
-0
mysql-test/suite/compat/oracle/t/table_value_constr.test
mysql-test/suite/compat/oracle/t/table_value_constr.test
+44
-0
No files found.
mysql-test/suite/compat/oracle/r/table_value_constr.result
View file @
2c766538
...
@@ -2099,3 +2099,87 @@ v
...
@@ -2099,3 +2099,87 @@ v
#
#
with t as (values (),()) select 1 from t;
with t as (values (),()) select 1 from t;
ERROR HY000: Row with no elements is not allowed in table value constructor in this context
ERROR HY000: Row with no elements is not allowed in table value constructor in this context
#
# MDEV-17017: TVC in derived table
#
create table t1 (a int);
insert into t1 values (9), (3), (2);
select * from (values (7), (5), (8), (1), (3), (8), (1)) t;
7
7
5
8
1
3
8
1
explain select * from (values (7), (5), (8), (1), (3), (8), (1)) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
select * from (values (1,11), (7,77), (3,31), (4,42)) t;
1 11
1 11
7 77
3 31
4 42
explain select * from (values (1,11), (7,77), (3,31), (4,42)) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
select * from (values (7), (5), (8), (1) union values (3), (8), (1)) t;
7
7
5
8
1
3
explain select * from (values (7), (5), (8), (1) union values (3), (8), (1)) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
select * from (values (7), (5), (8), (1) union select * from t1) t;
7
7
5
8
1
9
3
2
explain select * from (values (7), (5), (8), (1) union select * from t1) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION t1 ALL NULL NULL NULL NULL 3
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
drop table t1;
#
# MDEV-16930: expression in the first row of TVC specifying derived table
#
SELECT 1 + 1, 2, 'abc';
1 + 1 2 abc
2 2 abc
SELECT * FROM (SELECT 1 + 1, 2, 'abc') t;
1 + 1 2 abc
2 2 abc
WITH cte AS (SELECT 1 + 1, 2, 'abc') SELECT * FROM cte;
1 + 1 2 abc
2 2 abc
SELECT 1 + 1, 2, 'abc' UNION SELECT 3+4, 3, 'abc';
1 + 1 2 abc
2 2 abc
7 3 abc
CREATE VIEW v1 AS SELECT 1 + 1, 2, 'abc';
SELECT * FROM v1;
1 + 1 2 abc
2 2 abc
DROP VIEW v1;
VALUES(1 + 1,2,'abc');
1 + 1 2 abc
2 2 abc
SELECT * FROM (VALUES(1 + 1,2,'abc')) t;
1 + 1 2 abc
2 2 abc
mysql-test/suite/compat/oracle/t/table_value_constr.test
View file @
2c766538
...
@@ -1081,3 +1081,47 @@ DELIMITER ;|
...
@@ -1081,3 +1081,47 @@ DELIMITER ;|
--
error
ER_EMPTY_ROW_IN_TVC
--
error
ER_EMPTY_ROW_IN_TVC
with
t
as
(
values
(),())
select
1
from
t
;
with
t
as
(
values
(),())
select
1
from
t
;
--
echo
#
--
echo
# MDEV-17017: TVC in derived table
--
echo
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
9
),
(
3
),
(
2
);
let
$q1
=
select
*
from
(
values
(
7
),
(
5
),
(
8
),
(
1
),
(
3
),
(
8
),
(
1
))
t
;
eval
$q1
;
eval
explain
$q1
;
let
$q2
=
select
*
from
(
values
(
1
,
11
),
(
7
,
77
),
(
3
,
31
),
(
4
,
42
))
t
;
eval
$q2
;
eval
explain
$q2
;
let
$q3
=
select
*
from
(
values
(
7
),
(
5
),
(
8
),
(
1
)
union
values
(
3
),
(
8
),
(
1
))
t
;
eval
$q3
;
eval
explain
$q3
;
let
$q4
=
select
*
from
(
values
(
7
),
(
5
),
(
8
),
(
1
)
union
select
*
from
t1
)
t
;
eval
$q4
;
eval
explain
$q4
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-16930: expression in the first row of TVC specifying derived table
--
echo
#
SELECT
1
+
1
,
2
,
'abc'
;
SELECT
*
FROM
(
SELECT
1
+
1
,
2
,
'abc'
)
t
;
WITH
cte
AS
(
SELECT
1
+
1
,
2
,
'abc'
)
SELECT
*
FROM
cte
;
SELECT
1
+
1
,
2
,
'abc'
UNION
SELECT
3
+
4
,
3
,
'abc'
;
CREATE
VIEW
v1
AS
SELECT
1
+
1
,
2
,
'abc'
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
VALUES
(
1
+
1
,
2
,
'abc'
);
SELECT
*
FROM
(
VALUES
(
1
+
1
,
2
,
'abc'
))
t
;
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