diff --git a/src/Lunr/Cache/Cache.php b/src/Lunr/Cache/Cache.php
index 3f36b418588387770e4b6f9ea3f26809922db3f5..bac6bd7bf3cab6b1e6b77e788af383d441a9383e 100644
--- a/src/Lunr/Cache/Cache.php
+++ b/src/Lunr/Cache/Cache.php
@@ -46,13 +46,13 @@ class Cache
      *
      * @param string $key Unique identifier for the data.
      *
-     * @return mixed|boolean FALSE if error, mixed data if successful.
+     * @return mixed NULL if error, mixed data if successful.
      */
     public function get($key)
     {
         if (empty($key))
         {
-            return FALSE;
+            return NULL;
         }
 
         $item = $this->cache_pool->getItem($key);
@@ -62,7 +62,7 @@ class Cache
             return $item->get();
         }
 
-        return FALSE;
+        return NULL;
     }
 
     /**
diff --git a/src/Lunr/Cache/Tests/CacheHandlerDataTest.php b/src/Lunr/Cache/Tests/CacheHandlerDataTest.php
index 8dd8adc15486a3a24bab53cded77b49924f2b272..d0ea1ac50d08fbccd59ae2b5bd28d93424766dc6 100644
--- a/src/Lunr/Cache/Tests/CacheHandlerDataTest.php
+++ b/src/Lunr/Cache/Tests/CacheHandlerDataTest.php
@@ -27,7 +27,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
     public function testGetCallWithoutKey(): void
     {
         $method = $this->get_accessible_reflection_method('get');
-        $this->assertEquals(FALSE, $method->invoke($this->class, NULL));
+        $this->assertNull($method->invoke($this->class, NULL));
     }
 
     /**
@@ -53,7 +53,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
               ->will($this->returnValue($item));
 
         $method = $this->get_accessible_reflection_method('get');
-        $this->assertEquals(FALSE, $method->invoke($this->class, $key));
+        $this->assertNull($method->invoke($this->class, $key));
     }
 
     /**
@@ -95,7 +95,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
     public function testSetCallWithoutKey(): void
     {
         $method = $this->get_accessible_reflection_method('set');
-        $this->assertEquals(FALSE, $method->invoke($this->class, NULL, 3));
+        $this->assertFalse($method->invoke($this->class, NULL, 3));
     }
 
     /**
@@ -106,7 +106,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
     public function testSetCallWithoutValue(): void
     {
         $method = $this->get_accessible_reflection_method('set');
-        $this->assertEquals(FALSE, $method->invoke($this->class, 42, NULL));
+        $this->assertFalse($method->invoke($this->class, 42, NULL));
     }
 
     /**
@@ -141,7 +141,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
                          ->with($item);
 
         $method = $this->get_accessible_reflection_method('set');
-        $this->assertEquals(TRUE, $method->invoke($this->class, $key, $data));
+        $this->assertTrue($method->invoke($this->class, $key, $data));
     }
 
     /**
@@ -177,7 +177,7 @@ class CacheHandlerDataTest extends CacheHandlerTest
                          ->with($item);
 
         $method = $this->get_accessible_reflection_method('set');
-        $this->assertEquals(TRUE, $method->invoke($this->class, $key, $data, $ttl));
+        $this->assertTrue($method->invoke($this->class, $key, $data, $ttl));
     }
 
 }
diff --git a/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php b/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
index ca041927ce2ba5ec86cf947c033ce8829faa5d6b..e1045b328a17614419e097f996455a2062848ac0 100644
--- a/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
+++ b/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
@@ -443,11 +443,11 @@ interface DMLQueryBuilderInterface
      * Define a UNION or UNION ALL clause of the SQL statement.
      *
      * @param string $sql_query SQL query reference
-     * @param bool   $all       True for ALL or False for empty (default).
+     * @param string $type      Type of UNION operation to perform.
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
-    public function union($sql_query, $all = FALSE);
+    public function union($sql_query, $type);
 
     /**
      * Define the lock mode for a transaction.
diff --git a/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php b/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
index 621fa1a63924c86be87d70d1877aad9107e93fec..fb82e4540c844702472e53318222924bf2932411 100644
--- a/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
@@ -808,18 +808,27 @@ abstract class DatabaseDMLQueryBuilder implements DMLQueryBuilderInterface
      * Define a compound clause for the SQL statement.
      *
      * @param string $sql_query Left expression
-     * @param string $base      Whether to construct UNION, EXCEPT or INTERSECT
+     * @param string $type      Whether to construct UNION, EXCEPT or INTERSECT
+     * @param mixed  $operator  Whether to add ALL, DISTINCT or default
      *
      * @return void
      */
