Commit 79cc9664 authored by unknown's avatar unknown

Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1

into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0


sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
parents 2ba25676 8deb6616
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 ;
ERROR 23000: Can't write; duplicate key in table 't1'
DROP TABLE t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 ;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
Aarhus
Aaron
Aaron
Ababa
Ababa
aback
aback
abaft
abaft
abandon
abandon
abandoned
abandoned
abandoning
abandoning
abandonment
abandonment
abandons
abandons
abase
abased
abasement
abasements
abases
abash
abashed
abashes
abashing
abasing
abate
abated
abatement
abatements
abater
abates
abating
Abba
abbe
abbey
abbeys
abbot
abbots
Abbott
abbreviate
abbreviated
abbreviates
abbreviating
abbreviation
abbreviations
Abby
abdomen
abdomens
abdominal
abduct
abducted
abduction
abductions
abductor
abductors
abducts
Abe
abed
Abel
Abelian
Abelson
Aberdeen
Abernathy
aberrant
aberration
DROP TABLE t1;
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Basic test for different types of loading data
#
# should give duplicate key
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
--error 1022
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 ;
DROP TABLE t1;
# now without a primary key we should be ok
CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 ;
SELECT * FROM t1 ORDER BY word;
DROP TABLE t1;
# End of 4.1 tests
...@@ -3116,11 +3116,25 @@ int ha_ndbcluster::end_bulk_insert() ...@@ -3116,11 +3116,25 @@ int ha_ndbcluster::end_bulk_insert()
"rows_inserted:%d, bulk_insert_rows: %d", "rows_inserted:%d, bulk_insert_rows: %d",
(int) m_rows_inserted, (int) m_bulk_insert_rows)); (int) m_rows_inserted, (int) m_bulk_insert_rows));
m_bulk_insert_not_flushed= FALSE; m_bulk_insert_not_flushed= FALSE;
if (execute_no_commit(this,trans) != 0) { if (m_transaction_on)
{
if (execute_no_commit(this, trans) != 0)
{
no_uncommitted_rows_execute_failure(); no_uncommitted_rows_execute_failure();
my_errno= error= ndb_err(trans); my_errno= error= ndb_err(trans);
} }
} }
else
{
if (execute_commit(this, trans) != 0)
{
no_uncommitted_rows_execute_failure();
my_errno= error= ndb_err(trans);
}
int res= trans->restart();
DBUG_ASSERT(res == 0);
}
}
m_rows_inserted= (ha_rows) 0; m_rows_inserted= (ha_rows) 0;
m_rows_to_insert= (ha_rows) 1; m_rows_to_insert= (ha_rows) 1;
...@@ -5093,7 +5107,7 @@ bool ha_ndbcluster::low_byte_first() const ...@@ -5093,7 +5107,7 @@ bool ha_ndbcluster::low_byte_first() const
} }
bool ha_ndbcluster::has_transactions() bool ha_ndbcluster::has_transactions()
{ {
return m_transaction_on; return TRUE;
} }
const char* ha_ndbcluster::index_type(uint key_number) const char* ha_ndbcluster::index_type(uint key_number)
{ {
......
...@@ -373,8 +373,11 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, ...@@ -373,8 +373,11 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
error= read_sep_field(thd, info, table_list, fields_vars, error= read_sep_field(thd, info, table_list, fields_vars,
set_fields, set_values, read_info, set_fields, set_values, read_info,
*enclosed, skip_lines, ignore); *enclosed, skip_lines, ignore);
if (table->file->end_bulk_insert()) if (table->file->end_bulk_insert() && !error)
error=1; /* purecov: inspected */ {
table->file->print_error(my_errno, MYF(0));
error= 1;
}
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->next_number_field=0; table->next_number_field=0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment