I get this error when I run a simple stored procedure more than once -- but only on shinyapps.io, not when running on my local machine. The first time I call the procedure, it returns the data as expected; the second time I click the actionButton, I get the subject error.
My code:
library(pool)
library(shiny)
pool <- dbPool(
RMariaDB::MariaDB(),
dbname = Sys.getenv("HYDROP_DBNAME"),
host = Sys.getenv("HYDROP_HOST"),
user = Sys.getenv("HYDROP_USER"),
password = Sys.getenv("HYDROP_PWD")
)
onStop(function() {
poolClose(pool)
})
ui <- fluidPage(
actionButton("goBtn", "GO"),
tableOutput("table")
)
server <- function(input, output, session) {
observeEvent(input$goBtn, {
query <- "CALL sp_test();"
res <- dbGetQuery(pool, query)
output$table <- renderTable(res)
})
}
My stored procedure definition:
DELIMITER $$
CREATE PROCEDURE `sp_test`()
NO SQL
select * from site$$
DELIMITER ;
Possibly related to this RMariaDB issue.
Edited, to add a list of the relevant versions on my local machine:
R version 4.2.1
pool 0.1.6
RMariaDB 1.2.2
DBI 1.1.3
shiny 1.7.2
RStudio 2022.07.1 Build 554