summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-05-12 14:03:53 +0300
committerunknown <monty@donna.mysql.fi>2001-05-12 14:03:53 +0300
commite5f9ca3d759d61d76a6ce1c854d83d0625d731f8 (patch)
treee65fc5bd426965f04c6e2e2becac2c2309be48ea /myisammrg
parentdbd56fcdc575d522e8cac6046b85e29d496a37e9 (diff)
downloadmariadb-git-e5f9ca3d759d61d76a6ce1c854d83d0625d731f8.tar.gz
Only mark MERGE readonly if all tables are readonly
Optimize some queries when using LIMIT merge/open.c: Only mark MERGE readonly if all tables are readonly myisammrg/myrg_open.c: Only mark MERGE readonly if all tables are readonly sql/sql_select.cc: Optimize some queries when using LIMIT
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_open.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index f73339f63c8..ce2c97e1276 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -36,7 +36,7 @@ int mode;
int handle_locking;
{
int save_errno,i,errpos;
- uint files,dir_length,length;
+ uint files,dir_length,length,options;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MYRG_INFO info,*m_info;
@@ -93,16 +93,22 @@ int handle_locking;
m_info->tables=files;
errpos=2;
+ options= (uint) ~0;
for (i=files ; i-- > 0 ; )
{
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;
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);
+
/* Fix fileinfo for easyer debugging (actually set by rrnd) */
file_offset=0;
for (i=0 ; (uint) i < files ; i++)