summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authordlenev@jabberwock.localdomain <>2004-04-02 10:12:53 +0400
committerdlenev@jabberwock.localdomain <>2004-04-02 10:12:53 +0400
commitf6bff2e6c662d4778f86a919b6f7b731d2553f44 (patch)
tree9a60588328f7225c26e34d7cf0ce3ae4875c3523 /sql/ha_myisam.cc
parent4533338075714e2be7d4cfc8b2825cb52917603f (diff)
downloadmariadb-git-f6bff2e6c662d4778f86a919b6f7b731d2553f44.tar.gz
WL#1266 "Separate auto-set logic from TIMESTAMP type."
Final version of patch. Adds support for specifying of DEFAULT NOW() and/or ON UPDATE NOW() clauses for TIMESTAMP field definition. Current implementation allows only one such field per table and uses several unireg types for storing info about this properties of field. It should be replaced with better implementation when new .frm format is introduced.
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index a2a5f040081..cc8f84c4b00 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -253,9 +253,8 @@ int ha_myisam::write_row(byte * buf)
statistic_increment(ha_write_count,&LOCK_status);
/* If we have a timestamp column, update it to the current time */
-
- if (table->time_stamp)
- update_timestamp(buf+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(buf+table->timestamp_default_now-1);
/*
If we have an auto_increment column and we are writing a changed row
@@ -937,8 +936,8 @@ bool ha_myisam::is_crashed() const
int ha_myisam::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now-1);
return mi_update(file,old_data,new_data);
}