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
bca64929
Commit
bca64929
authored
Jun 21, 2006
by
gkodinov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into mysql.com:/home/kgeorge/mysql/5.0/B18080
parents
4f8f4cd5
f327a8c5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+5
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+9
-0
sql/sql_parse.cc
sql/sql_parse.cc
+0
-9
No files found.
mysql-test/r/insert_select.result
View file @
bca64929
...
...
@@ -690,3 +690,8 @@ CREATE TABLE t1 (a int PRIMARY KEY);
INSERT INTO t1 values (1), (2);
INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
DROP TABLE t1;
CREATE TABLE t1 (x int, y int);
CREATE TABLE t2 (z int, y int);
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 (SELECT x, y FROM t1 JOIN t2 USING (y) WHERE z = 1);
DROP TABLE IF EXISTS t1,t2,t3;
mysql-test/t/insert_select.test
View file @
bca64929
...
...
@@ -238,3 +238,12 @@ INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
DROP
TABLE
t1
;
# End of 4.1 tests
#
# Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
#
CREATE
TABLE
t1
(
x
int
,
y
int
);
CREATE
TABLE
t2
(
z
int
,
y
int
);
CREATE
TABLE
t3
(
a
int
,
b
int
);
INSERT
INTO
t3
(
SELECT
x
,
y
FROM
t1
JOIN
t2
USING
(
y
)
WHERE
z
=
1
);
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
;
sql/sql_parse.cc
View file @
bca64929
...
...
@@ -3333,15 +3333,6 @@ end_with_restore_list:
&
lex
->
value_list
,
lex
->
duplicates
,
lex
->
ignore
)))
{
/*
Skip first table, which is the table we are inserting in.
Below we set context.table_list again because the call above to
mysql_insert_select_prepare() calls resolve_in_table_list_only(),
which in turn resets context.table_list and
context.first_name_resolution_table.
*/
select_lex
->
context
.
table_list
=
select_lex
->
context
.
first_name_resolution_table
=
second_table
;
res
=
handle_select
(
thd
,
lex
,
result
,
OPTION_SETUP_TABLES_DONE
);
/*
Invalidate the table in the query cache if something changed
...
...
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