summaryrefslogtreecommitdiff
path: root/indexer
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-11-06 16:24:39 +0100
committerYorhel <git@yorhel.nl>2016-11-06 16:24:45 +0100
commit7d2abfb3a4d59297ff73dbf2dc67220edb8257b5 (patch)
tree19d92338fbc8ed9430bc5c4aa68b59bf4dcb3ec7 /indexer
parentcb81bedac133ebc32b2f028e4c3d3a8b4ef31d44 (diff)
indexer: Fix storing locale as NULL when empty
Perhaps it's better to get rid of NULL and make empty the default value. But for now this'll do.
Diffstat (limited to 'indexer')
-rw-r--r--indexer/src/pkg.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/indexer/src/pkg.rs b/indexer/src/pkg.rs
index d8766b3..9d59898 100644
--- a/indexer/src/pkg.rs
+++ b/indexer/src/pkg.rs
@@ -57,6 +57,7 @@ fn insert_pkg(tr: &postgres::transaction::Transaction, opt: &PkgOpt) -> Option<i
fn insert_man_row(tr: &postgres::GenericConnection, verid: i32, path: &str, enc: &str, hash: &[u8]) {
let (name, sect, locale) = man::parse_path(path).unwrap();
+ let locale = if locale == "" { None } else { Some(locale) };
if let Err(e) = tr.execute(
"INSERT INTO man (package, name, filename, locale, hash, section, encoding) VALUES ($1, $2, '/'||$3, $4, $5, $6, $7)",
&[&verid, &name, &path, &locale, &hash, &sect, &enc]