Describe the bug

There are two problems right now on 0.1.14-rc:

  1. The RisingWave doesn't insert a null by default for ignored columns
  2. The data inserted is not aligned w/ the column names

To Reproduce

On RisingWave 0.1.14-rc

dev=> create table t (v1 int, v2 int, v3 int);
CREATE_TABLE
dev=> insert into t (v1, v2, v3) values (1, 2, 3);
INSERT 0 1
dev=> insert into t (v2, v3) values (2, 3);
ERROR:  QueryError: Bind error: INSERT has more target columns than expressions
dev=> insert into t (v2, v3, v1) values (2, 3, 1);
INSERT 0 1
dev=> select * from t;
 v1 | v2 | v3
----+----+----
  1 |  2 |  3
  3 |  1 |  2
(2 rows)

Expected behavior

On PG

[email protected]:postgres> create table t (v1 int, v2 int, v3 int);
CREATE TABLE
Time: 0.048s
[email protected]:postgres> insert into t (v1, v2, v3) values (1, 2, 3);
INSERT 0 1
Time: 0.031s
[email protected]:postgres> select * from t;
+----+----+----+
| v1 | v2 | v3 |
|----+----+----|
| 1  | 2  | 3  |
+----+----+----+
SELECT 1
Time: 0.041s
[email protected]:postgres> insert into t (v2, v3, v1) values (2, 3, 1);
INSERT 0 1
Time: 0.082s
[email protected]:postgres> select * from t;
+----+----+----+
| v1 | v2 | v3 |
|----+----+----|
| 1  | 2  | 3  |
| 1  | 2  | 3  |
+----+----+----+
SELECT 2
Time: 0.089s
[email protected]:postgres> insert into t (v2, v3) values (2, 3);
INSERT 0 1
Time: 0.064s
[email protected]:postgres> select * from t;
+--------+----+----+
| v1     | v2 | v3 |
|--------+----+----|
| 1      | 2  | 3  |
| 1      | 2  | 3  |
| <null> | 2  | 3  |
+--------+----+----+
SELECT 3
Time: 0.279s

Additional context

No response

0
  • The first problem on null is an intentional intermediate step. #6128
  • The second problem is likely a bug of #5697 @CAJan93 Could you please take a look?
0

Hey @xiangjinwu, I want to have a look, but am busy with the meta HA setup at the moment. How urgent is this? Is it okay if I have a look at it in some time?

0

Maybe we can consider this feature as not-yet-fully-supported in 0.1.14, which includes (1) updating insert into t (v2, v3, v1) to an unimplemented error in 0.1.14-rc and (2) resolving both issues in 0.1.15. What do you think? @cyliu0

0
© 2022 pullanswer.com - All rights reserved.