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
5ebcb21f
Commit
5ebcb21f
authored
Jan 14, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge serg@bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
bc7f4b2c
367bcf8c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
13 deletions
+28
-13
heap/hp_create.c
heap/hp_create.c
+4
-3
heap/hp_write.c
heap/hp_write.c
+2
-1
include/heap.h
include/heap.h
+4
-3
sql/ha_heap.cc
sql/ha_heap.cc
+18
-6
No files found.
heap/hp_create.c
View file @
5ebcb21f
...
...
@@ -140,6 +140,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
}
share
->
min_records
=
min_records
;
share
->
max_records
=
max_records
;
share
->
max_table_size
=
create_info
->
max_table_size
;
share
->
data_length
=
share
->
index_length
=
0
;
share
->
reclength
=
reclength
;
share
->
blength
=
1
;
...
...
heap/hp_write.c
View file @
5ebcb21f
...
...
@@ -143,7 +143,8 @@ static byte *next_free_record_pos(HP_SHARE *info)
}
if
(
!
(
block_pos
=
(
info
->
records
%
info
->
block
.
records_in_block
)))
{
if
(
info
->
records
>
info
->
max_records
&&
info
->
max_records
)
if
((
info
->
records
>
info
->
max_records
&&
info
->
max_records
)
||
(
info
->
data_length
+
info
->
index_length
>=
info
->
max_table_size
))
{
my_errno
=
HA_ERR_RECORD_FILE_FULL
;
DBUG_RETURN
(
NULL
);
...
...
include/heap.h
View file @
5ebcb21f
...
...
@@ -135,7 +135,7 @@ typedef struct st_heap_share
HP_BLOCK
block
;
HP_KEYDEF
*
keydef
;
ulong
min_records
,
max_records
;
/* Params to open */
ulong
data_length
,
index_length
;
ulong
data_length
,
index_length
,
max_table_size
;
uint
records
;
/* records */
uint
blength
;
/* records rounded up to 2^n */
uint
deleted
;
/* Deleted records in database */
...
...
@@ -185,6 +185,7 @@ typedef struct st_heap_create_info
{
uint
auto_key
;
uint
auto_key_type
;
ulong
max_table_size
;
ulonglong
auto_increment
;
}
HP_CREATE_INFO
;
...
...
sql/ha_heap.cc
View file @
5ebcb21f
...
...
@@ -460,11 +460,23 @@ int ha_heap::create(const char *name, TABLE *table_arg,
KEY_PART_INFO
*
key_part
=
pos
->
key_part
;
KEY_PART_INFO
*
key_part_end
=
key_part
+
pos
->
key_parts
;
mem_per_row
+=
(
pos
->
key_length
+
(
sizeof
(
char
*
)
*
2
));
keydef
[
key
].
keysegs
=
(
uint
)
pos
->
key_parts
;
keydef
[
key
].
flag
=
(
pos
->
flags
&
(
HA_NOSAME
|
HA_NULL_ARE_EQUAL
));
keydef
[
key
].
seg
=
seg
;
switch
(
pos
->
algorithm
)
{
case
HA_KEY_ALG_UNDEF
:
case
HA_KEY_ALG_HASH
:
keydef
[
key
].
algorithm
=
HA_KEY_ALG_HASH
;
mem_per_row
+=
sizeof
(
char
*
)
*
2
;
// = sizeof(HASH_INFO)
break
;
case
HA_KEY_ALG_BTREE
:
keydef
[
key
].
algorithm
=
HA_KEY_ALG_BTREE
;
mem_per_row
+=
sizeof
(
TREE_ELEMENT
)
+
pos
->
key_length
+
sizeof
(
char
*
);
break
;
default:
DBUG_ASSERT
(
0
);
// cannot happen
}
keydef
[
key
].
algorithm
=
((
pos
->
algorithm
==
HA_KEY_ALG_UNDEF
)
?
HA_KEY_ALG_HASH
:
pos
->
algorithm
);
...
...
@@ -501,13 +513,13 @@ int ha_heap::create(const char *name, TABLE *table_arg,
}
}
mem_per_row
+=
MY_ALIGN
(
table_arg
->
reclength
+
1
,
sizeof
(
char
*
));
max_rows
=
(
ha_rows
)
(
current_thd
->
variables
.
max_heap_table_size
/
mem_per_row
);
HP_CREATE_INFO
hp_create_info
;
hp_create_info
.
auto_key
=
auto_key
;
hp_create_info
.
auto_key_type
=
auto_key_type
;
hp_create_info
.
auto_increment
=
(
create_info
->
auto_increment_value
?
create_info
->
auto_increment_value
-
1
:
0
);
hp_create_info
.
max_table_size
=
current_thd
->
variables
.
max_heap_table_size
;
max_rows
=
(
ha_rows
)
(
hp_create_info
.
max_table_size
/
mem_per_row
);
error
=
heap_create
(
fn_format
(
buff
,
name
,
""
,
""
,
4
+
2
),
table_arg
->
keys
,
keydef
,
table_arg
->
reclength
,
(
ulong
)
((
table_arg
->
max_rows
<
max_rows
&&
...
...
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