diff options
author | unknown <monty@mishka.local> | 2004-12-22 13:54:39 +0200 |
---|---|---|
committer | unknown <monty@mishka.local> | 2004-12-22 13:54:39 +0200 |
commit | bb2d3eaa30a3881927142c985fb637aca06d9823 (patch) | |
tree | 8e5f08b17957f896c2d4e931e60b57d99c260ed6 /myisam | |
parent | 52d080f09979deb2063a8010feee3b925a3d7938 (diff) | |
parent | 5c79810a6d3ca19254c310f1519664729367b647 (diff) | |
download | mariadb-git-bb2d3eaa30a3881927142c985fb637aca06d9823.tar.gz |
Merge with 4.1
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
Build-tools/Do-compile:
Auto merged
VC++Files/sql/mysqld.dsp:
Auto merged
client/Makefile.am:
Auto merged
client/mysql.cc:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
client/mysqltest.c:
Auto merged
include/my_base.h:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/dict/dict0load.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_rnext_same.c:
Auto merged
myisam/mi_write.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/ctype_ujis.result:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/metadata.result:
Auto merged
mysql-test/r/ndb_alter_table.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/insert_update.result:
Auto merged
mysql-test/r/timezone2.result:
Auto merged
mysql-test/r/type_enum.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
ndb/include/ndbapi/NdbConnection.hpp:
Auto merged
ndb/include/ndbapi/NdbDictionary.hpp:
Auto merged
ndb/src/common/util/version.c:
Auto merged
ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbacc/Makefile.am:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
Auto merged
ndb/src/kernel/blocks/dbtux/Dbtux.hpp:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbConnection.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionary.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Auto merged
ndb/src/ndbapi/NdbOperationExec.cpp:
Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
Auto merged
ndb/test/ndbapi/Makefile.am:
Auto merged
scripts/make_win_src_distribution.sh:
Auto merged
scripts/mysql_install_db.sh:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/password.c:
Auto merged
sql/protocol.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_do.cc:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/examples/ha_archive.cc:
Auto merged
sql/strfunc.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/tztime.h:
Auto merged
sql/udf_example.cc:
Auto merged
sql/unireg.cc:
Auto merged
Makefile.am:
Simple merge
client/mysqldump.c:
Simple merge
configure.in:
Simple merge
libmysqld/lib_sql.cc:
Automatic merge
mysql-test/r/func_str.result:
Automatic merge
mysql-test/r/grant.result:
simple merge
mysql-test/r/multi_update.result:
automatc merge
mysql-test/r/ps.result:
automatic merge
mysql-test/r/ps_2myisam.result:
Automatic merge
mysql-test/r/ps_3innodb.result:
Automatic merge
mysql-test/r/ps_4heap.result:
Automatic merge
mysql-test/r/ps_5merge.result:
Automatic merge
mysql-test/r/ps_6bdb.result:
Automatic merge
mysql-test/r/ps_7ndb.result:
Automatic merge
mysql-test/r/show_check.result:
Automatic merge
mysql-test/r/subselect.result:
Automatic merge
mysql-test/t/grant.test:
Automatic merge
mysql-test/t/multi_update.test:
Automatic merge
mysql-test/t/ps.test:
Automatic merge
mysql-test/t/show_check.test:
Automatic merge
ndb/docs/wl2077.txt:
merge
ndb/src/mgmsrv/main.cpp:
merge
scripts/mysql_fix_privilege_tables.sh:
merge
sql/item.cc:
Merge (difficult)
sql/item.h:
simple merge
sql/item_cmpfunc.h:
Automatic merge
sql/item_subselect.cc:
Simple merge
sql/item_subselect.h:
Automatic merge
sql/mysql_priv.h:
Simple merge
sql/slave.h:
Automatic merge
sql/sql_base.cc:
Removed code that was backported to 4.1
sql/sql_class.h:
Merge (some code moved to sql_insert.cc)
sql/sql_db.cc:
simple merge
sql/sql_insert.cc:
Merge (difficult as logic had changed both in 4.1 and 5.0)
Some coded moved here from sql_class.h
sql/sql_parse.cc:
Merge (difficult)
sql/sql_prepare.cc:
Simple merge
sql/sql_select.cc:
Automatic merge
sql/sql_table.cc:
Simple merge
sql/sql_update.cc:
Difficult merge because of different logic for multi-updates
sql/sql_yacc.yy:
Simple merge
tests/client_test.c:
Simple merge
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 2 | ||||
-rw-r--r-- | myisam/mi_check.c | 10 | ||||
-rw-r--r-- | myisam/mi_rnext_same.c | 4 | ||||
-rw-r--r-- | myisam/mi_write.c | 7 | ||||
-rw-r--r-- | myisam/rt_index.c | 3 | ||||
-rw-r--r-- | myisam/sort.c | 7 | ||||
-rw-r--r-- | myisam/sp_key.c | 5 |
7 files changed, 30 insertions, 8 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index c432ac5a16c..ffc7e1bf104 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root, sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : - w.len+extra)); + w.len*ftb->charset->mbmaxlen+extra)); ftbw->len=w.len+1; ftbw->flags=0; ftbw->off=0; diff --git a/myisam/mi_check.c b/myisam/mi_check.c index b8f992dc21a..dcf57e78fa4 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -26,6 +26,7 @@ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif +#include "rt_index.h" #ifndef USE_RAID #define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) @@ -1466,6 +1467,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff, if (_mi_ft_add(info,i,(char*) key,buff,filepos)) goto err; } + else if (info->s->keyinfo[i].flag & HA_SPATIAL) + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (rtree_insert(info, i, key, key_length)) + goto err; + } else { uint key_length=_mi_make_key(info,i,key,buff,filepos); @@ -3988,7 +3995,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) key->seg->charset->mbmaxlen; key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; } - return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && + return (key->flag & HA_SPATIAL) || + (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > (ulonglong) myisam_max_temp_length)); } diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 3060a55038a..06408f57a3f 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -92,6 +92,10 @@ int mi_rnext_same(MI_INFO *info, byte *buf) if (my_errno == HA_ERR_KEY_NOT_FOUND) my_errno=HA_ERR_END_OF_FILE; } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } else if (!(*info->read_record)(info,info->lastpos,buf)) { info->update|= HA_STATE_AKTIV; /* Record is read */ diff --git a/myisam/mi_write.c b/myisam/mi_write.c index c2f24ae1ae3..019c372a885 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record) { if (local_lock_tree) rw_unlock(&share->key_root_lock[i]); - DBUG_PRINT("error",("Got error: %d on write",my_errno)); - goto err; + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; } } if (local_lock_tree) @@ -159,7 +159,8 @@ int mi_write(MI_INFO *info, byte *record) err: save_errno=my_errno; - if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL || + my_errno == HA_ERR_NULL_IN_SPATIAL) { if (info->bulk_insert) { 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; } diff --git a/myisam/sort.c b/myisam/sort.c index 5537ba55c7d..09dd45f388c 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, IO_CACHE *to_file, char* key, uint sort_length, uint count); -inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs); +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs); + /* Creates a index of sorted keys @@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, } /* write_keys */ -inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) { int err; uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs); diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 0e424a9e193..b61e8094cde 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); + if (!dptr) + { + my_errno= HA_ERR_NULL_IN_SPATIAL; + return 0; + } sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) |