Project

General

Profile

« Previous | Next » 

Revision 14762

fix: lib/sh/util.sh: already_exists_msg(): changed calling convention to avoid it seeming like `return 0` is run if already_exists_msg() throws an error, when in fact already_exists_msg() is just a command that should be run before returning/errexiting

View differences:

run
28 28
 `institution_code` varchar(255) NOT NULL PRIMARY KEY
29 29
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='from IH.vegpath.org?&Index+Herbariorum'
30 30
EOF
31
) || skip_table || return 0
31
) || { skip_table; return 0; }
32 32
	append=1 mysql_import <"$top_dir"/herbaria_filter.ih.csv_
33 33
}
34 34

  
......
45 45
 KEY `plant_fraction` (`plant_fraction`)
46 46
) ENGINE=MyISAM DEFAULT CHARSET=utf8
47 47
EOF
48
) || table=plant_fraction skip_table || return 0
48
) || { table=plant_fraction skip_table; return 0; }
49 49
	mysql <<EOF
50 50
INSERT INTO "plant_fraction"
51 51
SELECT
......
82 82
SELECT * FROM `plant_fraction`
83 83
WHERE plant_fraction >= 0.8
84 84
EOF
85
) || table=plant_fraction_for_herbaria_filter skip_table || return 0
85
) || { table=plant_fraction_for_herbaria_filter skip_table; return 0; }
86 86
}
87 87

  
88 88
herbaria_filter/make() # runtime: ~0 ("0m2.235s"): CSV import, index scans only
......
101 101
 `institution_code` varchar(255) NOT NULL PRIMARY KEY
102 102
) ENGINE=MyISAM DEFAULT CHARSET=utf8
103 103
EOF
104
) || skip_table || return 0
104
) || { skip_table; return 0; }
105 105
	mysql <<EOF
106 106
INSERT IGNORE INTO $table
107 107
SELECT institution_code FROM ih_herbarium
......
137 137
	OR  (family LIKE '%aceae%' OR family IN ('Compositae','Gramineae','Palmae','Guttiferae','Cruciferae','Labiatae','Umbelliferae','Leguminosae'))
138 138
)
139 139
EOF
140
) || skip_table || return 0
140
) || { skip_table; return 0; }
141 141
}
142 142

  
143 143
# table.tsv.gz/upload() runtime: 15 min ("2184253533 100% 2.30MB/s 0:15:03")

Also available in: Unified diff