[MDEV-19071] Wrong results when using STDDEV_SAMP() and view Created: 2019-03-28 Updated: 2023-01-02 Resolved: 2023-01-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.11.2, 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alice Sherepa | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Description |
|
And with window function:
|
| Comments |
| Comment by guy_rouillard [ 2021-01-22 ] |
|
If you use STDDEV_SAMP in a view query, the query gets transformed internally by the database engine (for optimization purposes). When you display that view's script, you will notice that the function STDDEV_SAMP has been replaced by the function STD. The issue is that STD is not equivalent to STDDEV_SAMP. STD is a shortcut to STDDEV_POP, which is the population standard deviation, while STDDEV_SAMP is for the sample standard deviation. I don't understand why this issue hasn't a higher priority. GR. |
| Comment by guy_rouillard [ 2021-01-22 ] |
|
Workaround:
GR. |