@returns whether a database is equal to the connection's default database */
| 2394 | @returns whether a database is equal to the connection's default database |
| 2395 | */ |
| 2396 | bool db_is_default_db(const char *db, size_t db_len, const THD *thd) |
| 2397 | { |
| 2398 | return thd != NULL && thd->db != NULL && |
| 2399 | thd->db_length == db_len && !memcmp(db, thd->db, db_len); |
| 2400 | } |
| 2401 | |
| 2402 | |
| 2403 | /** |