1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-26 04:52:36 +01:00

[feature/sql-bool-builder] Adding the IS operator to predicted operators

PHPBB3-13652
This commit is contained in:
brunoais 2015-03-16 11:31:51 +00:00
parent bc6ea5796d
commit 576eaa0cff
2 changed files with 19 additions and 1 deletions

View File

@ -866,6 +866,24 @@ abstract class driver implements driver_interface
break;
case 'IS_NOT':
$condition[1] = 'IS NOT';
// no break
case 'IS':
// If the value is NULL, the string of it is the empty string ('') which is not the intended result.
// this should solve that
if ($condition[2] === null)
{
$condition[2] = 'NULL';
}
$condition = implode(' ', $condition);
break;
default:
$condition = implode(' ', $condition);

View File

@ -153,7 +153,7 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
),
array('AND',
array('ug.group_id', '=', 1),
array('b.ban_id', 'IS NOT', NULL),
array('b.ban_id', 'IS_NOT', NULL),
),
),
array('u.user_id', '=', 'ug.user_id'),