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
d6646287
Commit
d6646287
authored
Jan 28, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving a feature from 4.1 to 5.0
parent
462ff190
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
47 deletions
+4
-47
mysql-test/r/insert.result
mysql-test/r/insert.result
+0
-13
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+1
-2
mysql-test/t/insert.test
mysql-test/t/insert.test
+0
-31
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+2
-1
No files found.
mysql-test/r/insert.result
View file @
d6646287
...
@@ -64,16 +64,3 @@ use test_$1;
...
@@ -64,16 +64,3 @@ use test_$1;
create table t1 (c int);
create table t1 (c int);
insert into test_$1.t1 set test_$1.t1.c = '1';
insert into test_$1.t1 set test_$1.t1.c = '1';
drop database test_$1;
drop database test_$1;
use test;
drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
select count(*) from t2;
count(*)
500
insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;
select count(*) from t2;
count(*)
25500
drop table if exists t1,t2,t3;
mysql-test/r/subselect.result
View file @
d6646287
...
@@ -578,6 +578,7 @@ x
...
@@ -578,6 +578,7 @@ x
3
3
3
3
INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
You can't specify target table 't1' for update in FROM clause
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
select * from t1;
select * from t1;
x
x
...
@@ -585,8 +586,6 @@ x
...
@@ -585,8 +586,6 @@ x
2
2
3
3
3
3
11
11
0
0
drop table t1, t2, t3;
drop table t1, t2, t3;
CREATE TABLE t1 (x int not null, y int, primary key (x));
CREATE TABLE t1 (x int not null, y int, primary key (x));
...
...
mysql-test/t/insert.test
View file @
d6646287
...
@@ -65,34 +65,3 @@ use test_$1;
...
@@ -65,34 +65,3 @@ use test_$1;
create
table
t1
(
c
int
);
create
table
t1
(
c
int
);
insert
into
test_
$
1.
t1
set
test_
$
1.
t1
.
c
=
'1'
;
insert
into
test_
$
1.
t1
set
test_
$
1.
t1
.
c
=
'1'
;
drop
database
test_
$
1
;
drop
database
test_
$
1
;
use
test
;
--
disable_warnings
drop
table
if
exists
t1
,
t2
,
t3
;
--
enable_warnings
create
table
t1
(
id1
int
not
null
auto_increment
primary
key
,
t
char
(
12
));
create
table
t2
(
id2
int
not
null
,
t
char
(
12
));
create
table
t3
(
id3
int
not
null
,
t
char
(
12
),
index
(
id3
));
disable_query_log
;
let
$
1
=
100
;
while
(
$
1
)
{
let
$
2
=
5
;
eval
insert
into
t1
(
t
)
values
(
'$1'
);
while
(
$
2
)
{
eval
insert
into
t2
(
id2
,
t
)
values
(
$
1
,
'$2'
);
let
$
3
=
10
;
while
(
$
3
)
{
eval
insert
into
t3
(
id3
,
t
)
values
(
$
1
,
'$2'
);
dec
$
3
;
}
dec
$
2
;
}
dec
$
1
;
}
enable_query_log
;
select
count
(
*
)
from
t2
;
insert
into
t2
select
t1
.*
from
t1
,
t2
t
,
t3
where
t1
.
id1
=
t
.
id2
and
t
.
id2
=
t3
.
id3
;
select
count
(
*
)
from
t2
;
drop
table
if
exists
t1
,
t2
,
t3
;
mysql-test/t/subselect.test
View file @
d6646287
...
@@ -335,6 +335,7 @@ INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
...
@@ -335,6 +335,7 @@ INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
select
*
from
t1
;
select
*
from
t1
;
INSERT
INTO
t1
(
x
)
select
(
SELECT
SUM
(
a
)
+
1
FROM
t2
)
FROM
t2
;
INSERT
INTO
t1
(
x
)
select
(
SELECT
SUM
(
a
)
+
1
FROM
t2
)
FROM
t2
;
select
*
from
t1
;
select
*
from
t1
;
--
error
1093
INSERT
INTO
t1
(
x
)
select
(
SELECT
SUM
(
x
)
+
2
FROM
t1
)
FROM
t2
;
INSERT
INTO
t1
(
x
)
select
(
SELECT
SUM
(
x
)
+
2
FROM
t1
)
FROM
t2
;
INSERT
DELAYED
INTO
t1
(
x
)
VALUES
((
SELECT
SUM
(
x
)
FROM
t2
));
INSERT
DELAYED
INTO
t1
(
x
)
VALUES
((
SELECT
SUM
(
x
)
FROM
t2
));
--
sleep
1
--
sleep
1
...
...
sql/sql_parse.cc
View file @
d6646287
...
@@ -2264,7 +2264,8 @@ mysql_execute_command(THD *thd)
...
@@ -2264,7 +2264,8 @@ mysql_execute_command(THD *thd)
if
(
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
if
(
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
{
{
lex
->
select_lex
.
options
|=
OPTION_BUFFER_RESULT
;
net_printf
(
thd
,
ER_UPDATE_TABLE_USED
,
tables
->
real_name
);
DBUG_VOID_RETURN
;
}
}
/* Skip first table, which is the table we are inserting in */
/* Skip first table, which is the table we are inserting in */
...
...
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