Skip to content

MDEV-38328: Promote GitHub stars in server log and client prompt in versions 10.11 and onward#5266

Open
ottok wants to merge 1 commit into
MariaDB:10.11from
ottok:github-stars-promotion-10.11
Open

MDEV-38328: Promote GitHub stars in server log and client prompt in versions 10.11 and onward#5266
ottok wants to merge 1 commit into
MariaDB:10.11from
ottok:github-stars-promotion-10.11

Conversation

@ottok

@ottok ottok commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This cherry-picked from 346c7af on 'main' with the intent of having PR#4262 applied on 10.11 now, and thus on all branches maintained for the next 6 months or more. I am excluding 10.6 as it is EOL soon.

Ask users to give MariaDB a star by having an extra line in the MariaDB
client prompt:

    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is X
    Server version: Y
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Help others discover MariaDB. Star it on GitHub: https://github.com/MariaDB/server

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]>

Additionally, have this extra line in server logs:

    [Note] Help others discover MariaDB. Star it on GitHub: https://github.com/MariaDB/server

This change is done in a way that it is easy to cherry-pick to older
releases, and the text can later be changed to promote something else.

Test file updated with:
nano --noconvert --nonewlines mysql-test/main/mysql-interactive.result

(cherry-picked from 346c7af on 'main')

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a message promoting MariaDB's GitHub repository in both the interactive client prompt and the server startup log. However, the implementation uses a preprocessor guard (SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE) that prevents the message from being displayed on stable releases, which contradicts the PR's objective. Additionally, the macro is undefined in the client code, causing the check to always evaluate to false. It is recommended to remove these preprocessor guards entirely to ensure the promotion message is correctly displayed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread client/mysql.cc
Comment on lines +1411 to +1415
#if SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE
put_info("Help others discover MariaDB."
" Star it on GitHub: https://github.com/MariaDB/server\n",
INFO_INFO);
#endif

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

There are two major issues with using #if SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE here:

  1. Logic Error on Stable Branches: Since 10.11 is a Stable (GA) release, SERVER_MATURITY_LEVEL is set to MariaDB_PLUGIN_MATURITY_STABLE. This makes the condition SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE false, meaning the promotion message will not be printed on 10.11 or any other stable release. This defeats the purpose of the PR ("Promote GitHub stars in server log and client prompt in versions 10.11 and onward") and will cause the mysql-interactive test to fail on stable builds because the .result file expects the message to be printed.
  2. Preprocessor Evaluation Issue: MariaDB_PLUGIN_MATURITY_STABLE is defined in mysql/plugin.h, which is a server-side header not included by client/mysql.cc. In C preprocessor directives, any undefined identifier is evaluated as 0. Therefore, the condition evaluates to 0 < 0 (false) on all client builds, meaning the message will never be printed by the client.

To fix both issues and ensure the message is printed on 10.11 and onward, we should remove the preprocessor guard entirely.

    put_info("Help others discover MariaDB."
             " Star it on GitHub: https://github.com/MariaDB/server\n",
             INFO_INFO);

Comment thread sql/mysqld.cc
Comment on lines +5052 to +5055
#if SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE
sql_print_information("Help others discover MariaDB."
" Star it on GitHub: https://github.com/MariaDB/server");
#endif

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Similar to the client-side change, using #if SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE on a stable branch like 10.11 means this message will never be printed in the server log, contradicting the PR's objective. We should remove the preprocessor guard to ensure the message is printed on 10.11 and onward.

    sql_print_information("Help others discover MariaDB."
                          " Star it on GitHub: https://github.com/MariaDB/server");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants