Bug 427102

Summary: mysql 5 triggers produces error Function with select return no data
Product: Red Hat Enterprise Linux 5 Reporter: Marcelo Giles <mgiles>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: byte, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://bugs.mysql.com/bug.php?id=20028
Whiteboard:
Fixed In Version: 5.0.45-7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-26 00:56:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marcelo Giles 2007-12-31 18:25:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20071122 Red Hat/1.5.0.12-7.el5 Firefox/1.5.0.12

Description of problem:
This bug has been reported upstream on the mysql web site:

Bug #20028 Function with select return no data
http://bugs.mysql.com/bug.php ?id=20028

There's a patch for this bug:

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

Version-Release number of selected component (if applicable):
mysql-server-5.0.22-2.1.0.1

How reproducible:
Always


Steps to Reproduce:
perform INSERT, SELECT or UPDATE triggers on database tables.

Actual Results:
Error on mysl CLI:
Reason: No data - zero rows fetched, selected, or processed 

Expected Results:
INSERT, SELECT or UPDATE triggers operations should have been carried on successfully.

Additional info:
Patch proposed on mysql.com:

ChangeSet@stripped, 2006-10-05 20:26:07-07:00, malff@weblab.(none) +8 -0
 Bug#20028 (Function with select return no data)
 
 Before this change, THD::abort_on_warning was set in sp_head::execute,
 causing Stored Procedures, Stored Functions and Triggers to treat warnings
 as errors when executing in a strict SQL_MODE.
 
 After this change, THD::abort_on_warning is set in process_triggers in
 sql/sql_trigger.cc, which only affects triggers. Only INSERT and UPDATE
 triggers can elevate the abort_on_warning flag, which does not affect
 DELETE triggers.
 
 This fix is a revision of the change done for 6951, it produces the
 same results for the INSERT and UPDATE triggers in strict mode, while not
 causing side effects in DELETE triggers, Stored Procedures or Stored
 Functions, which -- according to the definition of a STRICT mode -- should
 not produre errors when no insert or update is performed.

Comment 1 Tom Lane 2007-12-31 22:45:35 UTC
We are planning to rebase mysql to 5.0.45 (or later) in RHEL 5.2.  That should take care of this bug, along 
with boatloads of others ...

Comment 5 Tom Lane 2008-05-26 00:56:01 UTC
Fixed in RHEL 5.2 update.