| 585 | } |
| 586 | |
| 587 | int stmt_cache_put_distributed(struct sqlthdstate *thd, |
| 588 | struct sqlclntstate *clnt, struct sql_state *rec, |
| 589 | int outrc, int distributed) |
| 590 | { |
| 591 | int rc; |
| 592 | |
| 593 | dohsql_wait_for_master((rec) ? rec->stmt : NULL, clnt); |
| 594 | |
| 595 | rc = stmt_cache_put_int(thd, clnt, rec, 0, outrc, distributed); |
| 596 | if (rc != 0 && rec->stmt) { |
| 597 | sqlite3_finalize(rec->stmt); |
| 598 | rec->stmt = NULL; |
| 599 | } |
| 600 | if ((rec->status & CACHE_HAS_HINT) && (rec->status & CACHE_FOUND_STR)) { |
| 601 | char *k = rec->cache_hint; |
| 602 | Pthread_mutex_lock(&gbl_sql_lock); |
| 603 | lrucache_release(sql_hints, &k); |
| 604 | Pthread_mutex_unlock(&gbl_sql_lock); |
| 605 | } |
| 606 | return rc; |
| 607 | } |
| 608 | |
| 609 | /** |
| 610 | * Cache a stmt if needed; struct sql_state is prepared by |
no test coverage detected