Skip to content

Commit

Permalink
Merge branch 'MDL-30739' of git://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Dec 20, 2011
2 parents 8047294 + 5cff28c commit 2dee0aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/dml/simpletest/testdml.php
Expand Up @@ -919,6 +919,17 @@ public function test_execute() {
$this->assertTrue($DB->execute($sql, array('3')));
$this->assertEqual($DB->count_records($tablename1, array('course' => 6)), 2);

// update records with subquery condition
// confirm that the option not using table aliases is cross-db
$sql = "UPDATE {{$tablename1}}
SET course = 0
WHERE NOT EXISTS (
SELECT course
FROM {{$tablename2}} tbl2
WHERE tbl2.course = {{$tablename1}}.course
AND 1 = 0)"; // Really we don't update anything, but verify the syntax is allowed
$this->assertTrue($DB->execute($sql));

// insert from one into second table
$sql = "INSERT INTO {{$tablename2}} (course)
Expand Down

0 comments on commit 2dee0aa

Please sign in to comment.