jplindst@innobase06:~/svn/5.0/sql$ gdb mysqld GNU gdb 6.3-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) break row_search_for_mysql Breakpoint 1 at 0x834bdd8: file row0sel.c, line 3059. (gdb) run Starting program: /home/jplindst/svn/5.0/sql/mysqld [Thread debugging using libthread_db enabled] [New Thread -1210284352 (LWP 7162)] [New Thread -1501942864 (LWP 7166)] [New Thread -1510335568 (LWP 7167)] [New Thread -1518728272 (LWP 7168)] [New Thread -1527120976 (LWP 7169)] [New Thread -1535513680 (LWP 7170)] [New Thread -1543906384 (LWP 7171)] [New Thread -1560769616 (LWP 7172)] [Thread -1535513680 (zombie) exited] [New Thread -1569162320 (LWP 7173)] 060406 8:47:07 InnoDB: Started; log sequence number 0 56223 [New Thread -1552442448 (LWP 7174)] 060406 8:47:08 [Note] /home/jplindst/svn/5.0/sql/mysqld: ready for connections. Version: '5.0.21-debug-log' socket: '/home/jplindst/bugsocket' port: 3306 Source distribution [New Thread -1552643152 (LWP 7179)] [Switching to Thread -1552643152 (LWP 7179)] Breakpoint 1, row_search_for_mysql (buf=0x8c9ace0 "ÿ\001", mode=2, prebuilt=0xb7b6f868, match_mode=1, direction=0) at row0sel.c:3059 3059 dict_index_t* index = prebuilt->index; Current language: auto; currently c (gdb) next 3060 ibool comp = index->table->comp; (gdb) 3061 dtuple_t* search_tuple = prebuilt->search_tuple; (gdb) 3062 btr_pcur_t* pcur = prebuilt->pcur; (gdb) 3063 trx_t* trx = prebuilt->trx; (gdb) 3070 ulint err = DB_SUCCESS; (gdb) 3071 ibool unique_search = FALSE; (gdb) 3072 ibool unique_search_from_clust_index = FALSE; (gdb) 3073 ibool mtr_has_extra_clust_latch = FALSE; (gdb) 3074 ibool moves_up = FALSE; (gdb) 3075 ibool set_also_gap_locks = TRUE; (gdb) 3086 mem_heap_t* heap = NULL; (gdb) 3088 ulint* offsets = offsets_; (gdb) 3090 *offsets_ = (sizeof offsets_) / sizeof *offsets_; (gdb) 3095 if (UNIV_UNLIKELY(prebuilt->table->ibd_file_missing)) { (gdb) 3110 if (UNIV_UNLIKELY(prebuilt->magic_n != ROW_PREBUILT_ALLOCATED)) { (gdb) 3123 if (trx->n_mysql_tables_in_use == 0 (gdb) 3152 if (UNIV_UNLIKELY(btr_search_latch.writer != RW_LOCK_NOT_LOCKED) (gdb) 3170 if (srv_locks_unsafe_for_binlog (gdb) 3179 if (UNIV_UNLIKELY(direction == 0)) { (gdb) 3180 trx->op_info = "starting index read"; (gdb) 3182 prebuilt->n_rows_fetched = 0; (gdb) 3183 prebuilt->n_fetch_cached = 0; (gdb) 3184 prebuilt->fetch_cache_first = 0; (gdb) 3186 if (prebuilt->sel_graph == NULL) { (gdb) 3188 row_prebuild_sel_graph(prebuilt); (gdb) 3250 if (match_mode == ROW_SEL_EXACT (gdb) 3263 unique_search = TRUE; (gdb) 3270 if (UNIV_UNLIKELY(direction != 0 && (gdb) 3278 mtr_start(&mtr); (gdb) 3289 if (UNIV_UNLIKELY(direction == 0) (gdb) 3296 mode = PAGE_CUR_GE; (gdb) 3298 unique_search_from_clust_index = TRUE; (gdb) 3300 if (trx->mysql_n_tables_locked == 0 (gdb) 3390 if (trx->has_search_latch) { (gdb) 3395 trx_start_if_not_started(trx); (gdb) 3397 if (trx->isolation_level <= TRX_ISO_READ_COMMITTED (gdb) 3419 if (UNIV_UNLIKELY(direction == 0)) { (gdb) 3420 if (mode == PAGE_CUR_GE || mode == PAGE_CUR_G) { (gdb) 3421 moves_up = TRUE; (gdb) 3427 thr = que_fork_get_first_thr(prebuilt->sel_graph); (gdb) 3429 que_thr_move_to_run_state_for_mysql(thr, trx); (gdb) 3431 clust_index = dict_table_get_first_index(index->table); (gdb) 3433 if (UNIV_LIKELY(direction != 0)) { (gdb) 3440 } else if (dtuple_get_n_fields(search_tuple) > 0) { (gdb) 3442 btr_pcur_open_with_no_init(index, search_tuple, mode, (gdb) 3446 pcur->trx_if_known = trx; (gdb) 3457 if (!prebuilt->sql_stat_start) { (gdb) 3470 } else if (prebuilt->select_lock_type == LOCK_NONE) { (gdb) 3478 if (prebuilt->select_lock_type == LOCK_S) { (gdb) 3481 lock_mode = LOCK_IX; (gdb) 3483 err = lock_table(0, index->table, lock_mode, thr); (gdb) 3485 if (err != DB_SUCCESS) { (gdb) 3489 prebuilt->sql_stat_start = FALSE; (gdb) 3496 rec = btr_pcur_get_rec(pcur); (gdb) 3508 if (page_rec_is_infimum(rec)) { (gdb) 3517 if (page_rec_is_supremum(rec)) { (gdb) 3550 if (comp) { (gdb) 3551 next_offs = rec_get_next_offs(rec, TRUE); (gdb) 3552 if (UNIV_UNLIKELY(next_offs < PAGE_NEW_SUPREMUM)) { (gdb) 3554 goto wrong_offs; (gdb) 3564 if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) { (gdb) 3613 offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); (gdb) 3615 if (UNIV_UNLIKELY(srv_force_recovery > 0)) { (gdb) 3637 if (match_mode == ROW_SEL_EXACT) { (gdb) 3643 if (0 != cmp_dtuple_rec(search_tuple, rec, offsets)) { (gdb) 3707 if (prebuilt->select_lock_type != LOCK_NONE) { (gdb) 3719 if (!set_also_gap_locks (gdb) 3747 lock_type = LOCK_REC_NOT_GAP; (gdb) 3750 err = sel_set_rec_lock(rec, index, offsets, (gdb) 3754 if (err != DB_SUCCESS) { (gdb) 3756 goto lock_wait_or_error; (gdb) 3819 if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, comp))) { (gdb) 3840 if (index != clust_index && prebuilt->need_to_access_clustered) { (gdb) 3906 result_rec = rec; (gdb) 3916 if ((match_mode == ROW_SEL_EXACT (gdb) 3943 if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) { (gdb) 3950 if (!row_sel_store_mysql_rec(buf, prebuilt, (gdb) 3958 if (prebuilt->clust_index_was_generated) { (gdb) 3979 if (!unique_search_from_clust_index (gdb) 3985 btr_pcur_store_position(pcur, &mtr); (gdb) 3988 err = DB_SUCCESS; (gdb) 3990 goto normal_return; (gdb) 4105 que_thr_stop_for_mysql_no_error(thr, trx); (gdb) 4107 mtr_commit(&mtr); (gdb) 4109 if (prebuilt->n_fetch_cached > 0) { (gdb) 4120 if (err == DB_SUCCESS) { (gdb) 4121 srv_n_rows_read++; (gdb) 4125 trx->op_info = ""; (gdb) 4126 if (UNIV_LIKELY_NULL(heap)) { (gdb) 4129 return(err); (gdb) 4130 } (gdb) ha_innobase::index_read (this=0x8c9abc0, buf=0x8c9ace0 "ÿ\001", key_ptr=0x8cb79b8 "\001", key_len=4, find_flag=HA_READ_KEY_EXACT) at ha_innodb.cc:4058 4058 innodb_srv_conc_exit_innodb(prebuilt->trx); Current language: auto; currently c++ (gdb) 4060 if (ret == DB_SUCCESS) { (gdb) 4061 error = 0; (gdb) 4062 table->status = 0; (gdb) 4076 DBUG_RETURN(error); (gdb) 4077 } (gdb) handler::read_range_first (this=0x8c9abc0, start_key=0x8c9b268, end_key=0x8c9b274, eq_range_arg=true, sorted=false) at handler.cc:2540 2540 if (result) (gdb) 2545 DBUG_RETURN (compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE); (gdb) 2546 } (gdb) handler::read_multi_range_first (this=0x8c9abc0, found_range_p=0xa3747320, ranges=0x8c9b268, range_count=1, sorted=false, buffer=0x0) at handler.cc:2414 2414 if (result != HA_ERR_END_OF_FILE) (gdb) 2418 *found_range_p= multi_range_curr; (gdb) 2419 DBUG_PRINT("exit",("result %d", result)); (gdb) 2420 DBUG_RETURN(result); (gdb) 2421 } (gdb) QUICK_RANGE_SELECT::get_next (this=0x8c825d0) at opt_range.cc:6300 6300 if (result != HA_ERR_END_OF_FILE) (gdb) 6302 in_range= ! result; (gdb) 6303 DBUG_RETURN(result); (gdb) 6307 } (gdb) rr_quick (info=0xa3747598) at records.cc:237 237 return tmp; (gdb) 238 } (gdb) mysql_delete (thd=0x8c99688, table_list=0x8cb8f00, conds=0x8cb9178, order=0x8c999f4, limit=18446744073709551615, options=0, reset_auto_increment=false) at sql_delete.cc:201 201 if (!(select && select->skip_record())&& !thd->net.report_error ) (gdb) 204 if (table->triggers && (gdb) list 199 { 200 // thd->net.report_error is tested to disallow delete row on error 201 if (!(select && select->skip_record())&& !thd->net.report_error ) 202 { 203 204 if (table->triggers && 205 table->triggers->process_triggers(thd, TRG_EVENT_DELETE, 206 TRG_ACTION_BEFORE, FALSE)) 207 { 208 error= 1; (gdb) next 212 if (!(error=table->file->delete_row(table->record[0]))) (gdb) break ha_innobase::delete_row Breakpoint 2 at 0x829aea2: file ha_innodb.cc, line 3775. (gdb) next Breakpoint 2, ha_innobase::delete_row (this=0x8c9abc0, record=0x8c9ace0 "ÿ\001") at ha_innodb.cc:3775 3775 row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; (gdb) next 3776 int error = 0; (gdb) 3778 DBUG_ENTER("ha_innobase::delete_row"); (gdb) 3783 if (last_query_id != user_thd->query_id) { (gdb) 3790 if (!prebuilt->upd_node) { (gdb) 3791 row_get_prebuilt_update_vector(prebuilt); (gdb) 3796 prebuilt->upd_node->is_delete = TRUE; (gdb) 3798 innodb_srv_conc_enter_innodb(prebuilt->trx); (gdb) 3800 error = row_update_for_mysql((byte*) record, prebuilt); (gdb) step row_update_for_mysql (mysql_rec=0x8c9ace0 "ÿ\001", prebuilt=0xb7b6f868) at row0mysql.c:1300 1300 dict_table_t* table = prebuilt->table; Current language: auto; currently c (gdb) next 1301 trx_t* trx = prebuilt->trx; (gdb) 1307 if (prebuilt->table->ibd_file_missing) { (gdb) 1321 if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { (gdb) 1334 if (srv_created_new_raw || srv_force_recovery) { (gdb) 1346 trx->op_info = "updating or deleting"; (gdb) 1348 row_mysql_delay_if_needed(); (gdb) 1350 trx_start_if_not_started(trx); (gdb) 1352 node = prebuilt->upd_node; (gdb) 1354 clust_index = dict_table_get_first_index(table); (gdb) 1356 if (prebuilt->pcur->btr_cur.index == clust_index) { (gdb) 1357 btr_pcur_copy_stored_position(node->pcur, prebuilt->pcur); (gdb) 1363 ut_a(node->pcur->rel_pos == BTR_PCUR_ON); (gdb) 1372 savept = trx_savept_take(trx); (gdb) 1374 thr = que_fork_get_first_thr(prebuilt->upd_graph); (gdb) 1376 node->state = UPD_NODE_UPDATE_CLUSTERED; (gdb) 1380 que_thr_move_to_run_state_for_mysql(thr, trx); (gdb) 1383 thr->run_node = node; (gdb) 1384 thr->prev_node = node; (gdb) 1386 row_upd_step(thr); (gdb) 1388 err = trx->error_state; (gdb) 1390 if (err != DB_SUCCESS) { (gdb) 1391 que_thr_stop_for_mysql(thr); (gdb) 1393 if (err == DB_RECORD_NOT_FOUND) { (gdb) 1400 thr->lock_state= QUE_THR_LOCK_ROW; (gdb) 1401 was_lock_wait = row_mysql_handle_errors(&err, trx, thr, (gdb) 1403 thr->lock_state= QUE_THR_LOCK_NOLOCK;; (gdb) 1404 if (was_lock_wait) { (gdb) 1408 trx->op_info = ""; (gdb) 1410 return((int) err); (gdb) p err $1 = 37 (gdb) next 1430 } (gdb) ha_innobase::delete_row (this=0x8c9abc0, record=0x8c9ace0 "ÿ\001") at ha_innodb.cc:3802 3802 innodb_srv_conc_exit_innodb(prebuilt->trx); Current language: auto; currently c++ (gdb) 3804 error = convert_error_code_to_mysql(error, user_thd); (gdb) 3809 innobase_active_small(); (gdb) 3811 DBUG_RETURN(error); (gdb) 3812 } (gdb) mysql_delete (thd=0x8c99688, table_list=0x8cb8f00, conds=0x8cb9178, order=0x8c999f4, limit=18446744073709551615, options=0, reset_auto_increment=false) at sql_delete.cc:230 230 table->file->print_error(error,MYF(0)); (gdb) p error $2 = 152 (gdb) $3 = 152 (gdb) next 239 error= 1; (gdb) 240 break; (gdb) 246 if (thd->killed && !error) (gdb) 248 thd->proc_info="end"; (gdb) 249 end_read_record(&info); (gdb) 250 free_io_cache(table); // Will not do any harm (gdb) 251 if (options & OPTION_QUICK) (gdb) 254 if (reset_auto_increment && (error < 0)) (gdb) 274 if (deleted) (gdb) 279 delete select; (gdb) 280 transactional_table= table->file->has_transactions(); (gdb) 282 if ((error < 0) || (deleted && !transactional_table)) (gdb) 296 free_underlaid_joins(thd, select_lex); (gdb) 297 if (transactional_table) (gdb) 299 if (ha_autocommit_or_rollback(thd,error >= 0)) (gdb) break innobase_commit innobase_commit innobase_commit_complete(THD*) innobase_commit(THD*, bool) innobase_commit_low(trx_struct*) innobase_commit_by_xid(xid_t*) (gdb) break innobase_commit Breakpoint 3 at 0x8298a23: file ha_innodb.cc, line 1601. (gdb) break innobase_rollback Breakpoint 4 at 0x8299475: file ha_innodb.cc, line 2056. (gdb) next Breakpoint 4, innobase_rollback (thd=0x8c99688, all=false) at ha_innodb.cc:2056 2056 int error = 0; (gdb) next 2059 DBUG_ENTER("innobase_rollback"); (gdb) 2060 DBUG_PRINT("trans", ("aborting transaction")); (gdb) 2062 trx = check_trx_exists(thd); (gdb) 2065 trx->support_xa = (ibool)(thd->variables.innodb_support_xa); (gdb) 2071 innobase_release_stat_resources(trx); (gdb) 2073 if (trx->auto_inc_lock) { (gdb) 2081 if (all (gdb) 2084 error = trx_rollback_for_mysql(trx); (gdb) step trx_rollback_for_mysql (trx=0xb7b6c868) at trx0roll.c:126 126 if (trx->conc_state == TRX_NOT_STARTED) { Current language: auto; currently c (gdb) next 131 trx->op_info = "rollback"; (gdb) 133 err = trx_general_rollback_for_mysql(trx, FALSE, NULL); (gdb) step trx_general_rollback_for_mysql (trx=0xb7b6c868, partial=0, savept=0x0) at trx0roll.c:63 63 srv_active_wake_master_thread(); (gdb) next 65 trx_start_if_not_started(trx); (gdb) 67 heap = mem_heap_create(512); (gdb) 69 roll_node = roll_node_create(heap); (gdb) 71 roll_node->partial = partial; (gdb) 73 if (partial) { (gdb) 77 trx->error_state = DB_SUCCESS; (gdb) 79 thr = pars_complete_graph_for_exec(roll_node, trx, heap); (gdb) 81 ut_a(thr == que_fork_start_command(que_node_get_parent(thr))); (gdb) 82 que_run_threads(thr); (gdb) 84 mutex_enter(&kernel_mutex); (gdb) 86 while (trx->que_state != TRX_QUE_RUNNING) { (gdb) 95 mutex_exit(&kernel_mutex); (gdb) 97 mem_heap_free(heap); (gdb) 99 ut_a(trx->error_state == DB_SUCCESS); (gdb) 104 srv_active_wake_master_thread(); (gdb) 106 return((int) trx->error_state); (gdb) 113 } (gdb) trx_rollback_for_mysql (trx=0xb7b6c868) at trx0roll.c:135 135 trx->op_info = ""; (gdb) 137 return(err); (gdb) 138 } (gdb) innobase_rollback (thd=0x8c99688, all=false) at ha_innodb.cc:2085 2085 trx->active_trans = 0; Current language: auto; currently c++ (gdb) 2081 if (all (gdb) 2090 DBUG_RETURN(convert_error_code_to_mysql(error, NULL)); (gdb) 2091 } (gdb) ha_rollback_trans (thd=0x8c99688, all=false) at handler.cc:812 812 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status); (gdb) 813 *ht= 0; (gdb) 804 for (handlerton **ht=trans->ht; *ht; ht++) (gdb) 815 trans->nht=0; (gdb) 816 trans->no_2pc=0; (gdb) 817 if (is_real_trans) (gdb) 818 thd->transaction.xid_state.xid.null(); (gdb) 819 if (all) (gdb) 835 if (is_real_trans && (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && (gdb) 840 DBUG_RETURN(error); (gdb) 841 } (gdb) ha_autocommit_or_rollback (thd=0x8c99688, error=1) at handler.cc:866 866 thd->variables.tx_isolation=thd->session_tx_isolation; (gdb) 869 DBUG_RETURN(error); (gdb) 870 } (gdb) mysql_delete (thd=0x8c99688, table_list=0x8cb8f00, conds=0x8cb9178, order=0x8c999f4, limit=18446744073709551615, options=0, reset_auto_increment=false) at sql_delete.cc:300 300 error=1; (gdb) 303 if (thd->lock) (gdb) 305 mysql_unlock_tables(thd, thd->lock); (gdb) 306 thd->lock=0; (gdb) 308 if (error < 0) (gdb) 314 DBUG_RETURN(error >= 0 || thd->net.report_error); (gdb) 315 } (gdb) mysql_execute_command (thd=0x8c99688) at sql_parse.cc:3373 3373 break; (gdb) 4922 thd->proc_info="query end"; (gdb) 4934 if (thd->one_shot_set && lex->sql_command != SQLCOM_SET_OPTION) (gdb) 4945 if (lex->sql_command != SQLCOM_CALL && lex->sql_command != SQLCOM_EXECUTE && (gdb) 4948 DBUG_RETURN(res || thd->net.report_error); (gdb) 4952 } (gdb) mysql_parse (thd=0x8c99688, inBuf=0x8cb8e78 "DELETE IGNORE FROM table1 WHERE x=1", length=35) at sql_parse.cc:5711 5711 query_cache_end_of_result(thd); (gdb) 5714 lex->unit.cleanup(); (gdb) 5729 thd->proc_info="freeing items"; (gdb) 5730 thd->end_statement(); (gdb) 5731 thd->cleanup_after_query(); (gdb) 5732 DBUG_ASSERT(thd->change_list.is_empty()); (gdb) 5734 DBUG_VOID_RETURN; (gdb) 5735 } (gdb) dispatch_command (command=COM_QUERY, thd=0x8c99688, packet=0x8cb0e19 "DELETE IGNORE FROM table1 WHERE x=1", packet_length=36) at sql_parse.cc:1722 1722 while (!thd->killed && thd->lex->found_semicolon && !thd->net.report_error) (gdb) 1752 if (!(specialflag & SPECIAL_NO_PRIOR)) (gdb) 1753 my_pthread_setprio(pthread_self(),WAIT_PRIOR); (gdb) 1754 DBUG_PRINT("info",("query ready")); (gdb) 2050 if (thd->lock || thd->open_tables || thd->derived_tables || (gdb) 2053 thd->proc_info="closing tables"; (gdb) 2054 close_thread_tables(thd); /* Free tables */ (gdb) 2064 bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt)); (gdb) 2065 if (!thd->active_transaction()) (gdb) 2066 thd->transaction.xid_state.xid.null(); (gdb) 2069 if (thd->killed_errno() && !thd->net.report_error) (gdb) 2071 if (thd->net.report_error) (gdb) 2074 log_slow_statement(thd); (gdb) 2076 thd->proc_info="cleaning up"; (gdb) 2077 VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list (gdb) 2078 thd->proc_info=0; (gdb) 2079 thd->command=COM_SLEEP; (gdb) 2080 thd->query=0; (gdb) 2081 thd->query_length=0; (gdb) 2082 thread_running--; (gdb) 2083 VOID(pthread_mutex_unlock(&LOCK_thread_count)); (gdb) 2084 thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory (gdb) 2085 free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); (gdb) 2086 DBUG_RETURN(error); (gdb) 2087 } (gdb) do_command (thd=0x8c99688) at sql_parse.cc:1517 1517 } (gdb) handle_one_connection (arg=0x8c99688) at sql_parse.cc:1155 1155 while (!net->error && net->vio != 0 && (gdb) 1158 net->no_send_error= 0; (gdb) 1159 if (do_command(thd)) (gdb)