MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / unlock_tables_if

Method unlock_tables_if

handlersocket/database.cpp:434–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void
435dbcontext::unlock_tables_if()
436{
437 if (lock != 0) {
438 DENA_VERBOSE(100, fprintf(stderr, "HNDSOCK unlock tables %p %p\n",
439 thd, thd->lock));
440 if (for_write_flag) {
441 for (size_t i = 0; i < table_vec.size(); ++i) {
442 if (table_vec[i].modified) {
443 query_cache_invalidate3(thd, table_vec[i].table, 1);
444 table_vec[i].table->file->ha_release_auto_increment();
445 }
446 }
447 }
448 {
449 bool suc = true;
450 #if MYSQL_VERSION_ID >= 50505
451 suc = (trans_commit_stmt(thd) == 0);
452 #else
453 suc = (ha_autocommit_or_rollback(thd, 0) == 0);
454 #endif
455 if (!suc) {
456 commit_error = true;
457 DENA_VERBOSE(10, fprintf(stderr,
458 "HNDSOCK unlock tables: commit failed\n"));
459 }
460 }
461 mysql_unlock_tables(thd, lock);
462 lock = thd->lock = 0;
463 statistic_increment(unlock_tables_count, &LOCK_status);
464 }
465 if (user_level_lock_locked) {
466 if (user_lock->release_lock()) {
467 user_level_lock_locked = false;
468 }
469 }
470}
471
472bool
473dbcontext::get_commit_error()

Callers 2

run_one_nbMethod · 0.80
run_one_epMethod · 0.80

Calls 2

release_lockMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected