summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-09-23 00:46:59 +0400
committerunknown <konstantin@mysql.com>2005-09-23 00:46:59 +0400
commit38ebb6c638060bf31eccee86856f5b5855bd0f27 (patch)
treec8753cbe4273232bc93f91ecd04ad7014cee9cdb /sql/handler.cc
parent2fec728eb73cbd9177564faf4dc7ef64c9288a54 (diff)
parentac9c1fa39bb770a568387c2bee08c8821abdbf92 (diff)
downloadmariadb-git-38ebb6c638060bf31eccee86856f5b5855bd0f27.tar.gz
Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into mysql.com:/opt/local/work/mysql-5.0-root BitKeeper/etc/ignore: auto-union include/my_sys.h: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/ctype_ujis.test: Auto merged sql/ha_federated.cc: Auto merged sql/handler.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.cc: Auto merged
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 5f8fa33fecc..809ed188d59 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1456,11 +1456,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;