dbeaver / dbeaver/dbeaver

With MariadDB: MAX() on BIT(1) is shown as 48 or 49, not 0 or 1

Open
#15,329 2 comments 0 reactions 1 assignee Claimed by @ShadelessFox View on GitHub
x:maria xf:data
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

#### System information:
- Ubuntu 20.04.3 LTS
- DBeaver Version 21.3.3.202201221033

#### Connection specification:
- 10.5.13-MariaDB running on centos-linux-release-8.5-1.2111.el8.noarch (VirtualBox)
- org.mariadb.jdbc.Driver
- Driver connects to local port, which is a SSH-tunnel to the server with MariaDB

#### Describe the problem you're observing:

Some columns with BIT-data seems to show 49 or 48 instead of 0 or 1 when connected to a MariaDB-database.
Note that 49 and 48 is the ascii-code for '0' and '1'.

#### Steps to reproduce:

If I'm using MariaDB-client, I get as expected:

```
MariaDB [test]> CREATE OR REPLACE TEMPORARY TABLE temp_bit (b1 BIT(1));

MariaDB [test]> INSERT INTO temp_bit (b1) VALUES (b'1'),(b'1');

MariaDB [test]> SELECT MAX(b1) FROM temp_bit;
+---------+
| MAX(b1) |
+---------+
| 1 |
+---------+
1 row in set (0.001 sec)
```

Running the same in DBeaver gives 49. (Or 48 if MAX() gives b'0')

![image](https://user-images.githubusercontent.com/10186207/151658036-a150b02b-d7d0-40cf-a624-9df27d8e94a3.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.