[MDEV-22189] Change error messages inside code to have mariadb instead of mysql Created: 2020-04-08  Updated: 2021-07-27  Resolved: 2021-07-27

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: 10.6.4

Type: Task Priority: Critical
Reporter: Rasmus Johansson (Inactive) Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17812 Use MariaDB in error messages instead... Closed

 Description   

Error messages inside the code

There are error messages which are composed in the code directly, particularly (but probably not only) in replication. At the very least they can appear in error logs or stderr, but possibly they can also be added to SQL errors with generic patterns, like errors passed through from an engine.

Examples:

client/mysql_upgrade.c:    print_error("Version check failed. Got the following error when calling "
client/mysql_upgrade.c-                "the 'mysql' command line client", &ds_version);

sql/slave.cc:      errmsg= "The slave I/O thread stops because master and slave have equal \
sql/slave.cc-MySQL server ids; these ids must be different for replication to work (or \

sql/slave.cc-  rli->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_READ_FAILURE, NULL,
sql/slave.cc-              ER_THD(thd, ER_SLAVE_RELAY_LOG_READ_FAILURE), "\
sql/slave.cc-Could not parse relay log event entry. The possible reasons are: the master's \
sql/slave.cc-binary log is corrupted (you can check this by running 'mysqlbinlog' on the \
sql/slave.cc-binary log), the slave's relay log is corrupted (you can check this by running \
sql/slave.cc:'mysqlbinlog' on the relay log), a network problem, or a bug in the master's \
sql/slave.cc-or slave's MySQL code. If you want to check the master's binary log or slave's \
sql/slave.cc-relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' \

and then the corresponding test results will have to be updated, e.g.

./suite/rpl/r/rpl_server_id1.result:Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the -



 Comments   
Comment by Rucha Deodhar [ 2020-10-07 ]

Patch: https://github.com/MariaDB/server/commit/155a4671b61a3705ec03505670eb2ae564d264c5

Comment by Sergei Golubchik [ 2021-03-17 ]

The commit is not in a repository, seems to have been garbage-collected. Is it still valid? Could you recommit it?

Comment by Rucha Deodhar [ 2021-03-18 ]

serg Recommited patch: https://github.com/MariaDB/server/commit/2858f9fb7e052132bcc2da9f244746f1e139f90f

Comment by Rucha Deodhar [ 2021-04-09 ]

Patch:

server code: https://github.com/MariaDB/server/commit/0d19e878f220ec2d5ad35f98e220409b081b9b32

mariadb-connector-c:
https://github.com/mariadb-corporation/mariadb-connector-c/pull/162

Comment by Marko Mäkelä [ 2021-04-21 ]

It looks like this was already pushed to Connector/C. When I merged 10.5 to 10.6, there was a conflict on the libmariadb submodule. 10.2 through 10.5 use the 3.1 branch, while 10.6 uses the 3.2 branch. So, I had to update the submodule to a 3.2 branch that would include that change from 3.1. As part of the update, I noticed that several error messages had been changed, and I updated the tests accordingly.

Comment by Sergei Golubchik [ 2021-05-11 ]

commit 0d19e878f22 is ok to push

Comment by Daniel Black [ 2021-05-19 ]

rucha174 note I've conflicted with your sql/rpl_rli.cc message change in MDEV-25681 80ae3677e1b90a7f5d9dfc55ba0612e065b8ce97 with a more extensive change so you can drop that small bit from your commit.

Comment by Oleksandr Byelkin [ 2021-05-19 ]

I merged it

Comment by Rucha Deodhar [ 2021-06-24 ]

Patch (after marko found some mysql named errors and wlad 's comment on last fix):
https://github.com/MariaDB/server/commit/3ae1a67573b94f1e8eddead4e85f9098abbccc4b

Comment by Sergei Golubchik [ 2021-07-05 ]

rucha174, I don't understand. You replaced "mysqld" with a neutral "server". But it isn't a script, like mytop or innotop, that can work with either MySQL or MariaDB, your messages are compiled into the server binary, so surely they apply only to the current server, which is MariaDB. Why not just to write "MariaDB", preserving the original wording as much as possible?

Comment by Rucha Deodhar [ 2021-07-05 ]

Hi serg , thanks for the review. wlad left some comments on the commit. So I changed it to server instead of mysqld or mariadbd.

Comment by Sergei Golubchik [ 2021-07-12 ]

It's not very convincing, I'd say.

The argument is that one can start the server as mariadbd but also using the compatibility mysqld symlink.

First, it doesn't explain, why you shouldn't replace "MySQL" with "MariaDB", where a text refers to the name of the project, not to the name of the executable.

And second, one can symlink any executable under any name, mariadbd -> foobarblablad. We don't necessarily have to reflect that in the error messages.

I think changes like this

-  sql_print_information("Please restart mysqld without --tc-heuristic-recover");
+  sql_print_information("Please restart without --tc-heuristic-recover");

make error messages less clear and more confusing

Comment by Sergei Golubchik [ 2021-07-21 ]

wlad, any comments? Because I'd prefer, indeed,

-  sql_print_information("Please restart mysqld without --tc-heuristic-recover");
+  sql_print_information("Please restart mariadbd without --tc-heuristic-recover");

Comment by Vladislav Vaintroub [ 2021-07-21 ]

Ether "Please restart server with --tc-heuristic-recover" , or "please restart with --tc-heuristic-recover".
Or maybe omit "please" , because Unix does not say so.

"mariadbd" is misleading, because in fact, many people will be running mysqld.
In fact, I would prefer to guess executable names as little as possible, so "server" is the undisputably correct term, without marketing flavour.

Comment by Sergei Golubchik [ 2021-07-22 ]

There is no mysqld binary in 10.6, so every user will be running mariadbd. You can symlink it under any other name, but it'll still be the same mariadbd binary

Comment by Vladislav Vaintroub [ 2021-07-22 ]

Where I'm from, there is a very well mysqld binary, and no user, except perhaps mtr, runs mariadbd. There are also no symlinks.

Comment by Vladislav Vaintroub [ 2021-07-22 ]

Forgot to mention that messages that assume mysqld and command line parameters, like --tc-heuristic-recovery, have been wrong for perhaps decade or more, if used with embedded. I'm not sure what's misleading in "set server variable x to y, and restart the server", instead. If we want to add some branding into it, "restart the MariaDB server", whatever it is , mariadbd, mysqld, or libmaradbd.so . Old error messages can be improved upon, rather than mechanically replaced.

Comment by Sergei Golubchik [ 2021-07-26 ]

ok to push

Generated at Thu Feb 08 09:12:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.