fix bug: HAVING field check

This commit is contained in:
jingxiaobing 2018-08-10 15:42:59 +08:00
parent 1f1fc1d17c
commit f158e87159
2 changed files with 4 additions and 0 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ tests/
TAGS
edeProject.el
core
.cquery_cached_index/
# gtags file
GTAGS

View File

@ -1670,6 +1670,9 @@ select_check_HAVING_column(sql_select_t *select)
gboolean found = FALSE; /* found having cond in columns */
int num_aggregate = 0;
const char *having_func = having->left->token_text;
if (!having_func) {
return FALSE;
}
sql_expr_list_t *columns = select->columns;
int i;
for (i = 0; columns && i < columns->len; ++i) {