bug#24303 Wrong result for UPDATE IGNORE for NDB table: Refinement, only read...

bug#24303  Wrong result for UPDATE IGNORE for NDB table: Refinement, only read all fields for UPDATE IGNORE with pk (check if UPDATE command and pk in write_set)
parent cf58d3a1
...@@ -3835,10 +3835,13 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) ...@@ -3835,10 +3835,13 @@ 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) if (current_thd->lex->sql_command == SQLCOM_UPDATE &&
table_share->primary_key != MAX_KEY &&
bitmap_is_set(table->write_set, table_share->primary_key))
{ {
/* /*
Table has a primary key An UPDATE and table has a primary key that is
about to be updated
We need to read all fields for UPDATE IGNORE of pk We need to read all fields for UPDATE IGNORE of pk
since this is implemented as delete+insert since this is implemented as delete+insert
*/ */
......
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