-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added options to ignore order by in deletes and updates (#89)
* Added an option to ignore order by in deletes * Enable test only when integration tests are executed * Fix code styling * Apply suggestions from code review Co-authored-by: adityamish <[email protected]> * Added clarification according to the review --------- Co-authored-by: AdalbertMemSQL <[email protected]> Co-authored-by: adityamish <[email protected]>
- Loading branch information
1 parent
051eb68
commit 1be74cf
Showing
5 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace SingleStore\Laravel\Tests\Hybrid; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use SingleStore\Laravel\Schema\Blueprint; | ||
use SingleStore\Laravel\Tests\BaseTest; | ||
|
||
class orderByTest extends BaseTest | ||
{ | ||
use HybridTestHelpers; | ||
|
||
/** @test */ | ||
public function ignoresOrderByInDelete() | ||
{ | ||
if (! $this->runHybridIntegrations()) { | ||
return; | ||
} | ||
|
||
$this->createTable(function (Blueprint $table) { | ||
$table->id(); | ||
}); | ||
|
||
DB::table('test')->insert([ | ||
['id' => 1], | ||
]); | ||
|
||
DB::table('test')->orderBy('id', 'asc')->delete(); | ||
} | ||
|
||
/** @test */ | ||
public function ignoresOrderByInUpdate() | ||
{ | ||
if (! $this->runHybridIntegrations()) { | ||
return; | ||
} | ||
|
||
$this->createTable(function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('a'); | ||
}); | ||
|
||
DB::table('test')->insert([ | ||
['id' => 1, 'a' => 'a'], | ||
]); | ||
|
||
DB::table('test')->orderBy('id', 'asc')->update(['id' => 1, 'a' => 'b']); | ||
} | ||
} |