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
9248b402
Commit
9248b402
authored
Nov 13, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-4.1-opt
into mysql.com:/home/hf/work/31305/my41-31305
parents
6c5a2e50
cb927e2f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
0 deletions
+140
-0
.bzrignore
.bzrignore
+2
-0
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+68
-0
mysql-test/r/almost_full.result
mysql-test/r/almost_full.result
+29
-0
mysql-test/t/almost_full.test
mysql-test/t/almost_full.test
+41
-0
No files found.
.bzrignore
View file @
9248b402
...
...
@@ -1068,3 +1068,5 @@ include/check_abi
include/mysql_h.ic
mysql-test/r/blackhole.log
mysql-test/lib/init_db.sql
libmysql_r/client_settings.h
libmysqld/ha_blackhole.cc
myisam/mi_dynrec.c
View file @
9248b402
...
...
@@ -145,6 +145,29 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
DBUG_ENTER
(
"write_dynamic_record"
);
flag
=
0
;
/*
Check if we have enough room for the new record.
First we do simplified check to make usual case faster.
Then we do more precise check for the space left.
Though it still is not absolutely precise, as
we always use MI_MAX_DYN_BLOCK_HEADER while it can be
less in the most of the cases.
*/
if
(
unlikely
(
info
->
s
->
base
.
max_data_file_length
-
info
->
state
->
data_file_length
<
reclength
+
MI_MAX_DYN_BLOCK_HEADER
))
{
if
(
info
->
s
->
base
.
max_data_file_length
-
info
->
state
->
data_file_length
+
info
->
state
->
empty
-
info
->
state
->
del
*
MI_MAX_DYN_BLOCK_HEADER
<
reclength
+
MI_MAX_DYN_BLOCK_HEADER
)
{
my_errno
=
HA_ERR_RECORD_FILE_FULL
;
DBUG_RETURN
(
1
);
}
}
do
{
if
(
_mi_find_writepos
(
info
,
reclength
,
&
filepos
,
&
length
))
...
...
@@ -577,6 +600,51 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
DBUG_ENTER
(
"update_dynamic_record"
);
flag
=
block_info
.
second_read
=
0
;
/*
Check if we have enough room for the record.
First we do simplified check to make usual case faster.
Then we do more precise check for the space left.
Though it still is not absolutely precise, as
we always use MI_MAX_DYN_BLOCK_HEADER while it can be
less in the most of the cases.
*/
/*
compare with just the reclength as we're going
to get some space from the old replaced record
*/
if
(
unlikely
(
info
->
s
->
base
.
max_data_file_length
-
info
->
state
->
data_file_length
<
reclength
))
{
/*
let's read the old record's block to find out the length of the
old record
*/
if
((
error
=
_mi_get_block_info
(
&
block_info
,
info
->
dfile
,
filepos
))
&
(
BLOCK_DELETED
|
BLOCK_ERROR
|
BLOCK_SYNC_ERROR
|
BLOCK_FATAL_ERROR
))
{
DBUG_PRINT
(
"error"
,(
"Got wrong block info"
));
if
(
!
(
error
&
BLOCK_FATAL_ERROR
))
my_errno
=
HA_ERR_WRONG_IN_RECORD
;
goto
err
;
}
/*
if new record isn't longer, we can go on safely
*/
if
(
block_info
.
rec_len
<
reclength
)
{
if
(
info
->
s
->
base
.
max_data_file_length
-
info
->
state
->
data_file_length
+
info
->
state
->
empty
-
info
->
state
->
del
*
MI_MAX_DYN_BLOCK_HEADER
<
reclength
-
block_info
.
rec_len
+
MI_MAX_DYN_BLOCK_HEADER
)
{
my_errno
=
HA_ERR_RECORD_FILE_FULL
;
goto
err
;
}
}
block_info
.
second_read
=
0
;
}
while
(
reclength
>
0
)
{
if
(
filepos
!=
info
->
s
->
state
.
dellink
)
...
...
mysql-test/r/almost_full.result
0 → 100644
View file @
9248b402
drop table if exists t1;
set global myisam_data_pointer_size=2;
CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;
DELETE FROM t1 WHERE a=1 or a=5;
INSERT INTO t1 SET b=repeat('a',600);
ERROR HY000: The table 't1' is full
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 65448 of 65534 used
test.t1 check status OK
UPDATE t1 SET b=repeat('a', 800) where a=10;
ERROR HY000: The table 't1' is full
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 65448 of 65534 used
test.t1 check status OK
INSERT INTO t1 SET b=repeat('a',400);
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 65448 of 65534 used
test.t1 check status OK
DELETE FROM t1 WHERE a=2 or a=6;
UPDATE t1 SET b=repeat('a', 600) where a=11;
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 65448 of 65534 used
test.t1 check status OK
drop table t1;
set global myisam_data_pointer_size=default;
mysql-test/t/almost_full.test
0 → 100644
View file @
9248b402
#
# Some special cases with empty tables
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
set
global
myisam_data_pointer_size
=
2
;
CREATE
TABLE
t1
(
a
int
auto_increment
primary
key
not
null
,
b
longtext
)
ENGINE
=
MyISAM
;
--
disable_query_log
let
$
1
=
303
;
while
(
$
1
)
{
INSERT
INTO
t1
SET
b
=
repeat
(
'a'
,
200
);
dec
$
1
;
}
--
enable_query_log
DELETE
FROM
t1
WHERE
a
=
1
or
a
=
5
;
--
error
1114
INSERT
INTO
t1
SET
b
=
repeat
(
'a'
,
600
);
CHECK
TABLE
t1
EXTENDED
;
--
error
1114
UPDATE
t1
SET
b
=
repeat
(
'a'
,
800
)
where
a
=
10
;
CHECK
TABLE
t1
EXTENDED
;
INSERT
INTO
t1
SET
b
=
repeat
(
'a'
,
400
);
CHECK
TABLE
t1
EXTENDED
;
DELETE
FROM
t1
WHERE
a
=
2
or
a
=
6
;
UPDATE
t1
SET
b
=
repeat
(
'a'
,
600
)
where
a
=
11
;
CHECK
TABLE
t1
EXTENDED
;
drop
table
t1
;
set
global
myisam_data_pointer_size
=
default
;
# End of 4.1 tests
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