Skip to content

Conversation

QWenQ
Copy link

@QWenQ QWenQ commented Sep 7, 2025

…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.

  • The Jira issue number for this PR is: MDEV-28849

Description

  1. I_S.ROUTINES does not tell whether a particular storage function is aggregate or not.
  2. After the patch is applied, I_S.ROUTINES will show a new column FUNCTION_KIND.
  3. The patch just works on I_S.ROUTINES table, so, i don't think it will introduce side-effects in other parts of the server.

Release Notes

  1. Information Schema ROUTINES Table will add a new column FUNCTION_KIND to tell the function type;

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

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

QWenQ and others added 5 commits September 7, 2025 16:37
…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, in
I_S.ROUTINES table. For a procedure, the FUNCTION_KIND value is
NOT_FUNCTION; for a non-aggregate function, the value is NORMAL; and
for an aggregate function, the value is AGGREGATE.
@svoj svoj added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Sep 8, 2025
@QWenQ QWenQ closed this Sep 12, 2025
@QWenQ QWenQ reopened this Sep 12, 2025
apply swith statement coding style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.
Development

Successfully merging this pull request may close these issues.

2 participants