summaryrefslogtreecommitdiff
path: root/myisam/mi_create.c
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-03-12 18:51:03 +0400
committerunknown <hf@deer.(none)>2004-03-12 18:51:03 +0400
commit0bddae2ea710f3af6d0e14b26df10309a3cd9331 (patch)
tree416c45416bcc8605ff5754473476ddabbd22fe2f /myisam/mi_create.c
parent4cf338f8b2c5236689d37924dabb0720104b561d (diff)
downloadmariadb-git-0bddae2ea710f3af6d0e14b26df10309a3cd9331.tar.gz
WL#1163 To make spatial code optional
myisam spatial code isolated myisam/mi_create.c: spatial code ifdef-ed myisam/mi_key.c: spatial code ifdef-ed myisam/mi_open.c: spatial code ifdef-ed myisam/mi_range.c: spatial code ifdef-ed myisam/mi_rkey.c: spatial code ifdef-ed myisam/mi_rnext.c: spatial code ifdef-ed myisam/mi_rnext_same.c: spatial code ifdef-ed myisam/rt_index.c: spatial code ifdef-ed myisam/rt_index.h: spatial code ifdef-ed myisam/rt_key.c: spatial code ifdef-ed myisam/rt_key.h: spatial code ifdef-ed myisam/rt_mbr.c: spatial code ifdef-ed myisam/rt_mbr.h: spatial code ifdef-ed myisam/rt_split.c: spatial code ifdef-ed myisam/rt_test.c: spatial code ifdef-ed myisam/sp_defs.h: spatial code ifdef-ed myisam/sp_key.c: spatial code ifdef-ed myisam/sp_test.c: spatial code ifdef-ed sql/spatial.cc: spatial code ifdef-ed sql/spatial.h: spatial code ifdef-ed sql/sql_yacc.yy: wrong error messages fixed
Diffstat (limited to 'myisam/mi_create.c')
-rw-r--r--myisam/mi_create.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/myisam/mi_create.c b/myisam/mi_create.c
index 72633966b54..aef19ad8660 100644
--- a/myisam/mi_create.c
+++ b/myisam/mi_create.c
@@ -242,6 +242,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
key_length=pointer;
if (keydef->flag & HA_SPATIAL)
{
+#ifdef HAVE_SPATIAL
/* BAR TODO to support 3D and more dimensions in the future */
uint sp_segs=SPDIMS*2;
keydef->flag=HA_SPATIAL;
@@ -270,6 +271,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
key_length+=SPLEN*sp_segs;
length++; /* At least one length byte */
min_key_length_skip+=SPLEN*2*SPDIMS;
+#else
+ my_errno= HA_ERR_UNSUPPORTED;
+ goto err;
+#endif /*HAVE_SPATIAL*/
}
else
if (keydef->flag & HA_FULLTEXT)
@@ -582,6 +587,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
for (j=0 ; j < keydefs[i].keysegs-sp_segs ; j++)
if (mi_keyseg_write(file, &keydefs[i].seg[j]))
goto err;
+#ifdef HAVE_SPATIAL
for (j=0 ; j < sp_segs ; j++)
{
HA_KEYSEG sseg;
@@ -597,6 +603,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (mi_keyseg_write(file, &sseg))
goto err;
}
+#endif
}
/* Create extra keys for unique definitions */
offset=reclength-uniques*MI_UNIQUE_HASH_LENGTH;