diff options
author | unknown <monty@mashka.mysql.fi> | 2002-10-02 13:33:08 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-10-02 13:33:08 +0300 |
commit | 5a28c2caca888be932140d12f87c496398ad4220 (patch) | |
tree | 5a27bda6d3f628af7dcb922ad022e84cf8cb351c /myisam | |
parent | 9421f1dae99e0f2d6100b31a3641b2cd0ad68e58 (diff) | |
download | mariadb-git-5a28c2caca888be932140d12f87c496398ad4220.tar.gz |
Fixes and code cleanups after merge with 4.0.3
Warning handling and initial prepared statement handling (last not complete yet)
Changed a lot of functions that returned 0/1 to my_bool type.
GRANT handling now uses read/write locks instead of mutex
Change basic net functions to use THD instead of NET
(needed for 4.1 protocol)
Use my_sprintf instead of sprintf() + strlen()
Added alloc_query() to be able to chare query initialization code with
prepared statements.
Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID()
Note that the following test fails (will be fixed ASAP):
sub_select, union, rpl_rotate_logs and rpl_mystery22
BitKeeper/deleted/.del-README~3449730baf983117:
Delete: mysql-test/t/README
BitKeeper/deleted/.del-sql_error.cc~2f1caca8d2485dbe:
Delete: libmysqld/sql_error.cc
BitKeeper/deleted/.del-sql_prepare.cc~f703729793935ed6:
Delete: libmysqld/sql_prepare.cc
Docs/manual.texi:
Updated variable list
client/mysql.cc:
Show warning count to user.
client/mysqltest.c:
Add warnings to test results
configure.in:
New shared library version number
include/errmsg.h:
Indentation cleanup
include/mysql.h:
Removed MYSQL_ERROR
Indentaion cleanups
include/mysql_com.h:
Changed functions to returns true/false to my_bool.
include/mysqld_error.h:
New error messages
isam/pack_isam.c:
Indentation change
libmysql/Makefile.am:
Fix of wrong merge
libmysql/Makefile.shared:
Indentation cleanup
libmysql/errmsg.c:
Removed not used errors
libmysql/libmysql.c:
Change functions to return 1 on error (not -1)
Change type of functions that returns 0/1 to my_bool
Lot of code optimizations.
Lot of changes for prepared statements. This now handles sending of binary data to server.
Receving of binary data is not yet done (will have to wait until server code for this is ready)
mysql_warning_count and mysql_warnings() implemented.
libmysql/libmysql.def:
Added mysql_warnings and mysql_warning_count
libmysql/manager.c:
Fixed wrong testing of result from my_connect()
libmysqld/lib_sql.cc:
Removed global variable THR_NET
Change basic net functions to use THD instead of NET
GRANT handling now uses read/write locks instead of mutex
libmysqld/libmysqld.c:
Changed functions to be my_bool
myisam/ft_boolean_search.c:
Trivial code cleanup
myisam/ft_stopwords.c:
Trivial code cleanup
myisam/mi_check.c:
Update to 4.1 structures
myisam/myisampack.c:
Trivial code cleanup
myisam/rt_key.c:
Code cleanup
myisam/rt_test.c:
Code cleanup
Removed compiler warnings
myisam/sp_key.c:
Indentation changes
myisam/sp_test.c:
Removed compiler warnings
mysql-test/README:
Updated to reflect the new --external flag.
mysql-test/mysql-test-run.sh:
--local (start new server) is now default.
Use --external to test against external server.
mysql-test/r/rollback.result:
Updated for 4.1 warnings
mysql-test/r/rpl_log.result:
Update for 4.1
mysql-test/t/rollback.test:
Updated for 4.1 warnings
mysql-test/t/rpl_log_pos.test:
Portability fix
mysys/hash.c:
Indentation change
mysys/my_error.c:
Indentation change
mysys/tree.c:
Updated file description
sql/field.cc:
Fixed bugs introduced by merge
Use my_sprintf instead of sprintf() + strlen()
sql/field.h:
Add CHARSET_INFO to field structure
sql/gstream.h:
Indentation changes.
Added GPL copyright header
sql/ha_innodb.cc:
Updated parameters for net functions.
sql/item.cc:
Updates of Item_param
Indentation changes
sql/item.h:
Removed size_of() function from item.
sql/item_func.cc:
Update function usage for 4.1
Added get_system_var()
sql/item_func.h:
Indentation change
sql/item_strfunc.cc:
Removed not needed inclusion of gstream.h
Update to use system variables (from 4.0)
sql/item_sum.h:
Removed size_of() functions from item.
sql/item_timefunc.cc:
Change sprintf() + strlen() -> my_sprintf()
Added length parameter to ->append()
sql/item_timefunc.h:
Removed size_of() functions from item.
sql/item_uniq.h:
Removed size_of() functions from item.
sql/lex.h:
Removed SQL_ERROR_COUNT variable
sql/log.cc:
Change sprintf() + strlen() -> my_sprintf()
sql/log_event.cc:
Change sprintf() + strlen() -> my_sprintf()
sql/mini_client.cc:
Added check that one always specifies a length to mc_mysql_query()
sql/mysql_priv.h:
New prototypes
Change of NET -> THD parameter for net functions.
sql/mysqld.cc:
New startup options: 'max_prepared_statements', 'max_error_count'
Updated usage of net functions.
sql/net_pkg.cc:
Change basic net functions to use THD instead of NET
(needed to be able to handle 4.0 and 4.1 protocols)
Lots of function comments
sql/net_serv.cc:
Change int return values -> my_bool
Updated net_write_command() to take an extra header block to be added to the packet.
(This made the prepared statement code much nicer and more efficient)
sql/repl_failsafe.cc:
Update net functions to use THD instead of NET
sql/set_var.cc:
Added @@error_count and @@warning_count variables.
Updated to 4.1 function usage
sql/set_var.h:
Added @@error_count and @@warning_count variables.
sql/share/czech/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/english/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/greek/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/hungarian/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/japanese/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/korean/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/norwegian-ny/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/norwegian/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/polish/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/romanian/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/slovak/errmsg.txt:
Removed Warning: from warning error messages.
sql/share/swedish/errmsg.txt:
Removed Warning: from warning error messages.
sql/slave.cc:
Change basic net functions to use THD instead of NET
skip_load_data_file recoded to fit new client/server protocol
sql/spatial.h:
Added copyright header
Indentation cleanups
sql/sql_acl.cc:
Change basic net functions to use THD instead of NET
GRANT handling now uses read/write locks instead of mutex
sql/sql_analyse.cc:
Change basic net functions to use THD instead of NET
sprintf() + strlen() -> my_sprintf()
sql/sql_base.cc:
More DBUG statements
sql/sql_class.cc:
Change basic net functions to use THD instead of NET
warning and prepared statement handling
sql/sql_class.h:
Change basic net functions to use THD instead of NET
warning and prepared statement handling
sql/sql_db.cc:
Code cleanup & optimization.
sql/sql_delete.cc:
Change basic net functions to use THD instead of NET
sql/sql_derived.cc:
Change basic net functions to use THD instead of NET
sql/sql_do.cc:
Change basic net functions to use THD instead of NET
sql/sql_error.cc:
Big rewrite of error handling.
sql/sql_handler.cc:
Change basic net functions to use THD instead of NET
sql/sql_insert.cc:
Change basic net functions to use THD instead of NET
sql/sql_lex.cc:
Change basic net functions to use THD instead of NET
sql/sql_lex.h:
Added param_count to st_select_lex_node
sql/sql_list.h:
Removed not needed error list.
sql/sql_load.cc:
Change basic net functions to use THD instead of NET
sql/sql_parse.cc:
Change basic net functions to use THD instead of NET
Added alloc_query() to be able to chare query initialization code with
prepared statements.
Update of warning handling.
Added create_select_for_variable() (for SHOW COUNT(*) WARNINGS)
sql/sql_prepare.cc:
Initial prepared statement handling
sql/sql_rename.cc:
Change basic net functions to use THD instead of NET
sql/sql_repl.cc:
Change basic net functions to use THD instead of NET
sql/sql_select.cc:
Small code cleanups
Added missing initialization of error that caused some queries that returned an empty result set to fail
sql/sql_select.h:
Ensure that JOIN.error is properly initialized
sql/sql_show.cc:
Change basic net functions to use THD instead of NET
A lot of optimization
sql/sql_table.cc:
Change basic net functions to use THD instead of NET
Indentaion cleanup
sql/sql_udf.cc:
Change basic net functions to use THD instead of NET
sql/sql_union.cc:
Change basic net functions to use THD instead of NET
sql/sql_update.cc:
Change basic net functions to use THD instead of NET
sql/sql_yacc.yy:
Change basic net functions to use THD instead of NET
Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID()
sql/structs.h:
Moved structures to files where they was used
sql/table.cc:
Don't accept empty database names
sql/uniques.cc:
Indentation cleanup
sql/unireg.cc:
Change basic net functions to use THD instead of NET
sql/unireg.h:
Added defaults for warnings and prepared statements
strings/ctype-simple.c:
optimization
tests/client_test.c:
Fixed wrong paramaters to printf()
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 4 | ||||
-rw-r--r-- | myisam/ft_stopwords.c | 4 | ||||
-rw-r--r-- | myisam/mi_check.c | 6 | ||||
-rw-r--r-- | myisam/myisampack.c | 3 | ||||
-rw-r--r-- | myisam/rt_key.c | 63 | ||||
-rw-r--r-- | myisam/rt_test.c | 14 | ||||
-rw-r--r-- | myisam/sp_key.c | 15 | ||||
-rw-r--r-- | myisam/sp_test.c | 11 |
8 files changed, 68 insertions, 52 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 1a70113f0ad..9a2a29f9a08 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -241,8 +241,8 @@ static void _ftb_init_index_search(FT_INFO *ftb) { if (!is_tree_inited(& ftb->no_dupes)) { - init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), - _ftb_no_dupes_cmp,0,0,0); + init_tree(&ftb->no_dupes,0,0,sizeof(my_off_t), + _ftb_no_dupes_cmp, 0, NULL, NULL); } } } diff --git a/myisam/ft_stopwords.c b/myisam/ft_stopwords.c index 170442c71de..5415a08e5e3 100644 --- a/myisam/ft_stopwords.c +++ b/myisam/ft_stopwords.c @@ -41,8 +41,8 @@ int ft_init_stopwords(const char **sws) if(!stopwords3) { if(!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0)))) return -1; - init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,0, - NULL, NULL); + init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp, + 0, NULL, NULL); } if(!sws) return 0; diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 49f6f31f96e..10d7052fb0f 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1771,7 +1771,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, File new_file; MI_SORT_PARAM sort_param; MYISAM_SHARE *share=info->s; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; ulong *rec_per_key_part; char llbuff[22]; SORT_INFO sort_info; @@ -2136,7 +2136,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, MI_SORT_PARAM *sort_param=0; MYISAM_SHARE *share=info->s; ulong *rec_per_key_part; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; char llbuff[22]; IO_CACHE_SHARE io_share; SORT_INFO sort_info; @@ -3080,7 +3080,7 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a) { sort_info->dupp++; sort_info->info->lastpos=get_record_for_key(sort_info->info, - sort_parm->keyinfo, + sort_param->keyinfo, (uchar*) a); mi_check_print_warning(param, "Duplicate key for record at %10s against record at %10s", diff --git a/myisam/myisampack.c b/myisam/myisampack.c index a299e4eb00d..3fbc371be3f 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -665,7 +665,8 @@ static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records) (type == FIELD_NORMAL || type == FIELD_SKIP_ZERO)) count[i].max_zero_fill= count[i].field_length; - init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0,NULL,NULL); + init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL, + NULL); if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) count[i].tree_pos=count[i].tree_buff = my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, diff --git a/myisam/rt_key.c b/myisam/rt_key.c index c08e918c6db..a48aec53c97 100644 --- a/myisam/rt_key.c +++ b/myisam/rt_key.c @@ -1,5 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin & MySQL Finland AB - & TCX DataKonsult AB +/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,14 +21,16 @@ #include "rt_mbr.h" /* -Add key to the page -Result values: --1 - error - 0 - not split - 1 - split + Add key to the page + + RESULT VALUES + -1 Error + 0 Not split + 1 Split */ + int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, - uint key_length, uchar *page_buf, my_off_t *new_page) + uint key_length, uchar *page_buf, my_off_t *new_page) { uint page_size = mi_getint(page_buf); uint nod_flag = mi_test_if_nod(page_buf); @@ -53,47 +54,39 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, mi_putint(page_buf, page_size, nod_flag); return 0; } - else - { - if (rtree_split_page(info, keyinfo, page_buf, key, key_length, new_page)) - return -1; - else - return 1; - } + + return (rtree_split_page(info, keyinfo, page_buf, key, key_length, + new_page) ? -1 : 0); } /* -Delete key from the page + Delete key from the page */ int rtree_delete_key(MI_INFO *info, uchar *page_buf, uchar *key, - uint key_length, uint nod_flag) + uint key_length, uint nod_flag) { uint16 page_size = mi_getint(page_buf); uchar *key_start; + key_start= key - nod_flag; if (nod_flag) - { - key_start = key - nod_flag; - } - else - { - key_start = key; key_length += info->s->base.rec_reflength; - } - memmove(key_start, key + key_length, page_size - key_length - - (key - page_buf)); - page_size -= key_length + nod_flag; - mi_putint(page_buf, page_size, nod_flag); + memmove(key_start, key + key_length, page_size - key_length - + (key - page_buf)); + page_size-= key_length + nod_flag; + mi_putint(page_buf, page_size, nod_flag); return 0; } + /* -Calculate and store key MBR + Calculate and store key MBR */ + int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, - uint key_length, my_off_t child_page) + uint key_length, my_off_t child_page) { uchar *k; uchar *last; @@ -114,21 +107,25 @@ err1: return -1; } + /* -Choose non-leaf better key for insertion + Choose non-leaf better key for insertion */ + uchar *rtree_choose_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, - uint key_length, uchar *page_buf, uint nod_flag) + uint key_length, uchar *page_buf, uint nod_flag) { double increase; double best_incr = DBL_MAX; double area; double best_area; uchar *best_key; - uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); uchar *last = rt_PAGE_END(page_buf); + LINT_INIT(best_area); + LINT_INIT(best_key); + for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) { if ((increase = rtree_area_increase(keyinfo->seg, key, k, key_length, diff --git a/myisam/rt_test.c b/myisam/rt_test.c index 4cc60d63031..5cf4262e804 100644 --- a/myisam/rt_test.c +++ b/myisam/rt_test.c @@ -32,7 +32,7 @@ static void print_record(char * record,my_off_t offs,const char * tail); static int run_test(const char *filename); -int main(int argc,char *argv[]) +int main(int argc __attribute__((unused)),char *argv[]) { MY_INIT(argv[0]); exit(run_test("rt_test")); @@ -63,7 +63,6 @@ int run_test(const char *filename) int row_count=0; char record[MAX_REC_LENGTH]; char read_record[MAX_REC_LENGTH]; - int upd=10; ha_rows hrows; @@ -343,7 +342,10 @@ static int read_with_pos (MI_INFO * file,int silent) } -static void bprint_record(char * record, my_off_t offs,const char * tail) +#ifdef NOT_USED +static void bprint_record(char * record, + my_off_t offs __attribute__((unused)), + const char * tail) { int i; char * pos; @@ -356,8 +358,12 @@ static void bprint_record(char * record, my_off_t offs,const char * tail) } printf("%s",tail); } +#endif -static void print_record(char * record, my_off_t offs,const char * tail) + +static void print_record(char * record, + my_off_t offs __attribute__((unused)), + const char * tail) { int i; char * pos; diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 2ab11f993c3..82c2b1f8510 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -1,5 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin & MySQL Finland AB - & TCX DataKonsult AB +/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,8 +29,9 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims, double *mbr, int top); static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr); + uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, - const byte *record, my_off_t filepos) + const byte *record, my_off_t filepos) { HA_KEYSEG *keyseg; MI_KEYDEF *keyinfo = &info->s->keyinfo[keynr]; @@ -91,10 +91,12 @@ static int sp_mbr_from_wkb(uchar *wkb, uint size, uint n_dims, double *mbr) } /* -Add one point stored in wkb to mbr + Add one point stored in wkb to mbr */ + static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, - uchar byte_order, double *mbr) + uchar byte_order __attribute__((unused)), + double *mbr) { double ord; double *mbr_end = mbr + n_dims * 2; @@ -115,12 +117,14 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, return 0; } + static int sp_get_point_mbr(uchar *(*wkb), uchar *end, uint n_dims, uchar byte_order, double *mbr) { return sp_add_point_to_mbr(wkb, end, n_dims, byte_order, mbr); } + static int sp_get_linestring_mbr(uchar *(*wkb), uchar *end, uint n_dims, uchar byte_order, double *mbr) { @@ -137,6 +141,7 @@ static int sp_get_linestring_mbr(uchar *(*wkb), uchar *end, uint n_dims, return 0; } + static int sp_get_polygon_mbr(uchar *(*wkb), uchar *end, uint n_dims, uchar byte_order, double *mbr) { diff --git a/myisam/sp_test.c b/myisam/sp_test.c index 9d32b3e623d..b8b5880cf67 100644 --- a/myisam/sp_test.c +++ b/myisam/sp_test.c @@ -41,7 +41,7 @@ static void rtree_PrintWKB(uchar *wkb, uint n_dims); static char blob_key[MAX_REC_LENGTH]; -int main(int argc,char *argv[]) +int main(int argc __attribute__((unused)),char *argv[]) { MY_INIT(argv[0]); exit(run_test("sp_test")); @@ -320,7 +320,10 @@ static int read_with_pos (MI_INFO * file,int silent) } -static void bprint_record(char * record, my_off_t offs,const char * tail) +#ifdef NOT_USED +static void bprint_record(char * record, + my_off_t offs __attribute__((unused)), + const char * tail) { int i; char * pos; @@ -333,6 +336,8 @@ static void bprint_record(char * record, my_off_t offs,const char * tail) } printf("%s",tail); } +#endif + static void print_record(char * record, my_off_t offs,const char * tail) { @@ -356,6 +361,7 @@ static void print_record(char * record, my_off_t offs,const char * tail) +#ifndef NOT_USED static void create_point(char *record,uint rownr) { uint tmp; @@ -380,6 +386,7 @@ static void create_point(char *record,uint rownr) ptr=blob_key; memcpy_fixed(pos,&ptr,sizeof(char*)); } +#endif static void create_linestring(char *record,uint rownr) |