manticoresoftware / manticoresoftware/columnar

to_string(a) requires a to be in the select list

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
110
Forks
23
Avg merge
3d 5h
Merged PRs (30d)
8

Description

`to_string()` works only if the `` is in the select list too, otherwise it returns an empty value:

```
mysql> drop table if exists t; create table t(a bool) engine='columnar'; insert into t(id, a) values(1, 1); select to_string(a) from t; select a, to_string(a) from t;
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(a bool) engine='columnar'
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t(id, a) values(1, 1)
--------------

Query OK, 1 row affected (0.00 sec)

--------------
select to_string(a) from t
--------------

--------------
| to_string(a) |
--------------
| |
--------------
1 row in set (0.00 sec)

--------------
select a, to_string(a) from t
--------------

------ --------------
| a | to_string(a) |
------ --------------
| 1 | 1 |
------ --------------
1 row in set (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the SQL sequence in the report, comparing `select to_string(a) from t` with `select a, to_string(a) from t` on a columnar table. Trace the C++ handling of `to_string(bool)` and identify why the expression depends on the select list. Done means the first query returns the boolean value as a string without selecting `a` separately, with a regression test covering both queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.