Bug #47233 Innodb calls push_warning(MYSQL_ERROR::WARN_LEVEL_ERROR)
Submitted: 10 Sep 8:04 Modified: 22 Nov 1:47
Reporter: Marc Alff
Status: Closed
Category:Server: InnoDB Severity:S1 (Critical)
Version:5.4.3 (mysql-trunk), 5.1 OS:Any
Assigned to: Satya B Target Version:5.1+
Triage: Triaged: D2 (Serious)

[10 Sep 8:04] Marc Alff
Description:
In ha_innodb.cc, the code calls push_warning() or
push_warning_printf() with a level of WARN_LEVEL_ERROR.

For example:

                                push_warning_printf(
                                        (THD*) trx->mysql_thd,
                                        MYSQL_ERROR::WARN_LEVEL_ERROR,
                                        ER_CANT_CREATE_TABLE,
                                        "In InnoDB, charset-collation codes"
                                        " must be below 256."
                                        " Unsupported code %lu.",
                                        (ulong) charset_no);

                push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
                             ER_ILLEGAL_HA_CREATE_OPTION,
                             "InnoDB: KEY_BLOCK_SIZE"
                             " requires innodb_file_per_table.");

This is broken, and will be illegal in 5.4.

See related bug#39059

How to repeat:
Read the code

Suggested fix:
To raise an exception condition, call my_error() or similar.
To raise a completion condition, call push_warning with WARN_LEVEL_WARN.
[10 Sep 8:37] Sveta Smirnova
Thank you for the report.

Verified as described. InnoDB Plugin code contains such push_warning calls as well.
[10 Sep 8:38] Sveta Smirnova
Note to previous comment: InnoDB Plugin code in 5.1
[24 Sep 2:57] Jimmy Yang
Change will be made for both 5.1 and plugin (zip) branches.
[22 Oct 8:33] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version
source revid:alik@sun.com-20091020094819-qu426dey04qhoska) (merge vers: 6.0.14-alpha)
(pib:13)
[4 Nov 10:25] Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source
revid:kristofer.pettersson@sun.com-20091103162305-08l4gkeuif2ozsoj) (merge vers: 5.1.41)
(pib:13)
[8 Nov 17:41] Jimmy Yang
It seems there are really two types of issues here:

1. Misuse of WARN_LEVEL_ERROR vs. WARNING_LEVEL_WARN. As referred in the initial bug
report, as in #39059

2. Misuse of push_warning_printf() vs. my_printf_error(), the later (my_printf_error())
has not been used by innodb. And my_error() does not have the flexibility of printing
customized error message, thus push_warning_printf() was used instead.

In light of this, we might like to use my_printf_error() in some of previous cases used
by  push_warning_printf().
[11 Nov 7:52] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091110093407-rw5g8dys2baqkt67) (version
source revid:alik@sun.com-20091109080109-7dxapd5y5pxlu08w) (merge vers: 6.0.14-alpha)
(pib:13)
[11 Nov 8:00] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version
source revid:svoj@sun.com-20091105122958-jyqjx9xus8v4e0yd) (merge vers: 5.5.0-beta)
(pib:13)
[12 Nov 9:16] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version
source revid:alik@sun.com-20091022202044-144kxo3j386eenz4) (merge vers: 5.5.0-beta)
(pib:13)
[22 Nov 1:47] Paul DuBois
Noted in 5.1.41, 5.5.0, 6.0.14 changelogs.

InnoDB raised errors in some cases in a manner not compatible with
SIGNAL and RESIGNAL.