From 201c985be56f375677df9275d38f18a20cf41029 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 13 Apr 2015 22:36:49 +0400 Subject: [PATCH] MDEV-7886 CREATE VIEW IF NOT EXISTS produces a wrong warning --- mysql-test/r/create_drop_binlog.result | 2 +- mysql-test/r/create_drop_view.result | 2 +- mysql-test/suite/rpl/r/rpl_create_drop_view.result | 2 +- sql/sql_view.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/create_drop_binlog.result b/mysql-test/r/create_drop_binlog.result index 6db54a6997a..a1108890208 100644 --- a/mysql-test/r/create_drop_binlog.result +++ b/mysql-test/r/create_drop_binlog.result @@ -156,7 +156,7 @@ DROP VIEW v1; CREATE VIEW IF NOT EXISTS v1 AS SELECT 1; CREATE VIEW IF NOT EXISTS v1 AS SELECT 1; Warnings: -Note 1050 Table 'test' already exists +Note 1050 Table 'v1' already exists DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1; Warnings: diff --git a/mysql-test/r/create_drop_view.result b/mysql-test/r/create_drop_view.result index fa54463f51f..a822c16ae3c 100644 --- a/mysql-test/r/create_drop_view.result +++ b/mysql-test/r/create_drop_view.result @@ -19,7 +19,7 @@ VIEW_DEFINITION select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10) CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>12; Warnings: -Note 1050 Table 'test' already exists +Note 1050 Table 'v1' already exists SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1'; VIEW_DEFINITION select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10) diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_view.result b/mysql-test/suite/rpl/r/rpl_create_drop_view.result index 1fc30c2e89d..85731210ae8 100644 --- a/mysql-test/suite/rpl/r/rpl_create_drop_view.result +++ b/mysql-test/suite/rpl/r/rpl_create_drop_view.result @@ -30,7 +30,7 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10; ERROR 42S01: Table 'v1' already exists CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10; Warnings: -Note 1050 Table 'test' already exists +Note 1050 Table 'v1' already exists CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10; ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS # Syncing slave with master diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 1c64698d983..c56cb3267b3 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -930,7 +930,7 @@ loop_out: { push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR), - view->db, view->table_name); + view->table_name); DBUG_RETURN(0); } else if (mode == VIEW_CREATE_NEW)