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
f71ba273
Commit
f71ba273
authored
Jun 14, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
parents
05fd6b2e
15e2cb8d
Changes
3
Hide 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 @
f71ba273
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 @
f71ba273
--
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 @
f71ba273
...
...
@@ -2133,6 +2133,11 @@ int ha_ndbcluster::write_row(byte *record)
*/
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
);
if
(
!
peek_res
)
...
...
@@ -3270,6 +3275,19 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
DBUG_PRINT
(
"enter"
,
(
"rows: %d"
,
(
int
)
rows
));
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
)
{
/* 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