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
3ce20ed4
Commit
3ce20ed4
authored
Mar 09, 2012
by
Annamalai Gurusami
Browse files
Options
Browse Files
Download
Plain Diff
Merging from mysql-5.1 to mysql-5.5.
parents
26ab3d12
29aaa658
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
28 deletions
+67
-28
mysql-test/suite/innodb/r/innodb_bug11766634.result
mysql-test/suite/innodb/r/innodb_bug11766634.result
+6
-0
mysql-test/suite/innodb/t/innodb_bug11766634-master.opt
mysql-test/suite/innodb/t/innodb_bug11766634-master.opt
+1
-0
mysql-test/suite/innodb/t/innodb_bug11766634.test
mysql-test/suite/innodb/t/innodb_bug11766634.test
+51
-0
storage/innobase/fsp/fsp0fsp.c
storage/innobase/fsp/fsp0fsp.c
+9
-28
No files found.
mysql-test/suite/innodb/r/innodb_bug11766634.result
0 → 100644
View file @
3ce20ed4
create table t1 (f1 char(255)) engine innodb;
ibdata1 size: 27262976 bytes
drop table t1;
create table t1 (f1 char(255)) engine innodb;
ibdata1 size: 27262976 bytes
drop table t1;
mysql-test/suite/innodb/t/innodb_bug11766634-master.opt
0 → 100644
View file @
3ce20ed4
--force-restart
mysql-test/suite/innodb/t/innodb_bug11766634.test
0 → 100644
View file @
3ce20ed4
# Bug 11766634 59783: InnoDB data grows unexpectedly when inserting,
# truncating, inserting the same set of rows.
#
# Scenario:
# create table t1. Insert $recs records. check size of ibdata1.
# drop table t1. create table t1. Insert the same set of $recs
# records. The size of ibdata1 must not increase.
#
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_innodb
.
inc
create
table
t1
(
f1
char
(
255
))
engine
innodb
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
let
IBDATA1
=
$MYSQLD_DATADIR
/
ibdata1
;
let
$recs
=
36262
;
--
disable_query_log
let
$c
=
$recs
;
while
(
$c
)
{
insert
into
t1
values
(
'Hello World'
);
dec
$c
;
}
--
enable_query_log
perl
;
my
$filesize
=
-
s
$ENV
{
'IBDATA1'
};
print
"ibdata1 size:
$filesize
bytes
\n
"
;
EOF
drop
table
t1
;
create
table
t1
(
f1
char
(
255
))
engine
innodb
;
--
disable_query_log
let
$c
=
$recs
;
while
(
$c
)
{
insert
into
t1
values
(
'Hello World'
);
dec
$c
;
}
--
enable_query_log
perl
;
my
$filesize
=
-
s
$ENV
{
'IBDATA1'
};
print
"ibdata1 size:
$filesize
bytes
\n
"
;
EOF
drop
table
t1
;
storage/innobase/fsp/fsp0fsp.c
View file @
3ce20ed4
...
...
@@ -211,15 +211,13 @@ fseg_n_reserved_pages_low(
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
static
static
__attribute__
((
nonnull
))
void
fseg_mark_page_used
(
/*================*/
fseg_inode_t
*
seg_inode
,
/*!< in: segment inode */
ulint
space
,
/*!< in: space id */
ulint
zip_size
,
/*!< in: compressed page size in bytes
or 0 for uncompressed pages */
ulint
page
,
/*!< in: page offset */
xdes_t
*
descr
,
/* extent descriptor */
mtr_t
*
mtr
);
/*!< in: mtr */
/**********************************************************************//**
Returns the first extent descriptor for a segment. We think of the extent
...
...
@@ -643,12 +641,10 @@ xdes_calc_descriptor_index(
/********************************************************************//**
Gets pointer to a the extent descriptor of a page. The page where the extent
descriptor resides is x-locked. If the page offset is equal to the free limit
of the space, adds new extents from above the free limit to the space free
list, if not free limit == space size. This adding is necessary to make the
descriptor defined, as they are uninitialized above the free limit.
descriptor resides is x-locked. This function no longer extends the data
file.
@return pointer to the extent descriptor, NULL if the page does not
exist in the space or if the offset
exceeds
the free limit */
exist in the space or if the offset
is >=
the free limit */
UNIV_INLINE
__attribute__
((
nonnull
,
warn_unused_result
))
xdes_t
*
xdes_get_descriptor_with_space_hdr
(
...
...
@@ -678,19 +674,10 @@ xdes_get_descriptor_with_space_hdr(
zip_size
=
dict_table_flags_to_zip_size
(
mach_read_from_4
(
sp_header
+
FSP_SPACE_FLAGS
));
/* If offset is >= size or > limit, return NULL */
if
((
offset
>=
size
)
||
(
offset
>
limit
))
{
if
((
offset
>=
size
)
||
(
offset
>=
limit
))
{
return
(
NULL
);
}
/* If offset is == limit, fill free list of the space. */
if
(
offset
==
limit
)
{
fsp_fill_free_list
(
FALSE
,
space
,
sp_header
,
mtr
);
}
descr_page_no
=
xdes_calc_descriptor_page
(
zip_size
,
offset
);
if
(
descr_page_no
==
0
)
{
...
...
@@ -2811,7 +2798,7 @@ got_hinted_page:
ut_ad
(
xdes_get_bit
(
ret_descr
,
XDES_FREE_BIT
,
ret_page
%
FSP_EXTENT_SIZE
,
mtr
)
==
TRUE
);
fseg_mark_page_used
(
seg_inode
,
space
,
zip_size
,
ret_page
,
mtr
);
fseg_mark_page_used
(
seg_inode
,
ret_page
,
ret_descr
,
mtr
);
}
return
(
fsp_page_create
(
...
...
@@ -3217,27 +3204,21 @@ fsp_get_available_space_in_free_extents(
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
static
static
__attribute__
((
nonnull
))
void
fseg_mark_page_used
(
/*================*/
fseg_inode_t
*
seg_inode
,
/*!< in: segment inode */
ulint
space
,
/*!< in: space id */
ulint
zip_size
,
/*!< in: compressed page size in bytes
or 0 for uncompressed pages */
ulint
page
,
/*!< in: page offset */
xdes_t
*
descr
,
/* extent descriptor */
mtr_t
*
mtr
)
/*!< in: mtr */
{
xdes_t
*
descr
;
ulint
not_full_n_used
;
ut_ad
(
seg_inode
&&
mtr
);
ut_ad
(
!
((
page_offset
(
seg_inode
)
-
FSEG_ARR_OFFSET
)
%
FSEG_INODE_SIZE
));
ut_ad
(
mach_read_from_4
(
seg_inode
+
FSEG_MAGIC_N
)
==
FSEG_MAGIC_N_VALUE
);
descr
=
xdes_get_descriptor
(
space
,
zip_size
,
page
,
mtr
);
ut_ad
(
mtr_read_ulint
(
seg_inode
+
FSEG_ID
,
MLOG_4BYTES
,
mtr
)
==
mtr_read_ulint
(
descr
+
XDES_ID
,
MLOG_4BYTES
,
mtr
));
...
...
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