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
e87d5e9a
Commit
e87d5e9a
authored
Jan 18, 2006
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug8-4.1
parents
75bc48a8
4e931d3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
4 deletions
+87
-4
mysql-test/r/kill.result
mysql-test/r/kill.result
+13
-1
mysql-test/t/kill.test
mysql-test/t/kill.test
+48
-1
sql/sql_class.cc
sql/sql_class.cc
+3
-0
sql/sql_select.cc
sql/sql_select.cc
+14
-0
sql/sql_select.h
sql/sql_select.h
+9
-2
No files found.
mysql-test/r/kill.result
View file @
e87d5e9a
drop table if exists t1;
drop table if exists t1
, t2, t3
;
create table t1 (kill_id int);
insert into t1 values(connection_id());
select ((@id := kill_id) - kill_id) from t1;
...
...
@@ -17,3 +17,15 @@ select 4;
4
4
drop table t1;
create table t1 (id int primary key);
create table t2 (id int unsigned not null);
insert into t2 select id from t1;
create table t3 (kill_id int);
insert into t3 values(connection_id());
select id from t1 where id in (select distinct id from t2);
select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id)
0
kill @id;
ERROR 08S01: Server shutdown in progress
drop table t1, t2, t3;
mysql-test/t/kill.test
View file @
e87d5e9a
...
...
@@ -12,7 +12,7 @@ connect (con2, localhost, root,,);
#remember id of con1
connection
con1
;
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
,
t2
,
t3
;
--
enable_warnings
create
table
t1
(
kill_id
int
);
...
...
@@ -40,4 +40,51 @@ connection con2;
select
4
;
drop
table
t1
;
disconnect
con2
;
connection
default
;
#
# BUG#14851: killing long running subquery processed via a temporary table.
#
create
table
t1
(
id
int
primary
key
);
create
table
t2
(
id
int
unsigned
not
null
);
connect
(
conn1
,
localhost
,
root
,,);
connection
conn1
;
--
disable_result_log
--
disable_query_log
let
$
1
=
4096
;
while
(
$
1
)
{
eval
insert
into
t1
values
(
$
1
);
dec
$
1
;
}
--
enable_query_log
--
enable_result_log
insert
into
t2
select
id
from
t1
;
create
table
t3
(
kill_id
int
);
insert
into
t3
values
(
connection_id
());
--
disable_result_log
send
select
id
from
t1
where
id
in
(
select
distinct
id
from
t2
);
--
enable_result_log
connect
(
conn2
,
localhost
,
root
,,);
connection
conn2
;
select
((
@
id
:=
kill_id
)
-
kill_id
)
from
t3
;
--
sleep
1
kill
@
id
;
connection
conn1
;
--
error
1053
reap
;
disconnect
conn1
;
disconnect
conn2
;
connection
default
;
drop
table
t1
,
t2
,
t3
;
# End of 4.1 tests
sql/sql_class.cc
View file @
e87d5e9a
...
...
@@ -1681,7 +1681,10 @@ bool select_dumpvar::send_eof()
void
TMP_TABLE_PARAM
::
init
()
{
DBUG_ENTER
(
"TMP_TABLE_PARAM::init"
);
DBUG_PRINT
(
"enter"
,
(
"this: 0x%lx"
,
(
ulong
)
this
));
field_count
=
sum_func_count
=
func_count
=
hidden_field_count
=
0
;
group_parts
=
group_length
=
group_null_parts
=
0
;
quick_group
=
1
;
DBUG_VOID_RETURN
;
}
sql/sql_select.cc
View file @
e87d5e9a
...
...
@@ -4107,6 +4107,20 @@ JOIN::join_free(bool full)
problems in free_elements() as some of the elements are then deleted.
*/
tmp_table_param
.
copy_funcs
.
empty
();
/*
If we have tmp_join and 'this' JOIN is not tmp_join and
tmp_table_param.copy_field's of them are equal then we have to remove
pointer to tmp_table_param.copy_field from tmp_join, because it qill
be removed in tmp_table_param.cleanup().
*/
if
(
tmp_join
&&
tmp_join
!=
this
&&
tmp_join
->
tmp_table_param
.
copy_field
==
tmp_table_param
.
copy_field
)
{
tmp_join
->
tmp_table_param
.
copy_field
=
tmp_join
->
tmp_table_param
.
save_copy_field
=
0
;
}
tmp_table_param
.
cleanup
();
}
DBUG_VOID_RETURN
;
...
...
sql/sql_select.h
View file @
e87d5e9a
...
...
@@ -227,7 +227,14 @@ class JOIN :public Sql_alloc
{
init
(
thd_arg
,
fields_arg
,
select_options_arg
,
result_arg
);
}
JOIN
(
JOIN
&
join
)
:
fields_list
(
join
.
fields_list
)
{
init
(
join
.
thd
,
join
.
fields_list
,
join
.
select_options
,
join
.
result
);
}
void
init
(
THD
*
thd_arg
,
List
<
Item
>
&
fields_arg
,
ulong
select_options_arg
,
select_result
*
result_arg
)
{
...
...
@@ -272,7 +279,7 @@ class JOIN :public Sql_alloc
fields_list
=
fields_arg
;
bzero
((
char
*
)
&
keyuse
,
sizeof
(
keyuse
));
tmp_table_param
.
copy_field
=
0
;
tmp_table_param
.
init
()
;
tmp_table_param
.
end_write_records
=
HA_POS_ERROR
;
rollup
.
state
=
ROLLUP
::
STATE_NONE
;
}
...
...
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