Skip to content

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

Open
marcalff wants to merge 4 commits into
mysql:trunkfrom
marcalff:mysql-udt
Open

[POC] Prototyping - MySQL User Defined Types#707
marcalff wants to merge 4 commits into
mysql:trunkfrom
marcalff:mysql-udt

Conversation

@marcalff

@marcalff marcalff commented Aug 3, 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.

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

Copy link
Copy Markdown
Member Author

Can now add complex numbers.
@marcalff
marcalff requested a review from a team August 18, 2026 22:42
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