Skip to content
Browse files

MDL-30739 add one test to confirm the solution is cross-db

  • Loading branch information...
1 parent ceec817 commit fbb829b82dc973fd7fbf074207471584281f5829 @stronk7 stronk7 committed Dec 15, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/dml/simpletest/testdml.php
View
11 lib/dml/simpletest/testdml.php
@@ -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)

0 comments on commit fbb829b

Please sign in to comment.
Something went wrong with that request. Please try again.