Skip to content

Commit 17abf6d

Browse files
authored
Merge pull request #179 from glukkkk/issue-176
support MATCH conditions with DELETE queries
2 parents 53f799f + 73b42cf commit 17abf6d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/SphinxQL.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,9 @@ public function compileDelete()
807807
$query .= 'FROM '.$this->from[0].' ';
808808
}
809809

810+
if (!empty($this->match)) {
811+
$query .= $this->compileMatch();
812+
}
810813
if (!empty($this->where)) {
811814
$query .= $this->compileWhere();
812815
}

tests/SphinxQL/SphinxQLTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,12 @@ public function testDelete()
863863
$result = $this->createSphinxQL()
864864
->delete()
865865
->from('rt')
866-
->where('id', 'IN', array(10, 11, 12))
866+
->where('id', 'IN', [11, 12, 13])
867+
->match('content', 'content')
867868
->execute()
868869
->getStored();
869870

870-
$this->assertSame(3, $result);
871+
$this->assertSame(2, $result);
871872
}
872873

873874
/**

0 commit comments

Comments
 (0)