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
8235c4e1
Commit
8235c4e1
authored
Feb 28, 2012
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1 to mysql-5.5.
parents
a44974ab
1bd0c9b5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
57 deletions
+85
-57
storage/innobase/btr/btr0btr.c
storage/innobase/btr/btr0btr.c
+15
-11
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0dict.c
+17
-5
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+9
-3
storage/innobase/include/btr0btr.h
storage/innobase/include/btr0btr.h
+5
-2
storage/innobase/include/dict0dict.h
storage/innobase/include/dict0dict.h
+3
-11
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+3
-18
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+6
-4
storage/innobase/row/row0mysql.c
storage/innobase/row/row0mysql.c
+27
-3
No files found.
storage/innobase/btr/btr0btr.c
View file @
8235c4e1
...
...
@@ -1012,45 +1012,49 @@ btr_page_alloc(
/**************************************************************//**
Gets the number of pages in a B-tree.
@return number of pages */
@return number of pages
, or ULINT_UNDEFINED if the index is unavailable
*/
UNIV_INTERN
ulint
btr_get_size
(
/*=========*/
dict_index_t
*
index
,
/*!< in: index */
ulint
flag
)
/*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
ulint
flag
,
/*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t
*
mtr
)
/*!< in/out: mini-transaction where index
is s-latched */
{
fseg_header_t
*
seg_header
;
page_t
*
root
;
ulint
n
;
ulint
dummy
;
mtr_t
mtr
;
mtr_start
(
&
mtr
);
ut_ad
(
mtr_memo_contains
(
mtr
,
dict_index_get_lock
(
index
),
MTR_MEMO_S_LOCK
));
mtr_s_lock
(
dict_index_get_lock
(
index
),
&
mtr
);
if
(
index
->
page
==
FIL_NULL
||
index
->
to_be_dropped
||
*
index
->
name
==
TEMP_INDEX_PREFIX
)
{
return
(
ULINT_UNDEFINED
);
}
root
=
btr_root_get
(
index
,
&
mtr
);
root
=
btr_root_get
(
index
,
mtr
);
if
(
flag
==
BTR_N_LEAF_PAGES
)
{
seg_header
=
root
+
PAGE_HEADER
+
PAGE_BTR_SEG_LEAF
;
fseg_n_reserved_pages
(
seg_header
,
&
n
,
&
mtr
);
fseg_n_reserved_pages
(
seg_header
,
&
n
,
mtr
);
}
else
if
(
flag
==
BTR_TOTAL_SIZE
)
{
seg_header
=
root
+
PAGE_HEADER
+
PAGE_BTR_SEG_TOP
;
n
=
fseg_n_reserved_pages
(
seg_header
,
&
dummy
,
&
mtr
);
n
=
fseg_n_reserved_pages
(
seg_header
,
&
dummy
,
mtr
);
seg_header
=
root
+
PAGE_HEADER
+
PAGE_BTR_SEG_LEAF
;
n
+=
fseg_n_reserved_pages
(
seg_header
,
&
dummy
,
&
mtr
);
n
+=
fseg_n_reserved_pages
(
seg_header
,
&
dummy
,
mtr
);
}
else
{
ut_error
;
}
mtr_commit
(
&
mtr
);
return
(
n
);
}
...
...
storage/innobase/dict/dict0dict.c
View file @
8235c4e1
...
...
@@ -4337,16 +4337,27 @@ dict_update_statistics(
(
srv_force_recovery
<
SRV_FORCE_NO_IBUF_MERGE
||
(
srv_force_recovery
<
SRV_FORCE_NO_LOG_REDO
&&
dict_index_is_clust
(
index
))))
{
mtr_t
mtr
;
ulint
size
;
size
=
btr_get_size
(
index
,
BTR_TOTAL_SIZE
);
index
->
stat_index_size
=
size
;
mtr_start
(
&
mtr
);
mtr_s_lock
(
dict_index_get_lock
(
index
),
&
mtr
);
s
um_of_index_sizes
+=
size
;
s
ize
=
btr_get_size
(
index
,
BTR_TOTAL_SIZE
,
&
mtr
)
;
size
=
btr_get_size
(
index
,
BTR_N_LEAF_PAGES
);
if
(
size
!=
ULINT_UNDEFINED
)
{
sum_of_index_sizes
+=
size
;
index
->
stat_index_size
=
size
;
size
=
btr_get_size
(
index
,
BTR_N_LEAF_PAGES
,
&
mtr
);
}
mtr_commit
(
&
mtr
);
if
(
size
==
0
)
{
switch
(
size
)
{
case
ULINT_UNDEFINED
:
goto
fake_statistics
;
case
0
:
/* The root node of the tree is a leaf */
size
=
1
;
}
...
...
@@ -4363,6 +4374,7 @@ dict_update_statistics(
various means, also via secondary indexes. */
ulint
i
;
fake_statistics:
sum_of_index_sizes
++
;
index
->
stat_index_size
=
index
->
stat_n_leaf_pages
=
1
;
...
...
storage/innobase/handler/handler0alter.cc
View file @
8235c4e1
/*****************************************************************************
Copyright (c) 2005, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 2005, 201
2, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -1143,7 +1143,9 @@ ha_innobase::prepare_drop_index(
goto
func_exit
;
}
rw_lock_x_lock
(
dict_index_get_lock
(
index
));
index
->
to_be_dropped
=
TRUE
;
rw_lock_x_unlock
(
dict_index_get_lock
(
index
));
}
/* If FOREIGN_KEY_CHECKS = 1 you may not drop an index defined
...
...
@@ -1262,7 +1264,9 @@ func_exit:
=
dict_table_get_first_index
(
prebuilt
->
table
);
do
{
rw_lock_x_lock
(
dict_index_get_lock
(
index
));
index
->
to_be_dropped
=
FALSE
;
rw_lock_x_unlock
(
dict_index_get_lock
(
index
));
index
=
dict_table_get_next_index
(
index
);
}
while
(
index
);
}
...
...
@@ -1322,7 +1326,9 @@ ha_innobase::final_drop_index(
for
(
index
=
dict_table_get_first_index
(
prebuilt
->
table
);
index
;
index
=
dict_table_get_next_index
(
index
))
{
rw_lock_x_lock
(
dict_index_get_lock
(
index
));
index
->
to_be_dropped
=
FALSE
;
rw_lock_x_unlock
(
dict_index_get_lock
(
index
));
}
goto
func_exit
;
...
...
storage/innobase/include/btr0btr.h
View file @
8235c4e1
...
...
@@ -567,13 +567,16 @@ btr_parse_page_reorganize(
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Gets the number of pages in a B-tree.
@return number of pages */
@return number of pages
, or ULINT_UNDEFINED if the index is unavailable
*/
UNIV_INTERN
ulint
btr_get_size
(
/*=========*/
dict_index_t
*
index
,
/*!< in: index */
ulint
flag
);
/*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
ulint
flag
,
/*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t
*
mtr
)
/*!< in/out: mini-transaction where index
is s-latched */
__attribute__
((
nonnull
,
warn_unused_result
));
/**************************************************************//**
Allocates a new file page to be used in an index tree. NOTE: we assume
that the caller has made the reservation for free extents!
...
...
storage/innobase/include/dict0dict.h
View file @
8235c4e1
/*****************************************************************************
Copyright (c) 1996, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 20
12, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -1087,14 +1087,6 @@ dict_index_get_page(
/*================*/
const
dict_index_t
*
tree
);
/*!< in: index */
/*********************************************************************//**
Sets the page number of the root of index tree. */
UNIV_INLINE
void
dict_index_set_page
(
/*================*/
dict_index_t
*
index
,
/*!< in/out: index */
ulint
page
);
/*!< in: page number */
/*********************************************************************//**
Gets the read-write lock of the index tree.
@return read-write lock */
UNIV_INLINE
...
...
storage/innobase/include/dict0dict.ic
View file @
8235c4e1
/*****************************************************************************
Copyright (c) 1996, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 20
12, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -761,21 +761,6 @@ dict_index_get_page(
return(index->page);
}
/*********************************************************************//**
Sets the page number of the root of index tree. */
UNIV_INLINE
void
dict_index_set_page(
/*================*/
dict_index_t* index, /*!< in/out: index */
ulint page) /*!< in: page number */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
index->page = page;
}
/*********************************************************************//**
Gets the read-write lock of the index tree.
@return read-write lock */
...
...
storage/innobase/include/dict0mem.h
View file @
8235c4e1
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
2, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -396,7 +396,9 @@ struct dict_index_struct{
unsigned
to_be_dropped
:
1
;
/*!< TRUE if this index is marked to be
dropped in ha_innobase::prepare_drop_index(),
otherwise FALSE */
otherwise FALSE. Protected by
dict_sys->mutex, dict_operation_lock and
index->lock.*/
dict_field_t
*
fields
;
/*!< array of field descriptions */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T
(
dict_index_t
)
...
...
storage/innobase/row/row0mysql.c
View file @
8235c4e1
/*****************************************************************************
Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -3075,6 +3075,7 @@ row_drop_table_for_mysql(
{
dict_foreign_t
*
foreign
;
dict_table_t
*
table
;
dict_index_t
*
index
;
ulint
space_id
;
ulint
err
;
const
char
*
table_name
;
...
...
@@ -3368,6 +3369,18 @@ check_next_foreign:
"END;
\n
"
,
FALSE
,
trx
);
/* Mark all indexes unavailable in the data dictionary cache
before starting to drop the table. */
for
(
index
=
dict_table_get_first_index
(
table
);
index
!=
NULL
;
index
=
dict_table_get_next_index
(
index
))
{
rw_lock_x_lock
(
dict_index_get_lock
(
index
));
ut_ad
(
!
index
->
to_be_dropped
);
index
->
to_be_dropped
=
TRUE
;
rw_lock_x_unlock
(
dict_index_get_lock
(
index
));
}
switch
(
err
)
{
ibool
is_temp
;
const
char
*
name_or_path
;
...
...
@@ -3447,6 +3460,17 @@ check_next_foreign:
the undo log. We can directly exit here
and return the DB_TOO_MANY_CONCURRENT_TRXS
error. */
/* Mark all indexes available in the data dictionary
cache again. */
for
(
index
=
dict_table_get_first_index
(
table
);
index
!=
NULL
;
index
=
dict_table_get_next_index
(
index
))
{
rw_lock_x_lock
(
dict_index_get_lock
(
index
));
index
->
to_be_dropped
=
FALSE
;
rw_lock_x_unlock
(
dict_index_get_lock
(
index
));
}
break
;
case
DB_OUT_OF_FILE_SPACE
:
...
...
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