Bug #14532 BIT type broken on federated
Submitted: 1 Nov 2005 1:59 Modified: 2 Sep 2006 4:10
Reporter: Patrick Galbraith
Status: Closed
Category:Server: Federated Severity:S3 (Non-critical)
Version:5.0.16-debug-log (bk) OS:Linux (Linux/x86)
Assigned to: Bugs System Target Version:

[1 Nov 2005 1:59] Patrick Galbraith
Description:
Upon inserting into a table that has a bit type, the insert fails due to the fact that
the data is inserted without proper quoting binary values:

was being inserted as "INSERT INTO tbl `bitcol` VALUES (^A)" 

should be "INSERT INTO tbl `bitcol` VALUES (`^A`)"

(from the initial query "INSERT INTO tbl `bitcol` VALUES (b'001`)"

How to repeat:
create table t1  (
 `bitcol` bit(3)
) ENGINE=FEDERATED CONNECTION="mysql://user@host/db/tablename";

INSERT  INTO t1 `bitcol` VALUES (b'001');

see it fail.

Suggested fix:
have a fix to field.cc already.
[1 Nov 2005 2:18] 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/31710
[1 Nov 2005 2: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/31712
[13 Mar 2006 10:01] Patrick Galbraith
I will recreate this patch and test, commit and get a review while in Sorrento.
[19 Jul 2006 5:04] Patrick Galbraith
fixed with patch for http://bugs.mysql.com/bug.php?id=17608

mysql> create table t1  (  `bitcol` bit(3) ) ENGINE=FEDERATED
CONNECTION="mysql://root@localhost/test/t1";
Query OK, 0 rows affected (0.00 sec)

mysql> delete from t1;
Query OK, 1 row affected (0.00 sec)

mysql> drop table t1;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t1  (  `bitcol` bit(3) ) ENGINE=FEDERATED
CONNECTION="mysql://root@localhost/test/t1";
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT  INTO t1 (bitcol) VALUES (b'001');
Query OK, 1 row affected (0.00 sec)

mysql> select hex(bitcol) from t1;
+-------------+
| hex(bitcol) |
+-------------+
| 1           |
+-------------+
1 row in set (0.00 sec)

mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.0.25-debug-log |
+------------------+
1 row in set (0.00 sec)

mysql>
[4 Aug 2006 14:31] 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/commits/10049

ChangeSet@1.2279, 2006-08-04 14:31:13+02:00, pgalbraith@production.mysql.com +2 -0
  "BUG #14532: BIT type broken on federated"
  
  Added bit type to test and new results for federated test
  
  federated.test:
    "BUG #14532: BIT type broken on federated"
    Added test for bit type as listed in bug report
  federated.result:
    "BUG #14532: BIT type broken on federated"
    Result of new bit type test
[8 Aug 2006 22:47] Antony Curtis
for a very basic test, this patch is ok.
[15 Aug 2006 9:06] Patrick Galbraith
I was about to figure out getting this into 5.0-engines (which needs to be merged with
5.1-engines) and noticed this has had test coverage for some time (both trees have a test
for bit type)
[15 Aug 2006 14:56] Jon Stephens
For documentation purposes, we need to know the 3-part release number(s) in which the fix
appeared. Thanks.
[16 Aug 2006 17:33] Patrick Galbraith
5.0.25
[2 Sep 2006 4:10] Paul DuBois
Noted in 5.0.25 changelog.

Inserts into BIT columns of FEDERATED tables did not work.