-    protected function sql_compound($sql_query, $base)
+    protected function sql_compound($sql_query, $type, $operator = NULL)
     {
         if ($this->compound != '')
         {
             $this->compound .= ' ';
         }
+        if($operator == 'ALL' || $operator == 'DISTINCT' || empty($operator))
+        {
+            $base = $type . " " . $operator;
+        }
+        else
+        {
+            $base = $type;
+        }
 
-        $this->compound .= $base . ' ' . $sql_query;
+        $this->compound .= rtrim($base) . ' ' . $sql_query;
     }
 
     /**
diff --git a/src/Lunr/Gravity/Database/MariaDB/MariaDBDMLQueryBuilder.php b/src/Lunr/Gravity/Database/MariaDB/MariaDBDMLQueryBuilder.php
index 3205eaf6c6ff7d13f83978a069394ce8ff75a783..d1c73bb3cb952c7dea2c07e24b08e9fb3e828ecb 100644
--- a/src/Lunr/Gravity/Database/MariaDB/MariaDBDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/MariaDB/MariaDBDMLQueryBuilder.php
@@ -50,6 +50,34 @@ class MariaDBDMLQueryBuilder extends MySQLDMLQueryBuilder
         return $this;
     }
 
+    /**
+     * Define a EXCEPT, EXCEPT ALL or EXCEPT DISTINCT clause of the SQL statement.
+     *
+     * @param string $sql_query SQL query reference
+     * @param string $operator  EXCEPT operation to perform
+     *
+     * @return MariaDBDMLQueryBuilder $self Self reference
+     */
+    public function except($sql_query, $operator = NULL)
+    {
+        $this->sql_compound($sql_query, 'EXCEPT', strtoupper($operator));
+        return $this;
+    }
+
+    /**
+     * Define a INTERSECT, INTERSECT ALL or INTERSECT DISTINCT clause of the SQL statement.
+     *
+     * @param string $sql_query SQL query reference
+     * @param string $operator  INTERSECT operation to perform
+     *
+     * @return MariaDBDMLQueryBuilder $self Self reference
+     */
+    public function intersect($sql_query, $operator = NULL)
+    {
+        $this->sql_compound($sql_query, 'INTERSECT', strtoupper($operator));
+        return $this;
+    }
+
 }
 
 ?>
diff --git a/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..57588edb911b26a86441d854d15b5081c8a8c8f2
--- /dev/null
+++ b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * This file contains the MariaDBDMLQueryBuilderSelectTest class.
+ *
+ * @package    Lunr\Gravity\Database\MariaDB
+ * @author     David Cova <d.cova@m2mobi.com>
+ * @copyright  2013-2018, M2Mobi BV, Amsterdam, The Netherlands
+ * @license    http://lunr.nl/LICENSE MIT License
+ */
+
+namespace Lunr\Gravity\Database\MariaDB\Tests;
+
+use Lunr\Gravity\Database\MariaDB\Tests\MariaDBDMLQueryBuilderTest;
+/**
+ * This class contains select tests for the MariaDBDMLQueryBuilder class.
+ *
+ * @covers Lunr\Gravity\Database\MariaDB\MariaDBDMLQueryBuilder
+ */
+class MariaDBDMLQueryBuilderSelectTest extends MariaDBDMLQueryBuilderTest
+{
+     /**
+     * Test if except returns an instance of itself.
+     *
+     * @covers Lunr\Gravity\Database\MariaDB\MariaDBDMLQueryBuilder::except
+     */
+    public function testIfExceptReturnsSelfReference(): void
+    {
+        $return = $this->builder->except('query');
+
+        $this->assertInstanceOf('Lunr\Gravity\Database\MariaDB\MariaDBDMLQueryBuilder', $return);
+        $this->assertSame($this->builder, $return);
+    }
+
+    /**
+     * Test if intersect returns an instance of itself.
+     *
+     * @covers Lunr\Gravity\Database\MariaDB\MariaDBDMLQueryBuilder::intersect
+     */
+    public function testIfIntersectReturnsSelfReference(): void
+    {
+        $return = $this->builder->intersect('query');
+
+        $this->assertInstanceOf('Lunr\Gravity\Database\MariaDB\MariaDBDMLQueryBuilder', $return);
+        $this->assertSame($this->builder, $return);
+    }
+
+}
+
+?>
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php b/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
index 4d2faca639ee137b3cf9b46213c2b5024c937a81..0b5e48884be2ea32ed8cb9492fa1139f23602227 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
@@ -782,13 +782,13 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * Define a UNION or UNION ALL clause of the SQL statement.
      *
      * @param string $sql_query SQL query reference
