summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-09-22 02:11:21 +0400
committerkonstantin@mysql.com <>2005-09-22 02:11:21 +0400
commit6f8d3c4844e7f7dd760f09a5ab8ad309d1d690d6 (patch)
treec670884265eea87654bb764c095e254eff48128d /sql/handler.cc
parente89c5220b54fe74d1afc1361f91e18b164e90e33 (diff)
downloadmariadb-git-6f8d3c4844e7f7dd760f09a5ab8ad309d1d690d6.tar.gz
A fix and a test case for Bug#6513 "Test Suite: Values inserted by using
cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." A fix for a possible memory leak when fetching into an SP cursor in a long loop. The patch uses a common implementation of cursors in the binary protocol and in stored procedures and implements materialized cursors. For implementation details, see comments in sql_cursor.cc
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index b3754891d05..52edc6d8623 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1339,11 +1339,9 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
table->db_stat|=HA_READ_ONLY;
(void) extra(HA_EXTRA_NO_READCHECK); // Not needed in SQL
- if (!alloc_root_inited(&table->mem_root)) // If temporary table
- ref=(byte*) sql_alloc(ALIGN_SIZE(ref_length)*2);
- else
- ref=(byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2);
- if (!ref)
+ DBUG_ASSERT(alloc_root_inited(&table->mem_root));
+
+ if (!(ref= (byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2)))
{
close();
error=HA_ERR_OUT_OF_MEM;