| Bug #11385 | crash in group by and DIV | ||
|---|---|---|---|
| Submitted: | 16 Jun 2005 14:28 | Modified: | 23 Jun 2005 18:18 |
| Reporter: | Jan Kneschke | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.7/4.1.11 | OS: | Linux (Linux/x86, Windows) |
| Assigned to: | Igor Babaev | CPU Architecture: | Any |
[16 Jun 2005 14:28]
Jan Kneschke
[20 Jun 2005 16:34]
Igor Babaev
This bug was investigated by Alexander Ivanov. Here's his report.
The cause of the crash is as follows. The Field_datetime class inherits the decimals() function from the Field_Str class. This function simply returns NOT_FIXED_DEC = 0x1F value. Within the reported example when the Item_func_int_div::fix_length_and_dec() function is called:
void Item_func_int_div::fix_length_and_dec()
{
find_num_type();
max_length=args[0]->max_length - args[0]->decimals;
maybe_null=1;
}
we obtain:
args[0]->max_length = 0x13
args[0]->decimals = 0x1F
max_length = 0xFFFFFFF4
Later this leads to allocating ALIGN_SIZE(max_length + 1) = 0xFFFFFFF8 bytes.
[20 Jun 2005 17:49]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/26210
[21 Jun 2005 15:31]
Igor Babaev
This patch was prepared by Alexander Ivanov.
The bug was due to the fact that method decimals was not defined for
class Field_datatime, and as a result was inherited from Field_str.
ChangeSet
1.2302 05/06/20 10:49:04 igor@rurik.mysql.com +3 -0
group_by.result:
Added a test case for bug #11385.
group_by.test:
Added a test case for bug #11385.
field.h:
Fixed bug #11385.
The bug was due to not defined method decimals for the class
Field_datetime.
The fix will appear in 4.1.13 and 5.0.8.
[23 Jun 2005 18:18]
Mike Hillyer
Documented in the 4.1.13 and 5.0.8 changelogs.
