Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Jul 19, 6:25 AM

in-portal

Index: branches/5.2.x/core/kernel/application.php
===================================================================
--- branches/5.2.x/core/kernel/application.php (revision 16830)
+++ branches/5.2.x/core/kernel/application.php (revision 16831)
@@ -2515,8 +2515,12 @@
{
$table_name = TABLE_PREFIX . 'IdGenerator';
+ $this->Conn->nextQueryFromMaster = true;
$this->Conn->Query('LOCK TABLES ' . $table_name . ' WRITE');
+
$this->Conn->Query('UPDATE ' . $table_name . ' SET lastid = lastid + 1');
+
+ $this->Conn->nextQueryFromMaster = true;
$id = $this->Conn->GetOne('SELECT lastid FROM ' . $table_name);
if ( $id === false ) {
@@ -2524,6 +2528,7 @@
$id = 2;
}
+ $this->Conn->nextQueryFromMaster = true;
$this->Conn->Query('UNLOCK TABLES');
return $id - 1;

Event Timeline