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
8b0ec014
Commit
8b0ec014
authored
Aug 21, 2009
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
787a4940
a4e832d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
35 deletions
+44
-35
mysql-test/r/partition.result
mysql-test/r/partition.result
+14
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+22
-0
sql/ha_partition.cc
sql/ha_partition.cc
+0
-33
storage/myisam/mi_search.c
storage/myisam/mi_search.c
+8
-2
No files found.
mysql-test/r/partition.result
View file @
8b0ec014
drop table if exists t1, t2;
CREATE TABLE t1 (
a int NOT NULL,
b int NOT NULL);
CREATE TABLE t2 (
a int NOT NULL,
b int NOT NULL,
INDEX(b)
)
PARTITION BY HASH(a) PARTITIONS 2;
INSERT INTO t1 VALUES (399, 22);
INSERT INTO t2 VALUES (1, 22), (1, 42);
INSERT INTO t2 SELECT 1, 399 FROM t2, t1
WHERE t1.b = t2.b;
DROP TABLE t1, t2;
CREATE TABLE t1 (
a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
b varchar(10),
PRIMARY KEY (a)
...
...
mysql-test/t/partition.test
View file @
8b0ec014
...
...
@@ -14,6 +14,28 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
#
# Bug#46639: 1030 (HY000): Got error 124 from storage engine on
# INSERT ... SELECT ...
CREATE
TABLE
t1
(
a
int
NOT
NULL
,
b
int
NOT
NULL
);
CREATE
TABLE
t2
(
a
int
NOT
NULL
,
b
int
NOT
NULL
,
INDEX
(
b
)
)
PARTITION
BY
HASH
(
a
)
PARTITIONS
2
;
INSERT
INTO
t1
VALUES
(
399
,
22
);
INSERT
INTO
t2
VALUES
(
1
,
22
),
(
1
,
42
);
INSERT
INTO
t2
SELECT
1
,
399
FROM
t2
,
t1
WHERE
t1
.
b
=
t2
.
b
;
DROP
TABLE
t1
,
t2
;
#
# Bug#46478: timestamp field incorrectly defaulted when partition is reorganized
#
...
...
sql/ha_partition.cc
View file @
8b0ec014
...
...
@@ -4414,17 +4414,6 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
break
;
case
partition_index_first
:
DBUG_PRINT
(
"info"
,
(
"index_first on partition %d"
,
i
));
/* MyISAM engine can fail if we call index_first() when indexes disabled */
/* that happens if the table is empty. */
/* Here we use file->stats.records instead of file->records() because */
/* file->records() is supposed to return an EXACT count, and it can be */
/* possibly slow. We don't need an exact number, an approximate one- from*/
/* the last ::info() call - is sufficient. */
if
(
file
->
stats
.
records
==
0
)
{
error
=
HA_ERR_END_OF_FILE
;
break
;
}
error
=
file
->
index_first
(
buf
);
break
;
case
partition_index_first_unordered
:
...
...
@@ -4512,32 +4501,10 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
m_start_key
.
flag
);
break
;
case
partition_index_first
:
/* MyISAM engine can fail if we call index_first() when indexes disabled */
/* that happens if the table is empty. */
/* Here we use file->stats.records instead of file->records() because */
/* file->records() is supposed to return an EXACT count, and it can be */
/* possibly slow. We don't need an exact number, an approximate one- from*/
/* the last ::info() call - is sufficient. */
if
(
file
->
stats
.
records
==
0
)
{
error
=
HA_ERR_END_OF_FILE
;
break
;
}
error
=
file
->
index_first
(
rec_buf_ptr
);
reverse_order
=
FALSE
;
break
;
case
partition_index_last
:
/* MyISAM engine can fail if we call index_last() when indexes disabled */
/* that happens if the table is empty. */
/* Here we use file->stats.records instead of file->records() because */
/* file->records() is supposed to return an EXACT count, and it can be */
/* possibly slow. We don't need an exact number, an approximate one- from*/
/* the last ::info() call - is sufficient. */
if
(
file
->
stats
.
records
==
0
)
{
error
=
HA_ERR_END_OF_FILE
;
break
;
}
error
=
file
->
index_last
(
rec_buf_ptr
);
reverse_order
=
TRUE
;
break
;
...
...
storage/myisam/mi_search.c
View file @
8b0ec014
...
...
@@ -28,9 +28,15 @@ int _mi_check_index(MI_INFO *info, int inx)
{
if
(
inx
==
-
1
)
/* Use last index */
inx
=
info
->
lastinx
;
if
(
inx
<
0
||
!
mi_is_key_active
(
info
->
s
->
state
.
key_map
,
inx
)
)
if
(
inx
<
0
)
{
my_errno
=
HA_ERR_WRONG_INDEX
;
my_errno
=
HA_ERR_WRONG_INDEX
;
return
-
1
;
}
if
(
!
mi_is_key_active
(
info
->
s
->
state
.
key_map
,
inx
))
{
my_errno
=
info
->
s
->
state
.
state
.
records
?
HA_ERR_WRONG_INDEX
:
HA_ERR_END_OF_FILE
;
return
-
1
;
}
if
(
info
->
lastinx
!=
inx
)
/* Index changed */
...
...
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