summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-11-19 19:00:02 +0300
committerunknown <konstantin@mysql.com>2005-11-19 19:00:02 +0300
commit4ca413e9409ffe6ab70cb919782bb619e84ac034 (patch)
treea7b9e2de1cbfc33467143455059346894e48e755 /sql/sql_cursor.cc
parent6ba79a251681a765f491db1428a467a0a06a69bd (diff)
downloadmariadb-git-4ca413e9409ffe6ab70cb919782bb619e84ac034.tar.gz
A fix for Bug#14845 "mysql_stmt_fetch returns MYSQL_NO_DATA when
COUNT(*) is 0" (the test case has been pushed already) sql/sql_cursor.cc: Fix a return of an unitialized variable: return_zero_rows checks the return value of send_fields and in case it's 1 doesn't call send_data. This caused creation of an empty result set for the case when there is a cursor against a select with a group function and no matching rows.
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index fc169fe18e8..89c160cd70a 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -661,11 +661,10 @@ Materialized_cursor::~Materialized_cursor()
bool Select_materialize::send_fields(List<Item> &list, uint flags)
{
- bool rc;
DBUG_ASSERT(table == 0);
if (create_result_table(unit->thd, unit->get_unit_column_types(),
FALSE, thd->options | TMP_TABLE_ALL_COLUMNS, ""))
return TRUE;
- return rc;
+ return FALSE;
}