Skip to content

Commit

Permalink
fix: Remove identifier alias from count builtin function
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoniePhiline committed Feb 18, 2023
1 parent d2f0f66 commit eac9da2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ module.exports = grammar({
),

count: $ => seq(
field('name', alias($.keyword_count, $.identifier)),
field('name', $.keyword_count),
'(',
$._aggregate_expression,
')',
Expand Down
9 changes: 2 additions & 7 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions test/corpus/functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,22 @@ FROM table_a;
(keyword_select)
(select_expression
(term
(count
(identifier)
value: (count
name: (keyword_count)
(keyword_distinct)
(field
(identifier))
parameter: (field
name: (identifier))
(order_by
(keyword_order)
(keyword_by)
(order_target
(field
(identifier))))))))
name: (identifier))))))))
(from
(keyword_from)
(relation
(table_reference
(identifier))))))
name: (identifier))))))

================================================================================
GROUP CONCAT
Expand Down
10 changes: 5 additions & 5 deletions test/corpus/group_by.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ HAVING other_id > 10;
name: (identifier)))
(term
value: (count
name: (identifier)
name: (keyword_count)
parameter: (field
name: (identifier))))))
(from
Expand Down Expand Up @@ -58,7 +58,7 @@ HAVING other_id > 10;
name: (identifier)))
(term
value: (count
name: (identifier)
name: (keyword_count)
parameter: (field
name: (identifier))))))
(from
Expand Down Expand Up @@ -99,7 +99,7 @@ HAVING other_id > 10;
name: (identifier)))
(term
value: (count
name: (identifier)
name: (keyword_count)
parameter: (field
name: (identifier))))))
(from
Expand Down Expand Up @@ -140,7 +140,7 @@ HAVING COUNT(*) = 2;
name: (identifier)))
(term
value: (count
name: (identifier)
name: (keyword_count)
parameter: (field
name: (identifier))))))
(from
Expand All @@ -156,6 +156,6 @@ HAVING COUNT(*) = 2;
(keyword_having)
(binary_expression
left: (count
name: (identifier)
name: (keyword_count)
parameter: (all_fields))
right: (literal))))))
8 changes: 4 additions & 4 deletions test/corpus/select.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ FROM my_table;
(select_expression
(term
value: (count
name: (identifier)
name: (keyword_count)
(keyword_distinct)
parameter: (field
name: (identifier)))
Expand Down Expand Up @@ -721,7 +721,7 @@ FROM my_table;
(select_expression
(term
value: (count
name: (identifier)
name: (keyword_count)
(keyword_distinct)
parameter: (list
(field
Expand All @@ -747,7 +747,7 @@ FROM my_table;
(select_expression
(term
value: (count
name: (identifier)
name: (keyword_count)
parameter: (all_fields)))))
(from
(keyword_from)
Expand All @@ -770,7 +770,7 @@ FROM my_table;
(select_expression
(term
value: (count
name: (identifier)
name: (keyword_count)
(keyword_distinct)
parameter: (field
name: (identifier))))))
Expand Down

0 comments on commit eac9da2

Please sign in to comment.