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
356005ef
Commit
356005ef
authored
Dec 09, 2004
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix and test case for Bug#6873 "PS, having with subquery, crash
during execute"
parent
c09c1911
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+11
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+14
-0
sql/item_subselect.cc
sql/item_subselect.cc
+2
-0
No files found.
mysql-test/r/ps.result
View file @
356005ef
...
@@ -471,3 +471,14 @@ select @var is null, @var is not null, @var;
...
@@ -471,3 +471,14 @@ select @var is null, @var is not null, @var;
execute stmt using @var, @var, @var;
execute stmt using @var, @var, @var;
? is null ? is not null ?
? is null ? is not null ?
1 0 NULL
1 0 NULL
create table t1 (pnum char(3));
create table t2 (pnum char(3));
prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)";
execute stmt;
pnum
execute stmt;
pnum
execute stmt;
pnum
deallocate prepare stmt;
drop table t1, t2;
mysql-test/t/ps.test
View file @
356005ef
...
@@ -471,3 +471,17 @@ execute stmt using @var, @var, @var;
...
@@ -471,3 +471,17 @@ execute stmt using @var, @var, @var;
set
@
var
=
null
;
set
@
var
=
null
;
select
@
var
is
null
,
@
var
is
not
null
,
@
var
;
select
@
var
is
null
,
@
var
is
not
null
,
@
var
;
execute
stmt
using
@
var
,
@
var
,
@
var
;
execute
stmt
using
@
var
,
@
var
,
@
var
;
#
# Bug#6873 "PS, having with subquery, crash during execute"
# check that if we modify having subtree, we update JOIN->having pointer
#
create
table
t1
(
pnum
char
(
3
));
create
table
t2
(
pnum
char
(
3
));
prepare
stmt
from
"select pnum from t2 having pnum in (select 'p1' from t1)"
;
execute
stmt
;
execute
stmt
;
execute
stmt
;
deallocate
prepare
stmt
;
drop
table
t1
,
t2
;
sql/item_subselect.cc
View file @
356005ef
...
@@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
...
@@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
// did we changed top item of WHERE condition
// did we changed top item of WHERE condition
if
(
unit
->
outer_select
()
->
where
==
(
*
ref
))
if
(
unit
->
outer_select
()
->
where
==
(
*
ref
))
unit
->
outer_select
()
->
where
=
substitution
;
// correct WHERE for PS
unit
->
outer_select
()
->
where
=
substitution
;
// correct WHERE for PS
else
if
(
unit
->
outer_select
()
->
having
==
(
*
ref
))
unit
->
outer_select
()
->
having
=
substitution
;
// correct HAVING for PS
(
*
ref
)
=
substitution
;
(
*
ref
)
=
substitution
;
substitution
->
name
=
name
;
substitution
->
name
=
name
;
...
...
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