Jump to content

Manual talk:Filearchive table

About this board

length(fa_sha1) vs length(oldimage.oi_sha1)

1
Rillke (talkcontribs)

It seems like the fa_sha1 column is either 31 or 32 characters long (or 0 or NULL):

use enwiki_p;
SELECT count(*), length(fa_sha1)
FROM filearchive
GROUP BY length(fa_sha1);

SELECT fa_name, fa_size, fa_timestamp, fa_sha1
FROM filearchive
WHERE length(fa_sha1) IS NULL LIMIT 10;

SELECT fa_name, fa_size, fa_timestamp, fa_sha1
FROM filearchive
WHERE length(fa_sha1) = 0 LIMIT 10;

SELECT fa_name, fa_size, fa_timestamp, fa_sha1
FROM filearchive
WHERE length(fa_sha1) = 31 LIMIT 10;

SELECT fa_name, fa_size, fa_timestamp, fa_sha1
FROM filearchive
WHERE length(fa_sha1) = 32 LIMIT 10;


count(*)length(fa_sha1)
39994None
10960
230416731
77519032

When it is 32 chars long, it appears to be zero-padded. oi_sha1 is either 0 or 31 characters long.

Reply to "length(fa_sha1) vs length(oldimage.oi_sha1)"
There are no older topics