Bug #36679 push_warning() should return void
Submitted: 12 May 2008 22:57 Modified: 12 Aug 2008 17:34
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[12 May 2008 22:57] Marc ALFF
Description:
This is a design defect, and can not be verified by a functional test.

The functions:
- my_error()
- push_warning_printf()
do not return a MYSQL_ERROR* result, as expected.

The function:
- push_warning()
however, do return a MYSQL_ERROR*, which is later used in item_sum.cc
to *modify* a SQL condition after it has been raised.

This design breaks the interface of the error/warning component,
and affects the implementation of SIGNAL/RESIGNAL/GET DIAGNOSTICS

How to repeat:
Read sql_error.h

Suggested fix:
In Item_func_group_concat, delay the call to push_warning instead of making a
call with broken arguments, and calling MYSQL_ERROR::set_msg() later.
[18 May 2008 15:56] Davi Arnaut
This broken interface leads to bugs such as Bug#36785
[29 Jul 2008 22:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50689

2743 Marc Alff	2008-07-29
      Bug#36679 (push_warning() should return void)
      
      This fix is required as a preliminary for SIGNAL / RESIGNAL / GET
      DIAGNOSTICS, to prevent code to modify a SQL condition after it has been
      raised.
      
      Minor code cleanup.
[8 Aug 2008 2:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51162

2751 Marc Alff	2008-08-07 [merge]
      Merge 6.0-bugteam -> local bugfix branch
[8 Aug 2008 2:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51164

2751 Marc Alff	2008-08-07 [merge]
      Merge 6.0-bugteam -> local bugfix branch
[12 Aug 2008 14:32] Bugs System
Pushed into 6.0.7-alpha  (revid:marc.alff@sun.com-20080729220357-nfvvcqdrqoegy1kq) (version source revid:davi.arnaut@sun.com-20080812141852-8e6knbqclpfd8irn) (pib:3)
[12 Aug 2008 17:34] Paul DuBois
This is a fix related to a feature that has not been released yet. No changelog entry needed.
[28 Aug 2008 20:16] Bugs System
Pushed into 6.0.7-alpha  (revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (version source revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (pib:3)
[14 Sep 2008 2:16] Bugs System
Pushed into 6.0.7-alpha  (revid:marc.alff@sun.com-20080729220357-nfvvcqdrqoegy1kq) (version source revid:sven@mysql.com-20080818195835-r615g9zz6xphmkzg) (pib:3)