add argument to format_sql_condition telling it if the query will be used for the local or a remote repository. The latter doesn't have some fields (so don't accept to query them). Also, the successive code is passing the sql statement through sprintf, so % (percent) characters need to be escaped.
modified pkg/pkgcli.h
@@ -176,7 +176,7 @@ struct query_flags {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified pkg/query.c
@@ -395,7 +395,7 @@ typedef enum {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -435,22 +435,31 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -595,6 +604,8 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -783,7 +794,7 @@ exec_query(int argc, char **argv)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified pkg/rquery.c
@@ -139,7 +139,7 @@ exec_rquery(int argc, char **argv)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|