Skip to content

Commit b45ca7a

Browse files
committed
Added code to remove database name from table as SingleStore does not support this.
1 parent 578ae05 commit b45ca7a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Query/Grammar.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,23 @@ private function compileOffsetWithLimit($offset, $limit): string
254254

255255
return ' OFFSET '.(int) $offset;
256256
}
257+
258+
/**
259+
* Compile a delete statement with joins into SQL.
260+
*
261+
* @param \Illuminate\Database\Query\Builder $query
262+
* @param string $table
263+
* @param string $where
264+
* @return string
265+
*/
266+
protected function compileDeleteWithJoins(Builder $query, $table, $where): string
267+
{
268+
$joins = $this->compileJoins($query, $query->joins);
269+
270+
// SingleStore does not support "database.table" in a delete statement when the delete statement contains a join
271+
// strip the database name from the table, if it exists
272+
$deleteTable = last(explode('.', $table));
273+
274+
return "delete {$deleteTable} from {$table} {$joins} {$where}";
275+
}
257276
}

0 commit comments

Comments
 (0)