~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/dict/dict0load.c

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
        goto loop;
241
241
}
242
242
 
 
243
/*
 
244
  Send data to callback function .
 
245
*/
 
246
 
 
247
UNIV_INTERN void dict_print_with_callback(dict_print_callback func, void *func_arg)
 
248
{
 
249
        dict_table_t*   sys_tables;
 
250
        dict_index_t*   sys_index;
 
251
        btr_pcur_t      pcur;
 
252
        const rec_t*    rec;
 
253
        const byte*     field;
 
254
        ulint           len;
 
255
        mtr_t           mtr;
 
256
 
 
257
        /* Enlarge the fatal semaphore wait timeout during the InnoDB table
 
258
        monitor printout */
 
259
 
 
260
        mutex_enter(&kernel_mutex);
 
261
        srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
 
262
        mutex_exit(&kernel_mutex);
 
263
 
 
264
        mutex_enter(&(dict_sys->mutex));
 
265
 
 
266
        mtr_start(&mtr);
 
267
 
 
268
        sys_tables = dict_table_get_low("SYS_TABLES");
 
269
        sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
 
270
 
 
271
        btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
 
272
                                    TRUE, &mtr);
 
273
loop:
 
274
        btr_pcur_move_to_next_user_rec(&pcur, &mtr);
 
275
 
 
276
        rec = btr_pcur_get_rec(&pcur);
 
277
 
 
278
        if (!btr_pcur_is_on_user_rec(&pcur)) {
 
279
                /* end of index */
 
280
 
 
281
                btr_pcur_close(&pcur);
 
282
                mtr_commit(&mtr);
 
283
 
 
284
                mutex_exit(&(dict_sys->mutex));
 
285
 
 
286
                /* Restore the fatal semaphore wait timeout */
 
287
 
 
288
                mutex_enter(&kernel_mutex);
 
289
                srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
 
290
                mutex_exit(&kernel_mutex);
 
291
 
 
292
                return;
 
293
        }
 
294
 
 
295
        field = rec_get_nth_field_old(rec, 0, &len);
 
296
 
 
297
        if (!rec_get_deleted_flag(rec, 0)) {
 
298
 
 
299
                /* We found one */
 
300
 
 
301
                char*   table_name = mem_strdupl((char*) field, len);
 
302
 
 
303
                btr_pcur_store_position(&pcur, &mtr);
 
304
 
 
305
                mtr_commit(&mtr);
 
306
 
 
307
                func(func_arg, table_name);
 
308
                mem_free(table_name);
 
309
 
 
310
                mtr_start(&mtr);
 
311
 
 
312
                btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
 
313
        }
 
314
 
 
315
        goto loop;
 
316
}
 
317
 
243
318
/********************************************************************//**
244
319
Determine the flags of a table described in SYS_TABLES.
245
320
@return compressed page size in kilobytes; or 0 if the tablespace is