Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions MySQL/Procedures/RMCObject/search_RMCObject.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ CREATE PROCEDURE search_RMCObject
IN dX DOUBLE,
IN dY DOUBLE,
IN dZ DOUBLE,
IN sText VARCHAR (48)
IN sText VARCHAR (48),
OUT nResult BIGINT
)
BEGIN
DECLARE MVO_RMCOBJECT_TYPE_SATELLITE INT DEFAULT 15;

DECLARE bError INT;
DECLARE bError INT DEFAULT 0;
DECLARE bCommit INT DEFAULT 0;
DECLARE nError INT DEFAULT 0;

Expand All @@ -62,7 +63,7 @@ BEGIN

IF bError = 0
THEN
SET sText = TRIM (IFNULL (sText, ''));
SET sText = TRIM(IFNULL(sText, ''));

IF sText <> ''
THEN
Expand All @@ -85,7 +86,7 @@ BEGIN
POW(4.0, o.Type_bType - 7) AS dFactor,
-1 AS dDistance
FROM RMCObject AS o
WHERE o.Name_wsRMCObjectId LIKE CONCAT(sText, '%')
WHERE o.Name_wsRMCObjectId LIKE CONCAT(sText, '%') COLLATE utf8mb4_unicode_ci
AND o.Type_bType BETWEEN bType + 1 AND MVO_RMCOBJECT_TYPE_SATELLITE
ORDER BY POW(4.0, o.Type_bType - 7) * (-1) DESC, o.Name_wsRMCObjectId
LIMIT 10;
Expand Down Expand Up @@ -164,7 +165,7 @@ BEGIN

DROP TEMPORARY TABLE Error;

SET nError = bCommit - bError - 1;
SET nResult = bCommit - 1 - nError;
END$$
DELIMITER ;

Expand Down
2 changes: 1 addition & 1 deletion MySQL/Procedures/RMTMatrix/call_RMTMatrix_Relative.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ BEGIN

mr.d20,
mr.d21,
mr.d23,
mr.d22,
mr.d23,

mr.d30,
mr.d31,
Expand Down
14 changes: 9 additions & 5 deletions MySQL/Procedures/RMTObject/search_RMTObject.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ CREATE PROCEDURE search_RMTObject
IN dX DOUBLE,
IN dY DOUBLE,
IN dZ DOUBLE,
IN sText VARCHAR (48)
IN sText VARCHAR (48),
OUT nResult BIGINT
)
BEGIN
DECLARE MVO_RMTOBJECT_TYPE_COMMUNITY INT DEFAULT 9;

DECLARE bError INT;
DECLARE bError INT DEFAULT 0;
DECLARE bCommit INT DEFAULT 0;
DECLARE nError INT;
DECLARE nError INT DEFAULT 0;

DECLARE bType TINYINT UNSIGNED;
DECLARE dRange DOUBLE;
Expand Down Expand Up @@ -75,7 +76,7 @@ BEGIN

IF bError = 0
THEN
SET sText = TRIM (IFNULL (sText, ''));
SET sText = TRIM(IFNULL(sText, ''));

IF sText <> ''
THEN
Expand All @@ -98,7 +99,7 @@ BEGIN
FROM RMTObject AS o
JOIN RMTMatrix AS m ON m.bnMatrix = o.ObjectHead_Self_twObjectIx

WHERE o.Name_wsRMTObjectId LIKE CONCAT(sText, '%')
WHERE o.Name_wsRMTObjectId LIKE CONCAT(sText, '%') COLLATE utf8mb4_unicode_ci
AND o.Type_bType BETWEEN bType + 1 AND MVO_RMTOBJECT_TYPE_COMMUNITY
ORDER BY POW (4.0, o.Type_bType - 7) * ArcLength (dRadius, dX, dY, dZ, m.d03, m.d13, m.d23), o.Name_wsRMTObjectId
LIMIT 10;
Expand Down Expand Up @@ -179,6 +180,9 @@ BEGIN

DROP TEMPORARY TABLE Error;
DROP TEMPORARY TABLE Result;

SET nResult = bCommit - 1 - nError;

END$$

DELIMITER ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down