Bug #10651 Views: var_samp() looks like var_pop()

Submitted: 16 May 2005 0:25 Modified: 14 Jul 2005 18:57
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.6-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[16 May 2005 0:25] Peter Gulutzan
Description:
When I create a view which refers to var_samp(), MySQL translates it to variance().
That's not correct. Although var_pop() is the same a variance(), var_samp() is not.
So, when "select var_samp(...) from base_table" and "select var_samp(...)
from view_made_with_select_star_from_base_table" deliver different results.

How to repeat:
mysql> create table t86 (s1 int);
Query OK, 0 rows affected (0.01 sec)

mysql> create view v86 as select var_samp(s1) from t86;
Query OK, 0 rows affected (0.01 sec)

mysql> show create view v86;
+------+------------------------------------------------------------------------------------------------------------------------------+
| View | Create View          |
+------+------------------------------------------------------------------------------------------------------------------------------+
| v86  | CREATE ALGORITHM=UNDEFINED VIEW `mysql4`.`v86` AS select variance(`mysql4`.`t86`.`s1`) AS `var_samp(s1)` from `mysql4`.`t86` |
+------+------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
[16 May 2005 0:35] MySQL Verification Team
Thank you for the bug report.
[24 Jun 2005 19:08] Oleksandr Byelkin
ChangeSet
  1.2011 05/06/24 22:02:19 bell@sanja.is.com.ua +3 -0
  fixed var_samp printing (BUG#10651)
[24 Jun 2005 19:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26418
[28 Jun 2005 20:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26495
[2 Jul 2005 13:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26621
[5 Jul 2005 9:57] Oleksandr Byelkin
pushed to 5.0.9
[14 Jul 2005 18:57] Paul DuBois
Noted in 5.0.9 changelog.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.057 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.