1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Fix result of ROW_COUNT() after 'EXECUTE prepstmt'. (Bug #14956)

This commit is contained in:
jimw@mysql.com
2005-11-23 14:57:26 -08:00
parent 15df2c2298
commit 86beb208aa
3 changed files with 27 additions and 4 deletions

View File

@@ -4822,11 +4822,15 @@ end_with_restore_list:
/*
The return value for ROW_COUNT() is "implementation dependent" if
the statement is not DELETE, INSERT or UPDATE (or a CALL executing
such a statement), but -1 is what JDBC and ODBC wants.
The return value for ROW_COUNT() is "implementation dependent" if the
statement is not DELETE, INSERT or UPDATE, but -1 is what JDBC and ODBC
wants.
We do not change the value for a CALL or EXECUTE statement, so the value
generated by the last called (or executed) statement is preserved.
*/
if (lex->sql_command != SQLCOM_CALL && uc_update_queries[lex->sql_command]<2)
if (lex->sql_command != SQLCOM_CALL && lex->sql_command != SQLCOM_EXECUTE &&
uc_update_queries[lex->sql_command]<2)
thd->row_count_func= -1;
goto cleanup;