summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
authorGleb Shchepa <gleb.shchepa@oracle.com>2011-04-08 12:05:20 +0400
committerGleb Shchepa <gleb.shchepa@oracle.com>2011-04-08 12:05:20 +0400
commitbd193c61e38bc2c734a06ef5213654737e876fd7 (patch)
tree58fdcd306a524904d939098dccea7a540808fc52 /mysql-test/r/view.result
parentb563350e7a7918e3899039e51ba57d639b412e10 (diff)
downloadmariadb-git-bd193c61e38bc2c734a06ef5213654737e876fd7.tar.gz
Bug #11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
Select from a view with the underlying HAVING clause failed with a message: "1356: View '...' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" The bug is a regression of the fix for bug 11750328 - 40825 (similar case, but the HAVING cause references an aliased field). In the old fix for bug 40825 the Item_field::name_length value has been used in place of the real length of Item_field::name. However, in some cases Item_field::name_length is not in sync with the actual name length (TODO: combine name and name_length into a solid String field). The Item_ref::print() method has been modified to calculate actual name length every time.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 6b0a2103afa..2ca81f20cbb 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3897,6 +3897,15 @@ DROP TABLE t1;
#
CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f;
DROP VIEW v1;
+#
+# Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
+#
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a;
+SELECT * FROM v1;
+a
+DROP VIEW v1;
+DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------