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

Bad error message upon ALTER TABLE with wrong ROW_FORMAT

Details

    Description

      MariaDB [test]> CREATE TABLE t1 (i INT);
      Query OK, 0 rows affected (0.20 sec)
       
      MariaDB [test]> ALTER TABLE t1 ROW_FORMAT=FIXED;
      ERROR 1478 (HY000): Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE'
      

      In fact, the engine supports the option, and the option name is wrong. What it doesn't support is the value.
      CREATE TABLE behaves differently:

      MariaDB [test]> CREATE TABLE t2 (i INT) ROW_FORMAT=FIXED;
      ERROR 1005 (HY000): Can't create table `test`.`t2` (errno: 140 "Wrong create options")
      MariaDB [test]> SHOW WARNINGS;
      +---------+------+--------------------------------------------------------------------+
      | Level   | Code | Message                                                            |
      +---------+------+--------------------------------------------------------------------+
      | Warning | 1478 | InnoDB: invalid ROW_FORMAT specifier.                              |
      | Error   | 1005 | Can't create table `test`.`t2` (errno: 140 "Wrong create options") |
      | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
      +---------+------+--------------------------------------------------------------------+
      3 rows in set (0.00 sec)
      

      At least the message for error 1478 is better here.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -

            serg, as far as I remember, you do not like error or warning message codes to be added that are specific for a single storage engine. (Well, this one could be implemented in many storage engines if we wanted them to loudly ignore incorrect parameter values.)

            We would need an error message pattern that allows us to specify two strings, the parameter name and the value. Another error message pattern would be nice, to specify a parameter name and a numeric value (such as ENCRYPTION_KEY_ID, for MDEV-15116).

            marko Marko Mäkelä added a comment - serg , as far as I remember, you do not like error or warning message codes to be added that are specific for a single storage engine. (Well, this one could be implemented in many storage engines if we wanted them to loudly ignore incorrect parameter values.) We would need an error message pattern that allows us to specify two strings, the parameter name and the value. Another error message pattern would be nice, to specify a parameter name and a numeric value (such as ENCRYPTION_KEY_ID , for MDEV-15116 ).
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik added a comment - - edited

            I presume, it happens because of

            		if (const char* invalid_tbopt = info.check_table_options()) {
            			my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
            				 table_type(), invalid_tbopt);
            			goto err_exit_no_heap;
            		}
            

            I think it could be a bit more flexible, and let info.check_table_options() issue a more specific error message in certain cases, instead of just blindly assuming that the only possible error is the unknown option name. Like, for example

            static const char *error_message_already_issued_marker="*";
            ...
            if (const char* invalid_tbopt = info.check_table_options()) {
              if (invalid_tbopt != error_message_already_issued_marker)
                my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
                          table_type(), invalid_tbopt);
                          goto err_exit_no_heap;
            }
            

            serg Sergei Golubchik added a comment - - edited I presume, it happens because of if ( const char * invalid_tbopt = info.check_table_options()) { my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), table_type(), invalid_tbopt); goto err_exit_no_heap; } I think it could be a bit more flexible, and let info.check_table_options() issue a more specific error message in certain cases, instead of just blindly assuming that the only possible error is the unknown option name. Like, for example static const char *error_message_already_issued_marker= "*" ; ... if ( const char * invalid_tbopt = info.check_table_options()) { if (invalid_tbopt != error_message_already_issued_marker) my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), table_type(), invalid_tbopt); goto err_exit_no_heap; }
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Marko Mäkelä [ marko ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 80905 ] MariaDB v4 [ 140319 ]

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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