summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-07-21 14:56:43 +0700
committerDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-07-21 14:56:43 +0700
commit49d327ebf763dca23969ac4afe814617815d1411 (patch)
tree6fa561732c7d7b6aafd747e41417467da3cab2c9 /sql/sql_cursor.cc
parent48a74d7472d92915c12671d2b0563df5d44614b4 (diff)
downloadmariadb-git-49d327ebf763dca23969ac4afe814617815d1411.tar.gz
Fixed bug #42496 - the server could crash on a debug assert after a failure
to write into a closed socket
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 6f61dc40f66..d7d029d28d4 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -658,7 +658,12 @@ void Materialized_cursor::fetch(ulong num_rows)
if ((res= table->file->rnd_next(table->record[0])))
break;
/* Send data only if the read was successful. */
- result->send_data(item_list);
+ /*
+ If network write failed (i.e. due to a closed socked),
+ the error has already been set. Just return.
+ */
+ if (result->send_data(item_list))
+ return;
}
switch (res) {