Skip to content

Conversation

@htyoung
Copy link
Contributor

@htyoung htyoung commented Dec 2, 2024

cherry pick from #44782

…th `use db` and enable sql cache (apache#44782)

### What problem does this PR solve?

It will return wrong result when running same sql in different db with
`enable_sql_cache=true`

for example, the `db1` and `db2` has the same table `tbl` but the data
are not equals,
if execute the below sql in `db1` and cache the result, then execute it
in `db2`, it will return the wrong result
```sql
select count(*) from tbl
```
Co-authored-by: tongyang.han <tongyang.han@jiduauto.com>

(cherry picked from commit ea2a21d)
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@htyoung
Copy link
Contributor Author

htyoung commented Dec 2, 2024

run buildall

@924060929 924060929 changed the title [fix](cache) fix same sql return wrong result when switch database with use db and enable sql cache [fix](cache) fix same sql return wrong result when switch database with use db and enable sql cache (#44782) Dec 2, 2024
@924060929 924060929 merged commit 19d9296 into apache:branch-3.0 Dec 2, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants