Skip to content

App crash when run some queries. #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
huyphams opened this issue Dec 9, 2022 · 9 comments · Fixed by #273
Closed

App crash when run some queries. #266

huyphams opened this issue Dec 9, 2022 · 9 comments · Fixed by #273
Labels
need-info Awaiting extra info from community/issue creator priority-high Pretty important bug or issue

Comments

@huyphams
Copy link
Contributor

huyphams commented Dec 9, 2022

The lib would crash when we run the following queries:

  1. Crash when trying to run a query with invalid quotes.
select * from ‟food‟;
  1. Crash when trying to show some binary column

Create table

create table tableplus_crash_example (col AggregateFunction(argMax, Int32, DateTime(3))) engine = Memory;
insert into tableplus_crash_example values (unhex('010000000001089170A883010000'));

Then run this query.

select col from tableplus_crash_example;
@Enmk
Copy link
Contributor

Enmk commented Dec 14, 2022

Hi @huyphams thanks for your report, what is the server version?

@Enmk Enmk added the priority-high Pretty important bug or issue label Dec 14, 2022
@huyphams
Copy link
Contributor Author

I can reproduce with the latest commit 4774da1

@Enmk
Copy link
Contributor

Enmk commented Dec 15, 2022

Ok, what is the server version? There was recently a breaking change on aggregated functions state serializations (I believe between 22.8 and 22.10) so I'm curious is that related...

@huyphams
Copy link
Contributor Author

I'm testing with the ClickHouse version 21.12.3.32

@huyphams
Copy link
Contributor Author

Hi, @Enmk any update on this? we're holding back our release due to this issue. Should we move on or wait for the patch?
Thank you!

Enmk added a commit that referenced this issue Dec 23, 2022
@Enmk
Copy link
Contributor

Enmk commented Dec 23, 2022

@huyphams please see #273 for test sample, does that reproduces your case?

I tested that against 21.12 localy and it works fine:

Note: Google Test filter = *Issue266*
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from Client/ClientCase
[ RUN      ] Client/ClientCase.Issue266/0

+-----------+
| version() |
+-----------+
|    String |
+-----------+
| 21.12.4.1 |
+-----------+



+------+
|  col |
+------+
| Void |
+------+
| Unable to print value of type Void |
+------+

Could you please provide any details regarding the crash? Maybe some stacktrace?

@Enmk Enmk added the need-info Awaiting extra info from community/issue creator label Dec 23, 2022
@huyphams
Copy link
Contributor Author

Hi @Enmk could you check again? I saw that all the tests failed. Btw can you also the first example as it would cause the app to crash?

@Enmk
Copy link
Contributor

Enmk commented Dec 26, 2022

The crash itself is fixed here: #273

However, clickhouse-cpp currently doesn't support reading values of type AggregateFunction(...), so you woudn't be able to SELECT the result. As a workaround, you might want to cast it to String or a FixedString in the SELECT statement.

@Enmk Enmk closed this as completed in #273 Dec 27, 2022
@huyphams
Copy link
Contributor Author

I'm still getting the crash with the query

select * from ‟untitled_table_5‟;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-info Awaiting extra info from community/issue creator priority-high Pretty important bug or issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants