From a4d8ed871a52d0e2e424698da570c3ba87bec86b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Oct 2004 10:32:52 +0400 Subject: Fix for broken --with-csv-storage-engine build. Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/examples/ha_example.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/examples/ha_tina.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). --- sql/examples/ha_example.cc | 4 ++-- sql/examples/ha_tina.cc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/examples') diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 097abd48e05..cb0780ea74d 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -263,8 +263,8 @@ int ha_example::write_row(byte * buf) clause was used. Consecutive ordering is not guarenteed. Currently new_data will not have an updated auto_increament record, or and updated timestamp field. You can do these for example by doing these: - if (table->timestamp_on_update_now) - update_timestamp(new_row+table->timestamp_on_update_now-1); + if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) + table->timestamp_field->set_time(); if (table->next_number_field && record == table->record[0]) update_auto_increment(); diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 06a19e478ae..0345a170c3c 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -428,8 +428,8 @@ int ha_tina::write_row(byte * buf) statistic_increment(ha_write_count,&LOCK_status); - 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(); size= encode_quote(buf); @@ -464,8 +464,8 @@ int ha_tina::update_row(const byte * old_data, byte * new_data) statistic_increment(ha_update_count,&LOCK_status); - if (table->timestamp_default_now) - update_timestamp(new_data+table->timestamp_default_now-1); + if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) + table->timestamp_field->set_time(); size= encode_quote(new_data); -- cgit v1.2.1