Bug #47233 Innodb calls push_warning(MYSQL_ERROR::WARN_LEVEL_ERROR)
Submitted: 10 Sep 2009 6:04 Modified: 18 Jun 2010 22:45
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.4.3 (mysql-trunk), 5.1 OS:Any
Assigned to: Satya B CPU Architecture:Any

[10 Sep 2009 6: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 2009 6:37] Sveta Smirnova
Thank you for the report.

Verified as described. InnoDB Plugin code contains such push_warning calls as well.
[10 Sep 2009 6:38] Sveta Smirnova
Note to previous comment: InnoDB Plugin code in 5.1
[24 Sep 2009 0:57] Jimmy Yang
Change will be made for both 5.1 and plugin (zip) branches.
[22 Oct 2009 6: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 2009 9: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 2009 16: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 2009 6: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 2009 7: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 2009 8: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 2009 0: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.
[18 Dec 2009 10:27] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:43] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 10:59] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:13] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[5 May 2010 15:05] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 17:45] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[28 May 2010 6:06] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:35] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 7:02] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 2:53] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[15 Jun 2010 8:09] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (merge vers: 5.1.47) (pib:16)
[15 Jun 2010 8:25] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (pib:16)
[17 Jun 2010 12:11] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:58] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:39] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)