bug#24303 Wrong result for UPDATE IGNORE for NDB table: Read all fields for UPDATE IGNORE with pk

parent 3cb564e2
...@@ -18,7 +18,7 @@ pk1 b c ...@@ -18,7 +18,7 @@ pk1 b c
2 2 2 2 2 2
4 1 1 4 1 1
UPDATE t1 set pk1 = 4 where pk1 = 2; 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; UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
select * from t1 order by pk1; select * from t1 order by pk1;
pk1 b c pk1 b c
......
...@@ -3835,6 +3835,15 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) ...@@ -3835,6 +3835,15 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
DBUG_PRINT("info", ("HA_EXTRA_IGNORE_DUP_KEY")); DBUG_PRINT("info", ("HA_EXTRA_IGNORE_DUP_KEY"));
DBUG_PRINT("info", ("Ignoring duplicate key")); DBUG_PRINT("info", ("Ignoring duplicate key"));
m_ignore_dup_key= TRUE; 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; break;
case HA_EXTRA_NO_IGNORE_DUP_KEY: case HA_EXTRA_NO_IGNORE_DUP_KEY:
DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY")); DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY"));
......
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