summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-07-16 03:04:30 +0300
committerunknown <monty@tik.mysql.fi>2001-07-16 03:04:30 +0300
commit2a18a762e1d4c688ff169e92a8c3977bcbb00f03 (patch)
tree12ce618a9c1f4bb3a79632d66e11232e84ab2e12 /myisam
parentcb696ba1f3f7d64dbedd64487c7d02660251f98f (diff)
downloadmariadb-git-2a18a762e1d4c688ff169e92a8c3977bcbb00f03.tar.gz
Patch for netBSD
Added warning for tables where the auto_increment key is 0 Fixed DELETE ... LIMIT 0 Fixed UPDATE ..LIMIT 0 Docs/manual.texi: Changelog + Update to CHECK TABLE configure.in: Patch for netBSD mit-pthreads/gen/ctime.c: Patch for netBSD mit-pthreads/machdep/netbsd-1.1/__signal.h: Patch for netBSD mit-pthreads/stdio/strerror.c: Patch for netBSD myisam/mi_check.c: Added warning for tables where the auto_increment key is 0 myisam/myisamchk.c: Added warning for tables where the auto_increment key is 0 mysql-test/r/auto_increment.result: Added warning for tables where the auto_increment key is 0 mysql-test/r/limit.result: Test of DELETE ... LIMIT 0 mysql-test/t/auto_increment.test: Added warning for tables where the auto_increment key is 0 mysql-test/t/limit.test: Test of DELETE ... LIMIT 0 sql/Makefile.am: Don't add mysqld_LDADD to mysqlbinlog (portability patch) sql/ha_gemini.cc: Changed copyright (have got ok from NuSphere previously) sql/ha_gemini.h: Changed copyright (have got ok from NuSphere previously) sql/sql_delete.cc: Fixed DELETE ... LIMIT 0 sql/sql_update.cc: Fixed UPDATE ..LIMIT 0
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c16
-rw-r--r--myisam/myisamchk.c2
2 files changed, 16 insertions, 2 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index c6e07445bcf..0caedbe1a51 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -432,9 +432,9 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
}
else
full_text_keys++;
- /* Check that auto_increment key is bigger than max key value */
if ((uint) share->base.auto_key -1 == key)
{
+ /* Check that auto_increment key is bigger than max key value */
ulonglong save_auto_value=info->s->state.auto_increment;
info->s->state.auto_increment=0;
info->lastinx=key;
@@ -454,6 +454,20 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
}
else
info->s->state.auto_increment=save_auto_value;
+
+ /* Check that there isn't a row with auto_increment = 0 in the table */
+ mi_extra(info,HA_EXTRA_KEYREAD);
+ bzero(info->lastkey,keyinfo->seg->length);
+ if (!mi_rkey(info, info->rec_buff, key, info->lastkey,
+ keyinfo->seg->length, HA_READ_KEY_EXACT))
+ {
+ /* Don't count this as a real warning, as myisamchk can't correct it */
+ uint save=param->warning_printed;
+ mi_check_print_warning(param,
+ "Found row where the auto_increment column has the value 0");
+ param->warning_printed=save;
+ }
+ mi_extra(info,HA_EXTRA_NO_KEYREAD);
}
length=(my_off_t) isam_key_length(info,keyinfo)*keys + param->key_blocks*2;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index dd23e214ccf..61ad939d6ed 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -201,7 +201,7 @@ static struct option long_options[] =
static void print_version(void)
{
- printf("%s Ver 1.47 for %s at %s\n",my_progname,SYSTEM_TYPE,
+ printf("%s Ver 1.48 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
}