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
7141bada
Commit
7141bada
authored
Oct 05, 2011
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1 -> 5.5 merge
parents
14572938
14dc91ff
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
3 deletions
+48
-3
mysql-test/r/error_simulation.result
mysql-test/r/error_simulation.result
+13
-0
mysql-test/t/error_simulation.test
mysql-test/t/error_simulation.test
+14
-0
sql/item_subselect.cc
sql/item_subselect.cc
+10
-3
sql/item_subselect.h
sql/item_subselect.h
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+10
-0
No files found.
mysql-test/r/error_simulation.result
View file @
7141bada
...
@@ -83,5 +83,18 @@ a a b filler
...
@@ -83,5 +83,18 @@ a a b filler
SET SESSION debug = DEFAULT;
SET SESSION debug = DEFAULT;
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
#
# Bug#11747970 34660: CRASH WHEN FEDERATED TABLE LOSES CONNECTION DURING INSERT ... SELECT
#
CREATE TABLE t1(f1 INT, KEY(f1));
CREATE TABLE t2(f1 INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SET SESSION debug='d,bug11747970_simulate_error';
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
Warnings:
Error 1105 Unknown error
SET SESSION debug = DEFAULT;
DROP TABLE t1,t2;
#
# End of 5.1 tests
# End of 5.1 tests
#
#
mysql-test/t/error_simulation.test
View file @
7141bada
...
@@ -89,6 +89,20 @@ SET SESSION debug = DEFAULT;
...
@@ -89,6 +89,20 @@ SET SESSION debug = DEFAULT;
DROP TABLE t1, t2;
DROP TABLE t1, t2;
--echo #
--echo # Bug#11747970 34660: CRASH WHEN FEDERATED TABLE LOSES CONNECTION DURING INSERT ... SELECT
--echo #
CREATE TABLE t1(f1 INT, KEY(f1));
CREATE TABLE t2(f1 INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SET SESSION debug='
d
,
bug11747970_simulate_error
'
;
INSERT
IGNORE
INTO
t2
SELECT
f1
FROM
t1
a
WHERE
NOT
EXISTS
(
SELECT
1
FROM
t2
b
WHERE
a
.
f1
=
b
.
f1
);
SET
SESSION
debug
=
DEFAULT
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
#
--
echo
# End of 5.1 tests
--
echo
# End of 5.1 tests
--
echo
#
--
echo
#
sql/item_subselect.cc
View file @
7141bada
...
@@ -1690,7 +1690,7 @@ subselect_single_select_engine(st_select_lex *select,
...
@@ -1690,7 +1690,7 @@ subselect_single_select_engine(st_select_lex *select,
select_subselect
*
result_arg
,
select_subselect
*
result_arg
,
Item_subselect
*
item_arg
)
Item_subselect
*
item_arg
)
:
subselect_engine
(
item_arg
,
result_arg
),
:
subselect_engine
(
item_arg
,
result_arg
),
prepared
(
0
),
optimized
(
0
),
executed
(
0
),
prepared
(
0
),
optimized
(
0
),
executed
(
0
),
optimize_error
(
0
),
select_lex
(
select
),
join
(
0
)
select_lex
(
select
),
join
(
0
)
{
{
select_lex
->
master_unit
()
->
item
=
item_arg
;
select_lex
->
master_unit
()
->
item
=
item_arg
;
...
@@ -1700,7 +1700,7 @@ subselect_single_select_engine(st_select_lex *select,
...
@@ -1700,7 +1700,7 @@ subselect_single_select_engine(st_select_lex *select,
void
subselect_single_select_engine
::
cleanup
()
void
subselect_single_select_engine
::
cleanup
()
{
{
DBUG_ENTER
(
"subselect_single_select_engine::cleanup"
);
DBUG_ENTER
(
"subselect_single_select_engine::cleanup"
);
prepared
=
optimized
=
executed
=
0
;
prepared
=
optimized
=
executed
=
optimize_error
=
0
;
join
=
0
;
join
=
0
;
result
->
cleanup
();
result
->
cleanup
();
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1892,6 +1892,10 @@ int join_read_next_same_or_null(READ_RECORD *info);
...
@@ -1892,6 +1892,10 @@ int join_read_next_same_or_null(READ_RECORD *info);
int
subselect_single_select_engine
::
exec
()
int
subselect_single_select_engine
::
exec
()
{
{
DBUG_ENTER
(
"subselect_single_select_engine::exec"
);
DBUG_ENTER
(
"subselect_single_select_engine::exec"
);
if
(
optimize_error
)
DBUG_RETURN
(
1
);
char
const
*
save_where
=
thd
->
where
;
char
const
*
save_where
=
thd
->
where
;
SELECT_LEX
*
save_select
=
thd
->
lex
->
current_select
;
SELECT_LEX
*
save_select
=
thd
->
lex
->
current_select
;
thd
->
lex
->
current_select
=
select_lex
;
thd
->
lex
->
current_select
=
select_lex
;
...
@@ -1899,12 +1903,15 @@ int subselect_single_select_engine::exec()
...
@@ -1899,12 +1903,15 @@ int subselect_single_select_engine::exec()
{
{
SELECT_LEX_UNIT
*
unit
=
select_lex
->
master_unit
();
SELECT_LEX_UNIT
*
unit
=
select_lex
->
master_unit
();
DBUG_EXECUTE_IF
(
"bug11747970_simulate_error"
,
DBUG_SET
(
"+d,bug11747970_raise_error"
););
optimized
=
1
;
optimized
=
1
;
unit
->
set_limit
(
unit
->
global_parameters
);
unit
->
set_limit
(
unit
->
global_parameters
);
if
(
join
->
optimize
())
if
(
join
->
optimize
())
{
{
thd
->
where
=
save_where
;
thd
->
where
=
save_where
;
executed
=
1
;
optimize_error
=
1
;
thd
->
lex
->
current_select
=
save_select
;
thd
->
lex
->
current_select
=
save_select
;
DBUG_RETURN
(
join
->
error
?
join
->
error
:
1
);
DBUG_RETURN
(
join
->
error
?
join
->
error
:
1
);
}
}
...
...
sql/item_subselect.h
View file @
7141bada
...
@@ -429,6 +429,7 @@ class subselect_single_select_engine: public subselect_engine
...
@@ -429,6 +429,7 @@ class subselect_single_select_engine: public subselect_engine
my_bool
prepared
;
/* simple subselect is prepared */
my_bool
prepared
;
/* simple subselect is prepared */
my_bool
optimized
;
/* simple subselect is optimized */
my_bool
optimized
;
/* simple subselect is optimized */
my_bool
executed
;
/* simple subselect is executed */
my_bool
executed
;
/* simple subselect is executed */
my_bool
optimize_error
;
///< simple subselect optimization failed
st_select_lex
*
select_lex
;
/* corresponding select_lex */
st_select_lex
*
select_lex
;
/* corresponding select_lex */
JOIN
*
join
;
/* corresponding JOIN structure */
JOIN
*
join
;
/* corresponding JOIN structure */
public:
public:
...
...
sql/sql_select.cc
View file @
7141bada
...
@@ -2691,6 +2691,16 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
...
@@ -2691,6 +2691,16 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
table_vector
[
i
]
=
s
->
table
=
table
=
tables
->
table
;
table_vector
[
i
]
=
s
->
table
=
table
=
tables
->
table
;
table
->
pos_in_table_list
=
tables
;
table
->
pos_in_table_list
=
tables
;
error
=
table
->
file
->
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_NO_LOCK
);
error
=
table
->
file
->
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_NO_LOCK
);
DBUG_EXECUTE_IF
(
"bug11747970_raise_error"
,
{
if
(
!
error
)
{
my_error
(
ER_UNKNOWN_ERROR
,
MYF
(
0
));
goto
error
;
}
});
if
(
error
)
if
(
error
)
{
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
table
->
file
->
print_error
(
error
,
MYF
(
0
));
...
...
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