silverp1/pb — pull request #98 by buhman (2014-12-26 19:07:09+00:00)
Title: bugz

Fixes #97.
Fixes #96.

Needs:

```sql
DROP PROCEDURE IF EXISTS paste_put@@
CREATE PROCEDURE paste_put (
p_secret BINARY(16),
p_content MEDIUMBLOB,
OUT p_id MEDIUMINT,
OUT p_digest BINARY(20),
OUT p_label TINYBLOB
)
BEGIN
START TRANSACTION;
UPDATE paste
SET digest = UNHEX(SHA1(p_content)), content = p_content
WHERE secret = p_secret;
UPDATE private
SET digest = UNHEX(SHA1(p_content)), content = p_content
WHERE secret = p_secret;
UPDATE vanity
SET digest = UNHEX(SHA1(p_content)), content = p_content
WHERE secret = p_secret;
/* .. */
SELECT id INTO p_id
FROM paste
WHERE secret = p_secret;
SELECT digest INTO p_digest
FROM private
WHERE secret = p_secret;
SELECT label INTO p_label
FROM vanity
WHERE secret = p_secret;
COMMIT;
END;
@@
```