Bug #24648 | DBD::mysql::st execute failed: No data to FETCH at | ||
---|---|---|---|
Submitted: | 28 Nov 2006 9:50 | Modified: | 3 Dec 2006 9:30 |
Reporter: | Konkov Eugen | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | OS: | ||
Assigned to: | CPU Architecture: | Any |
[28 Nov 2006 9:50]
Konkov Eugen
[28 Nov 2006 11:09]
Konkov Eugen
When we run 'SELECT INTO' statement from trigger and this statement return nothing. I get error 'NO DATA to FETCH' HOW TO REPEAT: 1. Create a table 2. Add row to this table 3. Create a any trigger for this table 3.a Trigger must have 'SELECT INTO some_var ' statement which must return nothing. If 'Select INTO' statement return some data you don't get the error MySQL can't assign data to 'some_var' because of no data selected 4. UPDATE/INSERT data to you table to involve trigger
[29 Nov 2006 3:27]
Valeriy Kravchuk
Why do you think it is a bug? Please, read the manual: http://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html http://dev.mysql.com/doc/refman/5.0/en/declare-handlers.html to get some ideas on how to fix your trigger's code.
[1 Dec 2006 10:45]
Konkov Eugen
I am not imagine how to declare a such handle I want only: select somthint into someVar .... if( rowsAffected>0 ) { update } I have been surprised for a such error. May be MySQL needs more informative error message that contains TRIGGER NAME, LINE where error occour not only: 'No data to FETCH'
[3 Dec 2006 9:30]
Valeriy Kravchuk
SELECT ... INTO ... should always return 1 row. Otherwise error is generated (and you have to process it). As for the following: > May be MySQL needs more informative error message that contains > TRIGGER NAME, LINE where error occour > not only: 'No data to FETCH' It looks like a reasonable feature request for me. Please, report it separately.