@@ -113,6 +113,7 @@ clause
113113 | loadCSVClause
114114 | foreachClause
115115 | orderBySkipLimitClause
116+ | composableCommandClauses
116117 ;
117118
118119useClause
@@ -937,8 +938,7 @@ command
937938 | stopDatabase
938939 | enableServerCommand
939940 | allocationCommand
940- | showCommand
941- | terminateCommand
941+ | showAdminCommand
942942 )
943943 ;
944944
@@ -980,23 +980,16 @@ dropCommand
980980 )
981981 ;
982982
983- showCommand
983+ showAdminCommand
984984 : SHOW (
985985 showAliases
986- | showConstraintCommand
987- | showCurrentGraphTypeCommand
988986 | showCurrentUser
989987 | showDatabase
990- | showFunctions
991- | showIndexCommand
992988 | showPrivileges
993- | showProcedures
994989 | showRolePrivileges
995990 | showRoles
996991 | showServers
997- | showSettings
998992 | showSupportedPrivileges
999- | showTransactions
1000993 | showUserPrivileges
1001994 | showUsers
1002995 | showAuthRules
@@ -1008,6 +1001,11 @@ showCommandYield
10081001 | whereClause
10091002 ;
10101003
1004+ showCommandYieldWhere
1005+ : yieldClause
1006+ | whereClause
1007+ ;
1008+
10111009yieldItem
10121010 : variable (AS variable)?
10131011 ;
@@ -1066,7 +1064,7 @@ showIndexType
10661064 ;
10671065
10681066showIndexesEnd
1069- : indexToken showCommandYield? composableCommandClauses ?
1067+ : indexToken showCommandYieldWhere ?
10701068 ;
10711069
10721070showConstraintCommand
@@ -1090,19 +1088,19 @@ constraintExistType
10901088 ;
10911089
10921090showConstraintsEnd
1093- : constraintToken showCommandYield? composableCommandClauses ?
1091+ : constraintToken showCommandYieldWhere ?
10941092 ;
10951093
10961094showCurrentGraphTypeCommand
1097- : CURRENT GRAPH TYPE showCommandYield? composableCommandClauses ?
1095+ : CURRENT GRAPH TYPE showCommandYieldWhere ?
10981096 ;
10991097
11001098showProcedures
1101- : (PROCEDURE | PROCEDURES ) executableBy? showCommandYield? composableCommandClauses ?
1099+ : (PROCEDURE | PROCEDURES ) executableBy? showCommandYieldWhere ?
11021100 ;
11031101
11041102showFunctions
1105- : showFunctionsType? functionToken executableBy? showCommandYield? composableCommandClauses ?
1103+ : showFunctionsType? functionToken executableBy? showCommandYieldWhere ?
11061104 ;
11071105
11081106functionToken
@@ -1124,7 +1122,7 @@ showTransactions
11241122 ;
11251123
11261124terminateTransactions
1127- : transactionToken stringsOrExpression showCommandYield? composableCommandClauses ?
1125+ : transactionToken stringsOrExpression showCommandYieldWhere ?
11281126 ;
11291127
11301128showSettings
@@ -1135,8 +1133,12 @@ settingToken
11351133 : SETTING | SETTINGS
11361134 ;
11371135
1136+ // Keeping both sides here as optional instead of having one mandatory and then optionally call `namesAndClauses`,
1137+ // to not prioritize stringsOrExpression over regular clauses (for example, we don't want `SHOW SETTINGS WITH * MATCH (*)`
1138+ // to be parsed as variable `WITH` multiplied with the function call `MATCH (*)`)
11381139namesAndClauses
1139- : (showCommandYield? | stringsOrExpression showCommandYield?) composableCommandClauses?
1140+ : showCommandYieldWhere?
1141+ | stringsOrExpression showCommandYieldWhere?
11401142 ;
11411143
11421144stringsOrExpression
0 commit comments