Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F847858
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
Sat, Apr 19, 7:04 PM
Size
718 B
Mime Type
text/x-diff
Expires
Sun, Apr 20, 7:04 PM (20 m, 58 s)
Engine
blob
Format
Raw Data
Handle
602644
Attached To
D501: INP-1890 - Force "\kApplication::NextResourceId" method to use master database connection
D501.diff
View Options
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
Log In to Comment