Skip to content
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

PANIC occurs during bind Insert #110

Closed
Joeyscat opened this issue Dec 18, 2023 · 1 comment
Closed

PANIC occurs during bind Insert #110

Joeyscat opened this issue Dec 18, 2023 · 1 comment
Assignees
Labels
invalid This doesn't seem right

Comments

@Joeyscat
Copy link
Contributor

Bug Report

What version of KipSQL are you using?
0.0.1-alpha.6

What version of Rust are you using?

❯ rustc -V
rustc 1.76.0-nightly (de686cbc6 2023-12-14)

What's the status of the running?

What did you do?

> πŸ‘‡πŸ‘‡πŸ»πŸ‘‡πŸΌπŸ‘‡πŸ½πŸ‘‡πŸΎπŸ‘‡πŸΏ <
create table blog_1 (id int primary key, title varchar unique, created_at datetime);

+----------------------+
| CREATE TABLE SUCCESS |
+======================+
| blog_1               |
+----------------------+

> πŸ‘‡πŸ‘‡πŸ»πŸ‘‡πŸΌπŸ‘‡πŸ½πŸ‘‡πŸΎπŸ‘‡πŸΏ <
insert into blog_1 (id, title) values (0, 'KipSQL', '2022-10-12 12:22:33');
thread 'main' panicked at /home/jojo/code/open-source/kipsql/src/binder/insert.rs:52:52:
index out of bounds: the len is 2 but the index is 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What did you expect to see?
Insert bind fails with error

> πŸ‘‡πŸ‘‡πŸ»πŸ‘‡πŸΌπŸ‘‡πŸ½πŸ‘‡πŸΎπŸ‘‡πŸΏ <
insert into blog_1 (id, title) values (0, 'KipSQL', '2022-10-12 12:22:33');
Oops!: bind error: column count not match, expect 2, got 3

What did you see instead?
PANIC occurs when the number of columns does not match the expression during bind Insert.

> πŸ‘‡πŸ‘‡πŸ»πŸ‘‡πŸΌπŸ‘‡πŸ½πŸ‘‡πŸΎπŸ‘‡πŸΏ <
insert into blog_1 (id, title) values (0, 'KipSQL', '2022-10-12 12:22:33');
thread 'main' panicked at /home/jojo/code/open-source/kipsql/src/binder/insert.rs:52:52:
index out of bounds: the len is 2 but the index is 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@KKould
Copy link
Member

KKould commented Dec 19, 2023

Thank you very much for your contribution, I will put this case in the insert test at the weekend ref: https://github.com/KipData/kipsql/blob/main/tests/slt/insert.slt

@KKould KKould closed this as completed Dec 20, 2023
@KKould KKould added bug Something isn't working invalid This doesn't seem right and removed bug Something isn't working labels Dec 20, 2023
KKould added a commit to KKould/KipSQL that referenced this issue Dec 21, 2023
@KKould KKould mentioned this issue Dec 21, 2023
9 tasks
KKould added a commit that referenced this issue Dec 25, 2023
* feat: valid column & table name

* perf: use advance calculation of OrderBy Values to avoid double calculations

* test: add test case for issue #110

* code fmt

* perf: reconstruction Sort operator reconstruction using radix sort + memcomparable encode

ref https://duckdb.org/2021/08/27/external-sorting.html

* code fmt

* fix: nulls first default true

* test: add multi-null value case

* code fmt

* perf: filter Key after sorting

* code fmt

* fix: index out of bounds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants