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

MonetDBLite unable to execute LIMIT 1 statement #3956

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

MonetDBLite unable to execute LIMIT 1 statement #3956

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-03-17 20:48:22 +0100
From: Anthony Damico <>
To: Hannes Muehleisen <>
Version: 11.21.19 (Jul2015-SP4)
CC: ajdamico

Last updated: 2016-06-23 10:24:44 +0200

Comment 21928

Date: 2016-03-17 20:48:22 +0100
From: Anthony Damico <>

User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build Identifier:

Error in .local(conn, statement, ...) :
Unable to execute statement 'select * from pnad2011 limit 1'.
Server says 'integer value too large or not a number (1) in: "select * from pnad2011 limit 1"
' [22003].

Reproducible: Always

Steps to Reproduce:

devtools::install_github( "djalmapessoa/convey" )
library(convey)
library(survey)
library(downloader)

if you set this to output, then no crash!
options( monetdb.log.query = "s:/temp/query log.txt" )

if you set this to TRUE, then no crash!
options( monetdb.debug.query = TRUE )

if you debug and walk through, then no crash!
debug( convey:::survey.design.svypoormed )

setwd( "C:/My Directory/PNAD/" )

setInternet2( FALSE ) only windows users need this line
options( encoding = "windows-1252" ) only macintosh and *nix users need this line

download just 2011 (pretty fast)
years.to.download <- 2011
source_url( "https://raw.githubusercontent.com/ajdamico/asdfree/master/Pesquisa%20Nacional%20por%20Amostra%20de%20Domicilios/download%20all%20microdata.R" , prompt = FALSE , echo = TRUE )

pnad.dbfolder <- paste0( getwd() , "/MonetDB" )
db <- dbConnect( MonetDBLite() , pnad.dbfolder )
dbListTables(db)

sample.pnad <- svydesign( id = ~v4618 , strata = ~v4617 , data = 'pnad2011' , weights = ~pre_wgt , nest = TRUE , dbtype = "MonetDBLite" , dbname = pnad.dbfolder )

sample.pnad <- convey_prep( sample.pnad )

this is the line that is going to crash, but it should work fine
dbGetQuery( db , "select * from pnad2011 limit 1" )

options(survey.lonely.psu = "adjust")

svypoormed( ~v4720 , sample.pnad , na.rm = TRUE )
ERROR

Actual Results:

Error in .local(conn, statement, ...) :
Unable to execute statement 'select * from pnad2011 limit 1'.
Server says 'integer value too large or not a number (1) in: "select * from pnad2011 limit 1"
' [22003].

Expected Results:

the same result as any of these three workarounds:

if you set this to output, then no crash!
options( monetdb.log.query = "s:/temp/query log.txt" )

if you set this to TRUE, then no crash!
options( monetdb.debug.query = TRUE )

if you debug and walk through, then no crash!
debug( convey:::survey.design.svypoormed )

tested on windows R version 3.2.3 and 3.2.4

used today's MonetDBLite build

Comment 21929

Date: 2016-03-18 09:02:44 +0100
From: @hannesmuehleisen

this is not a crash but an incorrect answer...

Comment 21930

Date: 2016-03-18 13:08:44 +0100
From: Anthony Damico <>

hi, i've just confirmed that this bug is reproducible on rocks040

for mac/unix, make sure to set

 options( encoding = "windows-1252" )

thanks

Comment 22074

Date: 2016-04-21 10:43:37 +0200
From: Anthony Damico <>

no longer crashes there. now the error is within svypoormed (which is a convey issue instead)

svypoormed( ~v4720 , sample.pnad , na.rm = TRUE )
Error in eval(expr, envir, enclos) : object 'v4720' not found

Comment 22083

Date: 2016-04-23 16:09:09 +0200
From: Anthony Damico <>

hi, this breaks again on both windows and unix :( sessionInfo below

i have added a limit1 test to eanthony so it's incorporated into perpetual testing once fixed..

MonetDB/eanthony@dbfd624

thanks

svypoormed( ~v4720 , sample.pnad , na.rm = TRUE )
Error in .local(conn, statement, ...) :
Unable to execute statement 'select * from pnad2011 limit 1'.
Server says 'integer value too large or not a number (1) in: "select * from pnad2011 limit 1"
' [22003].
In addition: There were 24 warnings (use warnings() to see them)
sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Fedora 20 (Heisenbug)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base

other attached packages:
[1] ff_2.2-13 bit_1.1-13 digest_0.6.9 R.utils_2.3.0
[5] R.oo_1.20.0 R.methodsS3_1.7.1 descr_1.1.2 SAScii_1.0
[9] MonetDBLite_0.2.3 MonetDB.R_1.0.2 DBI_0.3.1 downloader_0.4
[13] survey_3.30-3 convey_0.1.0

loaded via a namespace (and not attached):
[1] codetools_0.2-14 xtable_1.8-3

Comment 22093

Date: 2016-04-25 16:32:06 +0200
From: @hannesmuehleisen

this works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant