According to the documentation, dbExecute() is supposed to return the "number of rows affected by the statement". This tends to work, but it appears that when dropping a table dbExecute() instead returns the number of rows affected by the last call to dbExecute(). If no previous statements were executed then it returns 1 row affected independent of the number of rows in the table that was dropped.
con <- dbConnect(RSQLite::SQLite(), ":memory:")
data(USArrests)
dim(USArrests) # 50 rows
dbWriteTable(con, "USArrests", USArrests)
dbExecute(con, "delete from USArrests where UrbanPop < 50") # 8 rows deleted
dbExecute(con, "drop table USArrests") # 8 rows affected?
dbDisconnect(con)
This was on RSQlite v2.0.
According to the documentation, dbExecute() is supposed to return the "number of rows affected by the statement". This tends to work, but it appears that when dropping a table dbExecute() instead returns the number of rows affected by the last call to dbExecute(). If no previous statements were executed then it returns 1 row affected independent of the number of rows in the table that was dropped.
This was on RSQlite v2.0.