diff --git a/lib/Db/Driver.php b/lib/Db/Driver.php index cc522dc..09f16e7 100644 --- a/lib/Db/Driver.php +++ b/lib/Db/Driver.php @@ -75,8 +75,8 @@ interface Driver { * - "nocase": the name of a general-purpose case-insensitive collation sequence * - "like": the case-insensitive LIKE operator * - "integer": the integer type to use for explicit casts - * - "asc": ascending sort order - * - "desc": descending sort order + * - "asc": ascending sort order when dealing with nulls + * - "desc": descending sort order when dealing with nulls */ public function sqlToken(string $token): string; diff --git a/tests/cases/Db/BaseDriver.php b/tests/cases/Db/BaseDriver.php index f47bcf0..e34cf65 100644 --- a/tests/cases/Db/BaseDriver.php +++ b/tests/cases/Db/BaseDriver.php @@ -394,7 +394,7 @@ abstract class BaseDriver extends \JKingWeb\Arsse\Test\AbstractTest { $this->assertSame("Z", $this->drv->query("SELECT 'Z' collate $nocase")->getValue()); $this->assertSame("Z", $this->drv->query("SELECT 'Z' where 'Z' $like 'z'")->getValue()); $this->assertEquals(1, $this->drv->query("SELECT CAST((1=1) as $integer)")->getValue()); - $this->assertEquals([null, 1], array_column($this->drv->query("SELECT 1 as t union select null as t order by t $asc")->getAll(), "t")); - $this->assertEquals([1, null], array_column($this->drv->query("SELECT 1 as t union select null as t order by t $desc")->getAll(), "t")); + $this->assertEquals([null, 1, 2], array_column($this->drv->query("SELECT 1 as t union select null as t union select 2 as t order by t $asc")->getAll(), "t")); + $this->assertEquals([2, 1, null], array_column($this->drv->query("SELECT 1 as t union select null as t union select 2 as t order by t $desc")->getAll(), "t")); } }