mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
bug#24303 Wrong result for UPDATE IGNORE for NDB table: Read all fields for UPDATE IGNORE with pk
This commit is contained in:
parent
3cb564e2dc
commit
cf58d3a136
2 changed files with 10 additions and 1 deletions
|
@ -18,7 +18,7 @@ pk1 b c
|
|||
2 2 2
|
||||
4 1 1
|
||||
UPDATE t1 set pk1 = 4 where pk1 = 2;
|
||||
ERROR 23000: Duplicate entry '4' for key 1
|
||||
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
|
||||
UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
|
||||
select * from t1 order by pk1;
|
||||
pk1 b c
|
||||
|
|
|
@ -3835,6 +3835,15 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
|
|||
DBUG_PRINT("info", ("HA_EXTRA_IGNORE_DUP_KEY"));
|
||||
DBUG_PRINT("info", ("Ignoring duplicate key"));
|
||||
m_ignore_dup_key= TRUE;
|
||||
if (table_share->primary_key != MAX_KEY)
|
||||
{
|
||||
/*
|
||||
Table has a primary key
|
||||
We need to read all fields for UPDATE IGNORE of pk
|
||||
since this is implemented as delete+insert
|
||||
*/
|
||||
bitmap_set_all(table->read_set);
|
||||
}
|
||||
break;
|
||||
case HA_EXTRA_NO_IGNORE_DUP_KEY:
|
||||
DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY"));
|
||||
|
|
Loading…
Reference in a new issue