List:Internals« Previous MessageNext Message »
From:Benjamin Pflugmann Date:August 30 2001 2:55am
Subject:Re: understanding the source
View as plain text  

Another question. I have tried to figure this out for over half an
hour now and don't get it. If I start to annoy you, just tell me and I
will search for some longer.

The problem is within the intended ha_myisammrg::write_row:

--- mysql-3.23.40/sql/	Wed Jul 18 23:19:10 2001
+++ mysql-3.23.40-philemon/sql/	Thu Aug 30 04:36:49 2001
@@ -67,5 +67,11 @@
 int ha_myisammrg::write_row(byte * buf)
-  return (my_errno=HA_ERR_WRONG_COMMAND);
+  statistic_increment(ha_write_count,&LOCK_status);
+  if (table->time_stamp)
+    update_timestamp(buf+table->time_stamp-1);
+  if (table->next_number_field && buf == table->record[0])
+      return (my_errno=HA_ERR_WRONG_COMMAND);
+  /*  update_auto_increment();   [phi] have to check this before allowing it */
+  return myrg_write(file,buf);

This is mainly taken from ha_myisam::write_row and I just assured that
everything still makes sense. My problem with that is, that I cannot
figure out what "buf == table->record[0]" is intended to do/mean. I
understand that table->record[0] seems to be a pointer to a "row".

But what does the comparison mean (i.e. when is
(buf == table->record[0]) true and when false?) and at which place in
the source is table->record[0] set to the relevant value?

Thank you,


understanding the sourceBenjamin Pflugmann30 Aug
  • bug confirmed (was: Re: understanding the source)Benjamin Pflugmann30 Aug
  • Re: understanding the sourceBenjamin Pflugmann30 Aug
    • Re: understanding the sourceMichael Widenius30 Aug
    • Re: understanding the sourceTimothy Smith30 Aug
      • Re: understanding the sourceMichael Widenius2 Sep
  • understanding the sourceMichael Widenius2 Sep