This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(db): don't return zombie devices from accountDevices
#165 r=vbudhram
- Loading branch information
Showing
7 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Alter the accountDevices stored procedure to use INNER JOIN instead of | ||
-- LEFT JOIN. There are zombie device records, we don't care about them. | ||
CREATE PROCEDURE `accountDevices_5` ( | ||
IN `uidArg` BINARY(16) | ||
) | ||
BEGIN | ||
SELECT | ||
d.uid, | ||
d.id, | ||
d.sessionTokenId, | ||
d.name, | ||
d.type, | ||
d.createdAt, | ||
d.callbackURL, | ||
d.callbackPublicKey, | ||
d.callbackAuthKey, | ||
s.uaBrowser, | ||
s.uaBrowserVersion, | ||
s.uaOS, | ||
s.uaOSVersion, | ||
s.uaDeviceType, | ||
s.lastAccessTime | ||
FROM devices d INNER JOIN sessionTokens s | ||
ON d.sessionTokenId = s.tokenId | ||
WHERE d.uid = uidArg; | ||
END; | ||
|
||
UPDATE dbMetadata SET value = '31' WHERE name = 'schema-patch-level'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- DROP PROCEDURE `accountDevices_5`; | ||
|
||
-- UPDATE dbMetadata SET value = '30' WHERE name = 'schema-patch-level'; | ||
|