Description
Let's take a look at the relations between listed functions from different approaches:
MySQL:
STDDEV() = STDDEV_POP()
STDDEV() != STDDEV_SAMP()
Couchbase:
STDDEV() = STDDEV_SAMP() — There is difference in case of one row ( It differs from STDDEV_SAMP in that STDDEV returns zero when it has only 1 row of input data, whereas STDDEV_SAMP returns null.)
STDDEV() != STDDEV_POP()
Spec:
STDDEV() = STDDEV_SAMP()
STDDEV() != STDDEV_POP()
Real life:
STDDEV() = STDDEV_POP()
STDDEV() != STDDEV_SAMP()
So, I think, STDDEV_POP() and STDDEV_SAMP() are messed in specification and in Couchbase backend.
Same thing for VARIANCE(), VARIANCE_POP(), VARIANCE_SAMP() functions