Commit 201c985b authored by Alexander Barkov's avatar Alexander Barkov

MDEV-7886 CREATE VIEW IF NOT EXISTS produces a wrong warning

parent ed349270
......@@ -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:
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment