[MCOL-266] BOOLEAN data type not supported Created: 2016-08-18  Updated: 2018-10-11  Resolved: 2018-10-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0

Type: New Feature Priority: Minor
Reporter: Andrew Hutchings (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: contribution, relnote

Epic Link: ColumnStore Compatibility Improvements
Sprint: 2018-18

 Description   

BOOLEAN data type is not currently supported



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-10-08 ]

Reviewing external contribution from tntnatbry

Comment by Daniel Lee (Inactive) [ 2018-10-08 ]

Build tested: 1.2 source

/root/columnstore/mariadb-columnstore-server
commit 6b44f0d9c453ede53024f525b7ddf32b5323171b
Merge: 7db44a7 853a0f7
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Sep 27 20:37:03 2018 +0100

Merge pull request #134 from mariadb-corporation/versionCmakeFix

port changes for mysql_version cmake to fix columnstore RPM packaging

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 6ee12248b8764569ca7e965b5cc35746b25d816c
Merge: 068b168 47fbf62
Author: Roman Nozdrin <drrtuy@gmail.com>
Date: Mon Oct 8 11:22:42 2018 +0300

Merge pull request #586 from mariadb-corporation/MCOL-1775

MCOL-1775 Fix addtime/subtime for WHERE

Found couple issues with alter table:

Add column does not support using true or false as default value.

MariaDB [mytest]> alter table t1 add column c10 boolean default true;
ERROR 1815 (HY000): Internal error: The default value is out of range for the specified data type.

Change column does not recognize boolean as data type

MariaDB [mytest]> alter table t1 change column c1 c10 boolean;
ERROR 1815 (HY000): Internal error: CAL0001: Alter table Failed: Changing the datatype of a column is not supported

this one worked with integer.

MariaDB [mytest]> alter table t1 change column c1 c10 integer;
Query OK, 0 rows affected (0.115 sec)
Records: 0 Duplicates: 0 Warnings: 0

Comment by Daniel Lee (Inactive) [ 2018-10-08 ]

The following areas have been tested:

create table, with or without default

alter table

add column
when adding boolean column, it takes 0 or 1 as default value. quoted or not

      • It does not take true or false, quoted or not

MariaDB [mytest]> alter table t1 add column c10 boolean default true;
ERROR 1815 (HY000): Internal error: The default value is out of range for the specified data type.

MariaDB [mytest]> alter table t1 change column c1 c10 boolean;
ERROR 1815 (HY000): Internal error: CAL0001: Alter table Failed: Changing the datatype of a column is not supported

drop column

colxml
boolean has the same definition as tinyint

editem

dml

insert with true , false, 1, 0
insert positive and negative value saturation

update with true, false, 1, 0.
update to another numeric column
update from an integer column
update from an integer columns with out of range values, saturation occurred
update with characters, failed as expected
update from a varchar column with characters, failed as expected
update to a varchar column
update integer columns * (-1)
update positive and negative value saturation

query
where clause
worked with true, false, 1, 0, is null, is not null, in where clause

join
column = column, worked just like a numeric column

truncate

cpimport
It takes numeric values only, over range value saturation ok

      • TRUE, FALSE, true, false, True also saturated to 0
      • NULL handling is incorrect
Comment by Andrew Hutchings (Inactive) [ 2018-10-09 ]

Modified the code to allow true/false as default values.

We can only support change of matching data type and digits. So you could change tinyint(1) to Boolean and back again. But not any other int type (including tinyint's default digits of tinyint(4)).

Comment by Daniel Lee (Inactive) [ 2018-10-11 ]

Build verified: 1.2 source

/root/columnstore/mariadb-columnstore-server
commit 6b44f0d9c453ede53024f525b7ddf32b5323171b
Merge: 7db44a7 853a0f7
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Sep 27 20:37:03 2018 +0100

Merge pull request #134 from mariadb-corporation/versionCmakeFix

port changes for mysql_version cmake to fix columnstore RPM packaging

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 39c283281af045e5b5fb3fe3f399b21a6b1236ca
Merge: 46775f8 19c8a2b
Author: Roman Nozdrin <drrtuy@gmail.com>
Date: Wed Oct 10 20:11:12 2018 +0300

Merge pull request #588 from mariadb-corporation/MCOL-266

MCOL-266 Support true/false DDL default values

The alter table add columns with default value issue has been fixed.

Generated at Thu Feb 08 02:19:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.