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

Do not use RE2 on CRAN #121

Closed
krlmlr opened this issue Mar 23, 2024 · 4 comments · Fixed by #127
Closed

Do not use RE2 on CRAN #121

krlmlr opened this issue Mar 23, 2024 · 4 comments · Fixed by #127
Milestone

Comments

@krlmlr
Copy link
Collaborator

krlmlr commented Mar 23, 2024

Add a check here to check it's not used.

@krlmlr krlmlr added this to the 0.10.1 milestone Mar 23, 2024
@krlmlr
Copy link
Collaborator Author

krlmlr commented Mar 23, 2024

Does rhub2 catch this?

Run: https://github.com/duckdb/duckdb-r/actions/runs/8402600629

@krlmlr
Copy link
Collaborator Author

krlmlr commented Mar 24, 2024

Yes, rhub2 catches this. I've also created a PR that breaks RE2::Init(), which is called for every regex operation AFAICT.

@hannes @Tmonster: There are at least two scenarios where re2 is invoked (involuntarily) -- listing tables and exporting the database, perhaps the latter is a variant of the former. I could work around for CRAN, but this will also show if other packages call duckdb::dbListTables() or duckdb::dbExistsTable(), which is sometimes also called from dbWriteTable() .

To reproduce, install the R package from #125.

library(duckdb)
#> Loading required package: DBI

con <- dbConnect(duckdb())
dbGetQuery(con, "SELECT * FROM sqlite_master")
#> Error: {"exception_type":"Invalid Input","exception_message":"Attempting to execute an unsuccessful or closed pending query result\nError: Invalid Error: Checking without re2 support"}
dbGetQuery(con, "SELECT * FROM information_schema.tables")
#> Error: {"exception_type":"Invalid Input","exception_message":"Attempting to execute an unsuccessful or closed pending query result\nError: Invalid Error: Checking without re2 support"}
dbGetQuery(con, "SELECT * FROM duckdb_tables()")
#> Error: {"exception_type":"Invalid Input","exception_message":"Attempting to execute an unsuccessful or closed pending query result\nError: Invalid Error: Checking without re2 support"}

Created on 2024-03-24 with reprex v2.1.0

export_location <- tempfile("duckdb_test_export")
dir.create(export_location)

con <- DBI::dbConnect(duckdb::duckdb())
DBI::dbExecute(con, "CREATE TABLE integers(i integer)")
#> [1] 0
DBI::dbExecute(con, "insert into integers select * from range(10)")
#> [1] 10
DBI::dbExecute(con, "CREATE TABLE integers2(i INTEGER)")
#> [1] 0
DBI::dbExecute(con, "INSERT INTO integers2 VALUES (1), (5), (7), (1928)")
#> [1] 4
DBI::dbExecute(con, paste0("EXPORT DATABASE '", export_location, "'"))
#> Error: rapi_prepare: Failed to prepare query EXPORT DATABASE '/var/folders/dj/yhk9rkx97wn_ykqtnmk18xvc0000gn/T//Rtmp5kUEV2/duckdb_test_export141f23e55a3c7'
#> Error: Invalid Error: Checking without re2 support

Created on 2024-03-24 with reprex v2.1.0

@krlmlr
Copy link
Collaborator Author

krlmlr commented Mar 24, 2024

On the other hand, there are only two downstream packages that have compiled code: arrow and another one, none of them shows the failing checks now. We can submit, but this is a time bomb worth fixing eventually.

@hannes
Copy link
Member

hannes commented Mar 25, 2024

This may be fixed by duckdb/duckdb#11252 from the next version 0.10.2

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 a pull request may close this issue.

2 participants