diff options
author | unknown <marko@hundin.mysql.fi> | 2005-01-27 14:05:44 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-01-27 14:05:44 +0200 |
commit | a12d52a1d7ff3ae0c6baca766400e7966c6e45a5 (patch) | |
tree | 2e2d306cd121c5e694d692fe0b4ce4649486ef54 /sql/ha_innodb.cc | |
parent | f7ad2046060e7708567394173038d4fae0ca2adc (diff) | |
download | mariadb-git-a12d52a1d7ff3ae0c6baca766400e7966c6e45a5.tar.gz |
InnoDB: Tolerate negative return values from ftell().
sql/ha_innodb.cc:
Tolerate negative return values from ftell().
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2e441b4f085..1a870ce3abf 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4346,12 +4346,12 @@ ha_innobase::update_table_comment( (ulong) innobase_get_free_space()); dict_print_info_on_foreign_keys(FALSE, file, prebuilt->table); flen = ftell(file); - if(length + flen + 3 > 64000) { + if (flen < 0) { + flen = 0; + } else if (length + flen + 3 > 64000) { flen = 64000 - 3 - length; } - ut_ad(flen > 0); - /* allocate buffer for the full string, and read the contents of the temporary file */ @@ -4414,12 +4414,12 @@ ha_innobase::get_foreign_key_create_info(void) prebuilt->trx->op_info = (char*)""; flen = ftell(file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if(flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen >= 0); - /* allocate buffer for the string, and read the contents of the temporary file */ @@ -4800,12 +4800,12 @@ innodb_show_status( srv_printf_innodb_monitor(srv_monitor_file); flen = ftell(srv_monitor_file); os_file_set_eof(srv_monitor_file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if (flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen > 0); - /* allocate buffer for the string, and read the contents of the temporary file */ |