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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c6cd5179
Commit
c6cd5179
authored
Jun 22, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-review changes (Bug#4090)
parent
cb0f607c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+20
-5
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+9
-1
No files found.
mysql-test/r/subselect.result
View file @
c6cd5179
...
...
@@ -1841,11 +1841,6 @@ id name id pet
2 Rebecca 2 Spot
3 NULL 3 Felix
drop table t1,t2;
DROP TABLE IF EXISTS t1, t2, t3;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
Note 1051 Unknown table 't3'
CREATE TABLE t1 ( a int, b int );
CREATE TABLE t2 ( c int, d int );
INSERT INTO t1 VALUES (1,2), (2,3), (3,4);
...
...
@@ -1866,4 +1861,24 @@ abc b
1 2
2 3
3 4
prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
execute stmt1;
deallocate prepare stmt1;
select * from t2;
c d
1 2
2 3
3 4
1 2
2 3
3 4
drop table t3;
prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
execute stmt1;
select * from t3;
abc b
1 2
2 3
3 4
deallocate prepare stmt1;
DROP TABLE t1, t2, t3;
mysql-test/t/subselect.test
View file @
c6cd5179
...
...
@@ -1182,7 +1182,6 @@ drop table t1,t2;
#
# outer fields resolving in INSERT/REPLACE and CRETE with SELECT
#
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
;
CREATE
TABLE
t1
(
a
int
,
b
int
);
CREATE
TABLE
t2
(
c
int
,
d
int
);
INSERT
INTO
t1
VALUES
(
1
,
2
),
(
2
,
3
),
(
3
,
4
);
...
...
@@ -1191,4 +1190,13 @@ INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE
select
*
from
t2
;
CREATE
TABLE
t3
SELECT
a
AS
abc
,
b
FROM
t1
WHERE
b
=
(
SELECT
MIN
(
b
)
FROM
t1
WHERE
a
=
abc
);
select
*
from
t3
;
prepare
stmt1
from
"INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"
;
execute
stmt1
;
deallocate
prepare
stmt1
;
select
*
from
t2
;
drop
table
t3
;
prepare
stmt1
from
"CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"
;
execute
stmt1
;
select
*
from
t3
;
deallocate
prepare
stmt1
;
DROP
TABLE
t1
,
t2
,
t3
;
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