~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_handler.cc

Merged in changes from Andrey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
  {
94
94
    (*table_ptr)->file->ha_index_or_rnd_end();
95
95
    if (! is_locked)
96
 
      VOID(pthread_mutex_lock(&LOCK_open));
 
96
      pthread_mutex_lock(&LOCK_open);
97
97
    if (close_thread_table(thd, table_ptr))
98
98
    {
99
99
      /* Tell threads waiting for refresh that something has happened */
100
100
      broadcast_refresh();
101
101
    }
102
102
    if (! is_locked)
103
 
      VOID(pthread_mutex_unlock(&LOCK_open));
 
103
      pthread_mutex_unlock(&LOCK_open);
104
104
  }
105
105
  else if (tables->table)
106
106
  {
135
135
  TableList    *hash_tables;
136
136
 
137
137
  if ((hash_tables= (TableList*) hash_search(&thd->handler_tables_hash,
138
 
                                              (uchar*) tables->alias,
 
138
                                              (unsigned char*) tables->alias,
139
139
                                              strlen(tables->alias) + 1)))
140
140
  {
141
141
    mysql_ha_close_table(thd, hash_tables, false);
142
 
    hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
 
142
    hash_delete(&thd->handler_tables_hash, (unsigned char*) hash_tables);
143
143
  }
144
144
  else
145
145
  {
168
168
  TableList *hash_tables, *head= NULL, *first= tables;
169
169
 
170
170
  /* search for all handlers with matching table names */
171
 
  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
 
171
  for (uint32_t i= 0; i < thd->handler_tables_hash.records; i++)
172
172
  {
173
173
    hash_tables= (TableList*) hash_element(&thd->handler_tables_hash, i);
174
174
    for (tables= first; tables; tables= tables->next_local)
213
213
    next= hash_tables->next_local;
214
214
    if (hash_tables->table)
215
215
      mysql_ha_close_table(thd, hash_tables, is_locked);
216
 
    hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
 
216
    hash_delete(&thd->handler_tables_hash, (unsigned char*) hash_tables);
217
217
    hash_tables= next;
218
218
  }
219
219
 
236
236
 
237
237
  safe_mutex_assert_owner(&LOCK_open);
238
238
 
239
 
  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
 
239
  for (uint32_t i= 0; i < thd->handler_tables_hash.records; i++)
240
240
  {
241
241
    hash_tables= (TableList*) hash_element(&thd->handler_tables_hash, i);
242
242
    if (hash_tables->table && hash_tables->table->needs_reopen_or_name_lock())
263
263
{
264
264
  TableList *hash_tables;
265
265
 
266
 
  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
 
266
  for (uint32_t i= 0; i < thd->handler_tables_hash.records; i++)
267
267
  {
268
268
    hash_tables= (TableList*) hash_element(&thd->handler_tables_hash, i);
269
269
    if (hash_tables->table)