Page MenuHomeIn-Portal Phabricator

D501.diff
No OneTemporary

File Metadata

Created
Sat, Apr 19, 7:04 PM

D501.diff

Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php
+++ core/kernel/application.php
@@ -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