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
726fca05
Commit
726fca05
authored
Jul 03, 2003
by
ram@mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and test-case for the bug #775: SELECT misses rows in indexed HEAP table columns.
parent
3308f226
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
heap/hp_open.c
heap/hp_open.c
+6
-3
mysql-test/r/heap.result
mysql-test/r/heap.result
+14
-0
mysql-test/t/heap.test
mysql-test/t/heap.test
+9
-0
No files found.
heap/hp_open.c
View file @
726fca05
...
@@ -46,9 +46,12 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
...
@@ -46,9 +46,12 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
for
(
j
=
length
=
0
;
j
<
keydef
[
i
].
keysegs
;
j
++
)
for
(
j
=
length
=
0
;
j
<
keydef
[
i
].
keysegs
;
j
++
)
{
{
length
+=
keydef
[
i
].
seg
[
j
].
length
;
length
+=
keydef
[
i
].
seg
[
j
].
length
;
if
(
keydef
[
i
].
seg
[
j
].
null_bit
&&
if
(
keydef
[
i
].
seg
[
j
].
null_bit
)
!
(
keydef
[
i
].
flag
&
HA_NULL_ARE_EQUAL
))
{
keydef
[
i
].
flag
|=
HA_NULL_PART_KEY
;
length
++
;
if
(
!
(
keydef
[
i
].
flag
&
HA_NULL_ARE_EQUAL
))
keydef
[
i
].
flag
|=
HA_NULL_PART_KEY
;
}
}
}
keydef
[
i
].
length
=
length
;
keydef
[
i
].
length
=
length
;
if
(
length
>
max_length
)
if
(
length
>
max_length
)
...
...
mysql-test/r/heap.result
View file @
726fca05
...
@@ -197,6 +197,20 @@ a b
...
@@ -197,6 +197,20 @@ a b
INSERT INTO t1 VALUES (1,3);
INSERT INTO t1 VALUES (1,3);
Duplicate entry '3' for key 1
Duplicate entry '3' for key 1
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (
a int default NULL,
key a (a)
) TYPE=HEAP;
INSERT INTO t1 VALUES (10), (10), (10);
EXPLAIN SELECT * FROM t1 WHERE a=10;
table type possible_keys key key_len ref rows Extra
t1 ref a a 5 const 10 Using where
SELECT * FROM t1 WHERE a=10;
a
10
10
10
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
DELETE from t1 where a < 100;
...
...
mysql-test/t/heap.test
View file @
726fca05
...
@@ -129,6 +129,15 @@ SELECT * FROM t1 WHERE b<=>NULL;
...
@@ -129,6 +129,15 @@ SELECT * FROM t1 WHERE b<=>NULL;
INSERT
INTO
t1
VALUES
(
1
,
3
);
INSERT
INTO
t1
VALUES
(
1
,
3
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
int
default
NULL
,
key
a
(
a
)
)
TYPE
=
HEAP
;
INSERT
INTO
t1
VALUES
(
10
),
(
10
),
(
10
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
=
10
;
SELECT
*
FROM
t1
WHERE
a
=
10
;
DROP
TABLE
t1
;
#
#
# Test when deleting all rows
# Test when deleting all 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