MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
  • MariaDB\ 71.8%
  • C++ 16.4%
  • C 10.4%
  • Shell 0.5%
  • Perl 0.4%
  • Other 0.3%
Find a file
unknown 82bd9b6b61 Bug#22555: STDDEV yields positive result for groups with only one row
When only one row was present, the subtraction of nearly the same number 
resulted in catastropic cancellation, introducing an error in the 
VARIANCE calculation near 1e-15.  That was sqrt()ed to get STDDEV, the 
error was escallated to near 1e-8.  

The simple fix of testing for a row count of 1 and forcing that to yield 
0.0 is insufficient, as two rows of the same value should also have a
variance of 0.0, yet the error would be about the same.

So, this patch changes the formula that computes the VARIANCE to be one
that is not subject to catastrophic cancellation.

In addition, it now uses only (faster-than-decimal) floating point numbers
to calculate, and renders that to other types on demand.


mysql-test/r/func_group.result:
  Test that the bug is fixed, and that no unexpected behavior arises from the 
  changes.
mysql-test/t/func_group.test:
  Test that the bug is fixed, and that no unexpected behavior arises from the 
  changes.
sql/item_sum.cc:
  Serg's suggestion: Force all VARIANCE calculations to be done with floating-
  point types.  It's faster, and the SQL standard says we may implement these
  functions any way we want.
  
  Additionally, use a form of variance calculation that is not subject to 
  catastrophic cancellation.   
  http://static.flickr.com/108/311308512_5c4e1c0c3d_b.jpg
sql/item_sum.h:
  Remove unused members and add a comment describing the recurrence relation.
2006-12-22 15:37:37 -05:00
bdb make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
BitKeeper Bug#22555: STDDEV yields positive result for groups with only one row 2006-12-22 15:37:37 -05:00
BUILD Merge perch.ndb.mysql.com:/home/jonas/src/mysql-4.1 2006-09-05 15:05:52 +02:00
client Fix DBUG_PRINT in mysqltest, the real value to print is in ds_cmd 2006-11-03 16:06:13 +01:00
cmd-line-utils Merge neptunus.(none):/home/msvensson/mysql/bug16557/my50-bug16557 2006-02-21 08:58:19 +01:00
config/ac-macros Use a direct reference to the yassl and taocrypt libtool libraries to link with 2006-09-21 11:37:08 +02:00
dbug make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
Docs Add a dummy file for "Docs/manual.chm" as we need it for "make dist" to work. 2006-09-21 17:38:42 +02:00
extra Netware uses size_t as socklen_t 2006-10-23 13:26:04 +02:00
heap make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
include Updates for abi_check 2006-11-04 09:23:19 +01:00
innobase Bug#22224: Windows build depends on ib_config.h 2006-09-28 15:18:33 -04:00
libmysql make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
libmysql_r Bug#19575 MySQL-shared-5.0.21-0.glibc23 causes segfault in SSL_library_init 2006-05-31 16:19:06 +02:00
libmysqld Bug #23427: incompatible ABI change in 5.0.26? 2006-10-20 17:17:24 -04:00
man Makefile.am, configure.in: 2006-07-28 23:12:40 +02:00
myisam Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint 2006-11-03 16:18:32 +01:00
myisammrg Merge shellback.(none):/home/msvensson/mysql/mysql-5.0 2006-10-03 01:01:06 +02:00
mysql-test Bug#22555: STDDEV yields positive result for groups with only one row 2006-12-22 15:37:37 -05:00
mysys Fix merge collision. 2006-11-02 18:27:52 -05:00
ndb Merge bodhi.local:/opt/local/work/mysql-4.1-runtime 2006-11-02 02:38:41 +03:00
netware Replace all refernces to .la libraries with direct references 2006-10-24 13:12:34 +02:00
os2 Merge 2005-09-29 03:20:31 +02:00
pstack Makefile.am, configure.in: 2005-09-24 15:51:45 +02:00
regex make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
scripts Copy *.cnf file from std_data/ when doing a binary distribution 2006-10-23 10:56:13 +02:00
server-tools Instance Manager polishing. 2006-10-20 22:26:40 +04:00
sql Bug#22555: STDDEV yields positive result for groups with only one row 2006-12-22 15:37:37 -05:00
sql-bench Set thread_stack after return from end_thread() 2005-12-03 18:13:06 +02:00
sql-common Merge bk-internal:/home/bk/mysql-4.1-maint 2006-10-12 18:48:03 +02:00
SSL Remove client-req-pem and server-req.pem 2006-05-03 11:53:16 +02:00
strings Merge bk@192.168.21.1:mysql-4.1 2006-10-12 13:50:22 +05:00
support-files Merge mysql.com:/Users/kent/mysql/bk/bug17194/my50-bug17194 2006-08-24 14:51:54 +02:00
tests Merge bk-internal.mysql.com:/home/bk/mysql-4.1 2006-11-02 17:27:42 -05:00
tools Bug#19575 MySQL-shared-5.0.21-0.glibc23 causes segfault in SSL_library_init 2006-05-31 16:19:06 +02:00
VC++Files Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0 2006-08-06 16:47:49 +02:00
vio When using yaSSL on NetWare some of the OpenSSL specifix hacks can be skipped 2006-10-24 10:43:15 +02:00
win Additional files for cmake support 2006-08-31 19:52:42 +02:00
zlib Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint 2006-09-18 10:37:26 +05:00
.bzrignore Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint 2006-10-24 21:05:35 +02:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0.27-release 2006-10-21 01:13:50 +02:00
configure.in Merge bk-internal.mysql.com:/home/bk/mysql-4.1 2006-11-02 17:27:42 -05:00
COPYING - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all 2005-04-13 11:51:38 +02:00
Makefile.am Merge shellback.(none):/home/msvensson/mysql/mysql-5.0 2006-10-14 17:31:04 +02:00
README README: 2006-04-01 04:13:33 +02:00

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file.
- For commercial distributions, see the MySQLEULA.txt file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installation chapter.
- For future plans, see the TODO appendix.
- For the new features/bugfix history, see the News appendix.
- For the currently known bugs/misfeatures (known errors) see the problems
  appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.