Bug #10539 | When inserting out of range value in BIT, different engines behaves differently | ||
---|---|---|---|
Submitted: | 11 May 2005 10:57 | Modified: | 24 Jun 2005 11:38 |
Reporter: | Disha | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.5 Beta | OS: | Windows (Windows 2003) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[11 May 2005 10:57]
Disha
[11 May 2005 18:07]
MySQL Verification Team
I was able for to repeat this on Windows server. I will test again with same changeset as Linux server.
[12 May 2005 0:14]
MySQL Verification Team
I was able to repeat only with Windows server.
[13 May 2005 7:38]
Sergei Golubchik
I also repeated on freebsd
[18 May 2005 12:28]
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/25035
[6 Jun 2005 8:42]
Ramil Kalimullin
Fixed in 5.0.7
[23 Jun 2005 13:32]
Jon Stephens
I tested this on 5.0.7-beta-nt-max (Windows 2000 Server). With SQL_MODE='mysql40', the out-of-range value was truncated and inserted as inspected, and generated an approipriate warning. However, with SQL_MODE='traditional', I obtained the following result: mysql> create table b1 (c bit(8)); Query OK, 0 rows affected (0.16 sec) mysql> insert into b1 values (b'100'); Query OK, 1 row affected (0.06 sec) mysql> insert into b1 values (b'1100'); Query OK, 1 row affected (0.02 sec) mysql> insert into b1 values (b'100000000'); ERROR 1264 (22003): Out of range value adjusted for column 'c' at row 1 mysql> SELECT bin(c+0) FROM b1; +----------+ | bin(c+0) | +----------+ | 100 | | 1100 | +----------+ 2 rows in set (0.00 sec) The result was identical using either the MyISAM or the InnoDB storage engine. Whilst the behaviour itself is correct in that the value is not inserted, the error message needs to be modified accordingly, as the value is not 'adjusted'; rather it is not used at all.
[24 Jun 2005 11:38]
Jon Stephens
Opened new bug at developer request, as the problem with error messages which I noted previously constitutes a separate issue. See http://bugs.mysql.com/11546