chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Normalise commodity name case (from uploads)
[ypp-sc-tools.db-test.git]
/
yarrg
/
commod-email-processor
diff --git
a/yarrg/commod-email-processor
b/yarrg/commod-email-processor
index 79db83d4e97d8b063cebf21496a58b65ea36e41c..ff0880e9c876d6f14118d38c00149130de511f18 100755
(executable)
--- a/
yarrg/commod-email-processor
+++ b/
yarrg/commod-email-processor
@@
-34,12
+34,14
@@
BEGIN {
my $selfdir= $0;
$selfdir =~ s,/+[^/]*$,,;
chdir("$selfdir") or die "$selfdir $!";
my $selfdir= $0;
$selfdir =~ s,/+[^/]*$,,;
chdir("$selfdir") or die "$selfdir $!";
+
+ unshift @INC, qw(.);
}
use Commods;
use CommodsDatabase;
}
use Commods;
use CommodsDatabase;
-set
locale(LC_CTYPE, "en_GB.UTF-8"
);
+set
_ctype_utf8(
);
my $parser= new MIME::Parser;
our $entity;
my $parser= new MIME::Parser;
our $entity;
@@
-134,7
+136,7
@@
sub main () {
"SELECT stallid FROM stalls
WHERE islandid == $islandid AND stallname == ?
");
"SELECT stallid FROM stalls
WHERE islandid == $islandid AND stallname == ?
");
- $sth_insert{'commod
s
'}= $dbh->prepare(
+ $sth_insert{'commod'}= $dbh->prepare(
"INSERT OR IGNORE
INTO commods
(commodname) VALUES (?)
"INSERT OR IGNORE
INTO commods
(commodname) VALUES (?)
@@
-195,8
+197,9
@@
sub main () {
pipethrough_run_finish($pt, 'gunzip <$deduped_tsv.gz');
# print "\n";
pipethrough_run_finish($pt, 'gunzip <$deduped_tsv.gz');
# print "\n";
-
$dbh->commit(
);
+
db_chkcommit(0
);
+ # Warning! Below runes are bogus. Do not use NATURAL JOIN!
# select * from ((buy natural join commods) natural join stalls) natural join islands;
# select * from ((sell natural join commods) natural join stalls) natural join islands;
# select * from ((buy natural join commods) natural join stalls) natural join islands;
# select * from ((sell natural join commods) natural join stalls) natural join islands;