mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:00:12 +01:00
improved pilerexport
This commit is contained in:
parent
15f18eb939
commit
a87b62264a
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#define VERSION "0.1.23-master-branch"
|
#define VERSION "0.1.23-master-branch"
|
||||||
|
|
||||||
#define BUILD 774
|
#define BUILD 775
|
||||||
|
|
||||||
#define HOSTID "mailarchiver"
|
#define HOSTID "mailarchiver"
|
||||||
|
|
||||||
|
@ -319,15 +319,16 @@ int main(int argc, char **argv){
|
|||||||
|
|
||||||
(void) openlog("pilerexport", LOG_PID, LOG_MAIL);
|
(void) openlog("pilerexport", LOG_PID, LOG_MAIL);
|
||||||
|
|
||||||
|
if(exportall == 1){
|
||||||
|
rc = append_string_to_buffer(&query, "SELECT `id`, `piler_id`, `digest`, `bodydigest` FROM ");
|
||||||
|
rc += append_string_to_buffer(&query, SQL_METADATA_TABLE);
|
||||||
|
goto GO;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(s, sizeof(s)-1, "SELECT DISTINCT `id`, `piler_id`, `digest`, `bodydigest` FROM %s WHERE ", SQL_MESSAGES_VIEW);
|
snprintf(s, sizeof(s)-1, "SELECT DISTINCT `id`, `piler_id`, `digest`, `bodydigest` FROM %s WHERE ", SQL_MESSAGES_VIEW);
|
||||||
|
|
||||||
rc = append_string_to_buffer(&query, s);
|
rc = append_string_to_buffer(&query, s);
|
||||||
|
|
||||||
if(exportall == 1){
|
|
||||||
rc += append_string_to_buffer(&query, "1=1");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(from){
|
if(from){
|
||||||
rc += append_string_to_buffer(&query, "`from` IN (");
|
rc += append_string_to_buffer(&query, "`from` IN (");
|
||||||
rc += append_string_to_buffer(&query, from);
|
rc += append_string_to_buffer(&query, from);
|
||||||
@ -390,11 +391,11 @@ int main(int argc, char **argv){
|
|||||||
|
|
||||||
rc += append_string_to_buffer(&query, " ORDER BY id ASC");
|
rc += append_string_to_buffer(&query, " ORDER BY id ASC");
|
||||||
|
|
||||||
|
|
||||||
|
GO:
|
||||||
if(rc) p_clean_exit("malloc problem building query", 1);
|
if(rc) p_clean_exit("malloc problem building query", 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cfg = read_config(configfile);
|
cfg = read_config(configfile);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user