summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-07-15 20:43:57 +0200
committerunknown <serg@serg.mylan>2003-07-15 20:43:57 +0200
commitb40895f9d2e77940948e8b9a1fc97dc14ee81f21 (patch)
tree587e193ec21590a7396426468783cefd1e788609 /myisammrg
parentd99608d2f224b2b5c3ad058bc0517e2c6749e846 (diff)
downloadmariadb-git-b40895f9d2e77940948e8b9a1fc97dc14ee81f21.tar.gz
bug #702 - ALTER TABLE tm UNION=(t1,t2) doesn't work if t1.MYD is compressed
myisammrg/myrg_open.c: never mark merge table as readonly even if all underlying myisam tables are readonly, otherwise ALTER TABLE merge UNION=(t1,t2,t3,...) will not work sql/handler.cc: map EACCES to ER_OPEN_AS_READONLY. can only happen on modifying merge table that has (some) read-only myisam tables
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_open.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 7ff00270c68..5188669cad1 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -33,7 +33,7 @@
MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
int save_errno,i,errpos;
- uint files,dir_length,length,options, key_parts;
+ uint files,dir_length,length,key_parts;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MYRG_INFO info,*m_info;
@@ -110,13 +110,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
}
errpos=2;
- options= (uint) ~0;
for (i=files ; i-- > 0 ; )
{
uint j;
m_info->open_tables[i].table=isam;
m_info->options|=isam->s->options;
- options&=isam->s->options;
m_info->records+=isam->state->records;
m_info->del+=isam->state->del;
m_info->data_file_length+=isam->state->data_file_length;
@@ -125,9 +123,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
if (i)
isam=(MI_INFO*) (isam->open_list.next->data);
}
- /* Don't force readonly if not all tables are readonly */
- if (! (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA)))
- m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
+ /* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */
+ m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
/* Fix fileinfo for easyer debugging (actually set by rrnd) */
file_offset=0;