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
7e2fa49e
Commit
7e2fa49e
authored
Nov 03, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
f9948a3e
17e509b2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
198 additions
and
16 deletions
+198
-16
configure.in
configure.in
+1
-1
mysql-test/r/ps.result
mysql-test/r/ps.result
+38
-0
mysql-test/suite/innodb/r/innodb_bug57255.result
mysql-test/suite/innodb/r/innodb_bug57255.result
+10
-0
mysql-test/suite/innodb/t/innodb_bug57255.test
mysql-test/suite/innodb/t/innodb_bug57255.test
+36
-0
mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
+10
-0
mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
+36
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+22
-0
sql/item_subselect.cc
sql/item_subselect.cc
+15
-11
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-0
storage/innobase/row/row0mysql.c
storage/innobase/row/row0mysql.c
+9
-0
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/ChangeLog
+8
-4
storage/innodb_plugin/row/row0mysql.c
storage/innodb_plugin/row/row0mysql.c
+9
-0
No files found.
configure.in
View file @
7e2fa49e
...
...
@@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement
in
mysqlbinlog::check_master_version
()
.
You may also need
dnl to update version.c
in
ndb.
AC_INIT
([
MySQL Server],
[
5.1.5
2
],
[]
,
[
mysql]
)
AC_INIT
([
MySQL Server],
[
5.1.5
4
],
[]
,
[
mysql]
)
AC_CONFIG_SRCDIR
([
sql/mysqld.cc]
)
AC_CANONICAL_SYSTEM
...
...
mysql-test/r/ps.result
View file @
7e2fa49e
...
...
@@ -3001,4 +3001,42 @@ EXECUTE stmt;
1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
#
# Bug#54494 crash with explain extended and prepared statements
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2);
PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
#
# Bug#54488 crash when using explain and prepared statements with subqueries
#
CREATE TABLE t1(f1 INT);
INSERT INTO t1 VALUES (1),(1);
PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
mysql-test/suite/innodb/r/innodb_bug57255.result
0 → 100644
View file @
7e2fa49e
create table A(id int not null primary key) engine=innodb;
create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
insert into A values(1), (2);
DELETE FROM A where id = 1;
DELETE FROM C where f1 = 2;
DELETE FROM A where id = 1;
DROP TABLE C;
DROP TABLE B;
DROP TABLE A;
mysql-test/suite/innodb/t/innodb_bug57255.test
0 → 100644
View file @
7e2fa49e
# Test Bug #57255. Cascade deletes that affect different rows should not
# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
--
source
include
/
have_innodb
.
inc
create
table
A
(
id
int
not
null
primary
key
)
engine
=
innodb
;
create
table
B
(
id
int
not
null
auto_increment
primary
key
,
f1
int
not
null
,
foreign
key
(
f1
)
references
A
(
id
)
on
delete
cascade
)
engine
=
innodb
;
create
table
C
(
id
int
not
null
auto_increment
primary
key
,
f1
int
not
null
,
foreign
key
(
f1
)
references
B
(
id
)
on
delete
cascade
)
engine
=
innodb
;
insert
into
A
values
(
1
),
(
2
);
--
disable_query_log
let
$i
=
257
;
while
(
$i
)
{
insert
into
B
(
f1
)
values
(
1
);
dec
$i
;
}
let
$i
=
486
;
while
(
$i
)
{
insert
into
C
(
f1
)
values
(
2
);
dec
$i
;
}
--
enable_query_log
# Following Deletes should not report error
DELETE
FROM
A
where
id
=
1
;
DELETE
FROM
C
where
f1
=
2
;
DELETE
FROM
A
where
id
=
1
;
DROP
TABLE
C
;
DROP
TABLE
B
;
DROP
TABLE
A
;
mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
0 → 100644
View file @
7e2fa49e
create table A(id int not null primary key) engine=innodb;
create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
insert into A values(1), (2);
DELETE FROM A where id = 1;
DELETE FROM C where f1 = 2;
DELETE FROM A where id = 1;
DROP TABLE C;
DROP TABLE B;
DROP TABLE A;
mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
0 → 100644
View file @
7e2fa49e
# Test Bug #57255. Cascade deletes that affect different rows should not
# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
--
source
include
/
have_innodb_plugin
.
inc
create
table
A
(
id
int
not
null
primary
key
)
engine
=
innodb
;
create
table
B
(
id
int
not
null
auto_increment
primary
key
,
f1
int
not
null
,
foreign
key
(
f1
)
references
A
(
id
)
on
delete
cascade
)
engine
=
innodb
;
create
table
C
(
id
int
not
null
auto_increment
primary
key
,
f1
int
not
null
,
foreign
key
(
f1
)
references
B
(
id
)
on
delete
cascade
)
engine
=
innodb
;
insert
into
A
values
(
1
),
(
2
);
--
disable_query_log
let
$i
=
257
;
while
(
$i
)
{
insert
into
B
(
f1
)
values
(
1
);
dec
$i
;
}
let
$i
=
486
;
while
(
$i
)
{
insert
into
C
(
f1
)
values
(
2
);
dec
$i
;
}
--
enable_query_log
# Following Deletes should not report error
DELETE
FROM
A
where
id
=
1
;
DELETE
FROM
C
where
f1
=
2
;
DELETE
FROM
A
where
id
=
1
;
DROP
TABLE
C
;
DROP
TABLE
B
;
DROP
TABLE
A
;
mysql-test/t/ps.test
View file @
7e2fa49e
...
...
@@ -3079,4 +3079,26 @@ EXECUTE stmt;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#54494 crash with explain extended and prepared statements
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
PREPARE
stmt
FROM
'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1'
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#54488 crash when using explain and prepared statements with subqueries
--
echo
#
CREATE
TABLE
t1
(
f1
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
1
);
PREPARE
stmt
FROM
'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))'
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
.
sql/item_subselect.cc
View file @
7e2fa49e
...
...
@@ -1907,18 +1907,22 @@ int subselect_single_select_engine::exec()
}
if
(
!
select_lex
->
uncacheable
&&
thd
->
lex
->
describe
&&
!
(
join
->
select_options
&
SELECT_DESCRIBE
)
&&
join
->
need_tmp
&&
item
->
const_item
()
)
join
->
need_tmp
)
{
/*
Force join->join_tmp creation, because this subquery will be replaced
by a simple select from the materialization temp table by optimize()
called by EXPLAIN and we need to preserve the initial query structure
so we can display it.
*/
select_lex
->
uncacheable
|=
UNCACHEABLE_EXPLAIN
;
select_lex
->
master_unit
()
->
uncacheable
|=
UNCACHEABLE_EXPLAIN
;
if
(
join
->
init_save_join_tab
())
DBUG_RETURN
(
1
);
/* purecov: inspected */
item
->
update_used_tables
();
if
(
item
->
const_item
())
{
/*
Force join->join_tmp creation, because this subquery will be replaced
by a simple select from the materialization temp table by optimize()
called by EXPLAIN and we need to preserve the initial query structure
so we can display it.
*/
select_lex
->
uncacheable
|=
UNCACHEABLE_EXPLAIN
;
select_lex
->
master_unit
()
->
uncacheable
|=
UNCACHEABLE_EXPLAIN
;
if
(
join
->
init_save_join_tab
())
DBUG_RETURN
(
1
);
/* purecov: inspected */
}
}
if
(
item
->
engine_changed
)
{
...
...
sql/sql_prepare.cc
View file @
7e2fa49e
...
...
@@ -2362,11 +2362,15 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
sl
->
where
=
sl
->
prep_where
->
copy_andor_structure
(
thd
);
sl
->
where
->
cleanup
();
}
else
sl
->
where
=
NULL
;
if
(
sl
->
prep_having
)
{
sl
->
having
=
sl
->
prep_having
->
copy_andor_structure
(
thd
);
sl
->
having
->
cleanup
();
}
else
sl
->
having
=
NULL
;
DBUG_ASSERT
(
sl
->
join
==
0
);
ORDER
*
order
;
/* Fix GROUP list */
...
...
storage/innobase/row/row0mysql.c
View file @
7e2fa49e
...
...
@@ -1613,6 +1613,9 @@ row_update_cascade_for_mysql(
trx
=
thr_get_trx
(
thr
);
/* Increment fk_cascade_depth to record the recursive call depth on
a single update/delete that affects multiple tables chained
together with foreign key relations. */
thr
->
fk_cascade_depth
++
;
if
(
thr
->
fk_cascade_depth
>
FK_MAX_CASCADE_DEL
)
{
...
...
@@ -1624,6 +1627,12 @@ run_again:
row_upd_step
(
thr
);
/* The recursive call for cascading update/delete happens
in above row_upd_step(), reset the counter once we come
out of the recursive call, so it does not accumulate for
different row deletes */
thr
->
fk_cascade_depth
=
0
;
err
=
trx
->
error_state
;
/* Note that the cascade node is a subnode of another InnoDB
...
...
storage/innodb_plugin/ChangeLog
View file @
7e2fa49e
...
...
@@ -39,10 +39,14 @@
2010-10-11 The InnoDB Team
* row/row0sel.c:
Fix Bug#57345 btr_pcur_store_position abort for load with concurrent
lock/unlock tables
* row/row0sel.c
Fix Bug #57345 btr_pcur_store_position abort for load with
concurrent lock/unlock tables
2010-10-06 The InnoDB Team
* row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
Fix Bug #Cascade Delete results in "Got error -1 from storage engine"
2010-09-27 The InnoDB Team
* row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
...
...
storage/innodb_plugin/row/row0mysql.c
View file @
7e2fa49e
...
...
@@ -1593,6 +1593,9 @@ row_update_cascade_for_mysql(
trx
=
thr_get_trx
(
thr
);
/* Increment fk_cascade_depth to record the recursive call depth on
a single update/delete that affects multiple tables chained
together with foreign key relations. */
thr
->
fk_cascade_depth
++
;
if
(
thr
->
fk_cascade_depth
>
FK_MAX_CASCADE_DEL
)
{
...
...
@@ -1604,6 +1607,12 @@ run_again:
row_upd_step
(
thr
);
/* The recursive call for cascading update/delete happens
in above row_upd_step(), reset the counter once we come
out of the recursive call, so it does not accumulate for
different row deletes */
thr
->
fk_cascade_depth
=
0
;
err
=
trx
->
error_state
;
/* Note that the cascade node is a subnode of another InnoDB
...
...
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