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
49b9b9a0
Commit
49b9b9a0
authored
Jun 14, 2006
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents
0ecea73c
01046bb7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
134 additions
and
0 deletions
+134
-0
mysql-test/r/ndb_loaddatalocal.result
mysql-test/r/ndb_loaddatalocal.result
+46
-0
mysql-test/t/ndb_loaddatalocal.test
mysql-test/t/ndb_loaddatalocal.test
+70
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+18
-0
No files found.
mysql-test/r/ndb_loaddatalocal.result
0 → 100644
View file @
49b9b9a0
DROP TABLE IF EXISTS t1;
create table t1(a int) engine=myisam;
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int) engine=ndb;
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
select count(*) from t1;
count(*)
10000
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (2), (3);
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
2
3
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (1), (2), (3);
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
2
3
drop table t1;
create table t1(a int) engine=myisam;
insert into t1 values (1), (2), (3), (3);
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key) engine=ndb;
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
select * from t1 order by a;
a
1
2
3
drop table t1;
mysql-test/t/ndb_loaddatalocal.test
0 → 100644
View file @
49b9b9a0
--
source
include
/
have_ndb
.
inc
--
source
include
/
not_embedded
.
inc
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
create
table
t1
(
a
int
)
engine
=
myisam
;
let
$
1
=
10000
;
disable_query_log
;
set
SQL_LOG_BIN
=
0
;
while
(
$
1
)
{
insert
into
t1
values
(
1
);
dec
$
1
;
}
set
SQL_LOG_BIN
=
1
;
enable_query_log
;
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
from
t1
;
#This will generate a 20KB file, now test LOAD DATA LOCAL
drop
table
t1
;
create
table
t1
(
a
int
)
engine
=
ndb
;
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
load
data
local
infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
into
table
t1
;
select
count
(
*
)
from
t1
;
system
rm
$MYSQLTEST_VARDIR
/
master
-
data
/
ndb_loaddatalocal
.
select_outfile
;
drop
table
t1
;
create
table
t1
(
a
int
)
engine
=
myisam
;
insert
into
t1
values
(
1
),
(
2
),
(
2
),
(
3
);
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
from
t1
;
drop
table
t1
;
create
table
t1
(
a
int
primary
key
)
engine
=
ndb
;
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
load
data
local
infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
into
table
t1
;
system
rm
$MYSQLTEST_VARDIR
/
master
-
data
/
ndb_loaddatalocal
.
select_outfile
;
select
*
from
t1
order
by
a
;
drop
table
t1
;
create
table
t1
(
a
int
)
engine
=
myisam
;
insert
into
t1
values
(
1
),
(
1
),
(
2
),
(
3
);
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
from
t1
;
drop
table
t1
;
create
table
t1
(
a
int
primary
key
)
engine
=
ndb
;
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
load
data
local
infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
into
table
t1
;
system
rm
$MYSQLTEST_VARDIR
/
master
-
data
/
ndb_loaddatalocal
.
select_outfile
;
select
*
from
t1
order
by
a
;
drop
table
t1
;
create
table
t1
(
a
int
)
engine
=
myisam
;
insert
into
t1
values
(
1
),
(
2
),
(
3
),
(
3
);
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
from
t1
;
drop
table
t1
;
create
table
t1
(
a
int
primary
key
)
engine
=
ndb
;
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
eval
load
data
local
infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile'
into
table
t1
;
system
rm
$MYSQLTEST_VARDIR
/
master
-
data
/
ndb_loaddatalocal
.
select_outfile
;
select
*
from
t1
order
by
a
;
drop
table
t1
;
# End of 4.1 tests
sql/ha_ndbcluster.cc
View file @
49b9b9a0
...
@@ -2452,6 +2452,11 @@ int ha_ndbcluster::write_row(byte *record)
...
@@ -2452,6 +2452,11 @@ int ha_ndbcluster::write_row(byte *record)
*/
*/
if
(
!
m_use_write
&&
m_ignore_dup_key
)
if
(
!
m_use_write
&&
m_ignore_dup_key
)
{
{
/*
compare if expression with that in start_bulk_insert()
start_bulk_insert will set parameters to ensure that each
write_row is committed individually
*/
int
peek_res
=
peek_indexed_rows
(
record
);
int
peek_res
=
peek_indexed_rows
(
record
);
if
(
!
peek_res
)
if
(
!
peek_res
)
...
@@ -3693,6 +3698,19 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
...
@@ -3693,6 +3698,19 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
DBUG_PRINT
(
"enter"
,
(
"rows: %d"
,
(
int
)
rows
));
DBUG_PRINT
(
"enter"
,
(
"rows: %d"
,
(
int
)
rows
));
m_rows_inserted
=
(
ha_rows
)
0
;
m_rows_inserted
=
(
ha_rows
)
0
;
if
(
!
m_use_write
&&
m_ignore_dup_key
)
{
/*
compare if expression with that in write_row
we have a situation where peek_indexed_rows() will be called
so we cannot batch
*/
DBUG_PRINT
(
"info"
,
(
"Batching turned off as duplicate key is "
"ignored by using peek_row"
));
m_rows_to_insert
=
1
;
m_bulk_insert_rows
=
1
;
DBUG_VOID_RETURN
;
}
if
(
rows
==
(
ha_rows
)
0
)
if
(
rows
==
(
ha_rows
)
0
)
{
{
/* We don't know how many will be inserted, guess */
/* We don't know how many will be inserted, guess */
...
...
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