Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1098784
D501.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 14, 5:44 AM
Size
763 B
Mime Type
text/x-diff
Expires
Fri, Aug 15, 5:44 AM (1 h, 29 m)
Engine
blob
Format
Raw Data
Handle
710947
Attached To
D501: INP-1890 - Force "\kApplication::NextResourceId" method to use master database connection
D501.diff
View Options
Index: branches/5.2.x/core/kernel/application.php
===================================================================
--- branches/5.2.x/core/kernel/application.php
+++ branches/5.2.x/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
Log In to Comment