-     * @param bool   $all       True for ALL or False for empty (default).
+     * @param string $operator  UNION operation to perform
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
-    public function union($sql_query, $all = FALSE)
+    public function union($sql_query, $operator = NULL)
     {
-        $this->builder->union($this->escaper->query_value($sql_query), $all);
+        $this->builder->union($this->escaper->query_value($sql_query), $operator);
         return $this;
     }
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
index 7cf20eda8677702090279357ddc98389e3cf23dc..caf71456e15c2871e639ca8d42c6cc9c79b10bcf 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
@@ -200,17 +200,37 @@ class MySQLSimpleDMLQueryBuilderSelectTest extends MySQLSimpleDMLQueryBuilderTes
     {
         $this->escaper->expects($this->once())
                       ->method('query_value')
-                      ->with($this->equalTo('query'))
-                      ->will($this->returnValue('(query)'));
+                      ->with('query')
+                      ->willReturn('(query)');
 
         $this->builder->expects($this->once())
                       ->method('union')
-                      ->with($this->equalTo('(query)'))
-                      ->will($this->returnSelf());
+                      ->with('(query)')
+                      ->willReturnSelf();
 
         $this->class->union('query');
     }
 
+    /**
+     * Test union() distinct.
+     *
+     * @covers Lunr\Gravity\Database\MySQL\MySQLSimpleDMLQueryBuilder::union
+     */
+    public function testUnionDistinct(): void
+    {
+        $this->escaper->expects($this->once())
+                      ->method('query_value')
+                      ->with('query')
+                      ->willReturn('(query)');
+
+        $this->builder->expects($this->once())
+                      ->method('union')
+                      ->with('(query)', 'DISTINCT')
+                      ->willReturnSelf();
+
+        $this->class->union('query', 'DISTINCT');
+    }
+
      /**
      * Test union() all.
      *
@@ -220,17 +240,57 @@ class MySQLSimpleDMLQueryBuilderSelectTest extends MySQLSimpleDMLQueryBuilderTes
     {
         $this->escaper->expects($this->once())
                       ->method('query_value')
-                      ->with($this->equalTo('query'))
-                      ->will($this->returnValue('(query)'));
+                      ->with('query')
+                      ->willReturn('(query)');
 
         $this->builder->expects($this->once())
                       ->method('union')
-                      ->with($this->equalTo('(query)', TRUE), $this->equalTo(TRUE))
-                      ->will($this->returnSelf());
+                      ->with('(query)', 'ALL')
+                      ->willReturnSelf();
+
+        $this->class->union('query', 'ALL');
+    }
+
+    /**
+     * Test union() when parameter passed is TRUE.
+     *
+     * @covers Lunr\Gravity\Database\MySQL\MySQLSimpleDMLQueryBuilder::union
+     */
+    public function testUnionWithTypeTrue(): void
+    {
+        $this->escaper->expects($this->once())
+                      ->method('query_value')
+                      ->with('query')
+                      ->willReturn('(query)');
+
+        $this->builder->expects($this->once())
+                      ->method('union')
+                      ->with('(query)', TRUE)
+                      ->willReturnSelf();
 
         $this->class->union('query', TRUE);
     }
 
+    /**
+     * Test union() when parameter passed is FALSE.
+     *
+     * @covers Lunr\Gravity\Database\MySQL\MySQLSimpleDMLQueryBuilder::union
+     */
+    public function testUnionWithTypeFalse(): void
+    {
+        $this->escaper->expects($this->once())
+                      ->method('query_value')
+                      ->with('query')
+                      ->willReturn('(query)');
+
+        $this->builder->expects($this->once())
+                      ->method('union')
+                      ->with('(query)', FALSE)
+                      ->willReturnSelf();
+
+        $this->class->union('query', FALSE);
+    }
+
 }
 
 ?>
