From a5d84a3c72569cdbbc3f59c6863f8e51e2248ca5 Mon Sep 17 00:00:00 2001 From: Patrick O'Shaughnessey Date: Mon, 4 May 2026 19:55:39 -0500 Subject: [PATCH] Fix swapped d22/d23 in call_RMTMatrix_Relative ELSE branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ELSE branch (taken when the parent is not an RMTObject — i.e. for sectors directly under root) used a `SELECT ... INTO ...` pattern with `mr.d23` and `mr.d22` listed in the wrong order against the `d20, d21, d22, d23` INTO list. In MySQL, `SELECT ... INTO ...` is positional, so this silently assigned local `d22 := mr.d23` and `d23 := mr.d22`. The matrix-to-transform extraction then computed `Transform_Scale_dZ = SQRT(... d22²) = 0` and `Transform_Position_dZ = d23` from the wrong column, persisting `scale.z = 0` and `position.z = ` to the RMTObject row even though the underlying matrix was correct. Reads from the row returned the corrupt values; subscriptions propagated them to clients. The SQL Server version had the same out-of-order textual layout but the syntax there is `@var = column` (assignment by name, not position), so it was cosmetic only. Fix both for consistency so the parallel MySQL bug isn't reintroduced by copying the SQL Server pattern. Verified on a live database: a sector whose row had been corrupted self-healed to the correct values on the next transform update after the procedure was reloaded. --- MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql | 2 +- SQL_Server/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql b/MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql index cfe9314..6c96482 100644 --- a/MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql +++ b/MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql @@ -91,8 +91,8 @@ BEGIN mr.d20, mr.d21, - mr.d23, mr.d22, + mr.d23, mr.d30, mr.d31, diff --git a/SQL_Server/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql b/SQL_Server/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql index ac26aaf..73135d8 100644 --- a/SQL_Server/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql +++ b/SQL_Server/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql @@ -86,8 +86,8 @@ BEGIN @d20 = mr.d20, @d21 = mr.d21, - @d23 = mr.d23, @d22 = mr.d22, + @d23 = mr.d23, @d30 = mr.d30, @d31 = mr.d31,