Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
Description
Using UNION and UNION ALL redefines datatypes from tinyint(1) to tinyint(4).
How to do:
|
mariadb> create table table_test (column_test_boolean tinyint(1)); |
Query OK, 0 rows affected (0.07 sec) |
|
mariadb> insert into table_test (column_test_boolean) values (1), (0), (1); |
Query OK, 1 row affected (0.00 sec) |
|
|
mariadb> create table table_test_2 select * from table_test;
|
Query OK, 0 rows affected (0.00 sec) |
|
mariadb> desc table_test_2
|
-> ;
|
+---------------------+------------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+---------------------+------------+------+-----+---------+-------+
|
| column_test_boolean | tinyint(1) | YES | | NULL | | |
+---------------------+------------+------+-----+---------+-------+
|
|
mariadb> create table table_test_3 select * from table_test union all select * from table_test;
|
Query OK, 0 rows affected (0.01 sec) |
|
mariadb> desc table_test_3;
|
+---------------------+------------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+---------------------+------------+------+-----+---------+-------+
|
| column_test_boolean | tinyint(4) | YES | | NULL | | |
+---------------------+------------+------+-----+---------+-------+
|
|
It occurs when opening the select, so it affects "select", "create table ... select", "creates view ... as select", ....
The problem is that i use TinyInt(1) fields as boolean,
so TinyInt(4) breaks my code.