mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1 sql/ha_innodb.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged storage/innobase/log/log0log.c: Auto merged storage/innobase/log/log0recv.c: Auto merged storage/innobase/row/row0umod.c: Auto merged storage/innobase/trx/trx0undo.c: Auto merged
This commit is contained in:
@ -416,10 +416,12 @@ INSERT INTO t1 VALUES
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
2000
|
||||
INSERT INTO t1 VALUES (1,1,1);
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
@ -437,7 +439,7 @@ begin;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
commit;
|
||||
ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster
|
||||
select * from t1 where pk1=1;
|
||||
@ -456,7 +458,7 @@ begin;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
rollback;
|
||||
select * from t1 where pk1=1;
|
||||
pk1 b c
|
||||
@ -474,7 +476,7 @@ begin;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
SELECT * FROM t1 WHERE pk1=10;
|
||||
ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster
|
||||
rollback;
|
||||
@ -494,7 +496,7 @@ begin;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
SELECT * FROM t1 WHERE pk1=10;
|
||||
ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster
|
||||
SELECT * FROM t1 WHERE pk1=10;
|
||||
@ -517,7 +519,7 @@ begin;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
ERROR 23000: Duplicate entry '10' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
INSERT INTO t1 values (4000, 40, 44);
|
||||
ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster
|
||||
rollback;
|
||||
@ -534,7 +536,7 @@ select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
insert into t1 select * from t1 where b < 10 order by pk1;
|
||||
ERROR 23000: Duplicate entry '9' for key 1
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
DELETE FROM t1 WHERE pk1=2;
|
||||
begin;
|
||||
INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
|
||||
|
@ -434,6 +434,9 @@ SELECT COUNT(*) FROM t1;
|
||||
# Insert duplicate rows
|
||||
#
|
||||
--error 1062
|
||||
INSERT INTO t1 VALUES (1,1,1);
|
||||
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -457,7 +460,7 @@ rollback;
|
||||
#
|
||||
begin;
|
||||
|
||||
--error 1062
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -477,7 +480,7 @@ select count(*) from t1;
|
||||
#
|
||||
begin;
|
||||
|
||||
--error 1062
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -496,7 +499,7 @@ select count(*) from t1;
|
||||
#
|
||||
begin;
|
||||
|
||||
--error 1062
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -517,7 +520,7 @@ select count(*) from t1;
|
||||
#
|
||||
begin;
|
||||
|
||||
--error 1062
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -543,7 +546,7 @@ select count(*) from t1;
|
||||
#
|
||||
begin;
|
||||
|
||||
--error 1062
|
||||
--error 1022
|
||||
INSERT INTO t1 VALUES
|
||||
(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
|
||||
(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
|
||||
@ -562,7 +565,7 @@ select count(*) from t1;
|
||||
# Insert duplicate rows using "insert .. select"
|
||||
|
||||
#
|
||||
--error 1062
|
||||
--error 1022
|
||||
insert into t1 select * from t1 where b < 10 order by pk1;
|
||||
|
||||
DELETE FROM t1 WHERE pk1=2;
|
||||
|
@ -563,7 +563,7 @@ innobase_mysql_print_thd(
|
||||
thd = (const THD*) input_thd;
|
||||
|
||||
fprintf(f, "MySQL thread id %lu, query id %lu",
|
||||
thd->thread_id, thd->query_id);
|
||||
thd->thread_id, (ulong) thd->query_id);
|
||||
if (thd->host) {
|
||||
putc(' ', f);
|
||||
fputs(thd->host, f);
|
||||
@ -1805,7 +1805,7 @@ try_again:
|
||||
fprintf(stderr,
|
||||
"InnoDB: This transaction needs it to be sent up to\n"
|
||||
"InnoDB: file %s, position %lu\n", trx->repl_wait_binlog_name,
|
||||
(uint)trx->repl_wait_binlog_pos);
|
||||
(ulong)trx->repl_wait_binlog_pos);
|
||||
|
||||
innobase_repl_state = 0;
|
||||
|
||||
|
@ -511,8 +511,13 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans)
|
||||
DBUG_PRINT("info", ("transformed ndbcluster error %d to mysql error %d",
|
||||
err.code, res));
|
||||
if (res == HA_ERR_FOUND_DUPP_KEY)
|
||||
{
|
||||
if (m_rows_to_insert == 1)
|
||||
m_dupkey= table->s->primary_key;
|
||||
|
||||
else
|
||||
// We are batching inserts, offending key is not available
|
||||
m_dupkey= (uint) -1;
|
||||
}
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
@ -3027,6 +3032,13 @@ double ha_ndbcluster::scan_time()
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
/*
|
||||
Convert MySQL table locks into locks supported by Ndb Cluster.
|
||||
Note that MySQL Cluster does currently not support distributed
|
||||
table locks, so to be safe one should set cluster in Single
|
||||
User Mode, before relying on table locks when updating tables
|
||||
from several MySQL servers
|
||||
*/
|
||||
|
||||
THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
|
||||
THR_LOCK_DATA **to,
|
||||
@ -3042,7 +3054,7 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
|
||||
/* Since NDB does not currently have table locks
|
||||
this is treated as a ordinary lock */
|
||||
|
||||
if ((lock_type >= TL_WRITE_ALLOW_WRITE &&
|
||||
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
|
||||
lock_type <= TL_WRITE) && !thd->in_lock_tables)
|
||||
lock_type= TL_WRITE_ALLOW_WRITE;
|
||||
|
||||
|
@ -2064,7 +2064,7 @@ loop:
|
||||
/* A flush is urgent: we have to do a synchronous preflush */
|
||||
|
||||
sync = TRUE;
|
||||
advance = 2 * (age - log->max_modified_age_async);
|
||||
advance = 2 * (age - log->max_modified_age_sync);
|
||||
} else if (age > log->max_modified_age_async) {
|
||||
|
||||
/* A flush is not urgent: we do an asynchronous preflush */
|
||||
|
@ -477,6 +477,7 @@ recv_find_max_checkpoint(
|
||||
|
||||
max_no = ut_dulint_zero;
|
||||
*max_group = NULL;
|
||||
*max_field = 0;
|
||||
|
||||
buf = log_sys->checkpoint_buf;
|
||||
|
||||
@ -543,7 +544,6 @@ recv_find_max_checkpoint(
|
||||
"InnoDB: to create the InnoDB data files, but log file creation failed.\n"
|
||||
"InnoDB: If that is the case, please refer to\n"
|
||||
"InnoDB: http://dev.mysql.com/doc/mysql/en/Error_creating_InnoDB.html\n");
|
||||
*max_field = 0;
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
@ -1168,6 +1168,7 @@ recv_recover_page(
|
||||
}
|
||||
|
||||
modification_to_page = FALSE;
|
||||
start_lsn = end_lsn = ut_dulint_zero;
|
||||
|
||||
recv = UT_LIST_GET_FIRST(recv_addr->rec_list);
|
||||
|
||||
@ -1796,6 +1797,8 @@ recv_parse_log_rec(
|
||||
{
|
||||
byte* new_ptr;
|
||||
|
||||
*body = NULL;
|
||||
|
||||
if (ptr == end_ptr) {
|
||||
|
||||
return(0);
|
||||
|
@ -52,19 +52,16 @@ row_undo_mod_undo_also_prev_vers(
|
||||
/* out: TRUE if also previous modify or
|
||||
insert of this row should be undone */
|
||||
undo_node_t* node, /* in: row undo node */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
dulint* undo_no)/* out: the undo number */
|
||||
{
|
||||
trx_undo_rec_t* undo_rec;
|
||||
ibool ret;
|
||||
trx_t* trx;
|
||||
|
||||
UT_NOT_USED(thr);
|
||||
|
||||
trx = node->trx;
|
||||
|
||||
if (0 != ut_dulint_cmp(node->new_trx_id, trx->id)) {
|
||||
|
||||
*undo_no = ut_dulint_zero;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@ -72,13 +69,7 @@ row_undo_mod_undo_also_prev_vers(
|
||||
|
||||
*undo_no = trx_undo_rec_get_undo_no(undo_rec);
|
||||
|
||||
if (ut_dulint_cmp(trx->roll_limit, *undo_no) <= 0) {
|
||||
ret = TRUE;
|
||||
} else {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
return(ut_dulint_cmp(trx->roll_limit, *undo_no) <= 0);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
@ -214,7 +205,7 @@ row_undo_mod_clust(
|
||||
/* Check if also the previous version of the clustered index record
|
||||
should be undone in this same rollback operation */
|
||||
|
||||
more_vers = row_undo_mod_undo_also_prev_vers(node, thr, &new_undo_no);
|
||||
more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
|
||||
|
||||
pcur = &(node->pcur);
|
||||
|
||||
|
@ -556,7 +556,7 @@ void
|
||||
trx_undo_write_xid(
|
||||
/*===============*/
|
||||
trx_ulogf_t* log_hdr,/* in: undo log header */
|
||||
XID* xid, /* in: X/Open XA Transaction Identification */
|
||||
const XID* xid, /* in: X/Open XA Transaction Identification */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
mlog_write_ulint(log_hdr + TRX_UNDO_XA_FORMAT, xid->formatID,
|
||||
@ -568,7 +568,7 @@ trx_undo_write_xid(
|
||||
mlog_write_ulint(log_hdr + TRX_UNDO_XA_BQUAL_LEN, xid->bqual_length,
|
||||
MLOG_4BYTES, mtr);
|
||||
|
||||
mlog_write_string(log_hdr + TRX_UNDO_XA_XID, xid->data,
|
||||
mlog_write_string(log_hdr + TRX_UNDO_XA_XID, (const byte*) xid->data,
|
||||
XIDDATASIZE, mtr);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user