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

bug: array(T) insert don't work #5427

Closed
1 of 2 tasks
wubx opened this issue May 17, 2022 · 0 comments · Fixed by #5429
Closed
1 of 2 tasks

bug: array(T) insert don't work #5427

wubx opened this issue May 17, 2022 · 0 comments · Fixed by #5429
Assignees
Labels
C-bug Category: something isn't working

Comments

@wubx
Copy link
Member

wubx commented May 17, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Version

MySQL [(none)]> select version();
+--------------------------------------------------------------------------+
| @@Version() |
+--------------------------------------------------------------------------+
| 8.0.26--b97c58f-simd(rust-1.61.0-nightly-2022-05-16T16:18:55.377071526Z) |
+--------------------------------------------------------------------------+
1 row in set (0.003 sec)

What's Wrong?

read: https://databend.rs/doc/reference/data-types/data-type-array-types

MySQL [(none)]> CREATE TABLE array_int64_table(arr ARRAY(INT64) NULL);
Query OK, 0 rows affected (0.016 sec)
Read 0 rows, 0.00 B in 0.012 sec., 0 rows/sec., 0.00 B/sec.

MySQL [(none)]> INSERT INTO array_int64_table VALUES([1,2,3,4]),([5,6,7,8]);
Query OK, 0 rows affected (0.019 sec)
Read 2 rows, 88.00 B in 0.015 sec., 136.05 rows/sec., 5.85 KiB/sec.

MySQL [(none)]> select arr[0] from array_int64_table;
+--------+
| arr[0] |
+--------+
| 1 |
| NULL |
+--------+
2 rows in set (0.010 sec)

MySQL [(none)]> select arr from array_int64_table;
+--------------+
| arr |
+--------------+
| [1, 2, 3, 4] |
| NULL |
+--------------+
2 rows in set (0.007 sec)

MySQL [(none)]> INSERT INTO array_int64_table VALUES([1,2,3,4]),([5,6,7,8]);
Query OK, 0 rows affected (0.014 sec)
Read 2 rows, 88.00 B in 0.011 sec., 188.71 rows/sec., 8.11 KiB/sec.

MySQL [(none)]> select arr from array_int64_table;
+--------------+
| arr |
+--------------+
| [1, 2, 3, 4] |
| NULL |
| [1, 2, 3, 4] |
| NULL |
+--------------+
4 rows in set (0.009 sec)

MySQL [(none)]> INSERT INTO array_int64_table VALUES([5,6,7,8]);
Query OK, 0 rows affected (0.013 sec)
Read 1 rows, 48.00 B in 0.010 sec., 102.7 rows/sec., 4.81 KiB/sec.

MySQL [(none)]> select arr from array_int64_table;
+--------------+
| arr |
+--------------+
| [1, 2, 3, 4] |
| NULL |
| [1, 2, 3, 4] |
| NULL |
| [5, 6] |
+--------------+
5 rows in set (0.007 sec)

How to Reproduce?

above

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@wubx wubx added the C-bug Category: something isn't working label May 17, 2022
@b41sh b41sh self-assigned this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants