[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] deleting erroneous cert
From: |
stephen.a.leake |
Subject: |
Re: [Monotone-devel] deleting erroneous cert |
Date: |
Tue, 03 Feb 2009 12:30:08 -0500 |
User-agent: |
Gnus/5.1100000000000003 (Gnus v5.11) Emacs/22.1 (cygwin) |
"Derek Scherger" <address@hidden> writes:
> On Tue, Feb 3, 2009 at 8:58 AM, Stephen Leake <address@hidden> wrote:
>
> I'm trying to write the SQL statement to do the deletion. I tried:
>
> mtn -d gds.db db execute "delete from revision_certs where
> id=\"516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72\" and name=\"branch\"
> and value=\"gpm.work_gpm_release\""
>
> but that gives a result of '0 rows'. My SQL is _very_ rusty; help!
>
>
>
> Try with hex(id) = '516...' (id's are now binary values).
It turns out id = X'516...' works as well; I discovered that by
grepping a dump of the database.
Here's the insert statement for two of the branch certs from the dump:
INSERT INTO revision_certs
VALUES(X'4be626db8f00c0313275f905571e1e7d590d198e',X'516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72','branch',X'67706d2e776f726b5f67706d5f72656c65617365','address@hidden',X'21cd5c6c0a098c76e963ec28c5c2087019800d7b08d7c0b21b1b6bbc0f6e868e559064218f4fc68860af94aa0b54170be795bab278992e15f40f5021359c2104d016ef6f2d7af22e050658ad6ea8da293f47913cb8e3c9be2139d1939acafcda26735805adf56148bbb1cc3af29bfcf2d13c47affdfb44c5eeaeb1319b7d4719');
gpm.work_gpm_release?
INSERT INTO revision_certs
VALUES(X'43a210cc39d70040e80cec0a77aba47600e72411',X'516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72','branch',X'6c726f2e776f726b5f67706d5f72656c65617365','address@hidden',X'79f945e5c67c3382fd94706762d8100b1ecbf3e6951b570ad83cfef1c8276516a09f1dca18ef488f93db96f93e72ddd9e2eea412cd4926ba3317c53ca4903f00d24951b0e62c42e591cdbcdea2e79375eea50604b7d258c7bc58891240c27c3431f90402d77ee342ff9198aed5f5d1d180cf87bd456e5cee039e511a4c48766c');
lro.work_gpm_release?
Apparently 'dump' converts the value into hex, so I can't tell which
is the bad cert from this.
> Also, you may want to try a select first and ensure that it returns
> the correct rows before running the delete.
This works:
mtn -d gds.db db execute "select * from revision_certs where id =
X'516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72' and keypair =
'address@hidden'"
it gives: (with raw hex values shown as '...'):
... | branch | gpm.work_gpm_release | address@hidden | ...
... | branch | lro.work_gpm_release | address@hidden | ...
I can't seem to specify the 'value' field:
mtn -d gds.db db execute "select * from revision_certs where id =
X'516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72' and keypair =
'address@hidden' and value = 'gpm.work_gpm_release'"
gives 0 rows.
I guess I can live with deleting both of these, then adding back the
one we want to keep.
But, when I do the delete:
mtn -d gds.db db execute "delete from revision_certs where id =
X'516e1b7b2df2e1820f4a11060ac5fa7b8ea65d72' and keypair =
'address@hidden'"
it says '0 rows'. Hmm. A subsequent select and 'mtn ls certs' shows
they are gone. I guess that's just a misleading message from
'delete'.
Thanks for the hints.
--
-- Stephe