| 1 | /* Copyright (c) 2000-2002, 2005-2007 MySQL AB |
| 2 | Use is subject to license terms |
| 3 | |
| 4 | This program is free software; you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation; version 2 of the License. |
| 7 | |
| 8 | This program is distributed in the hope that it will be useful, |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | GNU General Public License for more details. |
| 12 | |
| 13 | You should have received a copy of the GNU General Public License |
| 14 | along with this program; if not, write to the Free Software |
| 15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ |
| 16 | |
| 17 | /* re-read current record */ |
| 18 | |
| 19 | #include "heapdef.h"cxx . . $ `<file>/storage/heap/heapdef.h`/ |
| 20 | |
| 21 | /* If inx != -1 the new record is read according to index |
| 22 | (for next/prev). Record must in this case point to last record |
| 23 | Returncodes: |
| 24 | 0 = Ok. |
| 25 | HA_ERR_RECORD_DELETED = Record was removed |
| 26 | HA_ERR_KEY_NOT_FOUND = Record not found with key |
| 27 | */ |
| 28 | |
| 29 | int heap_rsamecxx . . $ heap_rsame(5da3ab4f5fdac48b).(register HP_INFOcxx . . $ HP_INFO# *info, ucharcxx . . $ uchar# *record, int inx) |
| 30 | { |
| 31 | HP_SHAREcxx . . $ HP_SHARE# *share=info->scxx . . $ st_heap_info#s.; |
| 32 | DBUG_ENTERcxx . . $ `include/my_dbug.h:165:9`!("heap_rsame"); |
| 33 | |
| 34 | test_activecxx . . $ `storage/heap/heapdef.h:40:9`!(info); |
| 35 | if (info->current_ptrcxx . . $ st_heap_info#current_ptr.[share->visiblecxx . . $ st_heap_share#visible.]) |
| 36 | { |
| 37 | if (inx < -1 || inx >= (int) share->keyscxx . . $ st_heap_share#keys.) |
| 38 | { |
| 39 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!=HA_ERR_WRONG_INDEXcxx . . $ `include/my_base.h:470:9`!); |
| 40 | } |
| 41 | else if (inx != -1) |
| 42 | { |
| 43 | info->lastinxcxx . . $ st_heap_info#lastinx.=inx; |
| 44 | hp_make_keycxx . . $ hp_make_key(bb2b60d1b062c10c).(share->keydefcxx . . $ st_heap_share#keydef. + inx, info->lastkeycxx . . $ st_heap_info#lastkey., record); |
| 45 | if (!hp_searchcxx . . $ hp_search(c4268605dbc159cd).(info, share->keydefcxx . . $ st_heap_share#keydef. + inx, info->lastkeycxx . . $ st_heap_info#lastkey., 3)) |
| 46 | { |
| 47 | info->updatecxx . . $ st_heap_info#update.= 0; |
| 48 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(my_errnocxx . . $ `include/my_pthread.h:720:9`!); |
| 49 | } |
| 50 | } |
| 51 | memcpycxx . . $ memcpy(cc817cb175f282d).(record,info->current_ptrcxx . . $ st_heap_info#current_ptr.,(size_t) share->reclengthcxx . . $ st_heap_share#reclength.); |
| 52 | DBUG_RETURNcxx . . $ `include/my_dbug.h:168:9`!(0); |
| 53 | } |
| 54 | info->updatecxx . . $ st_heap_info#update.=0; |
| 55 | |
| 56 | 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`!); |
| 57 | } |