Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22189

Change error messages inside code to have mariadb instead of mysql

Details

    • Task
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.6.4
    • Server
    • None

    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 -
      

      Attachments

        Issue Links

          Activity

            rucha174 Rucha Deodhar added a comment - Patch: https://github.com/MariaDB/server/commit/155a4671b61a3705ec03505670eb2ae564d264c5

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

            serg Sergei Golubchik added a comment - The commit is not in a repository, seems to have been garbage-collected. Is it still valid? Could you recommit it?
            rucha174 Rucha Deodhar added a comment - serg Recommited patch: https://github.com/MariaDB/server/commit/2858f9fb7e052132bcc2da9f244746f1e139f90f
            rucha174 Rucha Deodhar added a comment - - edited Patch: server code: https://github.com/MariaDB/server/commit/0d19e878f220ec2d5ad35f98e220409b081b9b32 mariadb-connector-c: https://github.com/mariadb-corporation/mariadb-connector-c/pull/162

            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.

            marko Marko Mäkelä added a comment - 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.

            commit 0d19e878f22 is ok to push

            serg Sergei Golubchik added a comment - commit 0d19e878f22 is ok to push
            danblack Daniel Black added a comment -

            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.

            danblack Daniel Black added a comment - 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.

            I merged it

            sanja Oleksandr Byelkin added a comment - I merged it
            rucha174 Rucha Deodhar added a comment - - edited

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

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

            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?

            serg Sergei Golubchik added a comment - 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?
            rucha174 Rucha Deodhar added a comment -

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

            rucha174 Rucha Deodhar added a comment - Hi serg , thanks for the review. wlad left some comments on the commit. So I changed it to server instead of mysqld or mariadbd.

            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

            serg Sergei Golubchik added a comment - 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

            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");
            

            serg Sergei Golubchik added a comment - 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");
            wlad Vladislav Vaintroub added a comment - - edited

            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.

            wlad Vladislav Vaintroub added a comment - - edited 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.

            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

            serg Sergei Golubchik added a comment - 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
            wlad Vladislav Vaintroub added a comment - - edited

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

            wlad Vladislav Vaintroub added a comment - - edited Where I'm from, there is a very well mysqld binary, and no user, except perhaps mtr, runs mariadbd. There are also no symlinks.

            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.

            wlad Vladislav Vaintroub added a comment - 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.

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

              rucha174 Rucha Deodhar
              ratzpo Rasmus Johansson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.