Skip to content

[POC] Prototyping - MySQL User Defined Types - #704

Closed
marcalff wants to merge 2 commits into
mysql:trunkfrom
marcalff:trunk
Closed

[POC] Prototyping - MySQL User Defined Types#704
marcalff wants to merge 2 commits into
mysql:trunkfrom
marcalff:trunk

Conversation

@marcalff

@marcalff marcalff commented Jul 31, 2026

Copy link
Copy Markdown
Member

Proof Of Concepts - MySQL User Defined Types

Contributes to #674

Caution

Proof of concepts code, do not merge, do not use in production.

This code is dirty and to throw away.
The point of this PR is to do prototyping, to identify what needs to be changed in the server, to start a technical discussion.

Quick start

Build

Compile with -DWITH_EXPERIMENTAL_UDT=ON -DWITH_DEBUG=ON in CMake.

Run

mtr --suite=udt

Current progress

Declare a UDT and provide an implementation:

CREATE TYPE test.complex_number AS BINARY(16);

INSTALL COMPONENT "file://component_udt_example";

Declare a UDT variable, perform operations provided by the component:

delimiter $$

CREATE PROCEDURE test.complex()
BEGIN
  DECLARE a test.complex_number;
  DECLARE b test.complex_number;
  DECLARE c test.complex_number;
  SET a = complex_number_from_string("1+2i");
  SET b = complex_number_from_string("3+4i");
  SET c = complex_number_add(a, b);
  # SELECT complex_number_to_string(c);
END$$

delimiter ;

Invoke the UDT implementation at runtime:

call test.complex();

Cleanup:

UNINSTALL COMPONENT "file://component_udt_example";

DROP PROCEDURE test.complex;

Component implementation

Check files under components/udt_example.


Copyright (c) 2026, Oracle and/or its affiliates.

What does this change do?

Why is it needed?

How was it tested?

  • Added/updated MTR tests under mysql-test/
  • scripts/ci/mtr.sh passes locally
  • Ran the relevant full suite (name it): ______

Contributor checklist

  • I have signed the OCA with the email on these commits
  • Code is formatted (scripts/ci/format.sh)
  • Commits are focused with descriptive messages

AI assistance

  • I did not use AI assistance for this contribution
  • I used AI assistance for this contribution

If AI assistance was used, describe the tool(s) and extent of use:

Areas touched

@marcalff
marcalff requested a review from seemasundara as a code owner July 31, 2026 09:45
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 31, 2026
@github-actions github-actions Bot added MTR Failed MTR suite failed build Changes touching build or GitHub automation Build Failed PR build failed labels Jul 31, 2026
@github-actions
github-actions Bot requested a review from gopshank July 31, 2026 09:45
@github-actions github-actions Bot added the Review Requested Review requested from code owners label Jul 31, 2026
@marcalff marcalff added the User Defined Types User Defined Types project label Jul 31, 2026
@marcalff marcalff self-assigned this Jul 31, 2026
@github-actions github-actions Bot added innodb Changes touching InnoDB storage engine code pluggable Changes touching plugins or components tests Changes touching test code or test data labels Jul 31, 2026
@marcalff

marcalff commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Closing and re creating, should be in a git branch

Closed in favor of #707

@marcalff marcalff closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Failed PR build failed build Changes touching build or GitHub automation innodb Changes touching InnoDB storage engine code MTR Failed MTR suite failed OCA Verified All contributors have signed the Oracle Contributor Agreement. pluggable Changes touching plugins or components Review Requested Review requested from code owners tests Changes touching test code or test data User Defined Types User Defined Types project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant