dolthub / dolthub/dolt

dolt returns boolean values sometimes

Open
#6,044 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bug good repro sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Repro script:
```sh
rm -rf db
mkdir db
cd db

dolt init
dolt version

dolt sql -q "CREATE TABLE t(a INT, b INT);"
dolt sql -q "INSERT INTO t(a, b) VALUES (1, 1), (1, 2);"
dolt sql -q "select count(*) > 0 from t;"
```

Output:
```txt
Successfully initialized dolt data repository.
dolt version 1.2.0
database storage format: NEW ( __DOLT__ )
Query OK, 2 rows affected (0.00 sec)
+--------------+
| count(*) > 0 |
+--------------+
| true |
+--------------+
```

MySQL response to `select count(*) > 0 from t;`:
```txt
COUNT(*) > 0
1
```

Different behavior when using `dolt sql-client` against the same DB directory:
```txt
$ dolt sql-client -u root
# Welcome to the Dolt MySQL client.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
mysql> use db;
Query OK (0.00 sec)
mysql> select count(*) > 0 from t;
+--------------+
| count(*) > 0 |
+--------------+
| 1 |
+--------------+
1 row in set (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.