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
2de51adf
Commit
2de51adf
authored
Sep 28, 2006
by
svoj@mysql.com/april.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/svoj/devel/bk/mysql-4.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG21617/mysql-4.1-engines
parents
52758d86
b271d765
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
31 deletions
+43
-31
myisammrg/myrg_open.c
myisammrg/myrg_open.c
+5
-2
myisammrg/myrg_queue.c
myisammrg/myrg_queue.c
+2
-0
mysql-test/r/merge.result
mysql-test/r/merge.result
+6
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+11
-0
mysys/queues.c
mysys/queues.c
+19
-29
No files found.
myisammrg/myrg_open.c
View file @
2de51adf
...
...
@@ -33,7 +33,7 @@
MYRG_INFO
*
myrg_open
(
const
char
*
name
,
int
mode
,
int
handle_locking
)
{
int
save_errno
,
errpos
=
0
;
uint
files
=
0
,
i
,
dir_length
,
length
,
key_parts
;
uint
files
=
0
,
i
,
dir_length
,
length
,
key_parts
,
min_keys
=
0
;
ulonglong
file_offset
=
0
;
char
name_buff
[
FN_REFLEN
*
2
],
buff
[
FN_REFLEN
],
*
end
;
MYRG_INFO
*
m_info
=
0
;
...
...
@@ -109,6 +109,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
files
=
0
;
}
m_info
->
reclength
=
isam
->
s
->
base
.
reclength
;
min_keys
=
isam
->
s
->
base
.
keys
;
errpos
=
3
;
}
m_info
->
open_tables
[
files
].
table
=
isam
;
...
...
@@ -124,6 +125,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info
->
records
+=
isam
->
state
->
records
;
m_info
->
del
+=
isam
->
state
->
del
;
m_info
->
data_file_length
+=
isam
->
state
->
data_file_length
;
if
(
min_keys
>
isam
->
s
->
base
.
keys
)
min_keys
=
isam
->
s
->
base
.
keys
;
for
(
i
=
0
;
i
<
key_parts
;
i
++
)
m_info
->
rec_per_key_part
[
i
]
+=
(
isam
->
s
->
state
.
rec_per_key_part
[
i
]
/
m_info
->
tables
);
...
...
@@ -141,7 +144,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
my_errno
=
HA_ERR_RECORD_FILE_FULL
;
goto
err
;
}
m_info
->
keys
=
files
?
isam
->
s
->
base
.
keys
:
0
;
m_info
->
keys
=
min_keys
;
bzero
((
char
*
)
&
m_info
->
by_key
,
sizeof
(
m_info
->
by_key
));
/* this works ok if the table list is empty */
...
...
myisammrg/myrg_queue.c
View file @
2de51adf
...
...
@@ -51,6 +51,8 @@ int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag)
error
=
my_errno
;
}
}
else
my_errno
=
error
=
HA_ERR_WRONG_INDEX
;
return
error
;
}
...
...
mysql-test/r/merge.result
View file @
2de51adf
...
...
@@ -766,6 +766,12 @@ Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check status OK
drop table t1, t2, t3;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2),(1);
CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM t2 WHERE a=2;
ERROR HY000: Got error 124 from storage engine
DROP TABLE t1, t2;
CREATE TABLE t1(a INT) ENGINE=MEMORY;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM t2;
...
...
mysql-test/t/merge.test
View file @
2de51adf
...
...
@@ -376,6 +376,17 @@ select * from t3;
check
table
t1
,
t2
;
drop
table
t1
,
t2
,
t3
;
#
# BUG#21617 - crash when selecting from merge table with inconsistent
# indexes
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
2
),(
1
);
CREATE
TABLE
t2
(
a
INT
,
KEY
(
a
))
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1030
SELECT
*
FROM
t2
WHERE
a
=
2
;
DROP
TABLE
t1
,
t2
;
#
# BUG#10974 - No error message if merge table based on union of innodb,
# memory
...
...
mysys/queues.c
View file @
2de51adf
...
...
@@ -164,28 +164,22 @@ void delete_queue(QUEUE *queue)
void
queue_insert
(
register
QUEUE
*
queue
,
byte
*
element
)
{
reg2
uint
idx
,
next
;
reg2
uint
idx
,
next
;
int
cmp
;
#ifndef DBUG_OFF
if
(
queue
->
elements
<
queue
->
max_elements
)
#endif
DBUG_ASSERT
(
queue
->
elements
<
queue
->
max_elements
);
queue
->
root
[
0
]
=
element
;
idx
=
++
queue
->
elements
;
/* max_at_top swaps the comparison if we want to order by desc */
while
((
cmp
=
queue
->
compare
(
queue
->
first_cmp_arg
,
element
+
queue
->
offset_to_key
,
queue
->
root
[(
next
=
idx
>>
1
)]
+
queue
->
offset_to_key
))
&&
(
cmp
^
queue
->
max_at_top
)
<
0
)
{
queue
->
root
[
0
]
=
element
;
idx
=
++
queue
->
elements
;
/* max_at_top swaps the comparison if we want to order by desc */
while
((
cmp
=
queue
->
compare
(
queue
->
first_cmp_arg
,
element
+
queue
->
offset_to_key
,
queue
->
root
[(
next
=
idx
>>
1
)]
+
queue
->
offset_to_key
))
&&
(
cmp
^
queue
->
max_at_top
)
<
0
)
{
queue
->
root
[
idx
]
=
queue
->
root
[
next
];
idx
=
next
;
}
queue
->
root
[
idx
]
=
element
;
queue
->
root
[
idx
]
=
queue
->
root
[
next
];
idx
=
next
;
}
queue
->
root
[
idx
]
=
element
;
}
/* Remove item from queue */
...
...
@@ -193,16 +187,12 @@ void queue_insert(register QUEUE *queue, byte *element)
byte
*
queue_remove
(
register
QUEUE
*
queue
,
uint
idx
)
{
#ifndef DBUG_OFF
if
(
idx
>=
queue
->
max_elements
)
return
0
;
#endif
{
byte
*
element
=
queue
->
root
[
++
idx
];
/* Intern index starts from 1 */
queue
->
root
[
idx
]
=
queue
->
root
[
queue
->
elements
--
];
_downheap
(
queue
,
idx
);
return
element
;
}
byte
*
element
;
DBUG_ASSERT
(
idx
<
queue
->
max_elements
);
element
=
queue
->
root
[
++
idx
];
/* Intern index starts from 1 */
queue
->
root
[
idx
]
=
queue
->
root
[
queue
->
elements
--
];
_downheap
(
queue
,
idx
);
return
element
;
}
/* Fix when element on top has been replaced */
...
...
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