#At file:///E:/mysqlsrc/mysql-5.1-bugteam-windows-warning/ based on
revid:gshchepa@stripped
2875 Anurag Shekhar 2009-05-13
Bug #39802 On Windows, 32-bit time_t should be enforced
This patch fixes compilation warning, "conversion from 'time_t' to 'ulong',
possible loss of data".
The fix is to typecast time_t to ulong before assigning it to ulong.
Backported this from 6.0-bugteam tree.
@ storage/archive/ha_archive.cc
type casting time_t to ulong before assigning.
@ storage/federated/ha_federated.cc
type casting time_t to ulong before assigning.
@ storage/innobase/handler/ha_innodb.cc
type casting time_t to ulong before assigning.
@ storage/myisam/ha_myisam.cc
type casting time_t to ulong before assigning.
modified:
storage/archive/ha_archive.cc
storage/federated/ha_federated.cc
storage/innobase/handler/ha_innodb.cc
storage/myisam/ha_myisam.cc
=== modified file 'storage/archive/ha_archive.cc'
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2009-03-26 14:27:34 +0000
+++ b/storage/archive/ha_archive.cc 2009-05-13 10:11:24 +0000
@@ -1474,8 +1474,8 @@
stats.mean_rec_length= table->s->reclength + buffer.alloced_length();
stats.data_file_length= file_stat.st_size;
- stats.create_time= file_stat.st_ctime;
- stats.update_time= file_stat.st_mtime;
+ stats.create_time= (ulong) file_stat.st_ctime;
+ stats.update_time= (ulong) file_stat.st_mtime;
stats.max_data_file_length= share->rows_recorded * stats.mean_rec_length;
}
stats.delete_length= 0;
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2009-02-13 16:41:47 +0000
+++ b/storage/federated/ha_federated.cc 2009-05-13 10:11:24 +0000
@@ -2850,10 +2850,10 @@
stats.data_file_length= stats.records * stats.mean_rec_length;
if (row[12] != NULL)
- stats.update_time= (time_t) my_strtoll10(row[12], (char**) 0,
+ stats.update_time= (ulong) my_strtoll10(row[12], (char**) 0,
&error);
if (row[13] != NULL)
- stats.check_time= (time_t) my_strtoll10(row[13], (char**) 0,
+ stats.check_time= (ulong) my_strtoll10(row[13], (char**) 0,
&error);
}
/*
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2009-04-15 12:41:54 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2009-05-13 10:11:24 +0000
@@ -6012,7 +6012,7 @@
nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
if (os_file_get_status(path,&stat_info)) {
- stats.create_time = stat_info.ctime;
+ stats.create_time = (ulong) stat_info.ctime;
}
}
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2009-04-30 12:52:48 +0000
+++ b/storage/myisam/ha_myisam.cc 2009-05-13 10:11:24 +0000
@@ -1784,7 +1784,7 @@
stats.data_file_length= misam_info.data_file_length;
stats.index_file_length= misam_info.index_file_length;
stats.delete_length= misam_info.delete_length;
- stats.check_time= misam_info.check_time;
+ stats.check_time= (ulong) misam_info.check_time;
stats.mean_rec_length= misam_info.mean_reclength;
}
if (flag & HA_STATUS_CONST)
@@ -1792,7 +1792,7 @@
TABLE_SHARE *share= table->s;
stats.max_data_file_length= misam_info.max_data_file_length;
stats.max_index_file_length= misam_info.max_index_file_length;
- stats.create_time= misam_info.create_time;
+ stats.create_time= (ulong) misam_info.create_time;
ref_length= misam_info.reflength;
share->db_options_in_use= misam_info.options;
stats.block_size= myisam_block_size; /* record block size */
@@ -1831,7 +1831,7 @@
my_store_ptr(dup_ref, ref_length, misam_info.dupp_key_pos);
}
if (flag & HA_STATUS_TIME)
- stats.update_time = misam_info.update_time;
+ stats.update_time = (ulong) misam_info.update_time;
if (flag & HA_STATUS_AUTO)
stats.auto_increment_value= misam_info.auto_increment;
Attachment: [text/bzr-bundle] bzr/anurag.shekhar@sun.com-20090513101124-4e4xt4xc5noz2ylt.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (anurag.shekhar:2875)Bug#39802 | Anurag Shekhar | 13 May 2009 |