diff options
author | unknown <monty@tramp.mysql.fi> | 2001-10-29 10:49:35 +0200 |
---|---|---|
committer | unknown <monty@tramp.mysql.fi> | 2001-10-29 10:49:35 +0200 |
commit | b3a974963dee53187668e9f467310069b4a67fcc (patch) | |
tree | fc5532fe3c9a3bc29a1e71b5db41e1b702f4980a /myisam/mi_dynrec.c | |
parent | 440de598ee325364b89468c8bd66925956b0e66f (diff) | |
download | mariadb-git-b3a974963dee53187668e9f467310069b4a67fcc.tar.gz |
Fixed error message when opening a not-MyISAM file.
Extended MODIFY and CHANGE in ALTER TABLE to accept the AFTER keyword.
Extended MyISAM to handle records > 16M.
Docs/manual.texi:
Updated state of different modules.
Rewrote description of 'perror' and 'Packet too large'.
myisam/mi_dynrec.c:
Extended MyISAM to handle records > 16M
myisam/mi_open.c:
Fix error message when opening a not-MyISAM file.
myisam/myisamdef.h:
Extended MyISAM to handle records > 16M
mysql-test/r/alter_table.result:
Added test for CHANGE col ... AFTER
mysql-test/t/alter_table.test:
Added test for CHANGE col ... AFTER
sql/sql_table.cc:
Extended MODIFY and CHANGE in ALTER TABLE to accept the AFTER keyword.
sql/sql_yacc.yy:
Extended MODIFY and CHANGE in ALTER TABLE to accept the AFTER keyword.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'myisam/mi_dynrec.c')
-rw-r--r-- | myisam/mi_dynrec.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index c07fa5aa080..4facda91626 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -190,6 +190,8 @@ static int _mi_find_writepos(MI_INFO *info, my_errno=HA_ERR_RECORD_FILE_FULL; DBUG_RETURN(-1); } + if (*length > MI_MAX_BLOCK_LENGTH) + *length=MI_MAX_BLOCK_LENGTH; info->state->data_file_length+= *length; info->s->state.split++; info->update|=HA_STATE_WRITE_AT_END; @@ -370,19 +372,30 @@ int _mi_write_part_record(MI_INFO *info, info->s->state.dellink : info->state->data_file_length; if (*flag == 0) /* First block */ { - head_length=5+8+long_block*2; - temp[0]=5+(uchar) long_block; - if (long_block) + if (*reclength > MI_MAX_BLOCK_LENGTH) { - mi_int3store(temp+1,*reclength); + head_length= 16; + temp[0]=13; + mi_int4store(temp+1,*reclength); mi_int3store(temp+4,length-head_length); - mi_sizestore((byte*) temp+7,next_filepos); + mi_sizestore((byte*) temp+8,next_filepos); } else { - mi_int2store(temp+1,*reclength); - mi_int2store(temp+3,length-head_length); - mi_sizestore((byte*) temp+5,next_filepos); + head_length=5+8+long_block*2; + temp[0]=5+(uchar) long_block; + if (long_block) + { + mi_int3store(temp+1,*reclength); + mi_int3store(temp+4,length-head_length); + mi_sizestore((byte*) temp+7,next_filepos); + } + else + { + mi_int2store(temp+1,*reclength); + mi_int2store(temp+3,length-head_length); + mi_sizestore((byte*) temp+5,next_filepos); + } } } else @@ -1433,10 +1446,10 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos) } else { - if (info->header[0] > 6) + if (info->header[0] > 6 && info->header[0] != 13) return_val=BLOCK_SYNC_ERROR; } - info->next_filepos= HA_OFFSET_ERROR; /* Dummy ifall no next block */ + info->next_filepos= HA_OFFSET_ERROR; /* Dummy if no next block */ switch (info->header[0]) { case 0: @@ -1470,6 +1483,14 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos) info->filepos=filepos+4; return return_val | BLOCK_FIRST | BLOCK_LAST; + case 13: + info->rec_len=mi_uint4korr(header+1); + info->block_len=info->data_len=mi_uint3korr(header+5); + info->next_filepos=mi_sizekorr(header+8); + info->second_read=1; + info->filepos=filepos+16; + return return_val | BLOCK_FIRST; + case 3: info->rec_len=info->data_len=mi_uint2korr(header+1); info->block_len=info->rec_len+ (uint) header[3]; |