matrixorigin / matrixorigin/matrixone

[Bug]: INSERT ... SELECT * ... does not respect query rewrite hint.

Open
#25,186 3 comments 0 reactions 1 assignee Claimed by @slyunnn View on GitHub
kind/bug
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Is there an existing issue for the same bug?

- [x] I have checked the existing issues.

### Branch Name

main

### Commit ID

HEAD

### Other Environment Information

```Markdown
- Hardware parameters:
- OS type:
- Others:
```

### Actual Behavior

Create database foo;
use foo;

create table t (i int, j int);
create table t2(i int, j int);
insert into t select result, result from generate_series(1, 100) tmp;

set enable_remap_hint = 1;

-- the following works. only 10 rows selected
/*+ { "rewrites": { "foo.t": "select * from foo.t where i < 10" } } */ select * from t;

-- the following will insert 100 rows into t2; this is a bug that will leak data
/*+ { "rewrites": { "foo.t": "select * from foo.t where i < 10" } } */ insert into t2 select * from t;

### Expected Behavior

_No response_

### Steps to Reproduce

```Markdown
See above.
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.