mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 04:20:12 +01:00
Print the sphinx query to stdout in dry run
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
40e4dd4844
commit
66a8f60d9d
@ -163,7 +163,7 @@ int append_string_to_buffer(char **buffer, char *str){
|
||||
uint64 run_query(struct session_data *sdata, struct session_data *sdata2, char *where_condition, uint64 last_id, int *num, struct config *cfg){
|
||||
MYSQL_ROW row;
|
||||
uint64 id=0;
|
||||
char s[SMALLBUFSIZE];
|
||||
char s[MAXBUFSIZE];
|
||||
int rc=0;
|
||||
|
||||
*num = 0;
|
||||
@ -175,6 +175,10 @@ uint64 run_query(struct session_data *sdata, struct session_data *sdata2, char *
|
||||
|
||||
snprintf(s, sizeof(s)-1, "SELECT id FROM %s WHERE %s AND id > %llu ORDER BY id ASC LIMIT 0,%d", index_list, where_condition, last_id, max_matches);
|
||||
|
||||
if(dryrun){
|
||||
printf("sphinx query: %s\n", s);
|
||||
}
|
||||
|
||||
syslog(LOG_PRIORITY, "sphinx query: %s", s);
|
||||
|
||||
if(mysql_real_query(&(sdata2->mysql), s, strlen(s)) == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user