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
6288cfb8
Commit
6288cfb8
authored
Jul 26, 2001
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bulk insert bug fixed
parent
d8d3fcd8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
myisam/mi_write.c
myisam/mi_write.c
+2
-2
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+2
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+56
-0
No files found.
myisam/mi_write.c
View file @
6288cfb8
...
@@ -794,10 +794,10 @@ int _mi_init_bulk_insert(MI_INFO *info)
...
@@ -794,10 +794,10 @@ int _mi_init_bulk_insert(MI_INFO *info)
params
=
(
bulk_insert_param
*
)(
info
->
bulk_insert
+
share
->
base
.
keys
);
params
=
(
bulk_insert_param
*
)(
info
->
bulk_insert
+
share
->
base
.
keys
);
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
)
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
)
{
{
params
->
info
=
info
;
params
->
keynr
=
i
;
if
(
test
(
key_map
&
((
ulonglong
)
1
<<
i
)))
if
(
test
(
key_map
&
((
ulonglong
)
1
<<
i
)))
{
{
params
->
info
=
info
;
params
->
keynr
=
i
;
init_tree
(
&
info
->
bulk_insert
[
i
],
0
,
init_tree
(
&
info
->
bulk_insert
[
i
],
0
,
myisam_bulk_insert_tree_size
/
num_keys
,
0
,
myisam_bulk_insert_tree_size
/
num_keys
,
0
,
(
qsort_cmp2
)
keys_compare
,
0
,
(
qsort_cmp2
)
keys_compare
,
0
,
...
...
mysql-test/r/insert_select.result
View file @
6288cfb8
...
@@ -11,3 +11,5 @@ payoutID
...
@@ -11,3 +11,5 @@ payoutID
19
19
20
20
22
22
Variable_name Value
myisam_bulk_insert_tree_size 8388608
mysql-test/t/insert_select.test
View file @
6288cfb8
...
@@ -10,3 +10,59 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
...
@@ -10,3 +10,59 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
insert
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
insert
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
select
*
from
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# bug in bulk insert optimization
# test case by Fournier Jocelyn <joc@presence-pc.com>
#
DROP
TABLE
IF
EXISTS
crash1
,
crash2
;
CREATE
TABLE
`crash1`
(
`numeropost`
bigint
(
20
)
unsigned
NOT
NULL
default
'0'
,
`icone`
tinyint
(
4
)
unsigned
NOT
NULL
default
'0'
,
`numreponse`
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
`contenu`
text
NOT
NULL
,
`pseudo`
varchar
(
50
)
NOT
NULL
default
''
,
`date`
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
`ip`
bigint
(
11
)
NOT
NULL
default
'0'
,
`signature`
tinyint
(
1
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`numeropost`
,
`numreponse`
)
,
KEY
`ip`
(
`ip`
),
KEY
`date`
(
`date`
),
KEY
`pseudo`
(
`pseudo`
),
KEY
`numreponse`
(
`numreponse`
)
)
TYPE
=
MyISAM
;
CREATE
TABLE
`crash2`
(
`numeropost`
bigint
(
20
)
unsigned
NOT
NULL
default
'0'
,
`icone`
tinyint
(
4
)
unsigned
NOT
NULL
default
'0'
,
`numreponse`
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
`contenu`
text
NOT
NULL
,
`pseudo`
varchar
(
50
)
NOT
NULL
default
''
,
`date`
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
`ip`
bigint
(
11
)
NOT
NULL
default
'0'
,
`signature`
tinyint
(
1
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`numeropost`
,
`numreponse`
),
KEY
`ip`
(
`ip`
),
KEY
`date`
(
`date`
),
KEY
`pseudo`
(
`pseudo`
),
KEY
`numreponse`
(
`numreponse`
)
)
TYPE
=
MyISAM
;
INSERT
INTO
crash2
(
numeropost
,
icone
,
numreponse
,
contenu
,
pseudo
,
date
,
ip
,
signature
)
VALUES
(
9
,
1
,
56
,
'test'
,
'joce'
,
'2001-07-25 13:50:53'
,
3649052399
,
0
);
INSERT
INTO
crash1
(
numeropost
,
icone
,
contenu
,
pseudo
,
date
,
signature
,
ip
)
SELECT
1618
,
icone
,
contenu
,
pseudo
,
date
,
signature
,
ip
FROM
crash2
WHERE
numeropost
=
9
ORDER
BY
numreponse
ASC
;
show
variables
like
'%bulk%'
;
INSERT
INTO
crash1
(
numeropost
,
icone
,
contenu
,
pseudo
,
date
,
signature
,
ip
)
SELECT
1718
,
icone
,
contenu
,
pseudo
,
date
,
signature
,
ip
FROM
crash2
WHERE
numeropost
=
9
ORDER
BY
numreponse
ASC
;
DROP
TABLE
IF
EXISTS
crash1
,
crash2
;
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