• Welcome to Simple Machines Community Forum. Please login or sign up.

ManageNews.php newsletter sending error in postgresql

Started by piercej, October 16, 2014, 08:15:03 PM

Previous topic - Next topic

piercej

line 375 of Sources/ManageNews.php throws an error on postgresql 9.3 when you try and email a newsletter.


Database Error
ERROR: COALESCE types integer and boolean cannot be matched
LINE 6: AND (COALESCE(bg.expire_time, 1=1) OR bg.expire_time > 14...
^
File: /home/observers/smf/Sources/ManageNews.php
Line: 375

(this is on SMF 2.0.7)

I fixed this line to read...

                        AND (bg.expire_time IS NULL OR bg.expire_time > {int:current_time})

and it works, and IMHO, is easier to read.    8)

afaik, this should work in MySQL too, as IS NULL is standard sql.  COALESCE(INTEGER, BOOLEAN) doesn't make any sense to me.  ???




piercej

fyi, this code is unchanged in 2.0.8 (yeah, I should have upgraded /before/ I posted).

I haven't actually tested my alternate sql in mysql but it SHOULD work as mysql supports the standard construct IS NULL.


Oldiesmann

I'm as stumped as you are as to why COALESCE() is used there. It's already been changed to IS NULL for 2.1 though.
Michael Eshom
Cincy Space - now open!

Advertisement: