sqlancer icon indicating copy to clipboard operation
sqlancer copied to clipboard

Resolves #1163 Add function that supports query index dynamically

Open yaojiejia opened this issue 10 months ago • 5 comments

If I understand correctly, I just need to remove hard-coded index and use globalState.getSchema().getFreeIndexName() instead Tests ran:

  • [x] mvn package -DskipTests
  • [x] mvn formatter:format
  • [x] mvn verify -DskipTests=true
  • [x] mvn -Dtest=TestDuckDBTLP test
  • [x] mvn -Dtest=TestDuckDBNoREC test

I don't think duckdb supports b-tree and hash index for the index type therefore I didn't include them in here

yaojiejia avatar Mar 19 '25 18:03 yaojiejia

Hmm strange! I ran all the tests locally and they seem to be fine, will investigate further image image

yaojiejia avatar Mar 19 '25 18:03 yaojiejia

It seems like this triggered a bug in DuckDB. You could try to find a reduced version of the bug-inducing test case, see whether it still reproduces on the latest DuckDB version, and then report it to the developers.

mrigger avatar Mar 20 '25 10:03 mrigger

We will also need to add the indexes to the internal schema representation. See https://github.com/sqlancer/sqlancer/blob/7fbfe3d091a6254644dc0f4457e296ada94fe03e/src/sqlancer/duckdb/DuckDBSchema.java#L222

mrigger avatar Mar 20 '25 10:03 mrigger

There is another PR that already addresses this: https://github.com/sqlancer/sqlancer/pull/1171

Did you already continue on this PR? Otherwise, I'd be inclined to focus on reviewing and merging the other PR, as it is more comprehensive despite you being first. What's your thought on this?

mrigger avatar Mar 20 '25 14:03 mrigger

There is another PR that already addresses this: #1171

Did you already continue on this PR? Otherwise, I'd be inclined to focus on reviewing and merging the other PR, as it is more comprehensive despite you being first. What's your thought on this?

Yeah I was trying to find out the root cause and trying to add the indexes to internal schema, but in the mean time I think you should look at the other PR and I will try to figure out what's going on in my end. Thanks!!

yaojiejia avatar Mar 20 '25 14:03 yaojiejia