| 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. |
| 2 | |
| 3 | This program is free software; you can redistribute it and/or modify |
| 4 | it under the terms of the GNU General Public License as published by |
| 5 | the Free Software Foundation; version 2 of the License. |
| 6 | |
| 7 | This program is distributed in the hope that it will be useful, |
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | GNU General Public License for more details. |
| 11 | |
| 12 | You should have received a copy of the GNU General Public License |
| 13 | along with this program; if not, write to the Free Software |
| 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ |
| 15 | |
| 16 | /* Functions to handle fixed-length-records */ |
| 17 | |
| 18 | #include "myisamdef.h"cxx . . $ `<file>/storage/myisam/myisamdef.h`/ |
| 19 | |
| 20 | |
| 21 | int _mi_write_static_recordcxx . . $ _mi_write_static_record(c8f46092f4519684).(MI_INFOcxx . . $ MI_INFO# *info, const ucharcxx . . $ uchar# *record) |
| 22 | { |
| 23 | ucharcxx . . $ uchar# temp[8]; /* max pointer length */ |
| 24 | if (info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink. != HA_OFFSET_ERRORcxx . . $ `include/my_base.h:695:9`! && |
| 25 | !info->append_insert_at_endcxx . . $ st_myisam_info#append_insert_at_end.) |
| 26 | { |
| 27 | my_off_tcxx . . $ my_off_t# filepos=info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink.; |
| 28 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 29 | if (info->scxx . . $ st_myisam_info#s.->file_readcxx . . $ st_mi_isam_share#file_read.(info, &temp[0],info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..rec_reflengthcxx . . $ st_mi_base_info#rec_reflength., |
| 30 | info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink.+1, |
| 31 | MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!))) |
| 32 | goto err; |
| 33 | info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink.= _mi_rec_poscxx . . $ _mi_rec_pos(d890462fe8872e64).(info->scxx . . $ st_myisam_info#s.,temp); |
| 34 | info->statecxx . . $ st_myisam_info#state.->delcxx . . $ st_mi_status_info#del.--; |
| 35 | info->statecxx . . $ st_myisam_info#state.->emptycxx . . $ st_mi_status_info#empty.-=info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength.; |
| 36 | if (info->scxx . . $ st_myisam_info#s.->file_writecxx . . $ st_mi_isam_share#file_write.(info, record, info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 37 | filepos, |
| 38 | MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!))) |
| 39 | goto err; |
| 40 | } |
| 41 | else |
| 42 | { |
| 43 | if (info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length. > info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..max_data_file_lengthcxx . . $ st_mi_base_info#max_data_file_length.- |
| 44 | info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength.) |
| 45 | { |
| 46 | my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_RECORD_FILE_FULLcxx . . $ `include/my_base.h:480:9`!; |
| 47 | return(2); |
| 48 | } |
| 49 | if (info->opt_flagcxx . . $ st_myisam_info#opt_flag. & WRITE_CACHE_USEDcxx . . $ `include/my_base.h:613:9`!) |
| 50 | { /* Cash in use */ |
| 51 | if (my_b_writecxx . . $ my_b_write(3ec748bd5b0960c7).(&info->rec_cachecxx . . $ st_myisam_info#rec_cache., record, |
| 52 | info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.)) |
| 53 | goto err; |
| 54 | if (info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. != info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.) |
| 55 | { |
| 56 | uintcxx . . $ uint# length=info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. - info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.; |
| 57 | bzerocxx . . $ `include/m_string.h:61:10`!(temp,length); |
| 58 | if (my_b_writecxx . . $ my_b_write(3ec748bd5b0960c7).(&info->rec_cachecxx . . $ st_myisam_info#rec_cache., temp,length)) |
| 59 | goto err; |
| 60 | } |
| 61 | } |
| 62 | else |
| 63 | { |
| 64 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 65 | if (info->scxx . . $ st_myisam_info#s.->file_writecxx . . $ st_mi_isam_share#file_write.(info, record, info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 66 | info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length., |
| 67 | info->scxx . . $ st_myisam_info#s.->write_flagcxx . . $ st_mi_isam_share#write_flag.)) |
| 68 | goto err; |
| 69 | if (info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. != info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.) |
| 70 | { |
| 71 | uintcxx . . $ uint# length=info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. - info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.; |
| 72 | bzerocxx . . $ `include/m_string.h:61:10`!(temp,length); |
| 73 | if (info->scxx . . $ st_myisam_info#s.->file_writecxx . . $ st_mi_isam_share#file_write.(info, temp,length, |
| 74 | info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length.+ |
| 75 | info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 76 | info->scxx . . $ st_myisam_info#s.->write_flagcxx . . $ st_mi_isam_share#write_flag.)) |
| 77 | goto err; |
| 78 | } |
| 79 | } |
| 80 | info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length.+=info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength.; |
| 81 | info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..splitcxx . . $ st_mi_state_info#split.++; |
| 82 | } |
| 83 | return 0; |
| 84 | err: |
| 85 | return 1; |
| 86 | } |
| 87 | |
| 88 | int _mi_update_static_recordcxx . . $ _mi_update_static_record(fedf98377116f0fc).(MI_INFOcxx . . $ MI_INFO# *info, my_off_tcxx . . $ my_off_t# pos, const ucharcxx . . $ uchar# *record) |
| 89 | { |
| 90 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 91 | return (info->scxx . . $ st_myisam_info#s.->file_writecxx . . $ st_mi_isam_share#file_write.(info, |
| 92 | record, info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 93 | pos, |
| 94 | MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!)) != 0); |
| 95 | } |
| 96 | |
| 97 | |
| 98 | int _mi_delete_static_recordcxx . . $ _mi_delete_static_record(5bca52a199e8d1d4).(MI_INFOcxx . . $ MI_INFO# *info) |
| 99 | { |
| 100 | ucharcxx . . $ uchar# temp[9]; /* 1+sizeof(uint32) */ |
| 101 | |
| 102 | info->statecxx . . $ st_myisam_info#state.->delcxx . . $ st_mi_status_info#del.++; |
| 103 | info->statecxx . . $ st_myisam_info#state.->emptycxx . . $ st_mi_status_info#empty.+=info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength.; |
| 104 | temp[0]= '\0'; /* Mark that record is deleted */ |
| 105 | _mi_dpointercxx . . $ _mi_dpointer(e7cc669b93c15424).(info,temp+1,info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink.); |
| 106 | info->scxx . . $ st_myisam_info#s.->statecxx . . $ st_mi_isam_share#state..dellinkcxx . . $ st_mi_state_info#dellink. = info->lastposcxx . . $ st_myisam_info#lastpos.; |
| 107 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; |
| 108 | return (info->scxx . . $ st_myisam_info#s.->file_writecxx . . $ st_mi_isam_share#file_write.(info,(ucharcxx . . $ uchar#*) temp, 1+info->scxx . . $ st_myisam_info#s.->rec_reflengthcxx . . $ st_mi_isam_share#rec_reflength., |
| 109 | info->lastposcxx . . $ st_myisam_info#lastpos., MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!)) != 0); |
| 110 | } |
| 111 | |
| 112 | |
| 113 | int _mi_cmp_static_recordcxx . . $ _mi_cmp_static_record(c8f46092f4519684).(register MI_INFOcxx . . $ MI_INFO# *info, register const ucharcxx . . $ uchar# *old) |
| 114 | { |
| 115 | DBUG_ENTERcxx . . $ `include/my_dbug.h:165:9`!("_mi_cmp_static_record"); |
| 116 | |
| 117 | if (info->opt_flagcxx . . $ st_myisam_info#opt_flag. & WRITE_CACHE_USEDcxx . . $ `include/my_base.h:613:9`!) |
| 118 | { |
| 119 | if (flush_io_cachecxx . . $ `include/my_sys.h:850:9`!(&info->rec_cache)) |
| 120 | { |
| 121 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(-1); |
| 122 | } |
| 123 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 124 | } |
| 125 | |
| 126 | if ((info->opt_flagcxx . . $ st_myisam_info#opt_flag. & READ_CHECK_USEDcxx . . $ `include/my_base.h:611:9`!)) |
| 127 | { /* If check isn't disabled */ |
| 128 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 129 | if (info->scxx . . $ st_myisam_info#s.->file_readcxx . . $ st_mi_isam_share#file_read.(info, info->rec_buffcxx . . $ st_myisam_info#rec_buff., info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 130 | info->lastposcxx . . $ st_myisam_info#lastpos., |
| 131 | MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!))) |
| 132 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(-1); |
| 133 | if (memcmpcxx . . $ memcmp(36f949851efa3055).(info->rec_buffcxx . . $ st_myisam_info#rec_buff., old, |
| 134 | (uintcxx . . $ uint#) info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.)) |
| 135 | { |
| 136 | DBUG_DUMPcxx . . $ `include/my_dbug.h:182:9`!("read",old,info->s->base.reclength); |
| 137 | DBUG_DUMPcxx . . $ `include/my_dbug.h:182:9`!("disk",info->rec_buff,info->s->base.reclength); |
| 138 | my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_RECORD_CHANGEDcxx . . $ `include/my_base.h:469:9`!; /* Record have changed */ |
| 139 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(1); |
| 140 | } |
| 141 | } |
| 142 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(0); |
| 143 | } |
| 144 | |
| 145 | |
| 146 | int _mi_cmp_static_uniquecxx . . $ _mi_cmp_static_unique(da8c61c5d794970a).(MI_INFOcxx . . $ MI_INFO# *info, MI_UNIQUEDEFcxx . . $ MI_UNIQUEDEF# *def, |
| 147 | const ucharcxx . . $ uchar# *record, my_off_tcxx . . $ my_off_t# pos) |
| 148 | { |
| 149 | DBUG_ENTERcxx . . $ `include/my_dbug.h:165:9`!("_mi_cmp_static_unique"); |
| 150 | |
| 151 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 152 | if (info->scxx . . $ st_myisam_info#s.->file_readcxx . . $ st_mi_isam_share#file_read.(info, info->rec_buffcxx . . $ st_myisam_info#rec_buff., info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 153 | pos, MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!))) |
| 154 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(-1); |
| 155 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(mi_unique_comp(def, record, info->rec_buff, |
| 156 | def->null_are_equal)); |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /* Read a fixed-length-record */ |
| 161 | /* Returns 0 if Ok. */ |
| 162 | /* 1 if record is deleted */ |
| 163 | /* MY_FILE_ERROR on read-error or locking-error */ |
| 164 | |
| 165 | int _mi_read_static_recordcxx . . $ _mi_read_static_record(b7c1c5f7482b1f1b).(register MI_INFOcxx . . $ MI_INFO# *info, register my_off_tcxx . . $ my_off_t# pos, |
| 166 | register ucharcxx . . $ uchar# *record) |
| 167 | { |
| 168 | int error; |
| 169 | |
| 170 | if (pos != HA_OFFSET_ERRORcxx . . $ `include/my_base.h:695:9`!) |
| 171 | { |
| 172 | if (info->opt_flagcxx . . $ st_myisam_info#opt_flag. & WRITE_CACHE_USEDcxx . . $ `include/my_base.h:613:9`! && |
| 173 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..pos_in_filecxx . . $ st_io_cache#pos_in_file. <= pos && |
| 174 | flush_io_cachecxx . . $ `include/my_sys.h:850:9`!(&info->rec_cache)) |
| 175 | return(-1); |
| 176 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* We have done a seek */ |
| 177 | |
| 178 | error=info->scxx . . $ st_myisam_info#s.->file_readcxx . . $ st_mi_isam_share#file_read.(info, record, info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength., |
| 179 | pos,MYFcxx . . $ `include/my_global.h:986:9`!(MY_NABPcxx . . $ `include/my_sys.h:55:9`!)) != 0; |
| 180 | fast_mi_writeinfocxx . . $ `storage/myisam/myisamdef.h:672:9`!(info); |
| 181 | if (! error) |
| 182 | { |
| 183 | if (!*record) |
| 184 | { |
| 185 | my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_RECORD_DELETEDcxx . . $ `include/my_base.h:479:9`!; |
| 186 | return(1); /* Record is deleted */ |
| 187 | } |
| 188 | info->updatecxx . . $ st_myisam_info#update.|= HA_STATE_AKTIVcxx . . $ `include/my_base.h:618:9`!; /* Record is read */ |
| 189 | return(0); |
| 190 | } |
| 191 | return(-1); /* Error on read */ |
| 192 | } |
| 193 | fast_mi_writeinfocxx . . $ `storage/myisam/myisamdef.h:672:9`!(info); /* No such record */ |
| 194 | return(-1); |
| 195 | } |
| 196 | |
| 197 | |
| 198 | |
| 199 | int _mi_read_rnd_static_recordcxx . . $ _mi_read_rnd_static_record(d44cfcf591c80129).(MI_INFOcxx . . $ MI_INFO# *info, ucharcxx . . $ uchar# *buf, |
| 200 | register my_off_tcxx . . $ my_off_t# filepos, |
| 201 | my_boolcxx . . $ my_bool# skip_deleted_blocks) |
| 202 | { |
| 203 | int locked,error,cache_read; |
| 204 | uintcxx . . $ uint# cache_length; |
| 205 | MYISAM_SHAREcxx . . $ MYISAM_SHARE# *share=info->scxx . . $ st_myisam_info#s.; |
| 206 | DBUG_ENTERcxx . . $ `include/my_dbug.h:165:9`!("_mi_read_rnd_static_record"); |
| 207 | |
| 208 | cache_read=0; |
| 209 | cache_length=0; |
| 210 | if (info->opt_flagcxx . . $ st_myisam_info#opt_flag. & WRITE_CACHE_USEDcxx . . $ `include/my_base.h:613:9`! && |
| 211 | (info->rec_cachecxx . . $ st_myisam_info#rec_cache..pos_in_filecxx . . $ st_io_cache#pos_in_file. <= filepos || skip_deleted_blocks) && |
| 212 | flush_io_cachecxx . . $ `include/my_sys.h:850:9`!(&info->rec_cache)) |
| 213 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!); |
| 214 | if (info->opt_flagcxx . . $ st_myisam_info#opt_flag. & READ_CACHE_USEDcxx . . $ `include/my_base.h:610:9`!) |
| 215 | { /* Cache in use */ |
| 216 | if (filepos == my_b_tellcxx . . $ my_b_tell(5bf016f16bf1f83c).(&info->rec_cachecxx . . $ st_myisam_info#rec_cache.) && |
| 217 | (skip_deleted_blocks || !filepos)) |
| 218 | { |
| 219 | cache_read=1; /* Read record using cache */ |
| 220 | cache_length=(uintcxx . . $ uint#) (info->rec_cachecxx . . $ st_myisam_info#rec_cache..read_endcxx . . $ st_io_cache#read_end. - info->rec_cachecxx . . $ st_myisam_info#rec_cache..read_poscxx . . $ st_io_cache#read_pos.); |
| 221 | } |
| 222 | else |
| 223 | info->rec_cachecxx . . $ st_myisam_info#rec_cache..seek_not_donecxx . . $ st_io_cache#seek_not_done.=1; /* Filepos is changed */ |
| 224 | } |
| 225 | locked=0; |
| 226 | if (info->lock_typecxx . . $ st_myisam_info#lock_type. == F_UNLCKcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:225:10`!) |
| 227 | { |
| 228 | if (filepos >= info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length.) |
| 229 | { /* Test if new records */ |
| 230 | if (_mi_readinfocxx . . $ _mi_readinfo(fd66c073ad9c9ca7).(info,F_RDLCKcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:223:10`!,0)) |
| 231 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!); |
| 232 | locked=1; |
| 233 | } |
| 234 | else |
| 235 | { /* We don't nead new info */ |
| 236 | #ifndef UNSAFE_LOCKING |
| 237 | if ((! cache_read || share->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength. > cache_length) && |
| 238 | share->tot_lockscxx . . $ st_mi_isam_share#tot_locks. == 0) |
| 239 | { /* record not in cache */ |
| 240 | if (my_lockcxx . . $ my_lock(dbd27b0f34827610).(share->kfilecxx . . $ st_mi_isam_share#kfile.,F_RDLCKcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:223:10`!,0L,F_TO_EOFcxx . . $ `include/my_global.h:560:9`!, |
| 241 | MYFcxx . . $ `include/my_global.h:986:9`!(MY_SEEK_NOT_DONEcxx . . $ `include/my_sys.h:72:9`!) | info->lock_waitcxx . . $ st_myisam_info#lock_wait.)) |
| 242 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!); |
| 243 | locked=1; |
| 244 | } |
| 245 | #else |
| 246 | info->tmp_lock_type=F_RDLCK; |
| 247 | #endif |
| 248 | } |
| 249 | } |
| 250 | if (filepos >= info->statecxx . . $ st_myisam_info#state.->data_file_lengthcxx . . $ st_mi_status_info#data_file_length.) |
| 251 | { |
| 252 | DBUG_PRINTcxx . . $ `include/my_dbug.h:174:9`!("test",("filepos: %ld (%ld) records: %ld del: %ld", |
| 253 | (long) filepos/share->base.reclength, (long) filepos, |
| 254 | (long) info->state->records, (long) info->state->del)); |
| 255 | fast_mi_writeinfocxx . . $ `storage/myisam/myisamdef.h:672:9`!(info); |
| 256 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_END_OF_FILEcxx . . $ `include/my_base.h:482:9`!); |
| 257 | } |
| 258 | info->lastposcxx . . $ st_myisam_info#lastpos.= filepos; |
| 259 | info->nextposcxx . . $ st_myisam_info#nextpos.= filepos+share->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength.; |
| 260 | |
| 261 | if (! cache_read) /* No cacheing */ |
| 262 | { |
| 263 | if ((error=_mi_read_static_recordcxx . . $ _mi_read_static_record(b7c1c5f7482b1f1b).(info,filepos,buf))) |
| 264 | { |
| 265 | if (error > 0) |
| 266 | error=my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_RECORD_DELETEDcxx . . $ `include/my_base.h:479:9`!; |
| 267 | else |
| 268 | error=my_errnocxx . . $ `include/my_pthread.h:720:9`!; |
| 269 | } |
| 270 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(error); |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | Read record with caching. If my_b_read() returns TRUE, less than the |
| 275 | requested bytes have been read. In this case rec_cache.error is |
| 276 | either -1 for a read error, or contains the number of bytes copied |
| 277 | into the buffer. |
| 278 | */ |
| 279 | error=my_b_readcxx . . $ my_b_read(478acc456ee25e38).(&info->rec_cachecxx . . $ st_myisam_info#rec_cache.,(ucharcxx . . $ uchar#*) buf,share->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.); |
| 280 | if (info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. != info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength. && !error) |
| 281 | { |
| 282 | char tmp[8]; /* Skill fill bytes */ |
| 283 | error=my_b_readcxx . . $ my_b_read(478acc456ee25e38).(&info->rec_cachecxx . . $ st_myisam_info#rec_cache.,(ucharcxx . . $ uchar#*) tmp, |
| 284 | info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..pack_reclengthcxx . . $ st_mi_base_info#pack_reclength. - info->scxx . . $ st_myisam_info#s.->basecxx . . $ st_mi_isam_share#base..reclengthcxx . . $ st_mi_base_info#reclength.); |
| 285 | } |
| 286 | if (locked) |
| 287 | (void) _mi_writeinfocxx . . $ _mi_writeinfo(83f767d3a6dbcc54).(info,0); /* Unlock keyfile */ |
| 288 | if (!error) |
| 289 | { |
| 290 | if (!buf[0]) |
| 291 | { /* Record is removed */ |
| 292 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_RECORD_DELETEDcxx . . $ `include/my_base.h:479:9`!); |
| 293 | } |
| 294 | /* Found and may be updated */ |
| 295 | info->updatecxx . . $ st_myisam_info#update.|= HA_STATE_AKTIVcxx . . $ `include/my_base.h:618:9`! | HA_STATE_KEY_CHANGEDcxx . . $ `include/my_base.h:624:9`!; |
| 296 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(0); |
| 297 | } |
| 298 | /* error is TRUE. my_errno should be set if rec_cache.error == -1 */ |
| 299 | if (info->rec_cachecxx . . $ st_myisam_info#rec_cache..errorcxx . . $ st_io_cache#error. != -1 || my_errnocxx . . $ `include/my_pthread.h:720:9`! == 0) |
| 300 | { |
| 301 | /* |
| 302 | If we could not get a full record, we either have a broken record, |
| 303 | or are at end of file. |
| 304 | */ |
| 305 | if (info->rec_cachecxx . . $ st_myisam_info#rec_cache..errorcxx . . $ st_io_cache#error. == 0) |
| 306 | my_errnocxx . . $ `include/my_pthread.h:720:9`!= HA_ERR_END_OF_FILEcxx . . $ `include/my_base.h:482:9`!; |
| 307 | else |
| 308 | my_errnocxx . . $ `include/my_pthread.h:720:9`!= HA_ERR_WRONG_IN_RECORDcxx . . $ `include/my_base.h:472:9`!; |
| 309 | } |
| 310 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!); /* Something wrong (EOF?) */ |
| 311 | } |