diff --git a/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php b/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
index 8598aa54e5c2ce0a3cb656a454372ce48dee62b1..df6913a85513764c9431aa2de3ceec5e9f89918d 100644
--- a/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
@@ -517,17 +517,16 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
     }
 
     /**
-     * Define a UNION or UNION ALL clause of the SQL statement.
-     *
-     * @param string $sql_query SQL query reference
-     * @param bool   $all       True for ALL or False for empty (default).
-     *
-     * @return SQLDMLQueryBuilder $self Self reference
-     */
-    public function union($sql_query, $all = FALSE)
-    {
-        $base = ($all === TRUE) ? 'UNION ALL' : 'UNION';
-        $this->sql_compound($sql_query, $base);
+    * Define a UNION, UNION DISTINCT or UNION ALL clause of the SQL statement.
+    *
+    * @param string $sql_query SQL query reference
+    * @param string $operator  UNION operation to perform
+    *
+    * @return SQLDMLQueryBuilder $self Self reference
+    */
+    public function union($sql_query, $operator = NULL)
+    {
+        $this->sql_compound($sql_query, 'UNION', strtoupper($operator));
         return $this;
     }
 
diff --git a/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php b/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
index 02f88bfdb82fa8288b0115a939627c405de92a42..c39569b5518cb143c5776ef113d395ba6e2d688f 100644
--- a/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
@@ -267,6 +267,42 @@ class SQLite3DMLQueryBuilder extends SQLDMLQueryBuilder
         return $this;
     }
 
+    /**
+     * Define a EXCEPT, EXCEPT ALL or EXCEPT DISTINCT clause of the SQL statement.
+     *
+     * @param string $sql_query SQL query reference
+     * @param string $operator  EXCEPT operation to perform
+     *
+     * @return SQLite3DMLQueryBuilder $self Self reference
+     */
+    public function except($sql_query, $operator = NULL)
+    {
+        if(strtoupper($operator) !== 'DISTINCT')
+        {
+            $operator = NULL;
+        }
+        $this->sql_compound($sql_query, 'EXCEPT', $operator);
+        return $this;
+    }
+
+    /**
+     * Define a INTERSECT, INTERSECT ALL or INTERSECT DISTINCT clause of the SQL statement.
+     *
+     * @param string $sql_query SQL query reference
+     * @param string $operator  INTERSECT operation to perform
+     *
+     * @return SQLite3DMLQueryBuilder $self Self reference
+     */
+    public function intersect($sql_query, $operator = NULL)
+    {
+        if(strtoupper($operator) !== 'DISTINCT')
+        {
+            $operator = NULL;
+        }
+        $this->sql_compound($sql_query, 'INTERSECT', $operator);
+        return $this;
+    }
+
 }
 
 ?>
diff --git a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3DMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3DMLQueryBuilderSelectTest.php
index 4aa1ee51d44ea564c73f5953093a6dba22c0d6c5..6fbb32aa67ce2fc775e90bf735b40791211a83be 100644
--- a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3DMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3DMLQueryBuilderSelectTest.php
@@ -96,4 +96,30 @@ class SQLite3DMLQueryBuilderSelectTest extends SQLite3DMLQueryBuilderTest
         $this->assertSame($this->class, $return);
     }
 
