diff options
author | unknown <monty@narttu.mysql.fi> | 2003-08-28 06:08:17 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-08-28 06:08:17 +0300 |
commit | 26bb50a19b8c3a79a745d052c14f73a5a06e466e (patch) | |
tree | 41b52ce07c94e5878b59ffb52bf26ad79aa89469 /myisam | |
parent | ad4fdb79cd4c6f06a1a09e0ded07cb7e8c76f07c (diff) | |
download | mariadb-git-26bb50a19b8c3a79a745d052c14f73a5a06e466e.tar.gz |
Add detection of in_addr_t
Add pack_bits to pack_reclength for dynamic rows. This solves buffer a possible buffer overflow on update.
(This will probably solve bug #563)
Fix test for available file descriptors in mysqltest
Fixed core dump bug in replication tests when running without transactional table support
acconfig.h:
Add detection of in_addr_t
acinclude.m4:
Add detection of in_addr_t
configure.in:
Add detection of in_addr_t
extra/my_print_defaults.c:
Cleanup
extra/resolveip.c:
Add detection of in_addr_t
libmysql/dll.c:
Fixed C++ commments
myisam/mi_dynrec.c:
Add ASSERT if allocated record length is to small
myisam/mi_open.c:
Add pack_bits to pack_reclength for dynamic rows. This solves buffer a possible buffer overflow on update.
myisam/mi_test_all.sh:
Added valgrind option to make it easier to verify tests
mysql-test/include/check_var_limit.inc:
Fix test for available file descriptors
mysql-test/r/myisam.result:
More tests
mysql-test/t/myisam.test:
More tests
mysql-test/t/query_cache_merge.test:
Fix test for available file descriptors
mysys/default.c:
Cleanup
mysys/my_pthread.c:
Remove C++ comments
sql/log.cc:
Code cleanup
Fixed core dump bug in replication tests when running without transactional table support.
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_dynrec.c | 13 | ||||
-rw-r--r-- | myisam/mi_open.c | 4 | ||||
-rwxr-xr-x | myisam/mi_test_all.sh | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index faf86c3ffbd..eb38a058b0b 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -58,11 +58,11 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) { byte *rec_buff; int error; - ulong reclength,extra; + ulong reclength,reclength2,extra; extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ MI_DYN_DELETE_BLOCK_HEADER+1); - reclength= (info->s->base.pack_reclength + info->s->base.pack_bits + + 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) @@ -76,10 +76,13 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) my_errno=ENOMEM; return(-1); } - reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), - record); + reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + record); + DBUG_PRINT("info",("reclength: %lu reclength2: %lu", + reclength, reclength2)); + DBUG_ASSERT(reclength2 <= reclength); error=write_dynamic_record(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), - reclength); + reclength2); my_afree(rec_buff); return(error); } diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 59fae36ac33..857ca1486fd 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -595,7 +595,7 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **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.pack_bits, + length= max(info->s->base.pack_reclength, info->s->base.max_key_length); /* Avoid unnecessary realloc */ if (newptr && length == old_length) @@ -650,6 +650,8 @@ void mi_setup_functions(register MYISAM_SHARE *share) share->compare_unique=_mi_cmp_dynamic_unique; share->calc_checksum= mi_checksum; + /* add bits used to pack data to pack_reclength for faster allocation */ + share->base.pack_reclength+= share->base.pack_bits; if (share->base.blobs) { share->update_record=_mi_update_blob_record; diff --git a/myisam/mi_test_all.sh b/myisam/mi_test_all.sh index a2d57ea1a83..07e71d65675 100755 --- a/myisam/mi_test_all.sh +++ b/myisam/mi_test_all.sh @@ -3,7 +3,9 @@ # Execute some simple basic test on MyISAM libary to check if things # works at all. +valgrind="valgrind --alignment=8 --leak-check=yes" silent="-s" + if test -f mi_test1$MACH ; then suffix=$MACH else suffix=""; fi mi_test1$suffix $silent myisamchk$suffix -se test1 |