6592
6592
return a->length == b->length && !strncmp(a->str, b->str, a->length);
6597
Open and lock system tables for read.
6600
open_system_tables_for_read()
6602
table_list List of tables to open.
6603
backup Pointer to Open_tables_state instance where
6604
information about currently open tables will be
6605
saved, and from which will be restored when we will
6606
end work with system tables.
6609
Thanks to restrictions which we put on opening and locking of
6610
system tables for writing, we can open and lock them for reading
6611
even when we already have some other tables open and locked. One
6612
must call close_system_tables() to close systems tables opened
6621
open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
6622
Open_tables_state *backup)
6624
thd->reset_n_backup_open_tables_state(backup);
6628
for (TABLE_LIST *tables= table_list; tables; tables= tables->next_global)
6630
TABLE *table= open_table(thd, tables, thd->mem_root, ¬_used,
6631
DRIZZLE_LOCK_IGNORE_FLUSH);
6635
assert(table->s->table_category == TABLE_CATEGORY_SYSTEM);
6637
table->use_all_columns();
6638
table->reginfo.lock_type= tables->lock_type;
6639
tables->table= table;
6644
TABLE **list= (TABLE**) thd->alloc(sizeof(TABLE*) * count);
6646
for (TABLE_LIST *tables= table_list; tables; tables= tables->next_global)
6647
*(ptr++)= tables->table;
6649
thd->lock= mysql_lock_tables(thd, list, count,
6650
DRIZZLE_LOCK_IGNORE_FLUSH, ¬_used);
6656
close_system_tables(thd, backup);
6663
Close system tables, opened with open_system_tables_for_read().
6666
close_system_tables()
6668
backup Pointer to Open_tables_state instance which holds
6669
information about tables which were open before we
6670
decided to access system tables.
6674
close_system_tables(THD *thd, Open_tables_state *backup)
6676
close_thread_tables(thd);
6677
thd->restore_backup_open_tables_state(backup);
6682
Open and lock one system table for update.
6685
open_system_table_for_update()
6687
one_table Table to open.
6690
Table opened with this call should closed using close_thread_tables().
6694
# Pointer to TABLE object of system table
6698
open_system_table_for_update(THD *thd, TABLE_LIST *one_table)
6700
TABLE *table= open_ltable(thd, one_table, one_table->lock_type, 0);
6703
assert(table->s->table_category == TABLE_CATEGORY_SYSTEM);
6704
table->use_all_columns();
6711
6595
@} (end of group Data_Dictionary)