forked from MTSR/mapserver
check # of sql params
This commit is contained in:
parent
b81e3c8b21
commit
5547cdec0f
@ -128,6 +128,11 @@ func (db *Sqlite3Accessor) CountBlocks(pos1 coords.MapBlockCoords, pos2 coords.M
|
||||
}
|
||||
}
|
||||
|
||||
if len(poslist) > 999 {
|
||||
//https://stackoverflow.com/questions/7106016/too-many-sql-variables-error-in-django-witih-sqlite3
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
getBlocksQuery := "select count(*) from blocks b where b.pos in (?" + strings.Repeat(",?", len(poslist)-1) + ")"
|
||||
|
||||
rows, err := db.db.Query(getBlocksQuery, poslist...)
|
||||
|
Loading…
Reference in New Issue
Block a user