~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_handler.cc

Removed/replaced DBUG symbols and standardized TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
    name (table->alias) of the specified table.
128
128
 
129
129
  RETURN
130
 
    FALSE ok
131
 
    TRUE  error
 
130
    false ok
 
131
    true  error
132
132
*/
133
133
 
134
134
bool mysql_ha_close(THD *thd, TABLE_LIST *tables)
135
135
{
136
136
  TABLE_LIST    *hash_tables;
137
 
  DBUG_ENTER("mysql_ha_close");
138
 
  DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
139
 
                      tables->db, tables->table_name, tables->alias));
140
137
 
141
138
  if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
142
139
                                              (uchar*) tables->alias,
143
140
                                              strlen(tables->alias) + 1)))
144
141
  {
145
 
    mysql_ha_close_table(thd, hash_tables, FALSE);
 
142
    mysql_ha_close_table(thd, hash_tables, false);
146
143
    hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
147
144
  }
148
145
  else
149
146
  {
150
147
    my_error(ER_UNKNOWN_TABLE, MYF(0), tables->alias, "HANDLER");
151
 
    DBUG_PRINT("exit",("ERROR"));
152
 
    DBUG_RETURN(TRUE);
 
148
    return(true);
153
149
  }
154
150
 
155
151
  my_ok(thd);
156
 
  DBUG_PRINT("exit", ("OK"));
157
 
  DBUG_RETURN(FALSE);
 
152
  return(false);
158
153
}
159
154
 
160
155
 
172
167
static TABLE_LIST *mysql_ha_find(THD *thd, TABLE_LIST *tables)
173
168
{
174
169
  TABLE_LIST *hash_tables, *head= NULL, *first= tables;
175
 
  DBUG_ENTER("mysql_ha_find");
176
170
 
177
171
  /* search for all handlers with matching table names */
178
172
  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
193
187
    }
194
188
  }
195
189
 
196
 
  DBUG_RETURN(head);
 
190
  return(head);
197
191
}
198
192
 
199
193
 
210
204
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked)
211
205
{
212
206
  TABLE_LIST *hash_tables, *next;
213
 
  DBUG_ENTER("mysql_ha_rm_tables");
214
207
 
215
 
  DBUG_ASSERT(tables);
 
208
  assert(tables);
216
209
 
217
210
  hash_tables= mysql_ha_find(thd, tables);
218
211
 
225
218
    hash_tables= next;
226
219
  }
227
220
 
228
 
  DBUG_VOID_RETURN;
 
221
  return;
229
222
}
230
223
 
231
224
 
241
234
void mysql_ha_flush(THD *thd)
242
235
{
243
236
  TABLE_LIST *hash_tables;
244
 
  DBUG_ENTER("mysql_ha_flush");
245
237
 
246
238
  safe_mutex_assert_owner(&LOCK_open);
247
239
 
250
242
    hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i);
251
243
    if (hash_tables->table && hash_tables->table->needs_reopen_or_name_lock())
252
244
    {
253
 
      mysql_ha_close_table(thd, hash_tables, TRUE);
 
245
      mysql_ha_close_table(thd, hash_tables, true);
254
246
      /* Mark table as closed, ready for re-open. */
255
247
      hash_tables->table= NULL;
256
248
    }
257
249
  }
258
250
 
259
 
  DBUG_VOID_RETURN;
 
251
  return;
260
252
}
261
253
 
262
254
 
271
263
void mysql_ha_cleanup(THD *thd)
272
264
{
273
265
  TABLE_LIST *hash_tables;
274
 
  DBUG_ENTER("mysql_ha_cleanup");
275
266
 
276
267
  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
277
268
  {
278
269
    hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i);
279
270
    if (hash_tables->table)
280
 
      mysql_ha_close_table(thd, hash_tables, FALSE);
 
271
      mysql_ha_close_table(thd, hash_tables, false);
281
272
   }
282
273
 
283
274
  hash_free(&thd->handler_tables_hash);
284
275
 
285
 
  DBUG_VOID_RETURN;
 
276
  return;
286
277
}