~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/fil0fil.h

  • Committer: Brian Aker
  • Date: 2010-10-09 04:44:38 UTC
  • mto: (1827.1.1 trunk-drizzle)
  • mto: This revision was merged to the branch mainline in revision 1828.
  • Revision ID: brian@tangent.org-20101009044438-inypezfli460whto
First pass on moving show create schema out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
27
27
#define fil0fil_h
28
28
 
29
29
#include "univ.i"
 
30
#ifndef UNIV_HOTBACKUP
 
31
#include "sync0rw.h"
 
32
#endif /* !UNIV_HOTBACKUP */
30
33
#include "dict0types.h"
31
34
#include "ut0byte.h"
32
35
#include "os0file.h"
33
 
#ifndef UNIV_HOTBACKUP
34
 
#include "sync0rw.h"
35
 
#include "ibuf0types.h"
36
 
#endif /* !UNIV_HOTBACKUP */
37
36
 
38
37
/** When mysqld is run, the default directory "." is the mysqld datadir,
39
38
but in the MySQL Embedded Server Library and ibbackup it is not the default
111
110
                                        contents of this field is valid
112
111
                                        for all uncompressed pages. */
113
112
#define FIL_PAGE_FILE_FLUSH_LSN 26      /*!< this is only defined for the
114
 
                                        first page in a system tablespace
115
 
                                        data file (ibdata*, not *.ibd):
116
 
                                        the file has been flushed to disk
117
 
                                        at least up to this lsn */
 
113
                                        first page in a data file: the file
 
114
                                        has been flushed to disk at least up
 
115
                                        to this lsn */
118
116
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID  34 /*!< starting from 4.1.x this
119
117
                                        contains the space id of the page */
120
118
#define FIL_PAGE_DATA           38      /*!< start of the data on the page */
226
224
                                0 for uncompressed tablespaces */
227
225
        ulint           purpose);/*!< in: FIL_TABLESPACE, or FIL_LOG if log */
228
226
/*******************************************************************//**
229
 
Assigns a new space id for a new single-table tablespace. This works simply by
230
 
incrementing the global counter. If 4 billion id's is not enough, we may need
231
 
to recycle id's.
232
 
@return TRUE if assigned, FALSE if not */
 
227
Frees a space object from a the tablespace memory cache. Closes the files in
 
228
the chain but does not delete them.
 
229
@return TRUE if success */
233
230
UNIV_INTERN
234
231
ibool
235
 
fil_assign_new_space_id(
236
 
/*====================*/
237
 
        ulint*  space_id);      /*!< in/out: space id */
 
232
fil_space_free(
 
233
/*===========*/
 
234
        ulint   id);    /*!< in: space id */
238
235
/*******************************************************************//**
239
236
Returns the size of the space in pages. The tablespace must be cached in the
240
237
memory cache.
281
278
        ulint   hash_size,      /*!< in: hash table size */
282
279
        ulint   max_n_open);    /*!< in: max number of open files */
283
280
/*******************************************************************//**
284
 
Initializes the tablespace memory cache. */
285
 
UNIV_INTERN
286
 
void
287
 
fil_close(void);
288
 
/*===========*/
289
 
/*******************************************************************//**
290
281
Opens all log files and system tablespace data files. They stay open until the
291
282
database server shutdown. This should be called at a server startup after the
292
283
space objects for the log and the system tablespace have been created. The
438
429
ulint
439
430
fil_create_new_single_table_tablespace(
440
431
/*===================================*/
441
 
        ulint           space_id,       /*!< in: space id */
 
432
        ulint*          space_id,       /*!< in/out: space id; if this is != 0,
 
433
                                        then this is an input parameter,
 
434
                                        otherwise output */
442
435
        const char*     tablename,      /*!< in: the table name in the usual
443
436
                                        databasename/tablename format
444
437
                                        of InnoDB, or a dir path to a temp
507
500
ulint
508
501
fil_load_single_table_tablespaces(void);
509
502
/*===================================*/
 
503
/********************************************************************//**
 
504
If we need crash recovery, and we have called
 
505
fil_load_single_table_tablespaces() and dict_load_single_table_tablespaces(),
 
506
we can call this function to print an error message of orphaned .ibd files
 
507
for which there is not a data dictionary entry with a matching table name
 
508
and space id. */
 
509
UNIV_INTERN
 
510
void
 
511
fil_print_orphaned_tablespaces(void);
 
512
/*================================*/
510
513
/*******************************************************************//**
511
514
Returns TRUE if a single-table tablespace does not exist in the memory cache,
512
515
or is being deleted there.