MDL-32697 use current database sequences instead of global scope
authorPetr Skoda <commits@skodak.org>
Thu, 3 May 2012 08:52:19 +0000 (10:52 +0200)
committerPetr Skoda <commits@skodak.org>
Thu, 3 May 2012 08:52:19 +0000 (10:52 +0200)
Credit goes to Eloy, thanks!

lib/phpunit/lib.php

index de9bb86..8006877 100644 (file)
@@ -283,7 +283,7 @@ class phpunit_util {
             $lookup = array_flip($sequences);
             $empties = array();
             list($seqs, $params) = $DB->get_in_or_equal($sequences);
-            $sql = "SELECT sequence_name FROM dba_sequences WHERE last_number = 1 AND sequence_name $seqs";
+            $sql = "SELECT sequence_name FROM user_sequences WHERE last_number = 1 AND sequence_name $seqs";
             $rs = $DB->get_recordset_sql($sql, $params);
             foreach ($rs as $seq) {
                 $table = $lookup[$seq->sequence_name];
@@ -379,7 +379,7 @@ class phpunit_util {
 
             $current = array();
             list($seqs, $params) = $DB->get_in_or_equal($sequences);
-            $sql = "SELECT sequence_name, last_number FROM dba_sequences WHERE sequence_name $seqs";
+            $sql = "SELECT sequence_name, last_number FROM user_sequences WHERE sequence_name $seqs";
             $rs = $DB->get_recordset_sql($sql, $params);
             foreach ($rs as $seq) {
                 $table = $lookup[$seq->sequence_name];