Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 17218de

Browse files
committed
Prevent DISTINCT in func call without args.
1 parent 635ec2f commit 17218de

File tree

4 files changed

+416
-410
lines changed

4 files changed

+416
-410
lines changed

dist/sqlite-parser.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/parser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/grammar.pegjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,9 @@ function_call_args "Function Call Arguments"
741741
}
742742
};
743743
}
744-
/ d:( args_list_distinct )? e:( expression_list ) {
744+
/ d:( args_list_distinct )? e:( expression_list ) & {
745+
return !isOkay(d) || e['expression'].length > 0;
746+
} {
745747
return {
746748
'args': Object.assign(e, d)
747749
};
@@ -2642,7 +2644,7 @@ id_database "Database Identifier"
26422644
};
26432645
}
26442646

2645-
id_function
2647+
id_function "Function Identifier"
26462648
= d:( id_table_qualified )? n:( id_name ) {
26472649
return {
26482650
'type': 'identifier',
@@ -2702,7 +2704,7 @@ id_collation "Collation Identifier"
27022704
};
27032705
}
27042706

2705-
id_savepoint "Savepoint Indentifier"
2707+
id_savepoint "Savepoint Identifier"
27062708
= n:( id_name )
27072709
{
27082710
return {

0 commit comments

Comments
 (0)