mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
fixed var_samp printing (BUG#10651)
mysql-test/r/view.result: Using var_samp with view (BUG#10651) mysql-test/t/view.test: Using var_samp with view (BUG#10651) sql/item_sum.h: fixed var_samp printing
This commit is contained in:
@ -1850,3 +1850,10 @@ SELECT * FROM v1;
|
|||||||
SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1)
|
SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1)
|
||||||
dkjhgd
|
dkjhgd
|
||||||
drop view v1;
|
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;
|
||||||
|
@ -1696,3 +1696,13 @@ drop view v1;
|
|||||||
CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
|
CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
|
||||||
SELECT * FROM v1;
|
SELECT * FROM v1;
|
||||||
drop view 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;
|
||||||
|
|
||||||
|
@ -479,7 +479,8 @@ public:
|
|||||||
Item *result_item(Field *field)
|
Item *result_item(Field *field)
|
||||||
{ return new Item_variance_field(this); }
|
{ return new Item_variance_field(this); }
|
||||||
void no_rows_in_result() {}
|
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);
|
Item *copy_or_same(THD* thd);
|
||||||
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
|
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
|
||||||
enum Item_result result_type () const { return hybrid_type; }
|
enum Item_result result_type () const { return hybrid_type; }
|
||||||
|
Reference in New Issue
Block a user