summaryrefslogtreecommitdiff
path: root/myisam/rt_index.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/rt_index.c')
-rw-r--r--myisam/rt_index.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/myisam/rt_index.c b/myisam/rt_index.c
index cfb2ca877f4..bdf5ee9c60f 100644
--- a/myisam/rt_index.c
+++ b/myisam/rt_index.c
@@ -710,7 +710,8 @@ err1:
int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
{
- return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0;
+ return (!key_length ||
+ (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0;
}