mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[feature/sql-bool-builder] Adding the IS operator to predicted operators
PHPBB3-13652
This commit is contained in:
parent
bc6ea5796d
commit
576eaa0cff
2 changed files with 19 additions and 1 deletions
|
@ -866,6 +866,24 @@ abstract class driver implements driver_interface
|
||||||
|
|
||||||
break;
|
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:
|
default:
|
||||||
|
|
||||||
$condition = implode(' ', $condition);
|
$condition = implode(' ', $condition);
|
||||||
|
|
|
@ -153,7 +153,7 @@ class phpbb_boolean_processor_test extends phpbb_database_test_case
|
||||||
),
|
),
|
||||||
array('AND',
|
array('AND',
|
||||||
array('ug.group_id', '=', 1),
|
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'),
|
array('u.user_id', '=', 'ug.user_id'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue