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
3c69d7c9
Commit
3c69d7c9
authored
Feb 19, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
parents
8d7d50f0
22a70c11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+13
-0
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+13
-1
sql/sql_delete.cc
sql/sql_delete.cc
+7
-2
No files found.
mysql-test/r/multi_update.result
View file @
3c69d7c9
...
...
@@ -360,3 +360,16 @@ where 0=1;
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb;
insert into `t1`values ( 1 ) ;
create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
insert into `t2`values ( 1 ) ;
create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
insert into `t3`values ( 1 ) ;
delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
Cannot delete or update a parent row: a foreign key constraint fails
update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
Cannot delete or update a parent row: a foreign key constraint fails
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
Unknown table 't1' in where clause
drop table t3,t2,t1;
mysql-test/t/multi_update.test
View file @
3c69d7c9
...
...
@@ -302,4 +302,16 @@ delete t1, t2 from t2,t1
where
t1
.
id1
=
t2
.
id2
and
0
=
1
;
drop
table
t1
,
t2
;
create
table
`t1`
(
`id`
int
(
11
)
not
null
,
primary
key
(
`id`
))
type
=
innodb
;
insert
into
`t1`
values
(
1
)
;
create
table
`t2`
(
`id`
int
(
11
)
not
null
default
'0'
,
unique
key
`id`
(
`id`
)
,
constraint
`t1_id_fk`
foreign
key
(
`id`
)
references
`t1`
(
`id`
))
type
=
innodb
;
insert
into
`t2`
values
(
1
)
;
create
table
`t3`
(
`id`
int
(
11
)
not
null
default
'0'
,
key
`id`
(
`id`
)
,
constraint
`t2_id_fk`
foreign
key
(
`id`
)
references
`t2`
(
`id`
))
type
=
innodb
;
insert
into
`t3`
values
(
1
)
;
--
error
1217
delete
t3
,
t2
,
t1
from
t1
,
t2
,
t3
where
t1
.
id
=
1
and
t2
.
id
=
t1
.
id
and
t3
.
id
=
t2
.
id
;
--
error
1217
update
t1
,
t2
,
t3
set
t3
.
id
=
5
,
t2
.
id
=
6
,
t1
.
id
=
7
where
t1
.
id
=
1
and
t2
.
id
=
t1
.
id
and
t3
.
id
=
t2
.
id
;
--
error
1109
update
t3
set
t3
.
id
=
7
where
t1
.
id
=
1
and
t2
.
id
=
t1
.
id
and
t3
.
id
=
t2
.
id
;
drop
table
t3
,
t2
,
t1
;
sql/sql_delete.cc
View file @
3c69d7c9
...
...
@@ -347,7 +347,7 @@ bool multi_delete::send_data(List<Item> &values)
table
->
status
|=
STATUS_DELETED
;
if
(
!
(
error
=
table
->
file
->
delete_row
(
table
->
record
[
0
])))
deleted
++
;
else
if
(
!
table_being_deleted
->
next
)
else
if
(
!
table_being_deleted
->
next
||
table_being_deleted
->
table
->
file
->
has_transactions
()
)
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
1
);
...
...
@@ -450,7 +450,12 @@ int multi_delete::do_deletes(bool from_send_error)
if
((
local_error
=
table
->
file
->
delete_row
(
table
->
record
[
0
])))
{
table
->
file
->
print_error
(
local_error
,
MYF
(
0
));
break
;
if
(
transactional_tables
)
{
DBUG_RETURN
(
local_error
);
}
else
break
;
}
deleted
++
;
}
...
...
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