Browse files

Merge branch 'core' into mod

* core:
  Update sequence values after board population.
  • Loading branch information...
2 parents 1c18372 + c3cf198 commit fb763ff5b5bd2e9d3845040bed5e360ebc2edb36 @p committed Apr 25, 2012
View
8 includes/db/mssql.php
@@ -50,6 +50,14 @@ function sql_select_db($dbname)
{
return @mssql_select_db($dbname, $this->db_connect_id);
}
+
+ /**
+ * Updates value of a sequence.
+ * Does nothing in this dbal.
+ */
+ public function update_sequence($sequence_name, $value)
+ {
+ }
}
?>
View
8 includes/db/mysql.php
@@ -65,6 +65,14 @@ function sql_select_db($dbname)
{
return @mysql_select_db($dbname, $this->db_connect_id);
}
+
+ /**
+ * Updates value of a sequence.
+ * Does nothing in this dbal.
+ */
+ public function update_sequence($sequence_name, $value)
+ {
+ }
}
?>
View
8 includes/db/mysqli.php
@@ -54,6 +54,14 @@ function sql_select_db($dbname)
{
return @mysqli_select_db($this->db_connect_id, $dbname);
}
+
+ /**
+ * Updates value of a sequence.
+ * Does nothing in this dbal.
+ */
+ public function update_sequence($sequence_name, $value)
+ {
+ }
}
?>
View
9 includes/db/postgres.php
@@ -31,4 +31,13 @@ public function sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport = false,
}
return parent::sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $persistency, $new_link);
}
+
+ /**
+ * Updates value of a sequence.
+ */
+ public function update_sequence($sequence_name, $value)
+ {
+ $result = $this->sql_query("select setval('$sequence_name', '$value')");
+ $this->sql_freeresult($result);
+ }
}
View
8 includes/db/sqlite.php
@@ -107,6 +107,14 @@ function sql_create_db($dbname)
return $this->db_connect_id;
}
+
+ /**
+ * Updates value of a sequence.
+ * Does nothing in this dbal.
+ */
+ public function update_sequence($sequence_name, $value)
+ {
+ }
}
?>
View
3 includes/functions_populate.php
@@ -407,6 +407,9 @@ private function fill_forums()
// phpBB installs the forum with one topic and one post.
set_config('num_topics', $topic_cnt + 1);
set_config('num_posts', $post_cnt + 1);
+
+ $db->update_sequence(TOPICS_TABLE . '_seq', $topic_cnt + 1);
+ $db->update_sequence(POSTS_TABLE . '_seq', $post_cnt + 1);
}
/**

0 comments on commit fb763ff

Please sign in to comment.