From 04ff9d4da02d0f9e66e383b13fc456636f92819a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Oct 2007 10:32:52 +0500 Subject: Fixed bug #27695: View should not be allowed to have empty or all space column names. The parser has been modified to check VIEW column names with the check_column_name function and to report an error on empty and all space column names (same as for TABLE column names). sql/sql_yacc.yy: Fixed bug #27695. The parser has been modified to check VIEW column aliases with the check_column_name function and to report an error on empty columns and all space columns (same as for TABLE column names). mysql-test/t/select.test: Updated test case for bug #27695. mysql-test/r/select.result: Updated test case for bug #27695. --- mysql-test/r/select.result | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'mysql-test/r/select.result') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index ed120a1bbb8..52f2e84bf4e 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4077,23 +4077,21 @@ x 1 Warnings: Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' CREATE VIEW v1 AS SELECT 1 AS ` `; -Warnings: -Warning 1474 Name ' ' has become '' -SELECT `` FROM v1; - -1 -CREATE VIEW v2 AS SELECT 1 AS ` `; -Warnings: -Warning 1474 Name ' ' has become '' -SELECT `` FROM v2; - -1 -CREATE VIEW v3 AS SELECT 1 AS ` x`; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; Warnings: Warning 1466 Leading spaces are removed from name ' x' -SELECT `x` FROM v3; +SELECT `x` FROM v1; x 1 -DROP VIEW v1, v2, v3; +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; End of 5.0 tests -- cgit v1.2.1