[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Innodb and timestamps


Hi!

Thank you for the bug report. 3 lines of code had been omitted
from mysql/sql/ha_innobase.cc and that causes the timestamp
not to be updated in a row update.

If you compile yourself you can use the patch below.
Add the lines marked with '+' to function ha_innobase::update_row.

Best regards,

Heikki
http://www.innodb.com

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	heikki
# Host:	donna.mysql.fi
# Root:	/home/heikki/mysqlf

--- 1.34/sql/ha_innobase.cc	Thu Jun  7 00:10:57 2001
+++ 1.35/sql/ha_innobase.cc	Thu Jun 28 17:19:34 2001
@@ -1523,6 +1523,10 @@
 
 	DBUG_ENTER("ha_innobase::update_row");
 
+        if (table->time_stamp) {
+                update_timestamp(new_row + table->time_stamp - 1);
+	}
+
 	if (last_query_id != user_thd->query_id) {
 	        prebuilt->sql_stat_start = TRUE;
                 last_query_id = user_thd->query_id;


At 02:55 PM 6/28/01 +0300, you wrote:
>Content-Type: message/rfc822
>Content-Description: forwarded message
>Content-Transfer-Encoding: 7bit
>
>Subject: Innodb and timestamps
>From: Noel Clarkson <noel.clarkson@xxxxxxxxxxxxxx>
>To: "mysql@xxxxxxxxxxxxxxx" <mysql@xxxxxxxxxxxxxxx>
>Date: Thu, 28 Jun 2001 12:10:12 +1000
>Organization: UCA
>
>Hi there,
>
>I'm using MaxSQL 3.23.39 and have set up an innodb table but when I run an 
>update statement the timestamp field does not update automatically.  Is 
>anyone else experiencing this, or is it an expected behaviour of innodb 
>tables?  I couldn't find anything in the manual saying that this was 
>different for innodb tables.  Below is an example of what I did and the 
>results.
>
>running on Red Hat linux 6.1.
>
>cheers,
>
>noel
>
>mysql> create table tbl_test(name varchar(10), lastedit timestamp) 
>type=innodb;
>Query OK, 0 rows affected (0.04 sec)
>
>mysql> describe tbl_test;
>+----------+---------------+------+-----+---------+-------+
>| Field    | Type          | Null | Key | Default | Extra |
>+----------+---------------+------+-----+---------+-------+
>| name     | varchar(10)   | YES  |     | NULL    |       |
>| lastedit | timestamp(14) | YES  |     | NULL    |       |
>+----------+---------------+------+-----+---------+-------+
>2 rows in set (0.01 sec)
>
>mysql> insert into tbl_test(name) values('bob');
>Query OK, 1 row affected (0.00 sec)
>
>mysql> insert into tbl_test(name) values('ted');
>Query OK, 1 row affected (0.00 sec)
>
>mysql> select * from tbl_test;
>+------+----------------+
>| name | lastedit       |
>+------+----------------+
>| bob  | 20010613171610 |
>| ted  | 20010613171618 |
>+------+----------------+
>2 rows in set (0.00 sec)
>
>mysql> update tbl_test set name='fred' where name='ted';
>Query OK, 1 row affected (0.00 sec)
>Rows matched: 1  Changed: 1  Warnings: 0
>
>mysql> commit;
>Query OK, 0 rows affected (0.03 sec)
>
>mysql> select * from tbl_test;
>+------+----------------+
>| name | lastedit       |
>+------+----------------+
>| bob  | 20010613171610 |
>| fred | 20010613171618 |
>+------+----------------+
>2 rows in set (0.00 sec)
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <mysql-thread77875@xxxxxxxxxxxxxxx>
>To unsubscribe, e-mail <mysql-unsubscribe-sinisa=mysql.com@xxxxxxxxxxxxxxx>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>Content-Type: text/plain; charset=us-ascii
>Content-Description: message body and .signature
>Content-Transfer-Encoding: 7bit
>
>
>Something for you.
>
>-- 
>Regards,
>   __  ___     ___ ____  __
>  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <sinisa@xxxxxxxxx>
> / /|_/ / // /\ \/ /_/ / /__   MySQL AB, FullTime Developer
>/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
>       <___/   www.mysql.com
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread77926@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.