1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#12626844 : WE ARE NOT CHECKING VIEW TABLE NAMES

ENOUGH - CONCAT() HACKS. ALSO WRONG
               ERROR MESSAGE WHILE TRYING TO CREATE
               A VIEW ON A NON EXISTING DATABASE

PROBLEM:
The first part of the problem is concluded as not a
bug, as 'concat' is not a reserved word and it is
completely valid to create a view with the name
'concat'.

The second issue is, while trying to create a view on
a non existing database, we are not giving a proper error
message.

FIX:
We have added a check for the database existence while
trying to create a view. This check would give an error
as 'unknown database' when the database does not exist.

This patch is a backport of the patch for Bug#13601606


mysql-test/r/view.result:
  Added test case result of Bug#12626844
mysql-test/t/view.test:
  Added test case for Bug#12626844
sql/sql_view.cc:
  Added a check for database existence in mysql_create_view
This commit is contained in:
Chaithra Gopalareddy
2012-03-14 06:27:03 +05:30
parent 4977b60e59
commit e48afab412
3 changed files with 25 additions and 0 deletions

View File

@ -444,6 +444,13 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
view= lex->unlink_first_table(&link_to_local);
if (check_db_dir_existence(view->db))
{
my_error(ER_BAD_DB_ERROR, MYF(0), view->db);
res= TRUE;
goto err;
}
if (mode == VIEW_ALTER && fill_defined_view_parts(thd, view))
{
res= TRUE;