Explain leads to `bad value` error
Found when running the dbplyr tests. This was introduced with v1.3.0 and still happens in the dev version.
Edit: Sorry, didn't check the reprex again when running it the second time. The issue only seems to appear when I connect to an SQLite db before 😕
con_sqlite <- DBI::dbConnect(
RSQLite::SQLite(), ":memory:"
)
con <- DBI::dbConnect(
RMariaDB::MariaDB(),
dbname = "test",
host = "localhost",
username = Sys.getenv("USER")
)
DBI::dbWriteTable(con, "test", data.frame(x = 1:3))
DBI::dbGetQuery(
con,
"EXPLAIN SELECT `test`.*, `x` + 1.0 AS `y` FROM `test`"
)
#> Error in result_fetch(res@ptr, n = n): bad value
Created on 2023-10-27 with reprex v2.0.2
Thanks. What is the expected behavior here?
Argh, sorry, I ran the reprex again and didn't check that it didn't contain the issue anymore. This only seems to happen when connection to SQLite before. Interesting.
Works for me:
pkgload::load_all()
#> ℹ Loading RMariaDB
#> ! Skipping missing files: '/root/workspace/R/names.R'
con_sqlite <- DBI::dbConnect(
RSQLite::SQLite(), ":memory:"
)
con <- DBI::dbConnect(
RMariaDB::MariaDB()
)
DBI::dbWriteTable(con, "test", data.frame(x = 1:3), overwrite = TRUE)
DBI::dbGetQuery(
con,
"EXPLAIN SELECT `test`.*, `x` + 1.0 AS `y` FROM `test`"
)
#> id select_type table type possible_keys key key_len ref rows Extra
#> 1 1 SIMPLE test ALL <NA> <NA> <NA> <NA> 3
Created on 2024-04-01 with reprex v2.1.0
Can you please double-check in your setup?
Seems to be fixed now 👍
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.