diff options
author | unknown <bell@sanja.is.com.ua> | 2005-07-05 11:21:47 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-07-05 11:21:47 +0300 |
commit | 7ff88ba7a73ad9c32e47e4c8612a2ee2e7ade257 (patch) | |
tree | 15ee32fc23362a7682edef8d5c81e5ca20d3a995 | |
parent | 8226e5fcbd97e101b1ff464bc207df7d2abecf4d (diff) | |
parent | be515e075cf9f08d2249c2d3c4d6048bf7befe29 (diff) | |
download | mariadb-git-7ff88ba7a73ad9c32e47e4c8612a2ee2e7ade257.tar.gz |
merge
sql/item_sum.h:
Auto merged
-rw-r--r-- | mysql-test/r/view.result | 7 | ||||
-rw-r--r-- | mysql-test/t/view.test | 9 | ||||
-rw-r--r-- | sql/item_sum.h | 3 |
3 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index cad86dc94b8..4080c3dda49 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1850,6 +1850,13 @@ SELECT * FROM v1; SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1) dkjhgd drop view v1; +create table t1 (s1 int); +create view v1 as select var_samp(s1) from t1; +show create view v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select var_samp(`test`.`t1`.`s1`) AS `var_samp(s1)` from `test`.`t1` +drop view v1; +drop table t1; set sql_mode='strict_all_tables'; CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL) ENGINE = INNODB; CREATE VIEW v1 (vcol1) AS SELECT col1 FROM t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 78d992163fe..818dbcc65ca 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1698,6 +1698,15 @@ SELECT * FROM v1; drop view v1; # +# Using var_samp with view (BUG#10651) +# +create table t1 (s1 int); +create view v1 as select var_samp(s1) from t1; +show create view v1; +drop view v1; +drop table t1; + +# # Correct inserting data check (absence of default value) for view # underlying tables (BUG#6443) # diff --git a/sql/item_sum.h b/sql/item_sum.h index b02d18e9a55..32a1d8dd923 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -479,7 +479,8 @@ public: Item *result_item(Field *field) { return new Item_variance_field(this); } void no_rows_in_result() {} - const char *func_name() const { return "variance("; } + const char *func_name() const + { return sample ? "var_samp(" : "variance("; } Item *copy_or_same(THD* thd); Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length); enum Item_result result_type () const { return hybrid_type; } |