summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2004-10-01 18:54:06 +0400
committerdlenev@brandersnatch.localdomain <>2004-10-01 18:54:06 +0400
commit2511990c978137fe0bc81657e160a6d537bc957f (patch)
treeef52125fb61cc2cbe211c25d6ef541c0ca4cb188 /sql/ha_myisam.cc
parentd03f447f84936ccd8687d460f23ae020df41b95e (diff)
downloadmariadb-git-2511990c978137fe0bc81657e160a6d537bc957f.tar.gz
Support for TIMESTAMP columns holding NULL values. Unlike all other
column types TIMESTAMP is NOT NULL by default, so in order to have TIMESTAMP column holding NULL valaues you have to specify NULL as one of its attributes (this needed for backward compatibility). Main changes: Replaced TABLE::timestamp_default_now/on_update_now members with TABLE::timestamp_auto_set_type flag which is used everywhere for determining if we should auto-set value of TIMESTAMP field during this operation or not. We are also use Field_timestamp::set_time() instead of handler::update_timestamp() in handlers.
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 95a294764d3..729ec4c27eb 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -251,8 +251,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->timestamp_default_now)
- update_timestamp(buf+table->timestamp_default_now-1);
+ if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
+ table->timestamp_field->set_time();
/*
If we have an auto_increment column and we are writing a changed row
@@ -1070,8 +1070,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->timestamp_on_update_now)
- update_timestamp(new_data+table->timestamp_on_update_now-1);
+ if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
+ table->timestamp_field->set_time();
return mi_update(file,old_data,new_data);
}