+    /**
+     * Test if except returns an instance of itself.
+     *
+     * @covers Lunr\Gravity\Database\SQLite3\SQLite3DMLQueryBuilder::except
+     */
+    public function testIfExceptReturnsSelfReference()
+    {
+        $except = $this->class->except('query');
+
+        $this->assertInstanceOf('Lunr\Gravity\Database\SQLite3\SQLite3DMLQueryBuilder', $except);
+        $this->assertSame($this->class, $except);
+    }
+
+    /**
+     * Test if intersect returns an instance of itself.
+     *
+     * @covers Lunr\Gravity\Database\SQLite3\SQLite3DMLQueryBuilder::intersect
+     */
+    public function testIfIntersectReturnsSelfReference()
+    {
+        $intersect = $this->class->intersect('query');
+
+        $this->assertInstanceOf('Lunr\Gravity\Database\SQLite3\SQLite3DMLQueryBuilder', $intersect);
+        $this->assertSame($this->class, $intersect);
+    }
+
 }
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
index 1dcb661843034cf2d9f4547dde12868cd36bdbeb..413d819a67438189508686ce5c3c2b7a20d96daa 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
@@ -23,9 +23,9 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
 {
 
     /**
-     * Test specifying the UNION part of a query.
+     * Test specifying a compound query.
      *
-     * @param string $types Compound query operator
+     * @param string $types     Compound query operator
      *
      * @dataProvider compoundQueryTypeProvider
      * @covers       Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
@@ -46,7 +46,7 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
      *
      * @covers Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
      */
-    public function testCompoundQueryWhenCompoundIsSet(): void
+    public function testCompoundQueryWhenCompoundIsSetWithUnion(): void
     {
         $this->set_reflection_property_value('compound', 'QUERY');
 
@@ -57,6 +57,38 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
         $this->assertPropertyEquals('compound', 'QUERY UNION (sql query)');
     }
 
+    /**
+     * Test specifying the EXCEPT part of a query, when compound is set.
+     *
+     * @covers Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
+     */
+    public function testCompoundQueryWhenCompoundIsSetWithExcept(): void
+    {
+        $this->set_reflection_property_value('compound', 'QUERY');
+
+        $method = $this->get_accessible_reflection_method('sql_compound');
+
+        $method->invokeArgs($this->class, [ '(sql query)', 'EXCEPT' ]);
+
+        $this->assertPropertyEquals('compound', 'QUERY EXCEPT (sql query)');
+    }
+
+    /**
+     * Test specifying the INTERSECT part of a query, when compound is set.
+     *
+     * @covers Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
+     */
+    public function testCompoundQueryWhenCompoundIsSetWithIntersect(): void
+    {
+        $this->set_reflection_property_value('compound', 'QUERY');
+
+        $method = $this->get_accessible_reflection_method('sql_compound');
+
+        $method->invokeArgs($this->class, [ '(sql query)', 'INTERSECT' ]);
+
+        $this->assertPropertyEquals('compound', 'QUERY INTERSECT (sql query)');
+    }
+
     /**
      * Test creating a simple order by statement.
      *
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderTest.php
index b180e22ed1ac5bebe7b6d0260d1637b987cecfb6..402702a68b10428a87d48cd04522c75ea6574029 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderTest.php
@@ -119,8 +119,13 @@ abstract class DatabaseDMLQueryBuilderTest extends LunrBaseTest
         $types   = [];
         $types[] = [ 'UNION' ];
         $types[] = [ 'UNION ALL' ];
+        $types[] = [ 'UNION DISTINCT' ];
         $types[] = [ 'EXCEPT' ];
+        $types[] = [ 'EXCEPT ALL' ];
+        $types[] = [ 'EXCEPT DISTINCT' ];
         $types[] = [ 'INTERSECT' ];
+        $types[] = [ 'INTERSECT ALL' ];
+        $types[] = [ 'INTERSECT DISTINCT' ];
 
         return $types;
     }
diff --git a/src/Lunr/Gravity/Database/Tests/SQLDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/Tests/SQLDMLQueryBuilderSelectTest.php
index b6986b6c0adb48bc0cc0de6a8b7532b14b4e8ded..0e6c299eec29b7ded4170c16d8ef60e1977473b8 100644
--- a/src/Lunr/Gravity/Database/Tests/SQLDMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/Tests/SQLDMLQueryBuilderSelectTest.php
@@ -171,11 +171,24 @@ class SQLDMLQueryBuilderSelectTest extends SQLDMLQueryBuilderTest
      */
     public function testUnion(): void
     {
-        $return = $this->class->union('QUERY');
+        $this->class->union('QUERY');
 
         $this->assertPropertyEquals('compound', 'UNION QUERY');
     }
 
+    /**
+     * Test specifying a UNION DISTINCT statement.
+     *
+     * @depends Lunr\Gravity\Database\Tests\DatabaseDMLQueryBuilderQueryPartsTest::testCompoundQuery
+     * @covers  Lunr\Gravity\Database\SQLDMLQueryBuilder::union
+     */
+    public function testUnionDistinct(): void
+    {
+        $this->class->union('QUERY', 'DISTINCT');
+
+        $this->assertPropertyEquals('compound', 'UNION DISTINCT QUERY');
+    }
+
     /**
      * Test specifying a UNION ALL statement.
      *
@@ -184,13 +197,13 @@ class SQLDMLQueryBuilderSelectTest extends SQLDMLQueryBuilderTest
      */
     public function testUnionAll(): void
     {
-        $return = $this->class->union('QUERY', TRUE);
+        $this->class->union('QUERY', 'ALL');
 
         $this->assertPropertyEquals('compound', 'UNION ALL QUERY');
     }
 
     /**
-     * Test fluid interface of the union method.
+     * Test fluid interface of the UNION method.
      *
      * @covers Lunr\Gravity\Database\SQLDMLQueryBuilder::union
      */
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index 43b21b2e2edcc223b3ce150480fe18cf71009fb9..3b3f2aeafdcc765f29cd8a56661b40a016677b5a 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -161,6 +161,7 @@
             <file>../src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php</file>
             <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBConnectionBaseTest.php</file>
             <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderDeleteTest.php</file>
+            <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php</file>
             <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderBaseTest.php</file>
             <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderDeleteTest.php</file>
             <file>../src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderBaseTest.php</file>
