summaryrefslogtreecommitdiff
path: root/storage/myisam/mi_open.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-10-11 16:10:47 +0200
committerSergei Golubchik <serg@mariadb.org>2016-12-12 20:27:31 +0100
commit4aab0588541499d97ad1882ccb4481052dd2f62d (patch)
treebb6de1eceafdf8bdca0d71ecd6e7d68e2aeff12c /storage/myisam/mi_open.c
parentb2c8d55c228d560959a031d641959e86f0274c75 (diff)
downloadmariadb-git-4aab0588541499d97ad1882ccb4481052dd2f62d.tar.gz
cleanup: spatial indexes in MyISAM
In spatial indexes there can be only one keyseg. Make it explicit in the code, don't pretend that this can work with the arbitrary number of keysegs.
Diffstat (limited to 'storage/myisam/mi_open.c')
-rw-r--r--storage/myisam/mi_open.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index b8cbefe6ac2..9c3a6bf5a2f 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -377,8 +377,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{
#ifdef HAVE_SPATIAL
uint sp_segs=SPDIMS*2;
- share->keyinfo[i].seg=pos-sp_segs;
- share->keyinfo[i].keysegs--;
+ share->keyinfo[i].seg= pos - sp_segs;
+ DBUG_ASSERT(share->keyinfo[i].keysegs == sp_segs + 1);
+ share->keyinfo[i].keysegs= sp_segs;
#else
my_errno=HA_ERR_UNSUPPORTED;
goto err;