MDEV-28849: I_S.ROUTINES don't tell that the stored function is AGGRE… #4286
+393
−105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…GATE
INFORMATION_SCHEMA.ROUTINES does not tell whether a particular storage function is aggregate or not.
The fix is to add a new field FUNCTION_KIND, which is a SET type, containing NOT_FUNCTION, SCALAR and AGGREGATE values, in I_S.ROUTINES table. NOT_FUNCTION is for procedure, package, package body, trigger and event; SCALAR for non-aggregate function; AGGREGATE for aggregate function.
Description
Release Notes
How can this PR be tested?
The FUNCTION_KIND supports three types: NOT_FUNCTION for procedure(and package, package body, trigger, event), SCALAR for non-aggregate function and AGGREGATE for aggregate function. So, in a test, we can create a procedure, a non-aggregate function and an aggregate function in turn and check whether their FUNCTION_KIND values meet expectations.
UPDATE: the test for I_S.ROUTINES column FUNCTION_KIND has been added in server/mysql-test/main/infortmation_schema.test
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
main
branch.PR quality check