summaryrefslogtreecommitdiff
path: root/myisam/mi_open.c
diff options
context:
space:
mode:
authormonty@tik.mysql.fi <>2001-05-23 02:40:46 +0300
committermonty@tik.mysql.fi <>2001-05-23 02:40:46 +0300
commit8685094e159f29f2b00642f579be4ca681a10247 (patch)
tree22a09c551394dd62383433e28ef919ca86f669b7 /myisam/mi_open.c
parenta3be64bfa519ff04d5b6a9be8dfb2e255ee3862b (diff)
downloadmariadb-git-8685094e159f29f2b00642f579be4ca681a10247.tar.gz
Don't write rows in MyISAM tables when using count(distinct)
Don't read MyISAM header when running without locking
Diffstat (limited to 'myisam/mi_open.c')
-rw-r--r--myisam/mi_open.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 28f984006df..7f94de9ffa2 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -777,14 +777,17 @@ uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead)
{
char buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
- if (pRead)
+ if (!myisam_single_user)
{
- if (my_pread(file, buff, state->state_length,0L, MYF(MY_NABP)))
+ if (pRead)
+ {
+ if (my_pread(file, buff, state->state_length,0L, MYF(MY_NABP)))
+ return (MY_FILE_ERROR);
+ }
+ else if (my_read(file, buff, state->state_length,MYF(MY_NABP)))
return (MY_FILE_ERROR);
+ mi_state_info_read(buff, state);
}
- else if (my_read(file, buff, state->state_length,MYF(MY_NABP)))
- return (MY_FILE_ERROR);
- mi_state_info_read(buff, state);
return 0;
}