Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.0.10
-
None
-
None
Description
Found while merging type_bit test. type_bit patch attached.
CREATE TABLE t1(f1 bit(2) NOT NULL default b'10',f2 bit(14) NOT NULL default b'11110000111100');
|
INSERT INTO t1 (f1) VALUES (DEFAULT);
|
INSERT INTO t1 VALUES (b'',b''),('','');
|
SELECT HEX(f1), HEX(f2) FROM t1;
|
HEX(f1) HEX(f2)
|
2 3C3C
|
2 3C8F <!-------- should be 0 0?
|
0 0
|
DROP TABLE t1;
|
Attachments
Issue Links
- is part of
-
MDEV-4784 merge test cases from 5.6
-
- Stalled
-
Here' s what we have for MyISAM (the correct result):
MariaDB [test]> CREATE TABLE t1(f1 bit(2)) ENGINE=MYISAM;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> INSERT INTO t1 VALUES (b'');
Query OK, 1 row affected (0.00 sec)
MariaDB [test]> SELECT HEX(f1) from t1;
+---------+
| HEX(f1) |
+---------+
| 0 |
+---------+
1 row in set (0.00 sec)
MariaDB [test]> SELECT bin(f1) from t1;
+---------+
| bin(f1) |
+---------+
| 0 |
+---------+
1 row in set (0.00 sec)
And here's what we have for INNODB (an incorrect result):
MariaDB [test]> CREATE TABLE t2(f1 bit(2)) ENGINE=INNODB;
Query OK, 0 rows affected (0.06 sec)
MariaDB [test]> INSERT INTO t2 VALUES (b'');
Query OK, 1 row affected (0.01 sec)
MariaDB [test]> SELECT HEX(f1) from t2;
+---------+
| HEX(f1) |
+---------+
| 8F |
+---------+
1 row in set (0.00 sec)
MariaDB [test]> SELECT bin(f1) from t2;
+----------+
| bin(f1) |
+----------+
| 10001111 |
+----------+
1 row in set (0.00 sec)
mysql-5.6 returns the correct result in both cases.