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
9f59bc80
Commit
9f59bc80
authored
Mar 15, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/5.0
parents
2e3e05d0
bfbebe16
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
8 deletions
+87
-8
heap/hp_create.c
heap/hp_create.c
+2
-1
include/heap.h
include/heap.h
+1
-1
mysql-test/r/heap.result
mysql-test/r/heap.result
+42
-0
mysql-test/t/heap.test
mysql-test/t/heap.test
+29
-0
sql/filesort.cc
sql/filesort.cc
+5
-2
sql/ha_heap.cc
sql/ha_heap.cc
+8
-4
No files found.
heap/hp_create.c
View file @
9f59bc80
...
@@ -168,6 +168,8 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
...
@@ -168,6 +168,8 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
keyinfo
->
write_key
=
hp_write_key
;
keyinfo
->
write_key
=
hp_write_key
;
keyinfo
->
hash_buckets
=
0
;
keyinfo
->
hash_buckets
=
0
;
}
}
if
((
keyinfo
->
flag
&
HA_AUTO_KEY
)
&&
create_info
->
with_auto_increment
)
share
->
auto_key
=
i
+
1
;
}
}
share
->
min_records
=
min_records
;
share
->
min_records
=
min_records
;
share
->
max_records
=
max_records
;
share
->
max_records
=
max_records
;
...
@@ -178,7 +180,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
...
@@ -178,7 +180,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
share
->
keys
=
keys
;
share
->
keys
=
keys
;
share
->
max_key_length
=
max_length
;
share
->
max_key_length
=
max_length
;
share
->
changed
=
0
;
share
->
changed
=
0
;
share
->
auto_key
=
create_info
->
auto_key
;
share
->
auto_key_type
=
create_info
->
auto_key_type
;
share
->
auto_key_type
=
create_info
->
auto_key_type
;
share
->
auto_increment
=
create_info
->
auto_increment
;
share
->
auto_increment
=
create_info
->
auto_increment
;
/* Must be allocated separately for rename to work */
/* Must be allocated separately for rename to work */
...
...
include/heap.h
View file @
9f59bc80
...
@@ -183,10 +183,10 @@ typedef struct st_heap_info
...
@@ -183,10 +183,10 @@ typedef struct st_heap_info
typedef
struct
st_heap_create_info
typedef
struct
st_heap_create_info
{
{
uint
auto_key
;
uint
auto_key_type
;
uint
auto_key_type
;
ulong
max_table_size
;
ulong
max_table_size
;
ulonglong
auto_increment
;
ulonglong
auto_increment
;
my_bool
with_auto_increment
;
}
HP_CREATE_INFO
;
}
HP_CREATE_INFO
;
/* Prototypes for heap-functions */
/* Prototypes for heap-functions */
...
...
mysql-test/r/heap.result
View file @
9f59bc80
...
@@ -665,3 +665,45 @@ length(v)
...
@@ -665,3 +665,45 @@ length(v)
65530
65530
drop table t1;
drop table t1;
set storage_engine=MyISAM;
set storage_engine=MyISAM;
create table t1 (a bigint unsigned auto_increment primary key, b int,
key (b, a)) engine=heap;
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
insert t1 (b) values (1);
select * from t1;
a b
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
drop table t1;
create table t1 (a int not null, b int not null auto_increment,
primary key(a, b), key(b)) engine=heap;
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
insert t1 (a) values (1);
select * from t1;
a b
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
drop table t1;
mysql-test/t/heap.test
View file @
9f59bc80
...
@@ -406,3 +406,32 @@ drop table t1;
...
@@ -406,3 +406,32 @@ drop table t1;
# Reset varchar test
# Reset varchar test
#
#
eval
set
storage_engine
=
$default
;
eval
set
storage_engine
=
$default
;
#
# Bug #8489: Strange auto_increment behaviour
#
create
table
t1
(
a
bigint
unsigned
auto_increment
primary
key
,
b
int
,
key
(
b
,
a
))
engine
=
heap
;
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
insert
t1
(
b
)
values
(
1
);
select
*
from
t1
;
drop
table
t1
;
create
table
t1
(
a
int
not
null
,
b
int
not
null
auto_increment
,
primary
key
(
a
,
b
),
key
(
b
))
engine
=
heap
;
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
insert
t1
(
a
)
values
(
1
);
select
*
from
t1
;
drop
table
t1
;
sql/filesort.cc
View file @
9f59bc80
...
@@ -475,8 +475,11 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
...
@@ -475,8 +475,11 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if
(
*
killed
)
if
(
*
killed
)
{
{
DBUG_PRINT
(
"info"
,(
"Sort killed by user"
));
DBUG_PRINT
(
"info"
,(
"Sort killed by user"
));
(
void
)
file
->
extra
(
HA_EXTRA_NO_CACHE
);
if
(
!
indexfile
&&
!
quick_select
)
file
->
ha_rnd_end
();
{
(
void
)
file
->
extra
(
HA_EXTRA_NO_CACHE
);
file
->
ha_rnd_end
();
}
DBUG_RETURN
(
HA_POS_ERROR
);
/* purecov: inspected */
DBUG_RETURN
(
HA_POS_ERROR
);
/* purecov: inspected */
}
}
if
(
error
==
0
)
if
(
error
==
0
)
...
...
sql/ha_heap.cc
View file @
9f59bc80
...
@@ -457,6 +457,7 @@ int ha_heap::create(const char *name, TABLE *table_arg,
...
@@ -457,6 +457,7 @@ int ha_heap::create(const char *name, TABLE *table_arg,
char
buff
[
FN_REFLEN
];
char
buff
[
FN_REFLEN
];
int
error
;
int
error
;
TABLE_SHARE
*
share
=
table_arg
->
s
;
TABLE_SHARE
*
share
=
table_arg
->
s
;
bool
found_real_auto_increment
=
0
;
for
(
key
=
parts
=
0
;
key
<
keys
;
key
++
)
for
(
key
=
parts
=
0
;
key
<
keys
;
key
++
)
parts
+=
table_arg
->
key_info
[
key
].
key_parts
;
parts
+=
table_arg
->
key_info
[
key
].
key_parts
;
...
@@ -520,19 +521,22 @@ int ha_heap::create(const char *name, TABLE *table_arg,
...
@@ -520,19 +521,22 @@ int ha_heap::create(const char *name, TABLE *table_arg,
seg
->
null_bit
=
0
;
seg
->
null_bit
=
0
;
seg
->
null_pos
=
0
;
seg
->
null_pos
=
0
;
}
}
// We have to store field->key_type() as seg->type can differ from it
if
(
field
->
flags
&
AUTO_INCREMENT_FLAG
)
if
(
field
->
flags
&
AUTO_INCREMENT_FLAG
)
{
auto_key
=
key
+
1
;
auto_key_type
=
field
->
key_type
();
auto_key_type
=
field
->
key_type
();
}
}
}
}
}
mem_per_row
+=
MY_ALIGN
(
share
->
reclength
+
1
,
sizeof
(
char
*
));
mem_per_row
+=
MY_ALIGN
(
share
->
reclength
+
1
,
sizeof
(
char
*
));
max_rows
=
(
ha_rows
)
(
table
->
in_use
->
variables
.
max_heap_table_size
/
max_rows
=
(
ha_rows
)
(
table
->
in_use
->
variables
.
max_heap_table_size
/
mem_per_row
);
mem_per_row
);
if
(
table_arg
->
found_next_number_field
)
{
keydef
[
share
->
next_number_index
].
flag
|=
HA_AUTO_KEY
;
found_real_auto_increment
=
share
->
next_number_key_offset
==
0
;
}
HP_CREATE_INFO
hp_create_info
;
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_key_type
=
auto_key_type
;
hp_create_info
.
with_auto_increment
=
found_real_auto_increment
;
hp_create_info
.
auto_increment
=
(
create_info
->
auto_increment_value
?
hp_create_info
.
auto_increment
=
(
create_info
->
auto_increment_value
?
create_info
->
auto_increment_value
-
1
:
0
);
create_info
->
auto_increment_value
-
1
:
0
);
hp_create_info
.
max_table_size
=
current_thd
->
variables
.
max_heap_table_size
;
hp_create_info
.
max_table_size
=
current_thd
->
variables
.
max_heap_table_size
;
...
...
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