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
595d8c5b
Commit
595d8c5b
authored
Nov 29, 2006
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/work/20327-bug-5.0-opt-mysql
parents
1314ab22
e851a9ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+18
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+23
-0
sql/sql_base.cc
sql/sql_base.cc
+6
-0
No files found.
mysql-test/r/ps.result
View file @
595d8c5b
...
...
@@ -1475,6 +1475,24 @@ i
1
DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2;
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1), (2);
SELECT t1.i FROM t1 JOIN v1 ON t1.i = v1.i
WHERE EXISTS (SELECT * FROM t1 WHERE v1.i = 1);
i
1
PREPARE stmt FROM "SELECT t1.i FROM t1 JOIN v1 ON t1.i = v1.i
WHERE EXISTS (SELECT * FROM t1 WHERE v1.i = 1)";
EXECUTE stmt;
i
1
EXECUTE stmt;
i
1
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;
DROP PROCEDURE IF EXISTS p1;
flush status;
prepare sq from 'show status like "slow_queries"';
...
...
mysql-test/t/ps.test
View file @
595d8c5b
...
...
@@ -1513,6 +1513,29 @@ DEALLOCATE PREPARE stmt;
DROP
TABLE
t1
,
t2
;
#
# BUG#20327: Marking of a wrong field leads to a wrong result on select with
# view, prepared statement and subquery.
#
CREATE
TABLE
t1
(
i
INT
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
let
$query
=
SELECT
t1
.
i
FROM
t1
JOIN
v1
ON
t1
.
i
=
v1
.
i
WHERE
EXISTS
(
SELECT
*
FROM
t1
WHERE
v1
.
i
=
1
);
eval
$query
;
eval
PREPARE
stmt
FROM
"
$query
"
;
# Statement execution should return '1'.
EXECUTE
stmt
;
# Check re-execution.
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
#
# BUG#21856: Prepared Statments: crash if bad create
#
...
...
sql/sql_base.cc
View file @
595d8c5b
...
...
@@ -3308,6 +3308,12 @@ find_field_in_tables(THD *thd, Item_ident *item,
{
if
(
found
==
WRONG_GRANT
)
return
(
Field
*
)
0
;
/*
Only views fields should be marked as dependent, not an underlying
fields.
*/
if
(
!
table_ref
->
belong_to_view
)
{
SELECT_LEX
*
current_sel
=
thd
->
lex
->
current_select
;
SELECT_LEX
*
last_select
=
table_ref
->
select_lex
;
...
...
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