| 432 | } |
| 433 | |
| 434 | void |
| 435 | dbcontext::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 | |
| 472 | bool |
| 473 | dbcontext::get_commit_error() |
no test coverage detected