List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:April 22 2010 2:10am
Subject:HA_EXTRA_WRITE_CAN_REPLACE flag
View as plain text  
Hello all,

If I understand correctly, the flag HA_EXTRA_WRITE_CAN_REPLACE implies
that handler::write_row can overwrite existing rows, if a duplicate is
found. That is what the comment states, and that is what I heard NDB
does in MySQL Cluster. If this is the case, then I assume that
handler::write_row returns success even when the row is overwritten.

If that is the case, how is this part of the contract honored, as
stated by the MySQL 5.1 reference manual
(http://dev.mysql.com/doc/refman/5.1/en/replace.html):
"The REPLACE statement returns a count to indicate the number of rows
affected. This is the sum of the rows deleted and inserted."

Is something in my understanding not correct? Because it seems that if
handler::write_row silently overwrites an existing row, as
HA_EXTRA_WRITE_CAN_REPLACE seems to allow, then the counts will not be
accurate.

Thanks
-Zardosht
Thread
HA_EXTRA_WRITE_CAN_REPLACE flagZardosht Kasheff22 Apr
  • Re: HA_EXTRA_WRITE_CAN_REPLACE flagVenu Kalyan23 Apr
    • Re: HA_EXTRA_WRITE_CAN_REPLACE flagVenu Kalyan23 Apr
  • Re: HA_EXTRA_WRITE_CAN_REPLACE flagKonstantin Osipov23 Apr
    • Re: HA_EXTRA_WRITE_CAN_REPLACE flagKonstantin Osipov23 Apr
Re: HA_EXTRA_WRITE_CAN_REPLACE flagZardosht Kasheff23 Apr
Re: HA_EXTRA_WRITE_CAN_REPLACE flagZardosht Kasheff23 Apr
  • Re: HA_EXTRA_WRITE_CAN_REPLACE flagVenu Kalyan23 Apr
Re: HA_EXTRA_WRITE_CAN_REPLACE flagZardosht Kasheff24 Apr