diff options
author | unknown <monty@mashka.mysql.fi> | 2002-07-24 19:55:08 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-07-24 19:55:08 +0300 |
commit | 72dec69046e315080d17e4764f911c4c9f29459c (patch) | |
tree | 31ee919bea7e4456572b62d5ea7302dc58bc0b6a /myisam | |
parent | c911e9d72161045364893a838624c1484590a9cb (diff) | |
download | mariadb-git-72dec69046e315080d17e4764f911c4c9f29459c.tar.gz |
Removed wrong implementation of CUBE/ROLLUP
Fixed bugfix of INSERT ... SET db_name.table_name.column_name
Changed locking to external-locking
Fix client hangup for some invalid SQL queries.
Docs/manual.texi:
Changelog & recent incompatible changes to 4.0.3
include/mysqld_error.h:
New error messages
myisam/ft_boolean_search.c:
Removed compiler warning
myisam/mi_check.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/mi_dynrec.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/mi_extra.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/mi_key.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/mi_open.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/mi_packrec.c:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/myisamdef.h:
Change mi_fix_rec_buff_for_blob to mi_alloc_rec_buff
myisam/sort.c:
Fixed uninitialized variable
mysql-test/r/insert_set.result:
Change test case to use database foo
mysql-test/r/union.result:
Test wrong usage of union
mysql-test/t/insert_set.test:
Test bug in insert
mysql-test/t/union.test:
Test wrong usage of union
sql/item.h:
Indentation cleanup
sql/item_cmpfunc.h:
Indentation cleanup
sql/item_func.h:
Indentation cleanup
sql/item_strfunc.h:
Indentation cleanup
sql/item_sum.h:
Indentation cleanup
sql/item_timefunc.h:
Indentation cleanup
sql/item_uniq.h:
Indentation cleanup
sql/mysql_priv.h:
Fix that we always generate an error message when calling YYABORT
sql/mysqld.cc:
Changed command line arguments regarding locking to always use --external-locking
Disable external locking by default
sql/procedure.h:
Cleanup
sql/set_var.cc:
change locking -> external_locking
sql/share/czech/errmsg.txt:
New error messages
sql/share/danish/errmsg.txt:
New error messages
sql/share/dutch/errmsg.txt:
New error messages
sql/share/english/errmsg.txt:
New error messages
sql/share/estonian/errmsg.txt:
New error messages
sql/share/french/errmsg.txt:
New error messages
sql/share/german/errmsg.txt:
New error messages
sql/share/greek/errmsg.txt:
New error messages
sql/share/hungarian/errmsg.txt:
New error messages
sql/share/italian/errmsg.txt:
New error messages
sql/share/japanese/errmsg.txt:
New error messages
sql/share/korean/errmsg.txt:
New error messages
mysql-test/r/olap.result:
Removed CUBE/ROLLUP
mysql-test/t/olap.test:
Removed CUBE/ROLLUP
sql/share/norwegian-ny/errmsg.txt:
New error messages
sql/share/norwegian/errmsg.txt:
New error messages
sql/share/polish/errmsg.txt:
New error messages
sql/share/portuguese/errmsg.txt:
New error messages
sql/share/romanian/errmsg.txt:
New error messages
sql/share/russian/errmsg.txt:
New error messages
sql/share/slovak/errmsg.txt:
New error messages
sql/share/spanish/errmsg.txt:
New error messages
sql/share/swedish/errmsg.txt:
New error messages
sql/share/ukrainian/errmsg.txt:
New error messages
sql/sql_base.cc:
Removed wrong patch for INSERT...
sql/sql_insert.cc:
Fix bug in INSERT ... SET db_name.table_name.column_name
sql/sql_lex.h:
Changed NON_EXISTIONG_ONE -> UNSPECIFIED_OLAP_TYPE
sql/sql_olap.cc:
Removed wrong implementation of CUBE/ROLLUP
sql/sql_parse.cc:
Removed wrong implementation of CUBE/ROLLUP
Added function to give better error messages
sql/sql_select.cc:
Removed wrong implementation of CUBE/ROLLUP
sql/sql_union.cc:
Added comment
sql/sql_yacc.yy:
Fix that we always generate an error message when calling YYABORT
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 3 | ||||
-rw-r--r-- | myisam/mi_check.c | 8 | ||||
-rw-r--r-- | myisam/mi_dynrec.c | 24 | ||||
-rw-r--r-- | myisam/mi_extra.c | 3 | ||||
-rw-r--r-- | myisam/mi_key.c | 4 | ||||
-rw-r--r-- | myisam/mi_open.c | 18 | ||||
-rw-r--r-- | myisam/mi_packrec.c | 10 | ||||
-rw-r--r-- | myisam/myisamdef.h | 3 | ||||
-rw-r--r-- | myisam/sort.c | 2 |
9 files changed, 45 insertions, 30 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 8ebc5c33555..031d5e847e8 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -181,7 +181,8 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, return; } -static int _ftb_no_dupes_cmp(void* not_used, const void *a,const void *b) +static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)), + const void *a,const void *b) { return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b))); } diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 4727a3ab303..91990dc3b66 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -840,7 +840,9 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) } if (info->s->base.blobs) { - if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len))) + if (!(to= mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff, + &info->alloced_rec_buff_length))) { mi_check_print_error(param,"Not enough memory for blob at %s", llstr(start_recpos,llbuff)); @@ -2791,8 +2793,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) if (share->base.blobs) { if (!(to=mi_alloc_rec_buff(info,block_info.rec_len, - &(sort_param->rec_buff), - &(sort_param->alloced_rec_buff_length)))) + &(sort_param->rec_buff), + &(sort_param->alloced_rec_buff_length)))) { mi_check_print_error(param,"Not enough memory for blob at %s", llstr(sort_param->start_recpos,llbuff)); diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index 92c8e50690b..4ef4f80d137 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -60,10 +60,10 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) int error; ulong reclength,extra; - extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ - MI_DYN_DELETE_BLOCK_HEADER+1; - reclength=info->s->base.pack_reclength+ - _my_calc_total_blob_length(info,record)+ extra; + extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_DYN_DELETE_BLOCK_HEADER+1); + reclength= (info->s->base.pack_reclength+ + _my_calc_total_blob_length(info,record)+ extra); #ifdef NOT_USED /* We now support big rows */ if (reclength > MI_DYN_MAX_ROW_LENGTH) { @@ -91,10 +91,10 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record) int error; ulong reclength,extra; - extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ - MI_DYN_DELETE_BLOCK_HEADER; - reclength=info->s->base.pack_reclength+ - _my_calc_total_blob_length(info,record)+ extra; + extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_DYN_DELETE_BLOCK_HEADER); + reclength= (info->s->base.pack_reclength+ + _my_calc_total_blob_length(info,record)+ extra); #ifdef NOT_USED /* We now support big rows */ if (reclength > MI_DYN_MAX_ROW_LENGTH) { @@ -1059,7 +1059,9 @@ int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, byte *buf) goto panic; if (info->s->base.blobs) { - if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len))) + if (!(to=mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff, + &info->alloced_rec_buff_length))) goto err; } else @@ -1328,7 +1330,9 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf, info->lastpos=filepos; if (share->base.blobs) { - if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len))) + if (!(to= mi_alloc_rec_buff(info, block_info.rec_len, + &info->rec_buff, + &info->alloced_rec_buff_length))) goto err; } else diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c index 6c658a33dda..8ac65975a5c 100644 --- a/myisam/mi_extra.c +++ b/myisam/mi_extra.c @@ -344,7 +344,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) } } if (share->base.blobs) - mi_fix_rec_buff_for_blob(info, -1); + mi_alloc_rec_buff(info, -1, &info->rec_buff, + &info->alloced_rec_buff_length); break; case HA_EXTRA_NORMAL: /* Theese isn't in use */ info->quick_mode=0; diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 6ec8668ab61..3cee1f301e1 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -250,7 +250,9 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, if (info->blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY) { if (!(blob_ptr= - mi_fix_rec_buff_for_blob(info, info->s->keyinfo[keynr].keylength))) + mi_alloc_rec_buff(info, info->s->keyinfo[keynr].keylength, + &info->rec_buff, + &info->alloced_rec_buff_length))) goto err; } key=(byte*) info->lastkey; diff --git a/myisam/mi_open.c b/myisam/mi_open.c index e10d931e6d3..feed8f29df8 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -507,7 +507,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) /* Allocate buffer for one record */ /* prerequisites: bzero(info) && info->s=share; are met. */ - if (!mi_fix_rec_buff_for_blob(&info, -1)) + if (!mi_alloc_rec_buff(&info, -1, &info.rec_buff, + &info.alloced_rec_buff_length)) goto err; bzero(info.rec_buff, info.alloced_rec_buff_length); @@ -559,6 +560,7 @@ err: DBUG_RETURN (NULL); } /* mi_open */ + gptr mi_get_rec_buff_ptr(MI_INFO *info, byte *buf) { if (info->s->options & HA_OPTION_PACK_RECORD && buf) @@ -567,6 +569,7 @@ gptr mi_get_rec_buff_ptr(MI_INFO *info, byte *buf) return buf; } + byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf, uint *buf_len) { uint extra; @@ -576,23 +579,24 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf, uint *buf_len) byte *newptr = *buf; /* to simplify initial init of info->rec_buf in mi_open and mi_extra */ - if (length == (ulong)-1) - length=max(info->s->base.pack_reclength,info->s->base.max_key_length); + if (length == (ulong) -1) + length= max(info->s->base.pack_reclength,info->s->base.max_key_length); extra= ((info->s->options & HA_OPTION_PACK_RECORD) ? - ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ - MI_REC_BUFF_OFFSET : 0); + ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ + MI_REC_BUFF_OFFSET : 0); if (extra && newptr) newptr-=MI_REC_BUFF_OFFSET; if (!(newptr=(byte*) my_realloc((gptr)newptr, length+extra+8, MYF(MY_ALLOW_ZERO_PTR)))) return 0; - *buf=newptr+(extra ? MI_REC_BUFF_OFFSET : 0); - *buf_len=length; + *buf= newptr+(extra ? MI_REC_BUFF_OFFSET : 0); + *buf_len= length; } return *buf; } + ulonglong mi_safe_mul(ulonglong a, ulonglong b) { ulonglong max_val= ~ (ulonglong) 0; /* my_off_t is unsigned */ diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index d067fdc0fc5..07abde07644 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -1057,7 +1057,9 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file, info->blob_len=uint3korr(header+head_length+1); head_length+=4; } - if (!(mi_fix_rec_buff_for_blob(myisam,info->rec_len + info->blob_len))) + if (!(mi_alloc_rec_buff(myisam,info->rec_len + info->blob_len, + &myisam->rec_buff, + &myisam->alloced_rec_buff_length))) return BLOCK_FATAL_ERROR; /* not enough memory */ myisam->bit_buff.blob_pos=(uchar*) myisam->rec_buff+info->rec_len; myisam->blob_length=info->blob_len; @@ -1231,8 +1233,10 @@ static uchar *_mi_mempack_get_block_info(MI_INFO *myisam,MI_BLOCK_INFO *info, info->blob_len=uint3korr(header+1); header+=4; } - /* mi_fix_rec_buff_for_blob sets my_errno on error */ - if (!(mi_fix_rec_buff_for_blob(myisam,info->blob_len))) + /* mi_alloc_rec_buff sets my_errno on error */ + if (!(mi_alloc_rec_buff(myisam, info->blob_len, + &myisam->rec_buff, + &myisam->alloced_rec_buff_length))) return 0; /* not enough memory */ myisam->bit_buff.blob_pos=(uchar*) myisam->rec_buff; } diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 8c1ca393a3c..73b9a1280a4 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -525,9 +525,6 @@ extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos, extern void update_auto_increment(MI_INFO *info,const byte *record); extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**, uint*); extern gptr mi_get_rec_buff_ptr(MI_INFO *, byte *); -#define mi_fix_rec_buff_for_blob(INFO,LENGTH) \ - mi_alloc_rec_buff((INFO),(LENGTH), \ - &((INFO)->rec_buff), &((INFO)->alloced_rec_buff_length)) extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from, ulong reclength); extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos); diff --git a/myisam/sort.c b/myisam/sort.c index faac75ea120..79d31147bfc 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -283,7 +283,7 @@ pthread_handler_decl(thr_find_all_keys,arg) int error; uint memavl,old_memavl,keys,sort_length; uint idx, maxbuffer; - uchar **sort_keys; + uchar **sort_keys=0; error=1; |