diff options
author | Gleb Shchepa <gleb.shchepa@oracle.com> | 2011-04-08 12:09:24 +0400 |
---|---|---|
committer | Gleb Shchepa <gleb.shchepa@oracle.com> | 2011-04-08 12:09:24 +0400 |
commit | 71ffbd4651ad1131965ea39252e979bcc719f7de (patch) | |
tree | a882dbecbe9e5d691e50ad976300ec3274b5c79e | |
parent | 61dd7b36115df6eecc4843d63eaa38766e127638 (diff) | |
parent | bd193c61e38bc2c734a06ef5213654737e876fd7 (diff) | |
download | mariadb-git-71ffbd4651ad1131965ea39252e979bcc719f7de.tar.gz |
manual merge 5.1-->5.5 (bug 11829681)
-rw-r--r-- | mysql-test/r/view.result | 9 | ||||
-rw-r--r-- | mysql-test/t/view.test | 12 | ||||
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/item.h | 4 |
4 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index fdeed10701d..ce404c7dce2 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4012,6 +4012,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. # ----------------------------------------------------------------- diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index c82443e792f..39985bec339 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3979,6 +3979,18 @@ DROP TABLE t1; CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; DROP VIEW v1; +--echo # +--echo # Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY +--echo # + +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a; + +SELECT * FROM v1; + +DROP VIEW v1; +DROP TABLE t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- diff --git a/sql/item.cc b/sql/item.cc index a63d07b9708..a1482a6d634 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6479,7 +6479,7 @@ void Item_ref::print(String *str, enum_query_type query_type) { THD *thd= current_thd; append_identifier(thd, str, (*ref)->real_item()->name, - (*ref)->real_item()->name_length); + strlen((*ref)->real_item()->name)); } else (*ref)->print(str, query_type); diff --git a/sql/item.h b/sql/item.h index 6cd91f03604..3e67ffacfc8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -548,6 +548,10 @@ public: */ Item *next; uint32 max_length; /* Maximum length, in bytes */ + /* + TODO: convert name and name_length fields into String to keep them in sync + (see bug #11829681/60295 etc). + */ uint name_length; /* Length of name */ int8 marker; uint8 decimals; |