A coder's home for Marc "Foddex" Oude Kotte, who used to be located in Enschede, The Netherlands, but now in Stockholm, Sweden!
foddex.net

MySQL SUM whitespace weirdness [updated]

Originally posted at Fri 17-04-2009 07:07:46, in the nerd stuff category.
I just found out that MySQL seems to have difficulties with whitespace in a very, very weird way. I needed to summarize all sizes for all documents stored in a customer's database, and so I executed this query (literally):

SELECT SUM (size) FROM `documents`

To my great surprise and frustration MySQL responded with:

FUNCTION dbname.SUM does not exist

Eh, 'xcuse me? Who's the genius who decided that SUM is no longer a function we want in MySQL? Turns out that removing the space between SUM and the parenthesis open did the trick:

SELECT SUM(size) FROM `documents`

And voila, my results....

I know MySQL can be a bit strange at times, but this one was a bit too much for me. Can anyone enlighten me on this? I'm running server version 5.0.45-community-nt on a Fedora 9 box.


[ update ]
I found this page.... I'm.... flabbergasted, to put it mildly...

-- Foddex



0 comment(s)

Name:
URL: (optional!)
Write your comment:
Answer this question to prove you're human:
What's the last name of the first black American president?