MDEV-38328: Promote GitHub stars in server log and client prompt in versions 10.11 and onward#5266
MDEV-38328: Promote GitHub stars in server log and client prompt in versions 10.11 and onward#5266ottok wants to merge 1 commit into
Conversation
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')
There was a problem hiding this comment.
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.
| #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 |
There was a problem hiding this comment.
There are two major issues with using #if SERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLE here:
- Logic Error on Stable Branches: Since 10.11 is a Stable (GA) release,
SERVER_MATURITY_LEVELis set toMariaDB_PLUGIN_MATURITY_STABLE. This makes the conditionSERVER_MATURITY_LEVEL < MariaDB_PLUGIN_MATURITY_STABLEfalse, 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 themysql-interactivetest to fail on stable builds because the.resultfile expects the message to be printed. - Preprocessor Evaluation Issue:
MariaDB_PLUGIN_MATURITY_STABLEis defined inmysql/plugin.h, which is a server-side header not included byclient/mysql.cc. In C preprocessor directives, any undefined identifier is evaluated as0. Therefore, the condition evaluates to0 < 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);| #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 |
There was a problem hiding this comment.
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");
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.