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
8a3d59ea
Commit
8a3d59ea
authored
Sep 04, 2009
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Automerge
parents
79b5063d
2a6ac469
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
6 deletions
+42
-6
mysql-test/r/sp.result
mysql-test/r/sp.result
+16
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+22
-0
sql/item_subselect.cc
sql/item_subselect.cc
+4
-6
No files found.
mysql-test/r/sp.result
View file @
8a3d59ea
...
...
@@ -6963,6 +6963,22 @@ CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
#
# Bug #46629: Item_in_subselect::val_int(): Assertion `0'
# on subquery inside a SP
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT, b INT PRIMARY KEY);
CREATE PROCEDURE p1 ()
BEGIN
SELECT a FROM t1 A WHERE A.b IN (SELECT b FROM t2 AS B);
END|
CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/t/sp.test
View file @
8a3d59ea
...
...
@@ -8242,6 +8242,28 @@ while ($tab_count)
DROP PROCEDURE p1;
DROP TABLE t1;
--echo #
--echo # Bug #46629: Item_in_subselect::val_int(): Assertion `
0
'
--
echo
# on subquery inside a SP
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
,
b
INT
PRIMARY
KEY
);
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
BEGIN
SELECT
a
FROM
t1
A
WHERE
A
.
b
IN
(
SELECT
b
FROM
t2
AS
B
);
END
|
DELIMITER
;
|
--
error
ER_BAD_FIELD_ERROR
CALL
p1
;
--
error
ER_BAD_FIELD_ERROR
CALL
p1
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
,
t2
;
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
sql/item_subselect.cc
View file @
8a3d59ea
...
...
@@ -155,13 +155,11 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
res
))
return
TRUE
;
res
=
engine
->
prepare
();
if
(
!
(
res
=
engine
->
prepare
()))
{
// all transformation is done (used by prepared statements)
changed
=
1
;
if
(
!
res
)
{
if
(
substitution
)
{
int
ret
=
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