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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
83317e5b
Commit
83317e5b
authored
Nov 16, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
parents
c66db6ce
5decc21b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
mysql-test/r/key_cache.result
mysql-test/r/key_cache.result
+10
-0
mysql-test/t/key_cache.test
mysql-test/t/key_cache.test
+11
-0
mysys/mf_keycache.c
mysys/mf_keycache.c
+13
-12
No files found.
mysql-test/r/key_cache.result
View file @
83317e5b
...
...
@@ -277,3 +277,13 @@ Key_blocks_unused KEY_BLOCKS_UNUSED
set global keycache2.key_buffer_size=0;
set global keycache3.key_buffer_size=100;
set global keycache3.key_buffer_size=0;
create table t1 (mytext text, FULLTEXT (mytext));
insert t1 values ('aaabbb');
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
set GLOBAL key_cache_block_size=2048;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
mysql-test/t/key_cache.test
View file @
83317e5b
...
...
@@ -156,3 +156,14 @@ set global keycache2.key_buffer_size=0;
# Test to set up a too small size for a key cache (bug #2064)
set
global
keycache3
.
key_buffer_size
=
100
;
set
global
keycache3
.
key_buffer_size
=
0
;
# Test case for buf 6447
create
table
t1
(
mytext
text
,
FULLTEXT
(
mytext
));
insert
t1
values
(
'aaabbb'
);
check
table
t1
;
set
GLOBAL
key_cache_block_size
=
2048
;
check
table
t1
;
drop
table
t1
;
mysys/mf_keycache.c
View file @
83317e5b
...
...
@@ -1699,11 +1699,12 @@ byte *key_cache_read(KEY_CACHE *keycache,
keycache_pthread_mutex_unlock
(
&
keycache
->
cache_lock
);
goto
no_key_cache
;
}
read_length
=
length
>
keycache
->
key_cache_block_size
?
keycache
->
key_cache_block_size
:
length
;
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
offset
=
(
uint
)
(
filepos
&
(
keycache
->
key_cache_block_size
-
1
));
filepos
-=
offset
;
read_length
=
length
;
set_if_smaller
(
read_length
,
keycache
->
key_cache_block_size
-
offset
);
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
#ifndef THREAD
if
(
block_length
>
keycache
->
key_cache_block_size
||
offset
)
return_buffer
=
0
;
...
...
@@ -1773,7 +1774,7 @@ byte *key_cache_read(KEY_CACHE *keycache,
return
(
block
->
buffer
);
#endif
buff
+=
read_length
;
filepos
+=
read_length
;
filepos
+=
read_length
+
offset
;
}
while
((
length
-=
read_length
));
DBUG_RETURN
(
start
);
...
...
@@ -1835,12 +1836,12 @@ int key_cache_insert(KEY_CACHE *keycache,
keycache_pthread_mutex_unlock
(
&
keycache
->
cache_lock
);
DBUG_RETURN
(
0
);
}
read_length
=
length
>
keycache
->
key_cache_block_size
?
keycache
->
key_cache_block_size
:
length
;
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
offset
=
(
uint
)
(
filepos
&
(
keycache
->
key_cache_block_size
-
1
));
/* Read data into key cache from buff in key_cache_block_size incr. */
filepos
-=
offset
;
read_length
=
length
;
set_if_smaller
(
read_length
,
keycache
->
key_cache_block_size
-
offset
);
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
inc_counter_for_resize_op
(
keycache
);
keycache
->
global_cache_r_requests
++
;
...
...
@@ -1882,7 +1883,7 @@ int key_cache_insert(KEY_CACHE *keycache,
DBUG_RETURN
(
1
);
buff
+=
read_length
;
filepos
+=
read_length
;
filepos
+=
read_length
+
offset
;
}
while
((
length
-=
read_length
));
}
...
...
@@ -1959,12 +1960,12 @@ int key_cache_write(KEY_CACHE *keycache,
keycache_pthread_mutex_unlock
(
&
keycache
->
cache_lock
);
goto
no_key_cache
;
}
read_length
=
length
>
keycache
->
key_cache_block_size
?
keycache
->
key_cache_block_size
:
length
;
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
offset
=
(
uint
)
(
filepos
&
(
keycache
->
key_cache_block_size
-
1
));
/* Write data in key_cache_block_size increments */
filepos
-=
offset
;
read_length
=
length
;
set_if_smaller
(
read_length
,
keycache
->
key_cache_block_size
-
offset
);
KEYCACHE_DBUG_ASSERT
(
read_length
>
0
);
inc_counter_for_resize_op
(
keycache
);
keycache
->
global_cache_w_requests
++
;
...
...
@@ -2032,7 +2033,7 @@ int key_cache_write(KEY_CACHE *keycache,
next_block:
buff
+=
read_length
;
filepos
+=
read_length
;
filepos
+=
read_length
+
offset
;
offset
=
0
;
}
while
((
length
-=
read_length
));
...
...
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