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
6ee82470
Commit
6ee82470
authored
Jun 06, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
9bbad19d
f2405d71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
0 deletions
+86
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+40
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+44
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-0
No files found.
mysql-test/r/sp.result
View file @
6ee82470
...
...
@@ -3138,4 +3138,44 @@ x
x
3
drop procedure bug10961|
DROP PROCEDURE IF EXISTS bug6866|
DROP VIEW IF EXISTS tv|
Warnings:
Note 1051 Unknown table 'test.tv'
DROP TABLE IF EXISTS tt1,tt2,tt3|
Warnings:
Note 1051 Unknown table 'tt1'
Note 1051 Unknown table 'tt2'
Note 1051 Unknown table 'tt3'
CREATE TABLE tt1 (a1 int, a2 int, a3 int, data varchar(10))|
CREATE TABLE tt2 (a2 int, data2 varchar(10))|
CREATE TABLE tt3 (a3 int, data3 varchar(10))|
INSERT INTO tt1 VALUES (1, 1, 4, 'xx')|
INSERT INTO tt2 VALUES (1, 'a')|
INSERT INTO tt2 VALUES (2, 'b')|
INSERT INTO tt2 VALUES (3, 'c')|
INSERT INTO tt3 VALUES (4, 'd')|
INSERT INTO tt3 VALUES (5, 'e')|
INSERT INTO tt3 VALUES (6, 'f')|
CREATE VIEW tv AS
SELECT tt1.*, tt2.data2, tt3.data3
FROM tt1 INNER JOIN tt2 ON tt1.a2 = tt2.a2
LEFT JOIN tt3 ON tt1.a3 = tt3.a3
ORDER BY tt1.a1, tt2.a2, tt3.a3|
CREATE PROCEDURE bug6866 (_a1 int)
BEGIN
SELECT * FROM tv WHERE a1 = _a1;
END|
CALL bug6866(1)|
a1 a2 a3 data data2 data3
1 1 4 xx a d
CALL bug6866(1)|
a1 a2 a3 data data2 data3
1 1 4 xx a d
CALL bug6866(1)|
a1 a2 a3 data data2 data3
1 1 4 xx a d
DROP PROCEDURE bug6866;
DROP VIEW tv|
DROP TABLE tt1, tt2, tt3|
drop table t1,t2;
mysql-test/t/sp.test
View file @
6ee82470
...
...
@@ -3848,6 +3848,50 @@ call bug10961()|
drop
procedure
bug10961
|
#
# BUG #6866: Second call of a stored procedure using a view with on expressions
#
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
bug6866
|
--
enable_warnings
DROP
VIEW
IF
EXISTS
tv
|
DROP
TABLE
IF
EXISTS
tt1
,
tt2
,
tt3
|
CREATE
TABLE
tt1
(
a1
int
,
a2
int
,
a3
int
,
data
varchar
(
10
))
|
CREATE
TABLE
tt2
(
a2
int
,
data2
varchar
(
10
))
|
CREATE
TABLE
tt3
(
a3
int
,
data3
varchar
(
10
))
|
INSERT
INTO
tt1
VALUES
(
1
,
1
,
4
,
'xx'
)
|
INSERT
INTO
tt2
VALUES
(
1
,
'a'
)
|
INSERT
INTO
tt2
VALUES
(
2
,
'b'
)
|
INSERT
INTO
tt2
VALUES
(
3
,
'c'
)
|
INSERT
INTO
tt3
VALUES
(
4
,
'd'
)
|
INSERT
INTO
tt3
VALUES
(
5
,
'e'
)
|
INSERT
INTO
tt3
VALUES
(
6
,
'f'
)
|
CREATE
VIEW
tv
AS
SELECT
tt1
.*
,
tt2
.
data2
,
tt3
.
data3
FROM
tt1
INNER
JOIN
tt2
ON
tt1
.
a2
=
tt2
.
a2
LEFT
JOIN
tt3
ON
tt1
.
a3
=
tt3
.
a3
ORDER
BY
tt1
.
a1
,
tt2
.
a2
,
tt3
.
a3
|
CREATE
PROCEDURE
bug6866
(
_a1
int
)
BEGIN
SELECT
*
FROM
tv
WHERE
a1
=
_a1
;
END
|
CALL
bug6866
(
1
)
|
CALL
bug6866
(
1
)
|
CALL
bug6866
(
1
)
|
DROP
PROCEDURE
bug6866
;
DROP
VIEW
tv
|
DROP
TABLE
tt1
,
tt2
,
tt3
|
#
# BUG#NNNN: New bug synopsis
...
...
sql/sql_select.cc
View file @
6ee82470
...
...
@@ -7379,6 +7379,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
}
else
{
if
(
!
(
table
->
prep_on_expr
))
table
->
prep_on_expr
=
table
->
on_expr
;
used_tables
=
table
->
table
->
map
;
if
(
conds
)
not_null_tables
=
conds
->
not_null_tables
();
...
...
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