diff options
author | unknown <gkodinov/kgeorge@macbook.gmz> | 2007-06-06 17:54:14 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@macbook.gmz> | 2007-06-06 17:54:14 +0300 |
commit | 053907318516bb8d25f5ae8cb0367d1ebd327158 (patch) | |
tree | 43cfa432c922fb74631d12146acd6136980a01b5 /sql/sql_view.cc | |
parent | 865f294fcfe14bf69a85eb8ba1260b7a4af45d7d (diff) | |
download | mariadb-git-053907318516bb8d25f5ae8cb0367d1ebd327158.tar.gz |
Bug #28701:
Views don't have indexes. So they can't take index hints.
Added a check and disabled the usage of hints for views.
mysql-test/r/view.result:
Bug #28701: test case
mysql-test/t/view.test:
Bug #28701: test case
sql/sql_view.cc:
Bug #28701: disable usage of hints for views
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 0fb4d3aaea8..faefeb2aef4 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -918,6 +918,15 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, DBUG_RETURN(0); } + if (table->use_index || table->ignore_index) + { + my_error(ER_WRONG_USAGE, MYF(0), + table->ignore_index ? "IGNORE INDEX" : + (table->force_index ? "FORCE INDEX" : "USE INDEX"), + "VIEW"); + DBUG_RETURN(TRUE); + } + /* check loop via view definition */ for (TABLE_LIST *precedent= table->referencing_view; precedent; |