Improve expression parsing so that only valid expressions are accepted. I believe this will now catch all possible expression errors and generate only correct sql. Please let me know if you disagree, preferably with an example.
modified pkg/query.c
@@ -390,13 +390,16 @@ typedef enum {
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -454,29 +457,54 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -552,7 +580,7 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -564,7 +592,7 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -573,11 +601,17 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|