Skip to content

fix(rds): vendor mysql UDF plugin API in fakecloud_udf.c#813

Merged
vieiralucas merged 1 commit intomainfrom
worktree-rds-mysql-vendor-udf-headers
Apr 28, 2026
Merged

fix(rds): vendor mysql UDF plugin API in fakecloud_udf.c#813
vieiralucas merged 1 commit intomainfrom
worktree-rds-mysql-vendor-udf-headers

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 28, 2026

Summary

  • Vendor minimal UDF_INIT/UDF_ARGS/Item_result definitions inline in fakecloud_udf.c, dropping the #include <mysql.h> requirement.
  • Remove mysql-community-devel / libmysqlclient-dev / libmariadb-dev from both Dockerfiles — only gcc + libcurl-devel remain.
  • Probe plugin dir from a known list instead of relying on mysql_config.

Why

PR #812 added mysql-community-devel to fix mysql.h: not found, but the upstream mysql:8.0 image's Dockerfile strips its community release repo after install — microdnf install mysql-community-devel returns No package matches. Re-adding the repo would hard-code a brittle Oracle URL.

The UDF plugin API surface we touch is tiny and ABI-stable across MySQL 5.6 -> 8.x and MariaDB 10.x/11.x. Vendoring is safer than depending on a repo definition Oracle removed.

Test plan

  • CI RDS support images workflow builds fakecloud-mysql:8.0 on linux/amd64 and linux/arm64.
  • Same for fakecloud-mariadb 10.6, 10.11, 11.4.
  • Postgres images unaffected.

Summary by cubic

Vendor minimal MySQL UDF structs inline in both mysql/fakecloud_udf.c and mariadb/fakecloud_udf.c to drop the mysql.h dependency and fix UDF builds on mysql:8.0 and MariaDB. Dockerfiles now compile the UDF with only gcc + libcurl and probe plugin directories without mysql_config.

  • Bug Fixes

    • Inline UDF_INIT/UDF_ARGS/Item_result in both UDF sources and remove the include.
    • Probe common plugin dirs across OL and Debian paths (fallback to /usr/lib/mysql/plugin).
    • Build the UDF without mysql_config flags.
  • Dependencies

    • Remove mysql-community-devel, libmysqlclient-dev, libmariadb-dev.
    • Keep only gcc, make, libcurl headers (libcurl-devel/libcurl4-openssl-dev), and libc headers.

Written for commit dd18ac9. Summary will update on new commits. Review in cubic

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The upstream mysql:8.0 image strips its community release repo after
install, so `mysql-community-devel` (the package shipping `mysql.h`)
is no longer installable on a fresh build. Re-adding the repo would
hard-code a brittle URL.

The UDF plugin API surface we touch (UDF_INIT, UDF_ARGS, Item_result)
is tiny and ABI-stable across MySQL 5.6 -> 8.x and MariaDB 10.x/11.x.
Vendor the struct definitions inline, drop the mysql.h include, and
remove libmysqlclient-dev / libmariadb-dev from both Dockerfiles.
Plugin dir is probed instead of asked from mysql_config.
@vieiralucas vieiralucas force-pushed the worktree-rds-mysql-vendor-udf-headers branch from 01a416c to dd18ac9 Compare April 28, 2026 02:29
@vieiralucas vieiralucas merged commit 7072984 into main Apr 28, 2026
29 checks passed
@vieiralucas vieiralucas deleted the worktree-rds-mysql-vendor-udf-headers branch April 28, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant