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
c2c760bd
Commit
c2c760bd
authored
Sep 24, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging bug 28701 to 5.1-opt
parent
ea1a4ae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
mysql-test/r/view.result
mysql-test/r/view.result
+4
-4
sql/sql_view.cc
sql/sql_view.cc
+2
-5
No files found.
mysql-test/r/view.result
View file @
c2c760bd
...
...
@@ -625,7 +625,7 @@ drop table t1;
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
select b from v1 use index (some_index) where b=1;
ERROR
42000: Incorrect usage of USE INDEX
and VIEW
ERROR
HY000: Incorrect usage of index hints
and VIEW
drop view v1;
drop table t1;
create table t1 (col1 char(5),col2 char(5));
...
...
@@ -3563,11 +3563,11 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1 USE KEY(non_existant);
ERROR HY000: Incorrect usage of
USE INDEX
and VIEW
ERROR HY000: Incorrect usage of
index hints
and VIEW
SELECT * FROM v1 FORCE KEY(non_existant);
ERROR HY000: Incorrect usage of
FORCE INDEX
and VIEW
ERROR HY000: Incorrect usage of
index hints
and VIEW
SELECT * FROM v1 IGNORE KEY(non_existant);
ERROR HY000: Incorrect usage of
IGNORE INDEX
and VIEW
ERROR HY000: Incorrect usage of
index hints
and VIEW
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests.
...
...
sql/sql_view.cc
View file @
c2c760bd
...
...
@@ -953,12 +953,9 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
DBUG_RETURN
(
0
);
}
if
(
table
->
use_index
||
table
->
ignore_index
)
if
(
table
->
index_hints
&&
table
->
index_hints
->
elements
)
{
my_error
(
ER_WRONG_USAGE
,
MYF
(
0
),
table
->
ignore_index
?
"IGNORE INDEX"
:
(
table
->
force_index
?
"FORCE INDEX"
:
"USE INDEX"
),
"VIEW"
);
my_error
(
ER_WRONG_USAGE
,
MYF
(
0
),
"index hints"
,
"VIEW"
);
DBUG_RETURN
(
TRUE
);
}
...
...
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