User tests: Successful: Unsuccessful:
Fixes a couple of conditions that fail on PostgreSQL and MS SQL.
As a simple test, try these queries:
SELECT * FROM #__content WHERE 0
SELECT * FROM #__content WHERE 0 != 0
No results returned and no errors.
First query has errors.
On MSSQL:
An expression of non-boolean type specified in a context where a condition is expected, near '0'.
On PostgreSQL:
ERROR: argument of WHERE must be type boolean, not type integer Position: 33
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_users Front End com_banners |
Labels |
Added:
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Isn't this just places where we shouldn't be running queries to begin with rather than forcing queries to return empty results?
Yes, that would be better.
Closing this. Will make 2 separate PRs.
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-28 09:23:55 |
Closed_By | ⇒ | SharkyKZ | |
Labels |
Added:
?
|
I have tested this item✅ successfully on c116c1b
Code review + I can confirm that this is the right, standard SQL way to do it for any kind of database, have some condition which resolves to false or true, depending on the purpose. I've had that problemn recently, too, and have fixed it in the same way. Is a very commong thing to use such conditions for such purpose.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26789.