Bug #15090 sum()
Submitted: 21 Nov 2005 7:26 Modified: 28 May 2013 12:54
Reporter: Massimo Lodini Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.12 OS:Windows (XP Professional)
Assigned to: CPU Architecture:Any

[21 Nov 2005 7:26] Massimo Lodini
Description:
SELECT SUM(N_PERS) AS TOTAL FROM USERS WHERE USERID = 1

always returns null

Even the workaround
"SELECT CAST(SUM(N_PERS) as CHAR) AS TOTAL FROM USERS WHERE USERID = 1"
which is working on Windows2003 doesn't work on XP

How to repeat:
SELECT SUM(N_PERS) AS TOTAL FROM USERS WHERE USERID = 1
[21 Nov 2005 17:44] Valeriy Kravchuk
Thank you for a problem report. Please, send the SHOW CREATE TABLE results for the table used, as well as test data. What version of MySQL server are you connecting to?
[21 Nov 2005 22:29] Massimo Lodini
here is the SHOW CREATE TABLE result:

'users', 'CREATE TABLE `users` (
  `ID` int(10) NOT NULL auto_increment,
  `Page` varchar(255) NOT NULL default '',
  `Date` date NOT NULL default '0000-00-00',
  `UserID` mediumint(10) NOT NULL default '0',
  `n_pers` smallint(5) NOT NULL default '0',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1'

MySQL Server version is 5.0.15
[23 Nov 2005 10:41] Vasily Kishkin
Sorry...I was not able to reproduce the bug. The sum() works correct on my test case. Could you please create simple test case and attach ? I attached my test case.
[23 Nov 2005 10:42] Vasily Kishkin
Test case

Attachment: test.c (text/plain), 3.88 KiB.

[9 Dec 2005 10:09] Massimo Lodini
I've seen the test case....
sorry, I forgot to tell you that the problems occurs using ASP 3.0 on IIS, that's the reason why you have not been able to reproduce it.
[10 Dec 2005 10:14] Vasily Kishkin
I created asp test case and I was not able to reproduce the bug. Could you please test my test case on your computer. The test case is attached.
[10 Dec 2005 10:16] Vasily Kishkin
Test case

Attachment: 15090.asp (application/octet-stream, text), 655 bytes.

[11 Jan 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[28 May 2013 12:54] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.