Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
fff42272
Commit
fff42272
authored
May 17, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge marko@build.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/marko/j/mysql-4.1
parents
8eadb180
03f19377
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
553 additions
and
519 deletions
+553
-519
innobase/dict/dict0dict.c
innobase/dict/dict0dict.c
+35
-29
innobase/dict/dict0load.c
innobase/dict/dict0load.c
+15
-13
innobase/dict/dict0mem.c
innobase/dict/dict0mem.c
+20
-22
innobase/fil/fil0fil.c
innobase/fil/fil0fil.c
+67
-60
innobase/include/data0data.h
innobase/include/data0data.h
+1
-1
innobase/include/data0data.ic
innobase/include/data0data.ic
+1
-1
innobase/include/dict0dict.h
innobase/include/dict0dict.h
+29
-24
innobase/include/dict0dict.ic
innobase/include/dict0dict.ic
+5
-5
innobase/include/dict0load.h
innobase/include/dict0load.h
+13
-10
innobase/include/dict0mem.h
innobase/include/dict0mem.h
+36
-34
innobase/include/fil0fil.h
innobase/include/fil0fil.h
+55
-49
innobase/include/os0file.h
innobase/include/os0file.h
+83
-73
innobase/include/os0sync.h
innobase/include/os0sync.h
+9
-9
innobase/include/pars0pars.h
innobase/include/pars0pars.h
+2
-2
innobase/include/pars0sym.h
innobase/include/pars0sym.h
+2
-2
innobase/include/row0mysql.h
innobase/include/row0mysql.h
+26
-25
innobase/include/row0sel.h
innobase/include/row0sel.h
+5
-5
innobase/include/trx0roll.h
innobase/include/trx0roll.h
+2
-2
innobase/include/trx0sys.h
innobase/include/trx0sys.h
+1
-1
innobase/include/trx0trx.h
innobase/include/trx0trx.h
+3
-3
innobase/include/ut0rnd.h
innobase/include/ut0rnd.h
+5
-5
innobase/include/ut0rnd.ic
innobase/include/ut0rnd.ic
+5
-5
innobase/include/ut0ut.h
innobase/include/ut0ut.h
+0
-15
innobase/os/os0file.c
innobase/os/os0file.c
+87
-76
innobase/os/os0sync.c
innobase/os/os0sync.c
+9
-9
innobase/pars/pars0pars.c
innobase/pars/pars0pars.c
+2
-2
innobase/pars/pars0sym.c
innobase/pars/pars0sym.c
+1
-4
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+26
-25
innobase/row/row0sel.c
innobase/row/row0sel.c
+5
-5
innobase/trx/trx0roll.c
innobase/trx/trx0roll.c
+2
-2
innobase/trx/trx0sys.c
innobase/trx/trx0sys.c
+1
-1
No files found.
innobase/dict/dict0dict.c
View file @
fff42272
...
@@ -70,7 +70,7 @@ dict_col_reposition_in_cache(
...
@@ -70,7 +70,7 @@ dict_col_reposition_in_cache(
/*=========================*/
/*=========================*/
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
dict_col_t
*
col
,
/* in: column */
dict_col_t
*
col
,
/* in: column */
c
har
*
new_name
);
/* in: new table name */
c
onst
char
*
new_name
);
/* in: new table name */
/**************************************************************************
/**************************************************************************
Removes a column from the data dictionary hash table. */
Removes a column from the data dictionary hash table. */
static
static
...
@@ -309,7 +309,7 @@ dict_table_get_index_noninline(
...
@@ -309,7 +309,7 @@ dict_table_get_index_noninline(
/*===========================*/
/*===========================*/
/* out: index, NULL if does not exist */
/* out: index, NULL if does not exist */
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
name
)
/* in: index name */
c
onst
char
*
name
)
/* in: index name */
{
{
return
(
dict_table_get_index
(
table
,
name
));
return
(
dict_table_get_index
(
table
,
name
));
}
}
...
@@ -693,9 +693,10 @@ directory dict_table_get_low is usually the appropriate function. */
...
@@ -693,9 +693,10 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t
*
dict_table_t
*
dict_table_get
(
dict_table_get
(
/*===========*/
/*===========*/
/* out: table, NULL if does not exist */
/* out: table, NULL if
char
*
table_name
,
/* in: table name */
does not exist */
trx_t
*
trx
)
/* in: transaction handle or NULL */
const
char
*
table_name
,
/* in: table name */
trx_t
*
trx
)
/* in: transaction handle or NULL */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -722,9 +723,10 @@ Returns a table object and increments MySQL open handle count on the table. */
...
@@ -722,9 +723,10 @@ Returns a table object and increments MySQL open handle count on the table. */
dict_table_t
*
dict_table_t
*
dict_table_get_and_increment_handle_count
(
dict_table_get_and_increment_handle_count
(
/*======================================*/
/*======================================*/
/* out: table, NULL if does not exist */
/* out: table, NULL if
char
*
table_name
,
/* in: table name */
does not exist */
trx_t
*
trx
)
/* in: transaction handle or NULL */
const
char
*
table_name
,
/* in: table name */
trx_t
*
trx
)
/* in: transaction handle or NULL */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -886,7 +888,7 @@ dict_table_rename_in_cache(
...
@@ -886,7 +888,7 @@ dict_table_rename_in_cache(
/*=======================*/
/*=======================*/
/* out: TRUE if success */
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
new_name
,
/* in: new name */
c
onst
char
*
new_name
,
/* in: new name */
ibool
rename_also_foreigns
)
/* in: in ALTER TABLE we want
ibool
rename_also_foreigns
)
/* in: in ALTER TABLE we want
to preserve the original table name
to preserve the original table name
in constraints which reference it */
in constraints which reference it */
...
@@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache(
...
@@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache(
/*=========================*/
/*=========================*/
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
dict_col_t
*
col
,
/* in: column */
dict_col_t
*
col
,
/* in: column */
c
har
*
new_name
)
/* in: new table name */
c
onst
char
*
new_name
)
/* in: new table name */
{
{
ulint
fold
;
ulint
fold
;
...
@@ -2019,7 +2021,7 @@ dict_foreign_find_index(
...
@@ -2019,7 +2021,7 @@ dict_foreign_find_index(
column types must match */
column types must match */
{
{
dict_index_t
*
index
;
dict_index_t
*
index
;
c
har
*
col_name
;
c
onst
char
*
col_name
;
ulint
i
;
ulint
i
;
index
=
dict_table_get_first_index
(
table
);
index
=
dict_table_get_first_index
(
table
);
...
@@ -2564,14 +2566,14 @@ static
...
@@ -2564,14 +2566,14 @@ static
char
*
char
*
dict_strip_comments
(
dict_strip_comments
(
/*================*/
/*================*/
/* out, own: SQL string stripped from
/* out, own: SQL string stripped from
comments; the caller must free this
comments; the caller must free this
with mem_free()! */
with mem_free()! */
char
*
sql_string
)
/* in: SQL string */
c
onst
c
har
*
sql_string
)
/* in: SQL string */
{
{
char
*
str
;
char
*
str
;
char
*
sptr
;
c
onst
c
har
*
sptr
;
char
*
ptr
;
char
*
ptr
;
str
=
mem_alloc
(
strlen
(
sql_string
)
+
1
);
str
=
mem_alloc
(
strlen
(
sql_string
)
+
1
);
...
@@ -2970,7 +2972,8 @@ col_loop1:
...
@@ -2970,7 +2972,8 @@ col_loop1:
}
}
foreign
->
foreign_table
=
table
;
foreign
->
foreign_table
=
table
;
foreign
->
foreign_table_name
=
table
->
name
;
foreign
->
foreign_table_name
=
mem_heap_strdup
(
foreign
->
heap
,
table
->
name
);
foreign
->
foreign_index
=
index
;
foreign
->
foreign_index
=
index
;
foreign
->
n_fields
=
i
;
foreign
->
n_fields
=
i
;
foreign
->
foreign_col_names
=
mem_heap_alloc
(
foreign
->
heap
,
foreign
->
foreign_col_names
=
mem_heap_alloc
(
foreign
->
heap
,
...
@@ -3244,16 +3247,19 @@ allowed to contain more fields than mentioned in the constraint. */
...
@@ -3244,16 +3247,19 @@ allowed to contain more fields than mentioned in the constraint. */
ulint
ulint
dict_create_foreign_constraints
(
dict_create_foreign_constraints
(
/*============================*/
/*============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction */
trx_t
*
trx
,
/* in: transaction */
char
*
sql_string
,
/* in: table create or ALTER TABLE
const
char
*
sql_string
,
/* in: table create statement where
statement where foreign keys are declared like:
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
FOREIGN KEY (a, b) REFERENCES
table2 can be written also with the database
table2(c, d), table2 can be written
name before it: test.table2; the default
also with the database
database is the database of parameter name */
name before it: test.table2; the
char
*
name
)
/* in: table full name in the normalized form
default database id the database of
database_name/table_name */
parameter name */
const
char
*
name
)
/* in: table full name in the
normalized form
database_name/table_name */
{
{
char
*
str
;
char
*
str
;
ulint
err
;
ulint
err
;
...
...
innobase/dict/dict0load.c
View file @
fff42272
...
@@ -27,9 +27,10 @@ Finds the first table name in the given database. */
...
@@ -27,9 +27,10 @@ Finds the first table name in the given database. */
char
*
char
*
dict_get_first_table_name_in_db
(
dict_get_first_table_name_in_db
(
/*============================*/
/*============================*/
/* out, own: table name, NULL if does not exist;
/* out, own: table name, NULL if
the caller must free the memory in the string! */
does not exist; the caller must
char
*
name
)
/* in: database name which ends to '/' */
free the memory in the string! */
const
char
*
name
)
/* in: database name which ends to '/' */
{
{
dict_table_t
*
sys_tables
;
dict_table_t
*
sys_tables
;
btr_pcur_t
pcur
;
btr_pcur_t
pcur
;
...
@@ -389,8 +390,8 @@ Report that an index field or index for a table has been delete marked. */
...
@@ -389,8 +390,8 @@ Report that an index field or index for a table has been delete marked. */
static
static
void
void
dict_load_report_deleted_index
(
dict_load_report_deleted_index
(
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
ulint
field
)
/* in: index field, or ULINT_UNDEFINED */
ulint
field
)
/* in: index field, or ULINT_UNDEFINED */
{
{
fputs
(
"InnoDB: Error: data dictionary entry"
fputs
(
"InnoDB: Error: data dictionary entry"
" for table "
,
stderr
);
" for table "
,
stderr
);
...
@@ -688,12 +689,13 @@ dictionary cache. */
...
@@ -688,12 +689,13 @@ dictionary cache. */
dict_table_t
*
dict_table_t
*
dict_load_table
(
dict_load_table
(
/*============*/
/*============*/
/* out: table, NULL if does not exist; if the table is
/* out: table, NULL if does not exist;
stored in an .ibd file, but the file does not exist,
if the table is stored in an .ibd file,
then we set the ibd_file_missing flag TRUE in the table
but the file does not exist,
object we return */
then we set the ibd_file_missing flag TRUE
char
*
name
)
/* in: table name in the databasename/tablename
in the table object we return */
format */
const
char
*
name
)
/* in: table name in the
databasename/tablename format */
{
{
ibool
ibd_file_missing
=
FALSE
;
ibool
ibd_file_missing
=
FALSE
;
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -1185,8 +1187,8 @@ already in the dictionary cache. */
...
@@ -1185,8 +1187,8 @@ already in the dictionary cache. */
ulint
ulint
dict_load_foreigns
(
dict_load_foreigns
(
/*===============*/
/*===============*/
/* out: DB_SUCCESS or error code */
/* out: DB_SUCCESS or error code */
char
*
table_name
)
/* in: table name */
c
onst
c
har
*
table_name
)
/* in: table name */
{
{
btr_pcur_t
pcur
;
btr_pcur_t
pcur
;
mem_heap_t
*
heap
;
mem_heap_t
*
heap
;
...
...
innobase/dict/dict0mem.c
View file @
fff42272
...
@@ -30,15 +30,14 @@ dict_table_t*
...
@@ -30,15 +30,14 @@ dict_table_t*
dict_mem_table_create
(
dict_mem_table_create
(
/*==================*/
/*==================*/
/* out, own: table object */
/* out, own: table object */
c
har
*
name
,
/* in: table name */
c
onst
char
*
name
,
/* in: table name */
ulint
space
,
/* in: space where the clustered index of
ulint
space
,
/* in: space where the clustered index of
the table is placed; this parameter is
the table is placed; this parameter is
ignored if the table is made a member of
ignored if the table is made a member of
a cluster */
a cluster */
ulint
n_cols
)
/* in: number of columns */
ulint
n_cols
)
/* in: number of columns */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
char
*
str
;
mem_heap_t
*
heap
;
mem_heap_t
*
heap
;
ut_ad
(
name
);
ut_ad
(
name
);
...
@@ -48,11 +47,9 @@ dict_mem_table_create(
...
@@ -48,11 +47,9 @@ dict_mem_table_create(
table
=
mem_heap_alloc
(
heap
,
sizeof
(
dict_table_t
));
table
=
mem_heap_alloc
(
heap
,
sizeof
(
dict_table_t
));
table
->
heap
=
heap
;
table
->
heap
=
heap
;
str
=
mem_heap_strdup
(
heap
,
name
);
table
->
type
=
DICT_TABLE_ORDINARY
;
table
->
type
=
DICT_TABLE_ORDINARY
;
table
->
name
=
str
;
table
->
name
=
mem_heap_strdup
(
heap
,
name
)
;
table
->
space
=
space
;
table
->
space
=
space
;
table
->
ibd_file_missing
=
FALSE
;
table
->
ibd_file_missing
=
FALSE
;
table
->
tablespace_discarded
=
FALSE
;
table
->
tablespace_discarded
=
FALSE
;
...
@@ -103,11 +100,11 @@ dict_table_t*
...
@@ -103,11 +100,11 @@ dict_table_t*
dict_mem_cluster_create
(
dict_mem_cluster_create
(
/*====================*/
/*====================*/
/* out, own: cluster object */
/* out, own: cluster object */
c
har
*
name
,
/* in: cluster name */
c
onst
char
*
name
,
/* in: cluster name */
ulint
space
,
/* in: space where the clustered indexes
ulint
space
,
/* in: space where the clustered indexes
of the member tables are placed */
of the member tables are placed */
ulint
n_cols
,
/* in: number of columns */
ulint
n_cols
,
/* in: number of columns */
ulint
mix_len
)
/* in: length of the common key prefix in the
ulint
mix_len
)
/* in: length of the common key prefix in the
cluster */
cluster */
{
{
dict_table_t
*
cluster
;
dict_table_t
*
cluster
;
...
@@ -127,7 +124,7 @@ void
...
@@ -127,7 +124,7 @@ void
dict_mem_table_make_cluster_member
(
dict_mem_table_make_cluster_member
(
/*===============================*/
/*===============================*/
dict_table_t
*
table
,
/* in: non-published table */
dict_table_t
*
table
,
/* in: non-published table */
c
har
*
cluster_name
)
/* in: cluster name */
c
onst
char
*
cluster_name
)
/* in: cluster name */
{
{
table
->
type
=
DICT_TABLE_CLUSTER_MEMBER
;
table
->
type
=
DICT_TABLE_CLUSTER_MEMBER
;
table
->
cluster_name
=
cluster_name
;
table
->
cluster_name
=
cluster_name
;
...
@@ -140,7 +137,7 @@ void
...
@@ -140,7 +137,7 @@ void
dict_mem_table_add_col
(
dict_mem_table_add_col
(
/*===================*/
/*===================*/
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
name
,
/* in: column name */
c
onst
char
*
name
,
/* in: column name */
ulint
mtype
,
/* in: main datatype */
ulint
mtype
,
/* in: main datatype */
ulint
prtype
,
/* in: precise type */
ulint
prtype
,
/* in: precise type */
ulint
len
,
/* in: length */
ulint
len
,
/* in: length */
...
@@ -174,14 +171,15 @@ Creates an index memory object. */
...
@@ -174,14 +171,15 @@ Creates an index memory object. */
dict_index_t
*
dict_index_t
*
dict_mem_index_create
(
dict_mem_index_create
(
/*==================*/
/*==================*/
/* out, own: index object */
/* out, own: index object */
char
*
table_name
,
/* in: table name */
const
char
*
table_name
,
/* in: table name */
char
*
index_name
,
/* in: index name */
const
char
*
index_name
,
/* in: index name */
ulint
space
,
/* in: space where the index tree is placed,
ulint
space
,
/* in: space where the index tree is
ignored if the index is of the clustered
placed, ignored if the index is of
type */
the clustered type */
ulint
type
,
/* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
ulint
type
,
/* in: DICT_UNIQUE,
ulint
n_fields
)
/* in: number of fields */
DICT_CLUSTERED, ... ORed */
ulint
n_fields
)
/* in: number of fields */
{
{
dict_index_t
*
index
;
dict_index_t
*
index
;
mem_heap_t
*
heap
;
mem_heap_t
*
heap
;
...
@@ -259,7 +257,7 @@ void
...
@@ -259,7 +257,7 @@ void
dict_mem_index_add_field
(
dict_mem_index_add_field
(
/*=====================*/
/*=====================*/
dict_index_t
*
index
,
/* in: index */
dict_index_t
*
index
,
/* in: index */
c
har
*
name
,
/* in: column name */
c
onst
char
*
name
,
/* in: column name */
ulint
order
,
/* in: order criterion; 0 means an
ulint
order
,
/* in: order criterion; 0 means an
ascending order */
ascending order */
ulint
prefix_len
)
/* in: 0 or the column prefix length
ulint
prefix_len
)
/* in: 0 or the column prefix length
...
...
innobase/fil/fil0fil.c
View file @
fff42272
...
@@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
...
@@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
void
fil_node_create
(
fil_node_create
(
/*============*/
/*============*/
char
*
name
,
/* in: file name (file must be closed) */
const
char
*
name
,
/* in: file name (file must be closed) */
ulint
size
,
/* in: file size in database blocks, rounded downwards
ulint
size
,
/* in: file size in database blocks, rounded
to an integer */
downwards to an integer */
ulint
id
,
/* in: space id where to append */
ulint
id
,
/* in: space id where to append */
ibool
is_raw
)
/* in: TRUE if a raw device or a raw disk partition */
ibool
is_raw
)
/* in: TRUE if a raw device or
a raw disk partition */
{
{
fil_system_t
*
system
=
fil_system
;
fil_system_t
*
system
=
fil_system
;
fil_node_t
*
node
;
fil_node_t
*
node
;
...
@@ -804,10 +805,10 @@ there is an error, prints an error message to the .err log. */
...
@@ -804,10 +805,10 @@ there is an error, prints an error message to the .err log. */
ibool
ibool
fil_space_create
(
fil_space_create
(
/*=============*/
/*=============*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
,
/* in: space name */
c
onst
c
har
*
name
,
/* in: space name */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
ulint
purpose
)
/* in: FIL_TABLESPACE, or FIL_LOG if log */
ulint
purpose
)
/* in: FIL_TABLESPACE, or FIL_LOG if log */
{
{
fil_system_t
*
system
=
fil_system
;
fil_system_t
*
system
=
fil_system
;
fil_space_t
*
space
;
fil_space_t
*
space
;
...
@@ -1542,16 +1543,18 @@ static
...
@@ -1542,16 +1543,18 @@ static
void
void
fil_op_write_log
(
fil_op_write_log
(
/*=============*/
/*=============*/
ulint
type
,
/* in: MLOG_FILE_CREATE, MLOG_FILE_DELETE, or
ulint
type
,
/* in: MLOG_FILE_CREATE,
MLOG_FILE_RENAME */
MLOG_FILE_DELETE, or
ulint
space_id
,
/* in: space id */
MLOG_FILE_RENAME */
char
*
name
,
/* in: table name in the familiar
ulint
space_id
,
/* in: space id */
'databasename/tablename' format, or the file
const
char
*
name
,
/* in: table name in the familiar
path in the case of MLOG_FILE_DELETE */
'databasename/tablename' format, or
char
*
new_name
,
/* in: if type is MLOG_FILE_RENAME, the new
the file path in the case of
table name in the 'databasename/tablename'
MLOG_FILE_DELETE */
format */
const
char
*
new_name
,
/* in: if type is MLOG_FILE_RENAME,
mtr_t
*
mtr
)
/* in: mini-transaction handle */
the new table name in the
'databasename/tablename' format */
mtr_t
*
mtr
)
/* in: mini-transaction handle */
{
{
byte
*
log_ptr
;
byte
*
log_ptr
;
...
@@ -1960,14 +1963,15 @@ tablespace memory cache. */
...
@@ -1960,14 +1963,15 @@ tablespace memory cache. */
ibool
ibool
fil_rename_tablespace
(
fil_rename_tablespace
(
/*==================*/
/*==================*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
old_name
,
/* in: old table name in the standard
const
char
*
old_name
,
/* in: old table name in the standard
databasename/tablename format of InnoDB, or
databasename/tablename format of
NULL if we do the rename based on the space
InnoDB, or NULL if we do the rename
id only */
based on the space id only */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
char
*
new_name
)
/* in: new table name in the standard
const
char
*
new_name
)
/* in: new table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format
of InnoDB */
{
{
fil_system_t
*
system
=
fil_system
;
fil_system_t
*
system
=
fil_system
;
ibool
success
;
ibool
success
;
...
@@ -2124,15 +2128,16 @@ path '.'. */
...
@@ -2124,15 +2128,16 @@ path '.'. */
ulint
ulint
fil_create_new_single_table_tablespace
(
fil_create_new_single_table_tablespace
(
/*===================================*/
/*===================================*/
/* out: DB_SUCCESS or error code */
/* out: DB_SUCCESS or error code */
ulint
*
space_id
,
/* in/out: space id; if this is != 0, then
ulint
*
space_id
,
/* in/out: space id; if this is != 0,
this is an input parameter, otherwise
then this is an input parameter,
output */
otherwise output */
char
*
tablename
,
/* in: the table name in the usual
const
char
*
tablename
,
/* in: the table name in the usual
databasename/tablename format of InnoDB */
databasename/tablename format
ulint
size
)
/* in: the initial size of the tablespace file
of InnoDB */
in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE
ulint
size
)
/* in: the initial size of the
*/
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
{
{
os_file_t
file
;
os_file_t
file
;
ibool
ret
;
ibool
ret
;
...
@@ -2293,12 +2298,12 @@ lsn's just by looking at that flush lsn. */
...
@@ -2293,12 +2298,12 @@ lsn's just by looking at that flush lsn. */
ibool
ibool
fil_reset_too_high_lsns
(
fil_reset_too_high_lsns
(
/*====================*/
/*====================*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
name
,
/* in: table name in the databasename/tablenam
e
c
onst
char
*
name
,
/* in: table name in th
e
format */
databasename/tablename
format */
dulint
current_lsn
)
/* in: reset lsn's if the lsn stamped to
dulint
current_lsn
)
/* in: reset lsn's if the lsn stamped
FIL_PAGE_FILE_FLUSH_LSN in the first page is
to FIL_PAGE_FILE_FLUSH_LSN in the
too high */
first page is
too high */
{
{
os_file_t
file
;
os_file_t
file
;
char
*
filepath
;
char
*
filepath
;
...
@@ -2433,10 +2438,10 @@ closes it after we have looked at the space id in it. */
...
@@ -2433,10 +2438,10 @@ closes it after we have looked at the space id in it. */
ibool
ibool
fil_open_single_table_tablespace
(
fil_open_single_table_tablespace
(
/*=============================*/
/*=============================*/
/* out: TRUE if success */
/* out: TRUE if success */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
c
har
*
name
)
/* in: table name in the databasename/tablenam
e
c
onst
char
*
name
)
/* in: table name in th
e
format */
databasename/tablename
format */
{
{
os_file_t
file
;
os_file_t
file
;
char
*
filepath
;
char
*
filepath
;
...
@@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */
...
@@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */
ibool
ibool
fil_space_for_table_exists_in_mem
(
fil_space_for_table_exists_in_mem
(
/*==============================*/
/*==============================*/
/* out: TRUE if a matching tablespace exists
/* out: TRUE if a matching tablespace
in the memory cache */
exists in the memory cache */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
char
*
name
,
/* in: table name in the standard
const
char
*
name
,
/* in: table name in the standard
'databasename/tablename' format */
'databasename/tablename' format */
ibool
mark_space
,
/* in: in crash recovery, at database startup
ibool
mark_space
,
/* in: in crash recovery, at database
we mark all spaces which have an associated
startup we mark all spaces which have
table in the InnoDB data dictionary, so that
an associated table in the InnoDB
we can print a warning about orphaned
data dictionary, so that
tablespaces */
we can print a warning about orphaned
ibool
print_error_if_does_not_exist
)
tablespaces */
/* in: print detailed error information to
ibool
print_error_if_does_not_exist
)
the .err log if a matching tablespace is
/* in: print detailed error
not found from memory */
information to the .err log if a
matching tablespace is not found from
memory */
{
{
fil_system_t
*
system
=
fil_system
;
fil_system_t
*
system
=
fil_system
;
fil_space_t
*
namespace
;
fil_space_t
*
namespace
;
...
...
innobase/include/data0data.h
View file @
fff42272
...
@@ -86,7 +86,7 @@ void
...
@@ -86,7 +86,7 @@ void
dfield_set_data
(
dfield_set_data
(
/*============*/
/*============*/
dfield_t
*
field
,
/* in: field */
dfield_t
*
field
,
/* in: field */
void
*
data
,
/* in: data */
const
void
*
data
,
/* in: data */
ulint
len
);
/* in: length or UNIV_SQL_NULL */
ulint
len
);
/* in: length or UNIV_SQL_NULL */
/**************************************************************************
/**************************************************************************
Writes an SQL null field full of zeros. */
Writes an SQL null field full of zeros. */
...
...
innobase/include/data0data.ic
View file @
fff42272
...
@@ -93,7 +93,7 @@ void
...
@@ -93,7 +93,7 @@ void
dfield_set_data(
dfield_set_data(
/*============*/
/*============*/
dfield_t* field, /* in: field */
dfield_t* field, /* in: field */
void*
data, /* in: data */
const void*
data, /* in: data */
ulint len) /* in: length or UNIV_SQL_NULL */
ulint len) /* in: length or UNIV_SQL_NULL */
{
{
ut_ad(field);
ut_ad(field);
...
...
innobase/include/dict0dict.h
View file @
fff42272
...
@@ -166,7 +166,7 @@ dict_table_rename_in_cache(
...
@@ -166,7 +166,7 @@ dict_table_rename_in_cache(
/*=======================*/
/*=======================*/
/* out: TRUE if success */
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
new_name
,
/* in: new name */
c
onst
char
*
new_name
,
/* in: new name */
ibool
rename_also_foreigns
);
/* in: in ALTER TABLE we want
ibool
rename_also_foreigns
);
/* in: in ALTER TABLE we want
to preserve the original table name
to preserve the original table name
in constraints which reference it */
in constraints which reference it */
...
@@ -210,16 +210,19 @@ fields than mentioned in the constraint. */
...
@@ -210,16 +210,19 @@ fields than mentioned in the constraint. */
ulint
ulint
dict_create_foreign_constraints
(
dict_create_foreign_constraints
(
/*============================*/
/*============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction */
trx_t
*
trx
,
/* in: transaction */
char
*
sql_string
,
/* in: table create statement where
const
char
*
sql_string
,
/* in: table create statement where
foreign keys are declared like:
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
FOREIGN KEY (a, b) REFERENCES
table2 can be written also with the database
table2(c, d), table2 can be written
name before it: test.table2; the default
also with the database
database id the database of parameter name */
name before it: test.table2; the
char
*
name
);
/* in: table full name in the normalized form
default database id the database of
database_name/table_name */
parameter name */
const
char
*
name
);
/* in: table full name in the
normalized form
database_name/table_name */
/**************************************************************************
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
...
@@ -246,9 +249,10 @@ directory dict_table_get_low is usually the appropriate function. */
...
@@ -246,9 +249,10 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t
*
dict_table_t
*
dict_table_get
(
dict_table_get
(
/*===========*/
/*===========*/
/* out: table, NULL if does not exist */
/* out: table, NULL if
char
*
table_name
,
/* in: table name */
does not exist */
trx_t
*
trx
);
/* in: transaction handle */
const
char
*
table_name
,
/* in: table name */
trx_t
*
trx
);
/* in: transaction handle */
/**************************************************************************
/**************************************************************************
Returns a table object and increments MySQL open handle count on the table.
Returns a table object and increments MySQL open handle count on the table.
*/
*/
...
@@ -256,9 +260,10 @@ Returns a table object and increments MySQL open handle count on the table.
...
@@ -256,9 +260,10 @@ Returns a table object and increments MySQL open handle count on the table.
dict_table_t
*
dict_table_t
*
dict_table_get_and_increment_handle_count
(
dict_table_get_and_increment_handle_count
(
/*======================================*/
/*======================================*/
/* out: table, NULL if does not exist */
/* out: table, NULL if
char
*
table_name
,
/* in: table name */
does not exist */
trx_t
*
trx
);
/* in: transaction handle or NULL */
const
char
*
table_name
,
/* in: table name */
trx_t
*
trx
);
/* in: transaction handle or NULL */
/**************************************************************************
/**************************************************************************
Returns a table object, based on table id, and memoryfixes it. */
Returns a table object, based on table id, and memoryfixes it. */
...
@@ -290,8 +295,8 @@ UNIV_INLINE
...
@@ -290,8 +295,8 @@ UNIV_INLINE
dict_table_t
*
dict_table_t
*
dict_table_check_if_in_cache_low
(
dict_table_check_if_in_cache_low
(
/*==============================*/
/*==============================*/
/* out: table, NULL if not found */
/* out: table, NULL if not found */
char
*
table_name
);
/* in: table name */
c
onst
c
har
*
table_name
);
/* in: table name */
/**************************************************************************
/**************************************************************************
Gets a table; loads it to the dictionary cache if necessary. A low-level
Gets a table; loads it to the dictionary cache if necessary. A low-level
function. */
function. */
...
@@ -299,8 +304,8 @@ UNIV_INLINE
...
@@ -299,8 +304,8 @@ UNIV_INLINE
dict_table_t
*
dict_table_t
*
dict_table_get_low
(
dict_table_get_low
(
/*===============*/
/*===============*/
/* out: table, NULL if not found */
/* out: table, NULL if not found */
char
*
table_name
);
/* in: table name */
c
onst
c
har
*
table_name
);
/* in: table name */
/**************************************************************************
/**************************************************************************
Returns an index object. */
Returns an index object. */
UNIV_INLINE
UNIV_INLINE
...
@@ -309,7 +314,7 @@ dict_table_get_index(
...
@@ -309,7 +314,7 @@ dict_table_get_index(
/*=================*/
/*=================*/
/* out: index, NULL if does not exist */
/* out: index, NULL if does not exist */
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
name
);
/* in: index name */
c
onst
char
*
name
);
/* in: index name */
/**************************************************************************
/**************************************************************************
Returns an index object. */
Returns an index object. */
...
@@ -318,7 +323,7 @@ dict_table_get_index_noninline(
...
@@ -318,7 +323,7 @@ dict_table_get_index_noninline(
/*===========================*/
/*===========================*/
/* out: index, NULL if does not exist */
/* out: index, NULL if does not exist */
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
name
);
/* in: index name */
c
onst
char
*
name
);
/* in: index name */
/**************************************************************************
/**************************************************************************
Prints a table data. */
Prints a table data. */
...
@@ -340,7 +345,7 @@ Prints a table data when we know the table name. */
...
@@ -340,7 +345,7 @@ Prints a table data when we know the table name. */
void
void
dict_table_print_by_name
(
dict_table_print_by_name
(
/*=====================*/
/*=====================*/
char
*
name
);
c
onst
c
har
*
name
);
#endif
/* UNIV_DEBUG */
#endif
/* UNIV_DEBUG */
/**************************************************************************
/**************************************************************************
Outputs info on foreign keys of a table. */
Outputs info on foreign keys of a table. */
...
...
innobase/include/dict0dict.ic
View file @
fff42272
...
@@ -536,8 +536,8 @@ UNIV_INLINE
...
@@ -536,8 +536,8 @@ UNIV_INLINE
dict_table_t*
dict_table_t*
dict_table_check_if_in_cache_low(
dict_table_check_if_in_cache_low(
/*==============================*/
/*==============================*/
/* out: table, NULL if not found */
/* out: table, NULL if not found */
char* table_name) /* in: table name */
c
onst c
har* table_name) /* in: table name */
{
{
dict_table_t* table;
dict_table_t* table;
ulint table_fold;
ulint table_fold;
...
@@ -562,8 +562,8 @@ UNIV_INLINE
...
@@ -562,8 +562,8 @@ UNIV_INLINE
dict_table_t*
dict_table_t*
dict_table_get_low(
dict_table_get_low(
/*===============*/
/*===============*/
/* out: table, NULL if not found */
/* out: table, NULL if not found */
char* table_name) /* in: table name */
c
onst c
har* table_name) /* in: table name */
{
{
dict_table_t* table;
dict_table_t* table;
...
@@ -642,7 +642,7 @@ dict_table_get_index(
...
@@ -642,7 +642,7 @@ dict_table_get_index(
/*=================*/
/*=================*/
/* out: index, NULL if does not exist */
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
dict_table_t* table, /* in: table */
c
har*
name) /* in: index name */
c
onst char*
name) /* in: index name */
{
{
dict_index_t* index = NULL;
dict_index_t* index = NULL;
...
...
innobase/include/dict0load.h
View file @
fff42272
...
@@ -31,9 +31,10 @@ Finds the first table name in the given database. */
...
@@ -31,9 +31,10 @@ Finds the first table name in the given database. */
char
*
char
*
dict_get_first_table_name_in_db
(
dict_get_first_table_name_in_db
(
/*============================*/
/*============================*/
/* out, own: table name, NULL if does not exist;
/* out, own: table name, NULL if
the caller must free the memory in the string! */
does not exist; the caller must free
char
*
name
);
/* in: database name which ends to '/' */
the memory in the string! */
const
char
*
name
);
/* in: database name which ends to '/' */
/************************************************************************
/************************************************************************
Loads a table definition and also all its index definitions, and also
Loads a table definition and also all its index definitions, and also
the cluster definition if the table is a member in a cluster. Also loads
the cluster definition if the table is a member in a cluster. Also loads
...
@@ -43,11 +44,13 @@ a foreign key references columns in this table. */
...
@@ -43,11 +44,13 @@ a foreign key references columns in this table. */
dict_table_t
*
dict_table_t
*
dict_load_table
(
dict_load_table
(
/*============*/
/*============*/
/* out: table, NULL if does not exist; if the table is
/* out: table, NULL if does not exist;
stored in an .ibd file, but the file does not exist,
if the table is stored in an .ibd file,
then we set the ibd_file_missing flag TRUE in the table
but the file does not exist,
object we return */
then we set the ibd_file_missing flag TRUE
char
*
name
);
/* in: table name */
in the table object we return */
const
char
*
name
);
/* in: table name in the
databasename/tablename format */
/***************************************************************************
/***************************************************************************
Loads a table object based on the table id. */
Loads a table object based on the table id. */
...
@@ -75,8 +78,8 @@ already in the dictionary cache. */
...
@@ -75,8 +78,8 @@ already in the dictionary cache. */
ulint
ulint
dict_load_foreigns
(
dict_load_foreigns
(
/*===============*/
/*===============*/
/* out: DB_SUCCESS or error code */
/* out: DB_SUCCESS or error code */
char
*
table_name
);
/* in: table name */
c
onst
c
har
*
table_name
);
/* in: table name */
/************************************************************************
/************************************************************************
Prints to the standard output information on all tables found in the data
Prints to the standard output information on all tables found in the data
dictionary system table. */
dictionary system table. */
...
...
innobase/include/dict0mem.h
View file @
fff42272
...
@@ -48,27 +48,28 @@ Creates a table memory object. */
...
@@ -48,27 +48,28 @@ Creates a table memory object. */
dict_table_t
*
dict_table_t
*
dict_mem_table_create
(
dict_mem_table_create
(
/*==================*/
/*==================*/
/* out, own: table object */
/* out, own: table object */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
ulint
space
,
/* in: space where the clustered index of
ulint
space
,
/* in: space where the clustered index
the table is placed; this parameter is
of the table is placed; this parameter
ignored if the table is made a member of
is ignored if the table is made
a cluster */
a member of
a cluster */
ulint
n_cols
);
/* in: number of columns */
ulint
n_cols
);
/* in: number of columns */
/**************************************************************************
/**************************************************************************
Creates a cluster memory object. */
Creates a cluster memory object. */
dict_cluster_t
*
dict_cluster_t
*
dict_mem_cluster_create
(
dict_mem_cluster_create
(
/*====================*/
/*====================*/
/* out, own: cluster object (where the type
/* out, own: cluster object (where the
dict_cluster_t == dict_table_t) */
type dict_cluster_t == dict_table_t) */
char
*
name
,
/* in: cluster name */
const
char
*
name
,
/* in: cluster name */
ulint
space
,
/* in: space where the clustered indexes
ulint
space
,
/* in: space where the clustered
of the member tables are placed */
indexes of the member tables are
ulint
n_cols
,
/* in: number of columns */
placed */
ulint
mix_len
);
/* in: length of the common key prefix in the
ulint
n_cols
,
/* in: number of columns */
cluster */
ulint
mix_len
);
/* in: length of the common key prefix
in the cluster */
/**************************************************************************
/**************************************************************************
Declares a non-published table as a member in a cluster. */
Declares a non-published table as a member in a cluster. */
...
@@ -76,7 +77,7 @@ void
...
@@ -76,7 +77,7 @@ void
dict_mem_table_make_cluster_member
(
dict_mem_table_make_cluster_member
(
/*===============================*/
/*===============================*/
dict_table_t
*
table
,
/* in: non-published table */
dict_table_t
*
table
,
/* in: non-published table */
c
har
*
cluster_name
);
/* in: cluster name */
c
onst
char
*
cluster_name
);
/* in: cluster name */
/**************************************************************************
/**************************************************************************
Adds a column definition to a table. */
Adds a column definition to a table. */
...
@@ -84,7 +85,7 @@ void
...
@@ -84,7 +85,7 @@ void
dict_mem_table_add_col
(
dict_mem_table_add_col
(
/*===================*/
/*===================*/
dict_table_t
*
table
,
/* in: table */
dict_table_t
*
table
,
/* in: table */
c
har
*
name
,
/* in: column name */
c
onst
char
*
name
,
/* in: column name */
ulint
mtype
,
/* in: main datatype */
ulint
mtype
,
/* in: main datatype */
ulint
prtype
,
/* in: precise type */
ulint
prtype
,
/* in: precise type */
ulint
len
,
/* in: length */
ulint
len
,
/* in: length */
...
@@ -95,14 +96,15 @@ Creates an index memory object. */
...
@@ -95,14 +96,15 @@ Creates an index memory object. */
dict_index_t
*
dict_index_t
*
dict_mem_index_create
(
dict_mem_index_create
(
/*==================*/
/*==================*/
/* out, own: index object */
/* out, own: index object */
char
*
table_name
,
/* in: table name */
const
char
*
table_name
,
/* in: table name */
char
*
index_name
,
/* in: index name */
const
char
*
index_name
,
/* in: index name */
ulint
space
,
/* in: space where the index tree is placed,
ulint
space
,
/* in: space where the index tree is
ignored if the index is of the clustered
placed, ignored if the index is of
type */
the clustered type */
ulint
type
,
/* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
ulint
type
,
/* in: DICT_UNIQUE,
ulint
n_fields
);
/* in: number of fields */
DICT_CLUSTERED, ... ORed */
ulint
n_fields
);
/* in: number of fields */
/**************************************************************************
/**************************************************************************
Adds a field definition to an index. NOTE: does not take a copy
Adds a field definition to an index. NOTE: does not take a copy
of the column name if the field is a column. The memory occupied
of the column name if the field is a column. The memory occupied
...
@@ -112,7 +114,7 @@ void
...
@@ -112,7 +114,7 @@ void
dict_mem_index_add_field
(
dict_mem_index_add_field
(
/*=====================*/
/*=====================*/
dict_index_t
*
index
,
/* in: index */
dict_index_t
*
index
,
/* in: index */
c
har
*
name
,
/* in: column name */
c
onst
char
*
name
,
/* in: column name */
ulint
order
,
/* in: order criterion; 0 means an
ulint
order
,
/* in: order criterion; 0 means an
ascending order */
ascending order */
ulint
prefix_len
);
/* in: 0 or the column prefix length
ulint
prefix_len
);
/* in: 0 or the column prefix length
...
@@ -142,7 +144,7 @@ struct dict_col_struct{
...
@@ -142,7 +144,7 @@ struct dict_col_struct{
clustered index */
clustered index */
ulint
ord_part
;
/* count of how many times this column
ulint
ord_part
;
/* count of how many times this column
appears in ordering fields of an index */
appears in ordering fields of an index */
c
har
*
name
;
/* name */
c
onst
char
*
name
;
/* name */
dtype_t
type
;
/* data type */
dtype_t
type
;
/* data type */
dict_table_t
*
table
;
/* back pointer to table of this column */
dict_table_t
*
table
;
/* back pointer to table of this column */
ulint
aux
;
/* this is used as an auxiliary variable
ulint
aux
;
/* this is used as an auxiliary variable
...
@@ -154,7 +156,7 @@ struct dict_col_struct{
...
@@ -154,7 +156,7 @@ struct dict_col_struct{
/* Data structure for a field in an index */
/* Data structure for a field in an index */
struct
dict_field_struct
{
struct
dict_field_struct
{
dict_col_t
*
col
;
/* pointer to the table column */
dict_col_t
*
col
;
/* pointer to the table column */
c
har
*
name
;
/* name of the column */
c
onst
char
*
name
;
/* name of the column */
ulint
order
;
/* flags for ordering this field:
ulint
order
;
/* flags for ordering this field:
DICT_DESCEND, ... */
DICT_DESCEND, ... */
ulint
prefix_len
;
/* 0 or the length of the column
ulint
prefix_len
;
/* 0 or the length of the column
...
@@ -197,8 +199,8 @@ struct dict_index_struct{
...
@@ -197,8 +199,8 @@ struct dict_index_struct{
dulint
id
;
/* id of the index */
dulint
id
;
/* id of the index */
mem_heap_t
*
heap
;
/* memory heap */
mem_heap_t
*
heap
;
/* memory heap */
ulint
type
;
/* index type */
ulint
type
;
/* index type */
c
har
*
name
;
/* index name */
c
onst
char
*
name
;
/* index name */
c
har
*
table_name
;
/* table name */
c
onst
char
*
table_name
;
/* table name */
dict_table_t
*
table
;
/* back pointer to table */
dict_table_t
*
table
;
/* back pointer to table */
ulint
space
;
/* space where the index tree is placed */
ulint
space
;
/* space where the index tree is placed */
ulint
page_no
;
/* page number of the index tree root */
ulint
page_no
;
/* page number of the index tree root */
...
@@ -254,12 +256,12 @@ struct dict_foreign_struct{
...
@@ -254,12 +256,12 @@ struct dict_foreign_struct{
or DICT_FOREIGN_ON_DELETE_SET_NULL */
or DICT_FOREIGN_ON_DELETE_SET_NULL */
char
*
foreign_table_name
;
/* foreign table name */
char
*
foreign_table_name
;
/* foreign table name */
dict_table_t
*
foreign_table
;
/* table where the foreign key is */
dict_table_t
*
foreign_table
;
/* table where the foreign key is */
c
har
**
foreign_col_names
;
/* names of the columns in the
c
onst
char
**
foreign_col_names
;
/* names of the columns in the
foreign key */
foreign key */
char
*
referenced_table_name
;
/* referenced table name */
char
*
referenced_table_name
;
/* referenced table name */
dict_table_t
*
referenced_table
;
/* table where the referenced key
dict_table_t
*
referenced_table
;
/* table where the referenced key
is */
is */
c
har
**
referenced_col_names
;
/* names of the referenced
c
onst
char
**
referenced_col_names
;
/* names of the referenced
columns in the referenced table */
columns in the referenced table */
ulint
n_fields
;
/* number of indexes' first fields
ulint
n_fields
;
/* number of indexes' first fields
for which the the foreign key
for which the the foreign key
...
@@ -295,7 +297,7 @@ struct dict_table_struct{
...
@@ -295,7 +297,7 @@ struct dict_table_struct{
dulint
id
;
/* id of the table or cluster */
dulint
id
;
/* id of the table or cluster */
ulint
type
;
/* DICT_TABLE_ORDINARY, ... */
ulint
type
;
/* DICT_TABLE_ORDINARY, ... */
mem_heap_t
*
heap
;
/* memory heap */
mem_heap_t
*
heap
;
/* memory heap */
c
har
*
name
;
/* table name */
c
onst
char
*
name
;
/* table name */
ulint
space
;
/* space where the clustered index of the
ulint
space
;
/* space where the clustered index of the
table is placed */
table is placed */
ibool
ibd_file_missing
;
/* TRUE if this is in a single-table
ibool
ibd_file_missing
;
/* TRUE if this is in a single-table
...
@@ -363,7 +365,7 @@ struct dict_table_struct{
...
@@ -363,7 +365,7 @@ struct dict_table_struct{
byte
mix_id_buf
[
12
];
byte
mix_id_buf
[
12
];
/* mix id of a mixed table written in
/* mix id of a mixed table written in
a compressed form */
a compressed form */
c
har
*
cluster_name
;
/* if the table is a member in a
c
onst
char
*
cluster_name
;
/* if the table is a member in a
cluster, this is the name of the cluster */
cluster, this is the name of the cluster */
/*----------------------*/
/*----------------------*/
ibool
does_not_fit_in_memory
;
ibool
does_not_fit_in_memory
;
...
...
innobase/include/fil0fil.h
View file @
fff42272
...
@@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
...
@@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
void
fil_node_create
(
fil_node_create
(
/*============*/
/*============*/
char
*
name
,
/* in: file name (file must be closed) */
const
char
*
name
,
/* in: file name (file must be closed) */
ulint
size
,
/* in: file size in database blocks, rounded downwards
ulint
size
,
/* in: file size in database blocks, rounded
to an integer */
downwards to an integer */
ulint
id
,
/* in: space id where to append */
ulint
id
,
/* in: space id where to append */
ibool
is_raw
);
/* in: TRUE if a raw device or a raw disk partition */
ibool
is_raw
);
/* in: TRUE if a raw device or
a raw disk partition */
/********************************************************************
/********************************************************************
Drops files from the start of a file space, so that its size is cut by
Drops files from the start of a file space, so that its size is cut by
the amount given. */
the amount given. */
...
@@ -155,10 +156,10 @@ there is an error, prints an error message to the .err log. */
...
@@ -155,10 +156,10 @@ there is an error, prints an error message to the .err log. */
ibool
ibool
fil_space_create
(
fil_space_create
(
/*=============*/
/*=============*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
,
/* in: space name */
c
onst
c
har
*
name
,
/* in: space name */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
ulint
purpose
);
/* in: FIL_TABLESPACE, or FIL_LOG if log */
ulint
purpose
);
/* in: FIL_TABLESPACE, or FIL_LOG if log */
/***********************************************************************
/***********************************************************************
Frees a space object from a the tablespace memory cache. Closes the files in
Frees a space object from a the tablespace memory cache. Closes the files in
the chain but does not delete them. */
the chain but does not delete them. */
...
@@ -327,14 +328,15 @@ tablespace memory cache. */
...
@@ -327,14 +328,15 @@ tablespace memory cache. */
ibool
ibool
fil_rename_tablespace
(
fil_rename_tablespace
(
/*==================*/
/*==================*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
old_name
,
/* in: old table name in the standard
const
char
*
old_name
,
/* in: old table name in the standard
databasename/tablename format of InnoDB, or
databasename/tablename format of
NULL if we do the rename based on the space
InnoDB, or NULL if we do the rename
id only */
based on the space id only */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
char
*
new_name
);
/* in: new table name in the standard
const
char
*
new_name
);
/* in: new table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format
of InnoDB */
/***********************************************************************
/***********************************************************************
Creates a new single-table tablespace to a database directory of MySQL.
Creates a new single-table tablespace to a database directory of MySQL.
Database directories are under the 'datadir' of MySQL. The datadir is the
Database directories are under the 'datadir' of MySQL. The datadir is the
...
@@ -344,14 +346,16 @@ path '.'. */
...
@@ -344,14 +346,16 @@ path '.'. */
ulint
ulint
fil_create_new_single_table_tablespace
(
fil_create_new_single_table_tablespace
(
/*===================================*/
/*===================================*/
/* out: DB_SUCCESS or error code */
/* out: DB_SUCCESS or error code */
ulint
*
space_id
,
/* in/out: space id; if this is != 0, then
ulint
*
space_id
,
/* in/out: space id; if this is != 0,
this is an input parameter, otherwise
then this is an input parameter,
output */
otherwise output */
char
*
tablename
,
/* in: the table name in the usual
const
char
*
tablename
,
/* in: the table name in the usual
databasename/tablename format of InnoDB */
databasename/tablename format
ulint
size
);
/* in: the initial size of the tablespace file
of InnoDB */
in pages, must be > 0 */
ulint
size
);
/* in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
/************************************************************************
/************************************************************************
Tries to open a single-table tablespace and checks the space id is right in
Tries to open a single-table tablespace and checks the space id is right in
it. If does not succeed, prints an error message to the .err log. This
it. If does not succeed, prints an error message to the .err log. This
...
@@ -362,10 +366,10 @@ protection of the dictionary mutex, so that two users cannot race here. */
...
@@ -362,10 +366,10 @@ protection of the dictionary mutex, so that two users cannot race here. */
ibool
ibool
fil_open_single_table_tablespace
(
fil_open_single_table_tablespace
(
/*=============================*/
/*=============================*/
/* out: TRUE if success */
/* out: TRUE if success */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
c
har
*
name
);
/* in: table name in the databasename/tablenam
e
c
onst
char
*
name
);
/* in: table name in th
e
format */
databasename/tablename
format */
/************************************************************************
/************************************************************************
It is possible, though very improbable, that the lsn's in the tablespace to be
It is possible, though very improbable, that the lsn's in the tablespace to be
imported have risen above the current system lsn, if a lengthy purge, ibuf
imported have risen above the current system lsn, if a lengthy purge, ibuf
...
@@ -379,12 +383,12 @@ lsn's just by looking at that flush lsn. */
...
@@ -379,12 +383,12 @@ lsn's just by looking at that flush lsn. */
ibool
ibool
fil_reset_too_high_lsns
(
fil_reset_too_high_lsns
(
/*====================*/
/*====================*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
name
,
/* in: table name in the databasename/tablenam
e
c
onst
char
*
name
,
/* in: table name in th
e
format */
databasename/tablename
format */
dulint
current_lsn
);
/* in: reset lsn's if the lsn stamped to
dulint
current_lsn
);
/* in: reset lsn's if the lsn stamped
FIL_PAGE_FILE_FLUSH_LSN in the first page is
to FIL_PAGE_FILE_FLUSH_LSN in the
too high */
first page is
too high */
/************************************************************************
/************************************************************************
At the server startup, if we need crash recovery, scans the database
At the server startup, if we need crash recovery, scans the database
directories under the MySQL datadir, looking for .ibd files. Those files are
directories under the MySQL datadir, looking for .ibd files. Those files are
...
@@ -436,20 +440,22 @@ there may be many tablespaces which are not yet in the memory cache. */
...
@@ -436,20 +440,22 @@ there may be many tablespaces which are not yet in the memory cache. */
ibool
ibool
fil_space_for_table_exists_in_mem
(
fil_space_for_table_exists_in_mem
(
/*==============================*/
/*==============================*/
/* out: TRUE if a matching tablespace
/* out: TRUE if a matching tablespace
exists in the memory cache */
exists in the memory cache */
ulint
id
,
/* in: space id */
ulint
id
,
/* in: space id */
char
*
name
,
/* in: table name in the standard
const
char
*
name
,
/* in: table name in the standard
'databasename/tablename' format */
'databasename/tablename' format */
ibool
mark_space
,
/* in: in crash recovery, at database startup
ibool
mark_space
,
/* in: in crash recovery, at database
we mark all spaces which have an associated
startup we mark all spaces which have
table in the InnoDB data dictionary, so that
an associated table in the InnoDB
we can print a warning about orphaned
data dictionary, so that
tablespaces */
we can print a warning about orphaned
ibool
print_error_if_does_not_exist
);
tablespaces */
/* in: print detailed error information to
ibool
print_error_if_does_not_exist
);
the .err log if a matching tablespace is
/* in: print detailed error
not found from memory */
information to the .err log if a
matching tablespace is not found from
memory */
/**************************************************************************
/**************************************************************************
Tries to extend a data file so that it would accommodate the number of pages
Tries to extend a data file so that it would accommodate the number of pages
given. The tablespace must be cached in the memory cache. If the space is big
given. The tablespace must be cached in the memory cache. If the space is big
...
...
innobase/include/os0file.h
View file @
fff42272
...
@@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */
...
@@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_dir_t
os_file_opendir
(
os_file_opendir
(
/*============*/
/*============*/
/* out: directory stream, NULL if error */
/* out: directory stream, NULL if
char
*
dirname
,
/* in: directory name; it must not contain
error */
a trailing '\' or '/' */
const
char
*
dirname
,
/* in: directory name; it must not
ibool
error_is_fatal
);
/* in: TRUE if we should treat an error as a
contain a trailing '\' or '/' */
fatal error; if we try to open symlinks then
ibool
error_is_fatal
);
/* in: TRUE if we should treat an
we do not wish a fatal error if it happens
error as a fatal error; if we try to
not to be a directory */
open symlinks then we do not wish a
fatal error if it happens not to be
a directory */
/***************************************************************************
/***************************************************************************
Closes a directory stream. */
Closes a directory stream. */
...
@@ -201,7 +203,7 @@ os_file_readdir_next_file(
...
@@ -201,7 +203,7 @@ os_file_readdir_next_file(
/*======================*/
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
of the directory */
c
har
*
dirname
,
/* in: directory name or path */
c
onst
char
*
dirname
,
/* in: directory name or path */
os_file_dir_t
dir
,
/* in: directory stream */
os_file_dir_t
dir
,
/* in: directory stream */
os_file_stat_t
*
info
);
/* in/out: buffer where the info is returned */
os_file_stat_t
*
info
);
/* in/out: buffer where the info is returned */
/*********************************************************************
/*********************************************************************
...
@@ -213,81 +215,89 @@ fail_if_exists arguments is true. */
...
@@ -213,81 +215,89 @@ fail_if_exists arguments is true. */
ibool
ibool
os_file_create_directory
(
os_file_create_directory
(
/*=====================*/
/*=====================*/
/* out: TRUE if call succeeds, FALSE on
/* out: TRUE if call succeeds,
error */
FALSE on
error */
c
har
*
pathname
,
/* in: directory name as null-terminated
c
onst
char
*
pathname
,
/* in: directory name as
string */
null-terminated
string */
ibool
fail_if_exists
);
/* in: if TRUE, pre-existing directory is
ibool
fail_if_exists
);
/* in: if TRUE, pre-existing directory
treated as an error. */
is
treated as an error. */
/********************************************************************
/********************************************************************
A simple function to open or create a file. */
A simple function to open or create a file. */
os_file_t
os_file_t
os_file_create_simple
(
os_file_create_simple
(
/*==================*/
/*==================*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is
(if does not exist, error), or OS_FILE_CREATE if a new
opened (if does not exist, error), or
file is created (if exists, error), or
OS_FILE_CREATE if a new file is created
OS_FILE_CREATE_PATH if new file (if exists, error) and
(if exists, error), or
subdirectories along its path are created (if needed)*/
OS_FILE_CREATE_PATH if new file
ulint
access_type
,
/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
(if exists, error) and subdirectories along
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
its path are created (if needed)*/
ulint
access_type
,
/* in: OS_FILE_READ_ONLY or
OS_FILE_READ_WRITE */
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
/********************************************************************
/********************************************************************
A simple function to open or create a file. */
A simple function to open or create a file. */
os_file_t
os_file_t
os_file_create_simple_no_error_handling
(
os_file_create_simple_no_error_handling
(
/*====================================*/
/*====================================*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file
(if does not exist, error), or OS_FILE_CREATE if a new
is opened (if does not exist, error), or
file is created (if exists, error) */
OS_FILE_CREATE if a new file is created
ulint
access_type
,
/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
(if exists, error) */
OS_FILE_READ_ALLOW_DELETE; the last option is used by
ulint
access_type
,
/* in: OS_FILE_READ_ONLY,
a backup program reading the file */
OS_FILE_READ_WRITE, or
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
/********************************************************************
/********************************************************************
Opens an existing file or creates a new. */
Opens an existing file or creates a new. */
os_file_t
os_file_t
os_file_create
(
os_file_create
(
/*===========*/
/*===========*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file
(if does not exist, error), or OS_FILE_CREATE if a new
is opened (if does not exist, error), or
file is created (if exists, error), OS_FILE_OVERWRITE
OS_FILE_CREATE if a new file is created
if a new file is created or an old overwritten;
(if exists, error),
OS_FILE_OPEN_RAW, if a raw device or disk partition
OS_FILE_OVERWRITE if a new file is created
should be opened */
or an old overwritten;
ulint
purpose
,
/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
OS_FILE_OPEN_RAW, if a raw device or disk
is desired, OS_FILE_NORMAL, if any normal file;
partition should be opened */
NOTE that it also depends on type, os_aio_.. and srv_..
ulint
purpose
,
/* in: OS_FILE_AIO, if asynchronous,
variables whether we really use async i/o or
non-buffered i/o is desired,
unbuffered i/o: look in the function source code for
OS_FILE_NORMAL, if any normal file;
the exact rules */
NOTE that it also depends on type, os_aio_..
ulint
type
,
/* in: OS_DATA_FILE or OS_LOG_FILE */
and srv_.. variables whether we really use
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
async i/o or unbuffered i/o: look in the
function source code for the exact rules */
ulint
type
,
/* in: OS_DATA_FILE or OS_LOG_FILE */
ibool
*
success
);
/* out: TRUE if succeed, FALSE if error */
/***************************************************************************
/***************************************************************************
Deletes a file. The file has to be closed before calling this. */
Deletes a file. The file has to be closed before calling this. */
ibool
ibool
os_file_delete
(
os_file_delete
(
/*===========*/
/*===========*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
);
/* in: file path as a null-terminated string */
c
onst
c
har
*
name
);
/* in: file path as a null-terminated string */
/***************************************************************************
/***************************************************************************
Deletes a file if it exists. The file has to be closed before calling this. */
Deletes a file if it exists. The file has to be closed before calling this. */
...
@@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
...
@@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
ibool
ibool
os_file_delete_if_exists
(
os_file_delete_if_exists
(
/*=====================*/
/*=====================*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
);
/* in: file path as a null-terminated string */
c
onst
c
har
*
name
);
/* in: file path as a null-terminated string */
/***************************************************************************
/***************************************************************************
Renames a file (can also move it to another directory). It is safest that the
Renames a file (can also move it to another directory). It is safest that the
file is closed before calling this function. */
file is closed before calling this function. */
...
@@ -304,10 +314,10 @@ file is closed before calling this function. */
...
@@ -304,10 +314,10 @@ file is closed before calling this function. */
ibool
ibool
os_file_rename
(
os_file_rename
(
/*===========*/
/*===========*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
oldpath
,
/* in: old file path as a null-terminated
c
onst
char
*
oldpath
,
/* in: old file path as a
string */
null-terminated
string */
char
*
newpath
);
/* in: new file path */
c
onst
c
har
*
newpath
);
/* in: new file path */
/***************************************************************************
/***************************************************************************
Closes a file handle. In case of error, error number can be retrieved with
Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error. */
os_file_get_last_error. */
...
@@ -351,7 +361,7 @@ ibool
...
@@ -351,7 +361,7 @@ ibool
os_file_set_size
(
os_file_set_size
(
/*=============*/
/*=============*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
ulint
size
,
/* in: least significant 32 bits of file
ulint
size
,
/* in: least significant 32 bits of file
...
@@ -426,10 +436,10 @@ os_file_write(
...
@@ -426,10 +436,10 @@ os_file_write(
/*==========*/
/*==========*/
/* out: TRUE if request was
/* out: TRUE if request was
successful, FALSE if fail */
successful, FALSE if fail */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
void
*
buf
,
/* in: buffer from which to write */
const
void
*
buf
,
/* in: buffer from which to write */
ulint
offset
,
/* in: least significant 32 bits of file
ulint
offset
,
/* in: least significant 32 bits of file
offset where to write */
offset where to write */
ulint
offset_high
,
/* in: most significant 32 bits of
ulint
offset_high
,
/* in: most significant 32 bits of
...
@@ -442,8 +452,8 @@ ibool
...
@@ -442,8 +452,8 @@ ibool
os_file_status
(
os_file_status
(
/*===========*/
/*===========*/
/* out: TRUE if call succeeded */
/* out: TRUE if call succeeded */
c
har
*
path
,
/* in: pathname of the file */
c
onst
char
*
path
,
/* in: pathname of the file */
ibool
*
exists
,
/* out: TRUE if file exists */
ibool
*
exists
,
/* out: TRUE if file exists */
os_file_type_t
*
type
);
/* out: type of the file (if it exists) */
os_file_type_t
*
type
);
/* out: type of the file (if it exists) */
/********************************************************************
/********************************************************************
The function os_file_dirname returns a directory component of a
The function os_file_dirname returns a directory component of a
...
@@ -478,7 +488,7 @@ os_file_dirname(
...
@@ -478,7 +488,7 @@ os_file_dirname(
/*============*/
/*============*/
/* out, own: directory component of the
/* out, own: directory component of the
pathname */
pathname */
c
har
*
path
);
/* in: pathname */
c
onst
char
*
path
);
/* in: pathname */
/********************************************************************
/********************************************************************
Creates all missing subdirectories along the given path. */
Creates all missing subdirectories along the given path. */
...
@@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed(
...
@@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/*=============================*/
/* out: TRUE if call succeeded
/* out: TRUE if call succeeded
FALSE otherwise */
FALSE otherwise */
c
har
*
path
);
/* in: path name */
c
onst
char
*
path
);
/* in: path name */
/****************************************************************************
/****************************************************************************
Initializes the asynchronous io system. Creates separate aio array for
Initializes the asynchronous io system. Creates separate aio array for
non-ibuf read and write, a third aio array for the ibuf i/o, with just one
non-ibuf read and write, a third aio array for the ibuf i/o, with just one
...
@@ -527,7 +537,7 @@ os_aio(
...
@@ -527,7 +537,7 @@ os_aio(
because i/os are not actually handled until
because i/os are not actually handled until
all have been posted: use with great
all have been posted: use with great
caution! */
caution! */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
void
*
buf
,
/* in: buffer where to read or from which
void
*
buf
,
/* in: buffer where to read or from which
...
...
innobase/include/os0sync.h
View file @
fff42272
...
@@ -87,9 +87,9 @@ explicitly by calling sync_os_reset_event. */
...
@@ -87,9 +87,9 @@ explicitly by calling sync_os_reset_event. */
os_event_t
os_event_t
os_event_create
(
os_event_create
(
/*============*/
/*============*/
/* out: the event handle */
/* out: the event handle */
char
*
name
);
/* in: the name of the event, if NULL
c
onst
c
har
*
name
);
/* in: the name of the event, if NULL
the event is created without a name */
the event is created without a name */
#ifdef __WIN__
#ifdef __WIN__
/*************************************************************
/*************************************************************
Creates an auto-reset event semaphore, i.e., an event which is automatically
Creates an auto-reset event semaphore, i.e., an event which is automatically
...
@@ -98,9 +98,9 @@ reset when a single thread is released. Works only in Windows. */
...
@@ -98,9 +98,9 @@ reset when a single thread is released. Works only in Windows. */
os_event_t
os_event_t
os_event_create_auto
(
os_event_create_auto
(
/*=================*/
/*=================*/
/* out: the event handle */
/* out: the event handle */
char
*
name
);
/* in: the name of the event, if NULL
c
onst
c
har
*
name
);
/* in: the name of the event, if NULL
the event is created without a name */
the event is created without a name */
#endif
#endif
/**************************************************************
/**************************************************************
Sets an event semaphore to the signaled state: lets waiting threads
Sets an event semaphore to the signaled state: lets waiting threads
...
@@ -171,9 +171,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
...
@@ -171,9 +171,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
os_mutex_t
os_mutex_t
os_mutex_create
(
os_mutex_create
(
/*============*/
/*============*/
/* out: the mutex handle */
/* out: the mutex handle */
char
*
name
);
/* in: the name of the mutex, if NULL
c
onst
c
har
*
name
);
/* in: the name of the mutex, if NULL
the mutex is created without a name */
the mutex is created without a name */
/**************************************************************
/**************************************************************
Acquires ownership of a mutex semaphore. */
Acquires ownership of a mutex semaphore. */
...
...
innobase/include/pars0pars.h
View file @
fff42272
...
@@ -74,8 +74,8 @@ Parses an SQL string returning the query graph. */
...
@@ -74,8 +74,8 @@ Parses an SQL string returning the query graph. */
que_t
*
que_t
*
pars_sql
(
pars_sql
(
/*=====*/
/*=====*/
/* out, own: the query graph */
/* out, own: the query graph */
char
*
str
);
/* in: SQL string */
c
onst
c
har
*
str
);
/* in: SQL string */
/*****************************************************************
/*****************************************************************
Retrieves characters to the lexical analyzer. */
Retrieves characters to the lexical analyzer. */
...
...
innobase/include/pars0sym.h
View file @
fff42272
...
@@ -122,7 +122,7 @@ struct sym_node_struct{
...
@@ -122,7 +122,7 @@ struct sym_node_struct{
SYM_IMPLICIT_VAR,
SYM_IMPLICIT_VAR,
SYM_LIT, SYM_TABLE,
SYM_LIT, SYM_TABLE,
SYM_CURSOR, ... */
SYM_CURSOR, ... */
c
har
*
name
;
/* name of an id */
c
onst
char
*
name
;
/* name of an id */
ulint
name_len
;
/* id name length */
ulint
name_len
;
/* id name length */
dict_table_t
*
table
;
/* table definition
dict_table_t
*
table
;
/* table definition
if a table id or a
if a table id or a
...
@@ -150,7 +150,7 @@ struct sym_tab_struct{
...
@@ -150,7 +150,7 @@ struct sym_tab_struct{
que_t
*
query_graph
;
que_t
*
query_graph
;
/* query graph generated by the
/* query graph generated by the
parser */
parser */
c
har
*
sql_string
;
c
onst
char
*
sql_string
;
/* SQL string to parse */
/* SQL string to parse */
int
string_len
;
int
string_len
;
/* SQL string length */
/* SQL string length */
...
...
innobase/include/row0mysql.h
View file @
fff42272
...
@@ -316,15 +316,16 @@ fields than mentioned in the constraint. */
...
@@ -316,15 +316,16 @@ fields than mentioned in the constraint. */
int
int
row_table_add_foreign_constraints
(
row_table_add_foreign_constraints
(
/*==============================*/
/*==============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction */
trx_t
*
trx
,
/* in: transaction */
char
*
sql_string
,
/* in: table create statement where
c
onst
c
har
*
sql_string
,
/* in: table create statement where
foreign keys are declared like:
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
table2 can be written also with the
name before it: test.table2 */
database name before it: test.table2 */
char
*
name
);
/* in: table full name in the normalized form
const
char
*
name
);
/* in: table full name in the
database_name/table_name */
normalized form
database_name/table_name */
/*************************************************************************
/*************************************************************************
The master thread in srv0srv.c calls this regularly to drop tables which
The master thread in srv0srv.c calls this regularly to drop tables which
we must drop in background after queries to them have ended. Such lazy
we must drop in background after queries to them have ended. Such lazy
...
@@ -351,10 +352,10 @@ output by the master thread. */
...
@@ -351,10 +352,10 @@ output by the master thread. */
int
int
row_drop_table_for_mysql
(
row_drop_table_for_mysql
(
/*=====================*/
/*=====================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
ibool
drop_db
);
/* in: TRUE=dropping whole database */
ibool
drop_db
);
/* in: TRUE=dropping whole database */
/*************************************************************************
/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
Discards the tablespace of a table which stored in an .ibd file. Discarding
...
@@ -382,9 +383,9 @@ discard ongoing operations. */
...
@@ -382,9 +383,9 @@ discard ongoing operations. */
int
int
row_discard_tablespace_for_mysql
(
row_discard_tablespace_for_mysql
(
/*=============================*/
/*=============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
);
/* in: transaction handle */
trx_t
*
trx
);
/* in: transaction handle */
/*********************************************************************
/*********************************************************************
Imports a tablespace. The space id in the .ibd file must match the space id
Imports a tablespace. The space id in the .ibd file must match the space id
of the table in the data dictionary. */
of the table in the data dictionary. */
...
@@ -392,28 +393,28 @@ of the table in the data dictionary. */
...
@@ -392,28 +393,28 @@ of the table in the data dictionary. */
int
int
row_import_tablespace_for_mysql
(
row_import_tablespace_for_mysql
(
/*============================*/
/*============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
);
/* in: transaction handle */
trx_t
*
trx
);
/* in: transaction handle */
/*************************************************************************
/*************************************************************************
Drops a database for MySQL. */
Drops a database for MySQL. */
int
int
row_drop_database_for_mysql
(
row_drop_database_for_mysql
(
/*========================*/
/*========================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: database name which ends to '/' */
c
onst
c
har
*
name
,
/* in: database name which ends to '/' */
trx_t
*
trx
);
/* in: transaction handle */
trx_t
*
trx
);
/* in: transaction handle */
/*************************************************************************
/*************************************************************************
Renames a table for MySQL. */
Renames a table for MySQL. */
int
int
row_rename_table_for_mysql
(
row_rename_table_for_mysql
(
/*=======================*/
/*=======================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
old_name
,
/* in: old table name */
c
onst
c
har
*
old_name
,
/* in: old table name */
char
*
new_name
,
/* in: new table name */
c
onst
c
har
*
new_name
,
/* in: new table name */
trx_t
*
trx
);
/* in: transaction handle */
trx_t
*
trx
);
/* in: transaction handle */
/*************************************************************************
/*************************************************************************
Checks a table for corruption. */
Checks a table for corruption. */
...
...
innobase/include/row0sel.h
View file @
fff42272
...
@@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */
...
@@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */
ibool
ibool
row_search_check_if_query_cache_permitted
(
row_search_check_if_query_cache_permitted
(
/*======================================*/
/*======================================*/
/* out: TRUE if storing or retrieving from
/* out: TRUE if storing or retrieving
the query cache is permitted */
from
the query cache is permitted */
trx_t
*
trx
,
/* in: transaction object */
trx_t
*
trx
,
/* in: transaction object */
c
har
*
norm_name
);
/* in: concatenation of database name, '/'
c
onst
char
*
norm_name
);
/* in: concatenation of database name,
char, table name */
'/'
char, table name */
/* A structure for caching column values for prefetched rows */
/* A structure for caching column values for prefetched rows */
...
...
innobase/include/trx0roll.h
View file @
fff42272
...
@@ -193,7 +193,7 @@ trx_rollback_to_savepoint_for_mysql(
...
@@ -193,7 +193,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
otherwise DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
c
har
*
savepoint_name
,
/* in: savepoint name */
c
onst
char
*
savepoint_name
,
/* in: savepoint name */
ib_longlong
*
mysql_binlog_cache_pos
);
/* out: the MySQL binlog cache
ib_longlong
*
mysql_binlog_cache_pos
);
/* out: the MySQL binlog cache
position corresponding to this
position corresponding to this
savepoint; MySQL needs this
savepoint; MySQL needs this
...
@@ -211,7 +211,7 @@ trx_savepoint_for_mysql(
...
@@ -211,7 +211,7 @@ trx_savepoint_for_mysql(
/*====================*/
/*====================*/
/* out: always DB_SUCCESS */
/* out: always DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
c
har
*
savepoint_name
,
/* in: savepoint name */
c
onst
char
*
savepoint_name
,
/* in: savepoint name */
ib_longlong
binlog_cache_pos
);
/* in: MySQL binlog cache
ib_longlong
binlog_cache_pos
);
/* in: MySQL binlog cache
position corresponding to this
position corresponding to this
connection at the time of the
connection at the time of the
...
...
innobase/include/trx0sys.h
View file @
fff42272
...
@@ -258,7 +258,7 @@ replication has proceeded. */
...
@@ -258,7 +258,7 @@ replication has proceeded. */
void
void
trx_sys_update_mysql_binlog_offset
(
trx_sys_update_mysql_binlog_offset
(
/*===============================*/
/*===============================*/
c
har
*
file_name
,
/* in: MySQL log file name */
c
onst
char
*
file_name
,
/* in: MySQL log file name */
ib_longlong
offset
,
/* in: position in that log file */
ib_longlong
offset
,
/* in: position in that log file */
ulint
field
,
/* in: offset of the MySQL log info field in
ulint
field
,
/* in: offset of the MySQL log info field in
the trx sys header */
the trx sys header */
...
...
innobase/include/trx0trx.h
View file @
fff42272
...
@@ -315,7 +315,7 @@ struct trx_struct{
...
@@ -315,7 +315,7 @@ struct trx_struct{
ulint
magic_n
;
ulint
magic_n
;
/* All the next fields are protected by the kernel mutex, except the
/* All the next fields are protected by the kernel mutex, except the
undo logs which are protected by undo_mutex */
undo logs which are protected by undo_mutex */
c
har
*
op_info
;
/* English text describing the
c
onst
char
*
op_info
;
/* English text describing the
current operation, or an empty
current operation, or an empty
string */
string */
ulint
type
;
/* TRX_USER, TRX_PURGE */
ulint
type
;
/* TRX_USER, TRX_PURGE */
...
@@ -358,7 +358,7 @@ struct trx_struct{
...
@@ -358,7 +358,7 @@ struct trx_struct{
char
**
mysql_query_str
;
/* pointer to the field in mysqld_thd
char
**
mysql_query_str
;
/* pointer to the field in mysqld_thd
which contains the pointer to the
which contains the pointer to the
current SQL query string */
current SQL query string */
c
har
*
mysql_log_file_name
;
c
onst
char
*
mysql_log_file_name
;
/* if MySQL binlog is used, this field
/* if MySQL binlog is used, this field
contains a pointer to the latest file
contains a pointer to the latest file
name; this is NULL if binlog is not
name; this is NULL if binlog is not
...
@@ -366,7 +366,7 @@ struct trx_struct{
...
@@ -366,7 +366,7 @@ struct trx_struct{
ib_longlong
mysql_log_offset
;
/* if MySQL binlog is used, this field
ib_longlong
mysql_log_offset
;
/* if MySQL binlog is used, this field
contains the end offset of the binlog
contains the end offset of the binlog
entry */
entry */
c
har
*
mysql_master_log_file_name
;
c
onst
char
*
mysql_master_log_file_name
;
/* if the database server is a MySQL
/* if the database server is a MySQL
replication slave, we have here the
replication slave, we have here the
master binlog name up to which
master binlog name up to which
...
...
innobase/include/ut0rnd.h
View file @
fff42272
...
@@ -92,17 +92,17 @@ UNIV_INLINE
...
@@ -92,17 +92,17 @@ UNIV_INLINE
ulint
ulint
ut_fold_string
(
ut_fold_string
(
/*===========*/
/*===========*/
/* out: folded value */
/* out: folded value */
char
*
str
);
/* in: null-terminated string */
c
onst
c
har
*
str
);
/* in: null-terminated string */
/*****************************************************************
/*****************************************************************
Folds a binary string. */
Folds a binary string. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
ut_fold_binary
(
ut_fold_binary
(
/*===========*/
/*===========*/
/* out: folded value */
/* out: folded value */
byte
*
str
,
/* in: string of bytes */
const
byte
*
str
,
/* in: string of bytes */
ulint
len
);
/* in: length */
ulint
len
);
/* in: length */
/***************************************************************
/***************************************************************
Looks for a prime number slightly greater than the given argument.
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2. */
The prime is chosen so that it is not near any power of 2. */
...
...
innobase/include/ut0rnd.ic
View file @
fff42272
...
@@ -173,8 +173,8 @@ UNIV_INLINE
...
@@ -173,8 +173,8 @@ UNIV_INLINE
ulint
ulint
ut_fold_string(
ut_fold_string(
/*===========*/
/*===========*/
/* out: folded value */
/* out: folded value */
char* str) /* in: null-terminated string */
c
onst c
har* str) /* in: null-terminated string */
{
{
#ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
ulint i = 0;
ulint i = 0;
...
@@ -203,9 +203,9 @@ UNIV_INLINE
...
@@ -203,9 +203,9 @@ UNIV_INLINE
ulint
ulint
ut_fold_binary(
ut_fold_binary(
/*===========*/
/*===========*/
/* out: folded value */
/* out: folded value */
byte* str, /* in: string of bytes */
const
byte* str, /* in: string of bytes */
ulint len) /* in: length */
ulint
len) /* in: length */
{
{
ulint i;
ulint i;
ulint fold = 0;
ulint fold = 0;
...
...
innobase/include/ut0ut.h
View file @
fff42272
...
@@ -17,21 +17,6 @@ Created 1/20/1994 Heikki Tuuri
...
@@ -17,21 +17,6 @@ Created 1/20/1994 Heikki Tuuri
typedef
time_t
ib_time_t
;
typedef
time_t
ib_time_t
;
/************************************************************
On the 64-bit Windows we substitute the format string
%l -> %I64
because we define ulint as unsigned __int64 and lint as __int64 on Windows,
and both the Microsoft and Intel C compilers require the format string
%I64 in that case instead of %l. */
int
ut_printf
(
/*======*/
/* out: the number of characters written, or
negative in case of an error */
const
char
*
format
,
/* in: format of prints */
...);
/* in: arguments to be printed */
/************************************************************
/************************************************************
On the 64-bit Windows we substitute the format string
On the 64-bit Windows we substitute the format string
%l -> %I64
%l -> %I64
...
...
innobase/os/os0file.c
View file @
fff42272
...
@@ -70,7 +70,7 @@ struct os_aio_slot_struct{
...
@@ -70,7 +70,7 @@ struct os_aio_slot_struct{
bytes */
bytes */
ulint
offset_high
;
/* 32 high bits of file offset */
ulint
offset_high
;
/* 32 high bits of file offset */
os_file_t
file
;
/* file where to read or write */
os_file_t
file
;
/* file where to read or write */
c
har
*
name
;
/* file name or path */
c
onst
char
*
name
;
/* file name or path */
ibool
io_already_done
;
/* used only in simulated aio:
ibool
io_already_done
;
/* used only in simulated aio:
TRUE if the physical i/o already
TRUE if the physical i/o already
made and only the slot message
made and only the slot message
...
@@ -415,7 +415,7 @@ os_file_handle_error_no_exit(
...
@@ -415,7 +415,7 @@ os_file_handle_error_no_exit(
/* out: TRUE if we should retry the
/* out: TRUE if we should retry the
operation */
operation */
os_file_t
file
,
/* in: file pointer */
os_file_t
file
,
/* in: file pointer */
c
har
*
name
,
/* in: name of a file or NULL */
c
onst
char
*
name
,
/* in: name of a file or NULL */
const
char
*
operation
)
/* in: operation */
const
char
*
operation
)
/* in: operation */
{
{
ulint
err
;
ulint
err
;
...
@@ -493,13 +493,15 @@ and '..' items at the start of the directory listing. */
...
@@ -493,13 +493,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_dir_t
os_file_opendir
(
os_file_opendir
(
/*============*/
/*============*/
/* out: directory stream, NULL if error */
/* out: directory stream, NULL if
char
*
dirname
,
/* in: directory name; it must not contain
error */
a trailing '\' or '/' */
const
char
*
dirname
,
/* in: directory name; it must not
ibool
error_is_fatal
)
/* in: TRUE if we should treat an error as a
contain a trailing '\' or '/' */
fatal error; if we try to open symlinks then
ibool
error_is_fatal
)
/* in: TRUE if we should treat an
we do not wish a fatal error if it happens
error as a fatal error; if we try to
not to be a directory */
open symlinks then we do not wish a
fatal error if it happens not to be
a directory */
{
{
os_file_dir_t
dir
;
os_file_dir_t
dir
;
#ifdef __WIN__
#ifdef __WIN__
...
@@ -585,7 +587,7 @@ os_file_readdir_next_file(
...
@@ -585,7 +587,7 @@ os_file_readdir_next_file(
/*======================*/
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
of the directory */
c
har
*
dirname
,
/* in: directory name or path */
c
onst
char
*
dirname
,
/* in: directory name or path */
os_file_dir_t
dir
,
/* in: directory stream */
os_file_dir_t
dir
,
/* in: directory stream */
os_file_stat_t
*
info
)
/* in/out: buffer where the info is returned */
os_file_stat_t
*
info
)
/* in/out: buffer where the info is returned */
{
{
...
@@ -704,12 +706,12 @@ fail_if_exists arguments is true. */
...
@@ -704,12 +706,12 @@ fail_if_exists arguments is true. */
ibool
ibool
os_file_create_directory
(
os_file_create_directory
(
/*=====================*/
/*=====================*/
/* out: TRUE if call succeeds, FALSE on
/* out: TRUE if call succeeds,
error */
FALSE on
error */
c
har
*
pathname
,
/* in: directory name as null-terminated
c
onst
char
*
pathname
,
/* in: directory name as
string */
null-terminated
string */
ibool
fail_if_exists
)
/* in: if TRUE, pre-existing directory is
ibool
fail_if_exists
)
/* in: if TRUE, pre-existing directory
treated as an error. */
is
treated as an error. */
{
{
#ifdef __WIN__
#ifdef __WIN__
BOOL
rcode
;
BOOL
rcode
;
...
@@ -746,18 +748,21 @@ A simple function to open or create a file. */
...
@@ -746,18 +748,21 @@ A simple function to open or create a file. */
os_file_t
os_file_t
os_file_create_simple
(
os_file_create_simple
(
/*==================*/
/*==================*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is
(if does not exist, error), or OS_FILE_CREATE if a new
opened (if does not exist, error), or
file is created (if exists, error), or
OS_FILE_CREATE if a new file is created
OS_FILE_CREATE_PATH if new file (if exists, error) and
(if exists, error), or
subdirectories along its path are created (if needed)*/
OS_FILE_CREATE_PATH if new file
ulint
access_type
,
/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
(if exists, error) and subdirectories along
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
its path are created (if needed)*/
ulint
access_type
,
/* in: OS_FILE_READ_ONLY or
OS_FILE_READ_WRITE */
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
{
{
#ifdef __WIN__
#ifdef __WIN__
os_file_t
file
;
os_file_t
file
;
...
@@ -882,18 +887,20 @@ A simple function to open or create a file. */
...
@@ -882,18 +887,20 @@ A simple function to open or create a file. */
os_file_t
os_file_t
os_file_create_simple_no_error_handling
(
os_file_create_simple_no_error_handling
(
/*====================================*/
/*====================================*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file
(if does not exist, error), or OS_FILE_CREATE if a new
is opened (if does not exist, error), or
file is created (if exists, error) */
OS_FILE_CREATE if a new file is created
ulint
access_type
,
/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
(if exists, error) */
OS_FILE_READ_ALLOW_DELETE; the last option is used by
ulint
access_type
,
/* in: OS_FILE_READ_ONLY,
a backup program reading the file */
OS_FILE_READ_WRITE, or
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
{
{
#ifdef __WIN__
#ifdef __WIN__
os_file_t
file
;
os_file_t
file
;
...
@@ -991,25 +998,28 @@ Opens an existing file or creates a new. */
...
@@ -991,25 +998,28 @@ Opens an existing file or creates a new. */
os_file_t
os_file_t
os_file_create
(
os_file_create
(
/*===========*/
/*===========*/
/* out, own: handle to the file, not defined if error,
/* out, own: handle to the file, not defined
error number can be retrieved with
if error, error number can be retrieved with
os_file_get_last_error */
os_file_get_last_error */
char
*
name
,
/* in: name of the file or path as a null-terminated
const
char
*
name
,
/* in: name of the file or path as a
string */
null-terminated string */
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file is opened
ulint
create_mode
,
/* in: OS_FILE_OPEN if an existing file
(if does not exist, error), or OS_FILE_CREATE if a new
is opened (if does not exist, error), or
file is created (if exists, error), OS_FILE_OVERWRITE
OS_FILE_CREATE if a new file is created
if a new is created or an old overwritten,
(if exists, error),
OS_FILE_OPEN_RAW, if a raw device or disk partition
OS_FILE_OVERWRITE if a new file is created
should be opened */
or an old overwritten;
ulint
purpose
,
/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
OS_FILE_OPEN_RAW, if a raw device or disk
is desired, OS_FILE_NORMAL, if any normal file;
partition should be opened */
NOTE that it also depends on type, os_aio_.. and srv_..
ulint
purpose
,
/* in: OS_FILE_AIO, if asynchronous,
variables whether we really use async i/o or
non-buffered i/o is desired,
unbuffered i/o: look in the function source code for
OS_FILE_NORMAL, if any normal file;
the exact rules */
NOTE that it also depends on type, os_aio_..
ulint
type
,
/* in: OS_DATA_FILE or OS_LOG_FILE */
and srv_.. variables whether we really use
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
async i/o or unbuffered i/o: look in the
function source code for the exact rules */
ulint
type
,
/* in: OS_DATA_FILE or OS_LOG_FILE */
ibool
*
success
)
/* out: TRUE if succeed, FALSE if error */
{
{
#ifdef __WIN__
#ifdef __WIN__
os_file_t
file
;
os_file_t
file
;
...
@@ -1202,8 +1212,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
...
@@ -1202,8 +1212,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
ibool
ibool
os_file_delete_if_exists
(
os_file_delete_if_exists
(
/*=====================*/
/*=====================*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
)
/* in: file path as a null-terminated string */
c
onst
c
har
*
name
)
/* in: file path as a null-terminated string */
{
{
#ifdef __WIN__
#ifdef __WIN__
BOOL
ret
;
BOOL
ret
;
...
@@ -1263,8 +1273,8 @@ Deletes a file. The file has to be closed before calling this. */
...
@@ -1263,8 +1273,8 @@ Deletes a file. The file has to be closed before calling this. */
ibool
ibool
os_file_delete
(
os_file_delete
(
/*===========*/
/*===========*/
/* out: TRUE if success */
/* out: TRUE if success */
char
*
name
)
/* in: file path as a null-terminated string */
c
onst
c
har
*
name
)
/* in: file path as a null-terminated string */
{
{
#ifdef __WIN__
#ifdef __WIN__
BOOL
ret
;
BOOL
ret
;
...
@@ -1327,9 +1337,9 @@ ibool
...
@@ -1327,9 +1337,9 @@ ibool
os_file_rename
(
os_file_rename
(
/*===========*/
/*===========*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
oldpath
,
/* in: old file path as a null-terminated
c
onst
char
*
oldpath
,
/* in: old file path as a null-terminated
string */
string */
c
har
*
newpath
)
/* in: new file path */
c
onst
char
*
newpath
)
/* in: new file path */
{
{
#ifdef __WIN__
#ifdef __WIN__
BOOL
ret
;
BOOL
ret
;
...
@@ -1340,7 +1350,7 @@ os_file_rename(
...
@@ -1340,7 +1350,7 @@ os_file_rename(
return
(
TRUE
);
return
(
TRUE
);
}
}
os_file_handle_error
(
NULL
,
oldpath
,
"
delet
e"
);
os_file_handle_error
(
NULL
,
oldpath
,
"
renam
e"
);
return
(
FALSE
);
return
(
FALSE
);
#else
#else
...
@@ -1516,7 +1526,7 @@ ibool
...
@@ -1516,7 +1526,7 @@ ibool
os_file_set_size
(
os_file_set_size
(
/*=============*/
/*=============*/
/* out: TRUE if success */
/* out: TRUE if success */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
ulint
size
,
/* in: least significant 32 bits of file
ulint
size
,
/* in: least significant 32 bits of file
...
@@ -1777,7 +1787,7 @@ os_file_pwrite(
...
@@ -1777,7 +1787,7 @@ os_file_pwrite(
/*===========*/
/*===========*/
/* out: number of bytes written, -1 if error */
/* out: number of bytes written, -1 if error */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
void
*
buf
,
/* in: buffer from where to write */
const
void
*
buf
,
/* in: buffer from where to write */
ulint
n
,
/* in: number of bytes to write */
ulint
n
,
/* in: number of bytes to write */
ulint
offset
,
/* in: least significant 32 bits of file
ulint
offset
,
/* in: least significant 32 bits of file
offset where to write */
offset where to write */
...
@@ -2057,10 +2067,10 @@ os_file_write(
...
@@ -2057,10 +2067,10 @@ os_file_write(
/*==========*/
/*==========*/
/* out: TRUE if request was
/* out: TRUE if request was
successful, FALSE if fail */
successful, FALSE if fail */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
void
*
buf
,
/* in: buffer from which to write */
const
void
*
buf
,
/* in: buffer from which to write */
ulint
offset
,
/* in: least significant 32 bits of file
ulint
offset
,
/* in: least significant 32 bits of file
offset where to write */
offset where to write */
ulint
offset_high
,
/* in: most significant 32 bits of
ulint
offset_high
,
/* in: most significant 32 bits of
...
@@ -2214,7 +2224,7 @@ ibool
...
@@ -2214,7 +2224,7 @@ ibool
os_file_status
(
os_file_status
(
/*===========*/
/*===========*/
/* out: TRUE if call succeeded */
/* out: TRUE if call succeeded */
c
har
*
path
,
/* in: pathname of the file */
c
onst
char
*
path
,
/* in: pathname of the file */
ibool
*
exists
,
/* out: TRUE if file exists */
ibool
*
exists
,
/* out: TRUE if file exists */
os_file_type_t
*
type
)
/* out: type of the file (if it exists) */
os_file_type_t
*
type
)
/* out: type of the file (if it exists) */
{
{
...
@@ -2319,7 +2329,7 @@ os_file_dirname(
...
@@ -2319,7 +2329,7 @@ os_file_dirname(
/*============*/
/*============*/
/* out, own: directory component of the
/* out, own: directory component of the
pathname */
pathname */
c
har
*
path
)
/* in: pathname */
c
onst
char
*
path
)
/* in: pathname */
{
{
char
*
dir
;
char
*
dir
;
int
i
,
length
,
last_slash
;
int
i
,
length
,
last_slash
;
...
@@ -2356,7 +2366,7 @@ os_file_create_subdirs_if_needed(
...
@@ -2356,7 +2366,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/*=============================*/
/* out: TRUE if call succeeded
/* out: TRUE if call succeeded
FALSE otherwise */
FALSE otherwise */
c
har
*
path
)
/* in: path name */
c
onst
char
*
path
)
/* in: path name */
{
{
char
*
subdir
;
char
*
subdir
;
static
char
rootdir
[
2
]
=
{
OS_FILE_PATH_SEPARATOR
,
0
};
static
char
rootdir
[
2
]
=
{
OS_FILE_PATH_SEPARATOR
,
0
};
...
@@ -2753,7 +2763,7 @@ os_aio_array_reserve_slot(
...
@@ -2753,7 +2763,7 @@ os_aio_array_reserve_slot(
void
*
message2
,
/* in: message to be passed along with
void
*
message2
,
/* in: message to be passed along with
the aio operation */
the aio operation */
os_file_t
file
,
/* in: file handle */
os_file_t
file
,
/* in: file handle */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
void
*
buf
,
/* in: buffer where to read or from which
void
*
buf
,
/* in: buffer where to read or from which
to write */
to write */
...
@@ -3000,7 +3010,7 @@ os_aio(
...
@@ -3000,7 +3010,7 @@ os_aio(
because i/os are not actually handled until
because i/os are not actually handled until
all have been posted: use with great
all have been posted: use with great
caution! */
caution! */
c
har
*
name
,
/* in: name of the file or path as a
c
onst
char
*
name
,
/* in: name of the file or path as a
null-terminated string */
null-terminated string */
os_file_t
file
,
/* in: handle to a file */
os_file_t
file
,
/* in: handle to a file */
void
*
buf
,
/* in: buffer where to read or from which
void
*
buf
,
/* in: buffer where to read or from which
...
@@ -3543,6 +3553,7 @@ consecutive_loop:
...
@@ -3543,6 +3553,7 @@ consecutive_loop:
if
(
n_consecutive
==
1
)
{
if
(
n_consecutive
==
1
)
{
/* We can use the buffer of the i/o request */
/* We can use the buffer of the i/o request */
combined_buf
=
slot
->
buf
;
combined_buf
=
slot
->
buf
;
combined_buf2
=
NULL
;
}
else
{
}
else
{
combined_buf2
=
ut_malloc
(
total_len
+
UNIV_PAGE_SIZE
);
combined_buf2
=
ut_malloc
(
total_len
+
UNIV_PAGE_SIZE
);
...
@@ -3638,7 +3649,7 @@ consecutive_loop:
...
@@ -3638,7 +3649,7 @@ consecutive_loop:
}
}
}
}
if
(
n_consecutive
>
1
)
{
if
(
combined_buf2
)
{
ut_free
(
combined_buf2
);
ut_free
(
combined_buf2
);
}
}
...
...
innobase/os/os0sync.c
View file @
fff42272
...
@@ -109,9 +109,9 @@ must be reset explicitly by calling sync_os_reset_event. */
...
@@ -109,9 +109,9 @@ must be reset explicitly by calling sync_os_reset_event. */
os_event_t
os_event_t
os_event_create
(
os_event_create
(
/*============*/
/*============*/
/* out: the event handle */
/* out: the event handle */
char
*
name
)
/* in: the name of the event, if NULL
c
onst
c
har
*
name
)
/* in: the name of the event, if NULL
the event is created without a name */
the event is created without a name */
{
{
#ifdef __WIN__
#ifdef __WIN__
os_event_t
event
;
os_event_t
event
;
...
@@ -166,9 +166,9 @@ reset when a single thread is released. Works only in Windows. */
...
@@ -166,9 +166,9 @@ reset when a single thread is released. Works only in Windows. */
os_event_t
os_event_t
os_event_create_auto
(
os_event_create_auto
(
/*=================*/
/*=================*/
/* out: the event handle */
/* out: the event handle */
char
*
name
)
/* in: the name of the event, if NULL
c
onst
c
har
*
name
)
/* in: the name of the event, if NULL
the event is created without a name */
the event is created without a name */
{
{
os_event_t
event
;
os_event_t
event
;
...
@@ -430,9 +430,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
...
@@ -430,9 +430,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
os_mutex_t
os_mutex_t
os_mutex_create
(
os_mutex_create
(
/*============*/
/*============*/
/* out: the mutex handle */
/* out: the mutex handle */
char
*
name
)
/* in: the name of the mutex, if NULL
c
onst
c
har
*
name
)
/* in: the name of the mutex, if NULL
the mutex is created without a name */
the mutex is created without a name */
{
{
#ifdef __WIN__
#ifdef __WIN__
HANDLE
mutex
;
HANDLE
mutex
;
...
...
innobase/pars/pars0pars.c
View file @
fff42272
...
@@ -1729,8 +1729,8 @@ Parses an SQL string returning the query graph. */
...
@@ -1729,8 +1729,8 @@ Parses an SQL string returning the query graph. */
que_t
*
que_t
*
pars_sql
(
pars_sql
(
/*=====*/
/*=====*/
/* out, own: the query graph */
/* out, own: the query graph */
char
*
str
)
/* in: SQL string */
c
onst
c
har
*
str
)
/* in: SQL string */
{
{
sym_node_t
*
sym_node
;
sym_node_t
*
sym_node
;
mem_heap_t
*
heap
;
mem_heap_t
*
heap
;
...
...
innobase/pars/pars0sym.c
View file @
fff42272
...
@@ -217,13 +217,10 @@ sym_tab_add_id(
...
@@ -217,13 +217,10 @@ sym_tab_add_id(
node
->
common
.
type
=
QUE_NODE_SYMBOL
;
node
->
common
.
type
=
QUE_NODE_SYMBOL
;
node
->
name
=
mem_heap_alloc
(
sym_tab
->
heap
,
len
+
1
);
node
->
resolved
=
FALSE
;
node
->
resolved
=
FALSE
;
node
->
indirection
=
NULL
;
node
->
indirection
=
NULL
;
ut_memcpy
(
node
->
name
,
name
,
len
);
node
->
name
=
mem_heap_strdupl
(
sym_tab
->
heap
,
name
,
len
+
1
);
node
->
name
[
len
]
=
'\0'
;
node
->
name_len
=
len
;
node
->
name_len
=
len
;
UT_LIST_ADD_LAST
(
sym_list
,
sym_tab
->
sym_list
,
node
);
UT_LIST_ADD_LAST
(
sym_list
,
sym_tab
->
sym_list
,
node
);
...
...
innobase/row/row0mysql.c
View file @
fff42272
...
@@ -1686,15 +1686,16 @@ constraints which reference this table are ok. */
...
@@ -1686,15 +1686,16 @@ constraints which reference this table are ok. */
int
int
row_table_add_foreign_constraints
(
row_table_add_foreign_constraints
(
/*==============================*/
/*==============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction */
trx_t
*
trx
,
/* in: transaction */
char
*
sql_string
,
/* in: table create statement where
c
onst
c
har
*
sql_string
,
/* in: table create statement where
foreign keys are declared like:
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
table2 can be written also with the
name before it: test.table2 */
database name before it: test.table2 */
char
*
name
)
/* in: table full name in the normalized form
const
char
*
name
)
/* in: table full name in the
database_name/table_name */
normalized form
database_name/table_name */
{
{
ulint
err
;
ulint
err
;
...
@@ -1940,9 +1941,9 @@ discard ongoing operations. */
...
@@ -1940,9 +1941,9 @@ discard ongoing operations. */
int
int
row_discard_tablespace_for_mysql
(
row_discard_tablespace_for_mysql
(
/*=============================*/
/*=============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
)
/* in: transaction handle */
trx_t
*
trx
)
/* in: transaction handle */
{
{
dulint
new_id
;
dulint
new_id
;
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -2071,9 +2072,9 @@ of the table in the data dictionary. */
...
@@ -2071,9 +2072,9 @@ of the table in the data dictionary. */
int
int
row_import_tablespace_for_mysql
(
row_import_tablespace_for_mysql
(
/*============================*/
/*============================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
)
/* in: transaction handle */
trx_t
*
trx
)
/* in: transaction handle */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
ibool
success
;
ibool
success
;
...
@@ -2177,10 +2178,10 @@ the corresponding monitor output by the master thread. */
...
@@ -2177,10 +2178,10 @@ the corresponding monitor output by the master thread. */
int
int
row_drop_table_for_mysql
(
row_drop_table_for_mysql
(
/*=====================*/
/*=====================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: table name */
c
onst
c
har
*
name
,
/* in: table name */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
ibool
drop_db
)
/* in: TRUE=dropping whole database */
ibool
drop_db
)
/* in: TRUE=dropping whole database */
{
{
dict_foreign_t
*
foreign
;
dict_foreign_t
*
foreign
;
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -2519,9 +2520,9 @@ Drops a database for MySQL. */
...
@@ -2519,9 +2520,9 @@ Drops a database for MySQL. */
int
int
row_drop_database_for_mysql
(
row_drop_database_for_mysql
(
/*========================*/
/*========================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
name
,
/* in: database name which ends to '/' */
c
onst
c
har
*
name
,
/* in: database name which ends to '/' */
trx_t
*
trx
)
/* in: transaction handle */
trx_t
*
trx
)
/* in: transaction handle */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
char
*
table_name
;
char
*
table_name
;
...
@@ -2611,10 +2612,10 @@ Renames a table for MySQL. */
...
@@ -2611,10 +2612,10 @@ Renames a table for MySQL. */
int
int
row_rename_table_for_mysql
(
row_rename_table_for_mysql
(
/*=======================*/
/*=======================*/
/* out: error code or DB_SUCCESS */
/* out: error code or DB_SUCCESS */
char
*
old_name
,
/* in: old table name */
c
onst
c
har
*
old_name
,
/* in: old table name */
char
*
new_name
,
/* in: new table name */
c
onst
c
har
*
new_name
,
/* in: new table name */
trx_t
*
trx
)
/* in: transaction handle */
trx_t
*
trx
)
/* in: transaction handle */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
que_thr_t
*
thr
;
que_thr_t
*
thr
;
...
...
innobase/row/row0sel.c
View file @
fff42272
...
@@ -3585,11 +3585,11 @@ consistent read result, or store it to the query cache. */
...
@@ -3585,11 +3585,11 @@ consistent read result, or store it to the query cache. */
ibool
ibool
row_search_check_if_query_cache_permitted
(
row_search_check_if_query_cache_permitted
(
/*======================================*/
/*======================================*/
/* out: TRUE if storing or retrieving from
/* out: TRUE if storing or retrieving
the query cache is permitted */
from
the query cache is permitted */
trx_t
*
trx
,
/* in: transaction object */
trx_t
*
trx
,
/* in: transaction object */
c
har
*
norm_name
)
/* in: concatenation of database name, '/'
c
onst
char
*
norm_name
)
/* in: concatenation of database name,
char, table name */
'/'
char, table name */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
ibool
ret
=
FALSE
;
ibool
ret
=
FALSE
;
...
...
innobase/trx/trx0roll.c
View file @
fff42272
...
@@ -200,7 +200,7 @@ trx_rollback_to_savepoint_for_mysql(
...
@@ -200,7 +200,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
otherwise DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
c
har
*
savepoint_name
,
/* in: savepoint name */
c
onst
char
*
savepoint_name
,
/* in: savepoint name */
ib_longlong
*
mysql_binlog_cache_pos
)
/* out: the MySQL binlog cache
ib_longlong
*
mysql_binlog_cache_pos
)
/* out: the MySQL binlog cache
position corresponding to this
position corresponding to this
savepoint; MySQL needs this
savepoint; MySQL needs this
...
@@ -265,7 +265,7 @@ trx_savepoint_for_mysql(
...
@@ -265,7 +265,7 @@ trx_savepoint_for_mysql(
/*====================*/
/*====================*/
/* out: always DB_SUCCESS */
/* out: always DB_SUCCESS */
trx_t
*
trx
,
/* in: transaction handle */
trx_t
*
trx
,
/* in: transaction handle */
c
har
*
savepoint_name
,
/* in: savepoint name */
c
onst
char
*
savepoint_name
,
/* in: savepoint name */
ib_longlong
binlog_cache_pos
)
/* in: MySQL binlog cache
ib_longlong
binlog_cache_pos
)
/* in: MySQL binlog cache
position corresponding to this
position corresponding to this
connection at the time of the
connection at the time of the
...
...
innobase/trx/trx0sys.c
View file @
fff42272
...
@@ -569,7 +569,7 @@ replication has proceeded. */
...
@@ -569,7 +569,7 @@ replication has proceeded. */
void
void
trx_sys_update_mysql_binlog_offset
(
trx_sys_update_mysql_binlog_offset
(
/*===============================*/
/*===============================*/
c
har
*
file_name
,
/* in: MySQL log file name */
c
onst
char
*
file_name
,
/* in: MySQL log file name */
ib_longlong
offset
,
/* in: position in that log file */
ib_longlong
offset
,
/* in: position in that log file */
ulint
field
,
/* in: offset of the MySQL log info field in
ulint
field
,
/* in: offset of the MySQL log info field in
the trx sys header */
the trx sys header */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment