diff options
author | Timothy Smith <timothy.smith@sun.com> | 2009-03-11 18:15:46 -0600 |
---|---|---|
committer | Timothy Smith <timothy.smith@sun.com> | 2009-03-11 18:15:46 -0600 |
commit | a33a51e2a8cd07b684020753453ecb29fa668733 (patch) | |
tree | a3104376c93e0496b341f0cf92d7d1532232b2cc /storage/innobase/handler/ha_innodb.cc | |
parent | 50851796a5cd4f38268f9e986ef728e9651c0bd1 (diff) | |
download | mariadb-git-a33a51e2a8cd07b684020753453ecb29fa668733.tar.gz |
Applying InnoDB snashot 5.1-ss4350, part 2. Fixes
Bug #42400 InnoDB autoinc code can't handle floating-point columns
Detailed revision comments:
r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines
branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC
is only defined for integer columns. This caused an assertion failure when
we checked for the maximum value of a column type. We now calculate the
max value for floating-point autoinc columns too.
Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns
rb://84 and Mantis issue://162
r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines
branches/5.1: Add the ULL suffix otherwise there is an overflow.
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 522392edc7a..22e69852dc2 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3405,7 +3405,7 @@ skip_field: } /************************************************************************ -Get the upper limit of the MySQL integral type. */ +Get the upper limit of the MySQL integral and floating-point type. */ ulonglong ha_innobase::innobase_get_int_col_max_value( @@ -3444,12 +3444,20 @@ ha_innobase::innobase_get_int_col_max_value( max_value = 0x7FFFFFFFULL; break; /* BIG */ - case HA_KEYTYPE_ULONGLONG: + case HA_KEYTYPE_ULONGLONG: max_value = 0xFFFFFFFFFFFFFFFFULL; break; case HA_KEYTYPE_LONGLONG: max_value = 0x7FFFFFFFFFFFFFFFULL; break; + case HA_KEYTYPE_FLOAT: + /* We use the maximum as per IEEE754-2008 standard, 2^24 */ + max_value = 0x1000000ULL; + break; + case HA_KEYTYPE_DOUBLE: + /* We use the maximum as per IEEE754-2008 standard, 2^53 */ + max_value = 0x20000000000000ULL; + break; default: ut_error; } |